Using custom ID generation in document template

Post here questions and problems related to oXygen frameworks/document types.
Pascale
Posts: 33

Using custom ID generation in document template

Tue Feb 25, 2014 7:19 pm

If a document template uses the ${id} variable, the ID value is generated when a new document is based on that template.
Is it possible to call a custom ID generation ?

I tried by replacing

Code: Select all

<topic id=${id}>

with

Code: Select all

<topic id=${com.mycompany.oxygen.MyGenerateIDsOperation}>

but it does not work.
Note: com.mycompany.oxygen.MyGenerateIDsOperation is defined as an action in my custom framework and is working OK from the menu.

Pascale
alex_jitianu
Posts: 644

Re: Using custom ID generation in document template

Wed Feb 26, 2014 11:25 am

Hello,

We currently do not support custom editor variables, so you cannot plug your own ID generation mechanism using only the editor variables support. We added an internal issue to add support for this kind of custom editor variables, and we will notify you once it will be implemented. But maybe you can resolve the ID generation by using a combination of our default editor variables. A list is available at [5].

Meanwhile you will have to use our Java API [1] to set the ID attribute. You can get a notification when a document is opened with [2] (framework level API) or [3],[4] (plugin level API).

[1] http://oxygenxml.com/doc/ug-editor/#top ... a-api.html
[2] http://oxygenxml.com/doc/ug-editor/topi ... tener.html
[3] http://oxygenxml.com/doc/ug-editor/#con ... lugin.html
[4] http://www.oxygenxml.com/InstData/Edito ... ,%20int%29
[5] http://oxygenxml.com/doc/ug-editor/#top ... ables.html

Best regards,
Alex
Radu
Posts: 5688

Re: Using custom ID generation in document template

Wed Apr 01, 2015 10:29 am

Hi,

Just to update this thread, Oxygen 16.1 has this new Java API which can resolve any custom editor variable:

ro.sync.exml.workspace.api.util.UtilAccess.addCustomEditorVariablesResolver

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest