Page 1 of 1
Auto-generate ${uuid} beginning with letter
Posted: Wed Nov 26, 2014 2:49 pm
by joerg.hambuch
Hi,
oXygen auto-generates UUIDs which begin with a number or a letter. Is it possible to generate UUIDs only beginning with a letter, not a number? Otherwise generated uuids are not valid when used in id attributes.
We'd like to avoid prefixing the generated uuids with something like "id_" to stay conform to uuid standard.
Thanks in advance and best regards,
Jörg
Re: Auto-generate ${uuid} beginning with letter
Posted: Wed Nov 26, 2014 3:11 pm
by Radu
Hi Jörg,
We use a method in the Java VM libraries which come with the Oxygen installation to generate this UUID so we do not have control over the way in which it computes the returned value.
Basically an UUID is a sequence of hexadecimal numbers so it can begin either with letters A-F or with figures:
http://en.wikipedia.org/wiki/Universall ... identifier
My suggestion for you is to prefix that value with a letter just to be sure it is a valid ID attribute name token.
Otherwise, if you are using Oxygen 16.1 you can implement a Java Workspace Access plugin and use the API
ro.sync.exml.workspace.api.util.UtilAccess.addCustomEditorVariablesResolver(EditorVariablesResolver)
to add your custom editor variable resolver to resolve for example an editor variable like
${customUUID} to random values which always start with letters.
Regards,
Radu
Re: Auto-generate ${uuid} beginning with letter
Posted: Wed Nov 26, 2014 3:21 pm
by joerg.hambuch
Hi Radu,
wow, pretty quick response time

This forum is an example for outstanding quality of support. I'll recommend you!
Thanks for your answer and the hint to the EditorVariableResolver.
Best regards,
Jörg
Re: Auto-generate ${uuid} beginning with letter
Posted: Wed Nov 26, 2014 3:45 pm
by Radu
Hi Jörg,
No problem.
One other workaround would be to use the ${id} editor variable which is a pseudo-unique ID value generated by our own code which has a smaller number of characters and it always starts with a letter, but it is not a value generated according to a certain standard.
Regards,
Radu