InsertConrefOperation on specific location
Post here questions and problems related to oXygen frameworks/document types.
InsertConrefOperation on specific location
Hello,
Can I pass an argument to ro.sync.ecss.extensions.dita.conref.InsertConrefOperation in my DITA Map framework to open the wizard with a specific reuse file as "Location"?
Thanks!
François
Can I pass an argument to ro.sync.ecss.extensions.dita.conref.InsertConrefOperation in my DITA Map framework to open the wizard with a specific reuse file as "Location"?
Thanks!
François
Re: InsertConrefOperation on specific location
Hi François,
You can create your own AuthorOperation custom Java operation which calls directly this static method from the ro.sync.ecss.dita.DITAAccess class:
Regards,
Radu
You can create your own AuthorOperation custom Java operation which calls directly this static method from the ro.sync.ecss.dita.DITAAccess class:
Code: Select all
/**
* Shows a dialog that allows inserting a content reference (conref).
*
* @param authorAccess The Author access.
* @param initialReferenceURL The default URL that will be displayed in the URL
* field of the insert reference dialog.
* <br>
* <b>Note: </b> this parameter is not used on Eclipse plugin implementation.
* @param displayReferenceUrl If <code>true</code> the URL input will be
* displayed in the insert reference dialog (the user will have the possibility
* to change the reference URL).
* This parameter can be set to <code>false</code> when an initialReferenceURL
* is provided, and the user must not have the possibility to change it
* (the reference URL must be fixed).
* <br>
* <b>Note: </b> this parameter is not used on Eclipse plugin implementation.
*
* @throws AuthorOperationException
*
* @since 14.2
*/
public static void insertContentReference(
final AuthorAccess authorAccess,
URL initialReferenceURL,
boolean displayReferenceUrl)
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: InsertConrefOperation on specific location
Hi,
Or you can create an Author action based on the predefined JSOperation which invokes a script looking something like this:
Regards,
Radu
Or you can create an Author action based on the predefined JSOperation which invokes a script looking something like this:
Code: Select all
function doOperation(){
Packages.ro.sync.ecss.dita.DITAAccess.insertContentReference(authorAccess, new Packages.java.net.URL("http://www.google.com"), true);
}
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: InsertConrefOperation on specific location
Hello,
The following snippet works fine as the value of the arg-script parameter for the JSOperation in my .less file:
I would like to define the action in the .framework file directly (from the UI), but it seems it doesn't recognize oxy_xpath or oxy_concat ("Could not evaluate script: ReferenceError: "oxy_xpath" is not defined).
I've seen JSOperation-s that embarked oxy_ functions I think, so I must be wrong somewhere.
Current workaround would be to multiply the actions for language (with //map/@xml:lang = 'en',' fr', 'de' etc. as Activation XPath) but not too dynamic.
Thanks,
François
The following snippet works fine as the value of the arg-script parameter for the JSOperation in my .less file:
Code: Select all
oxy_concat(
'function doOperation(){ var url = Packages.ro.sync.ecss.dita.DITAAccess.insertContentReference(authorAccess, new Packages.java.net.URL("',
"${pdu}/reuse/", oxy_xpath("//map/@xml:lang"), "/customConrefFile.dita",
'")',
', true)}'
)
I've seen JSOperation-s that embarked oxy_ functions I think, so I must be wrong somewhere.
Current workaround would be to multiply the actions for language (with //map/@xml:lang = 'en',' fr', 'de' etc. as Activation XPath) but not too dynamic.
Thanks,
François
Re: InsertConrefOperation on specific location
Hi François,
Inside a JSOperation you can call all the Java-based API we have available. For example we have API which allows you to find nodes based on a certain XPath expression:
https://github.com/oxygenxml/javascript ... keyrefs.js
So even in your original CSS code you did not need to concat the strings so that you could use the CSS oxy_xpath function, you could have searched for the nodes based on XPath directly in the JSOperation code.
Regards,
Radu
Inside a JSOperation you can call all the Java-based API we have available. For example we have API which allows you to find nodes based on a certain XPath expression:
https://github.com/oxygenxml/javascript ... keyrefs.js
So even in your original CSS code you did not need to concat the strings so that you could use the CSS oxy_xpath function, you could have searched for the nodes based on XPath directly in the JSOperation code.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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