allow to set custom editor variable value from action
Are you missing a feature? Request its implementation here.
-
- Posts: 3
- Joined: Tue Aug 02, 2022 2:21 pm
allow to set custom editor variable value from action
Hi,
in order to grab certain values from one DITA topic in the editor and to insert them in another (via custom author action), it would be very helpful, if the value of a custom editor variable (already defined) could be set from within an author action.
A simple copy and paste will not do in this case, as we need to grab the id of the surrounding topic, and in addition the id of a nested topic within.
Thanks,
Sven.
in order to grab certain values from one DITA topic in the editor and to insert them in another (via custom author action), it would be very helpful, if the value of a custom editor variable (already defined) could be set from within an author action.
A simple copy and paste will not do in this case, as we need to grab the id of the surrounding topic, and in addition the id of a nested topic within.
Thanks,
Sven.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: allow to set custom editor variable value from action
Hi Sven,
We have API to expand a string containing editor variables to the variable values:
Is that what you wanted?
If not, we also have Java API to add a custom editor variables resolver.
https://www.oxygenxml.com/InstData/Edit ... olver.html
so for example a custom AuthorOperation Java implementation could add its own
Regards,
Radu
We have API to expand a string containing editor variables to the variable values:
Code: Select all
authorAccess.getUtilAccess().expandEditorVariables(pathWithEditorVariables, currentEditedURL)
If not, we also have Java API to add a custom editor variables resolver.
https://www.oxygenxml.com/InstData/Edit ... olver.html
so for example a custom AuthorOperation Java implementation could add its own
Code: Select all
void doOperation(AuthorAccess authorAccess, ArgumentsMap args)
throws IllegalArgumentException, AuthorOperationException{
EditorVariablesResolver customResolver = null;
authorAccess.getUtilAccess().addCustomEditorVariablesResolver(customResolver);
//..invoke other methods here
authorAccess.getUtilAccess().removeCustomEditorVariablesResolver(customResolver);
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Tue Aug 02, 2022 2:21 pm
Re: allow to set custom editor variable value from action
Hi Radu,
thanks for the quick reply. Maybe I am not familiar with what a resolver does, but it sounds like it would give you the values of a custom editor variable, maybe packaged in a nice way - but not write to the variable.
What I am looking for - and not using proper terminology - is this:
I have already defined a custom editor variable xyz in the preferences dialogue.
Now, while editing one topic, I would like to read some <data> from the topic (in a custom button action), and then say xyz=<data>.
Then, in another topic, again with a custom button action, I would like to insert a fragment containing ${xyz}.
Does that describe it more clearly?
Thanks and best regards,
Sven.
thanks for the quick reply. Maybe I am not familiar with what a resolver does, but it sounds like it would give you the values of a custom editor variable, maybe packaged in a nice way - but not write to the variable.
What I am looking for - and not using proper terminology - is this:
I have already defined a custom editor variable xyz in the preferences dialogue.
Now, while editing one topic, I would like to read some <data> from the topic (in a custom button action), and then say xyz=<data>.
Then, in another topic, again with a custom button action, I would like to insert a fragment containing ${xyz}.
Does that describe it more clearly?
Thanks and best regards,
Sven.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: allow to set custom editor variable value from action
Hi Sven,
I think the easiest way to accomplish what you want would be maybe this approach:
https://www.oxygenxml.com/doc/versions/ ... ables.html
Regards,
Radu
I think the easiest way to accomplish what you want would be maybe this approach:
In your custom "AuthorOperation" java implementation you could set a custom Java system property like:Now, while editing one topic, I would like to read some <data> from the topic (in a custom button action), and then say xyz=<data>.
Code: Select all
java.lang.System.setProperty("customProp", "someValue");
You can use in the inserted XML fragment the "${system(customProp)}" Oxygen specific editor variable which should expand to the value of the "customProp" Java system property.Then, in another topic, again with a custom button action, I would like to insert a fragment containing ${xyz}.
https://www.oxygenxml.com/doc/versions/ ... ables.html
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