Page 1 of 1

Using custom ID generation in document template

Posted: Tue Feb 25, 2014 7:19 pm
by Pascale
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

Re: Using custom ID generation in document template

Posted: Wed Feb 26, 2014 11:25 am
by alex_jitianu
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

Re: Using custom ID generation in document template

Posted: Wed Apr 01, 2015 10:29 am
by Radu
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