Auto-generate ${uuid} beginning with letter

Having trouble installing Oxygen? Got a bug to report? Post it all here.
joerg.hambuch
Posts: 19
Joined: Thu Nov 14, 2013 1:04 pm

Auto-generate ${uuid} beginning with letter

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

Re: Auto-generate ${uuid} beginning with letter

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
joerg.hambuch
Posts: 19
Joined: Thu Nov 14, 2013 1:04 pm

Re: Auto-generate ${uuid} beginning with letter

Post by joerg.hambuch »

Hi Radu,

wow, pretty quick response time :o 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
Radu
Posts: 9436
Joined: Fri Jul 09, 2004 5:18 pm

Re: Auto-generate ${uuid} beginning with letter

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