System variables in actions
Oxygen general issues.
-
- Posts: 160
- Joined: Mon Nov 24, 2014 1:49 pm
- Location: Greven/Germany
System variables in actions
Hi,
I'd like to open a file via a framework action. This works well with:
Unfortunately I could not figure out, how to open a file in a user dir. System variables like %HOMEPATH% do not work and Oxygen Editor Variables do not work either. Any chance?
Best regards,
Stefan
I'd like to open a file via a framework action. This works well with:
Code: Select all
ro.sync.ecss.extensions.commons.operations.OpenInSystemAppOperation
Unfortunately I could not figure out, how to open a file in a user dir. System variables like %HOMEPATH% do not work and Oxygen Editor Variables do not work either. Any chance?
Best regards,
Stefan
stefan-jung.org – Your DITA/DITA-OT XML consultant
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: System variables in actions
Post by alex_jitianu »
Hello Stefan,
Indeed, this operation doesn't expand editor variables although I believe it should. Hopefully I'll be able to fix this for version 17.0 (there's not much time left till the release). Luckily this operation is public API so you can make the necessary change yourself, like this:
1. create the sample SDK project
2. focus on the sub-module oxygen-sample-framework
3. run a mvn generate-resources. A folder named samples will appear and in it you will find the source code for OpenInSystemAppOperation.
4. Copy it inside the project's Java source folder and expand the variables like this:
If the operation receives this parameter it will now expand the variable (the start and end quote are important because the parameter is interpreted as an XPath expresssion so you mark it as a literal):
5. Run a mvn install. Look inside the target folder for a file named oxygen-sample-framework-0.0.1-SNAPSHOT.jar. This JAR must be added in the Classpath tab of the document type edit dialog and afterwards you can use your new action.
Best regards,
Alex
Indeed, this operation doesn't expand editor variables although I believe it should. Hopefully I'll be able to fix this for version 17.0 (there's not much time left till the release). Luckily this operation is public API so you can make the necessary change yourself, like this:
1. create the sample SDK project
2. focus on the sub-module oxygen-sample-framework
3. run a mvn generate-resources. A folder named samples will appear and in it you will find the source code for OpenInSystemAppOperation.
4. Copy it inside the project's Java source folder and expand the variables like this:
Code: Select all
toOpenVal = EditorVariables.expandEditorVariables(toOpenVal, authorAccess.getEditorAccess().getEditorLocation().toExternalForm());
Code: Select all
"${env(HOMEPATH)}/a.html"
Best regards,
Alex
-
- Posts: 9437
- Joined: Fri Jul 09, 2004 5:18 pm
Re: System variables in actions
Hi,
Just to update this thread, in Oxygen 17 the OpenInSystemAppOperation operation should expand editor variables by default.
Regards,
Radu
Just to update this thread, in Oxygen 17 the OpenInSystemAppOperation operation should expand editor variables by default.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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