Using custom ID generation in document template

Post here questions and problems related to oXygen frameworks/document types.
Pascale
Posts: 40
Joined: Wed Jan 29, 2014 4:30 pm

Using custom ID generation in document template

Post 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
alex_jitianu
Posts: 1009
Joined: Wed Nov 16, 2005 11:11 am

Re: Using custom ID generation in document template

Post 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
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Using custom ID generation in document template

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply