Accessing ${system(var.name)} variable via framework
Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
Accessing ${system(var.name)} variable via framework
Good morning,
We are unregistering some default actions in our framework depending on the context. If the environment is production, we will remove actions like "Author/ShowXML." In the development environment, we will keep all actions.
We used the editor.listen(sync.api.Editor.EventTypes.ACTIONS_LOADED) method along with .unregisterAction(), and it worked perfectly.
However, to detect the production environment, we would like to use a Java system variable that we created. We saw in the documentation that it is possible to access an environment variable using ${system(var.name)}. We need help capturing this variable using the framework directly, without relying on a plugin. We found a way to do this via a plugin that uses the Workspace, but we couldn't achieve the same through the framework.
Could you provide an example of how to access ${system(var.name)} using only the framework?
Thank you for your help.
We are unregistering some default actions in our framework depending on the context. If the environment is production, we will remove actions like "Author/ShowXML." In the development environment, we will keep all actions.
We used the editor.listen(sync.api.Editor.EventTypes.ACTIONS_LOADED) method along with .unregisterAction(), and it worked perfectly.
However, to detect the production environment, we would like to use a Java system variable that we created. We saw in the documentation that it is possible to access an environment variable using ${system(var.name)}. We need help capturing this variable using the framework directly, without relying on a plugin. We found a way to do this via a plugin that uses the Workspace, but we couldn't achieve the same through the framework.
Could you provide an example of how to access ${system(var.name)} using only the framework?
Thank you for your help.
-
- Posts: 517
- Joined: Thu Sep 04, 2014 4:22 pm
Re: Accessing ${system(var.name)} variable via framework
Post by cristi_talau »
Hello,
In the Java code that belongs to the framework, you can simply use:
In the client-side code of a framework you have to make a request to the server to fetch this information, using an AuthorOperationWithResult as described in this tutorial: https://www.oxygenxml.com/maven/com/oxy ... esult.html .
There is another option in which you use a plugin just to make the system property available to the client-side code, but I am not going to explore this option further since you manifested your dislike for using plugins.
Best,
Cristian
In the Java code that belongs to the framework, you can simply use:
Code: Select all
System.getProperty("name")
There is another option in which you use a plugin just to make the system property available to the client-side code, but I am not going to explore this option further since you manifested your dislike for using plugins.
Best,
Cristian
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service