Insert GUID?
Oxygen general issues.
-
- Posts: 26
- Joined: Tue Mar 31, 2009 5:47 pm
Insert GUID?
Hi guys
Is it possible to insert a unique GUID into XML documents when editing? I would like to add unique GUID's in my DITA documentation for the topic id attribute.
In NotePad++ there there is a simple plugin that generates and inserts a GUID at the caret position. I was able to map this to a keyboard shortcut which is very useful.
I am still using Oxygen 10.3, is this possible?
Many thanks
Is it possible to insert a unique GUID into XML documents when editing? I would like to add unique GUID's in my DITA documentation for the topic id attribute.
In NotePad++ there there is a simple plugin that generates and inserts a GUID at the caret position. I was able to map this to a keyboard shortcut which is very useful.
I am still using Oxygen 10.3, is this possible?
Many thanks
-
- Posts: 26
- Joined: Tue Mar 31, 2009 5:47 pm
Re: Insert GUID?
No worries, I have created a simple application that generates and pastes GUIDs automatically using a hotkey.
I have uploaded the application to GitHub for anybody interested:
https://github.com/kruncher/guid-generator-hotkey
I have uploaded the application to GitHub for anybody interested:
https://github.com/kruncher/guid-generator-hotkey
-
- Posts: 9428
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert GUID?
Hi Lea,
OXYGEN_INSTALL_DIR/frameworks/dita/templates/topic/Topic.dita
and its content contains an editor variable like:
and change it to use the ${uuid} editor variable like:
Then when creating new topics the editor variable would get expanded to an UUID.
Regards,
Radu
If you had a newer Oxygen version (I think 13.0 or newer) you would just have to open the new file template used to create DITA topics:I am still using Oxygen 10.3, is this possible?
OXYGEN_INSTALL_DIR/frameworks/dita/templates/topic/Topic.dita
and its content contains an editor variable like:
Code: Select all
.....
<topic id="topic_${id}">
.....
Code: Select all
.....
<topic id="topic_${uuid}">
.....
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 72
- Joined: Tue Oct 21, 2014 10:01 pm
Re: Insert GUID?
I know that I'm responding to a very old post, but the subject matter is relevant today. We are using Oxygen 17.1 and have a need for our writers to insert GUID as target IDs for our conrefs. Our developer suggested that we access an external site to generate unique GUID values, copy the value, and then paste the value into our conref targets. I find this method to be awkward.
Is there a way to get Oxygen to generate these values on the fly? I'm thinking of a keyboard shortcut or XML snippet. I really have no clue how this can be done.
Thanks for the feedback.
Is there a way to get Oxygen to generate these values on the fly? I'm thinking of a keyboard shortcut or XML snippet. I really have no clue how this can be done.
Thanks for the feedback.
-
- Posts: 26
- Joined: Tue Mar 31, 2009 5:47 pm
Re: Insert GUID?
I stopped using <oxygen/> a long time ago in favour of the likes of Sublime and VSCode (which have GUID generator plugins); however, back when I was experiencing this limitation in <oxygen/> I did make a little tool to ease this process.
Essentially you run the tool; and then you use Ctrl+Shift+V in any other program on Windows and it will insert a fresh GUID:
https://github.com/kruncher/guid-generator-hotkey
I hope that this helps with your needs!
Essentially you run the tool; and then you use Ctrl+Shift+V in any other program on Windows and it will insert a fresh GUID:
https://github.com/kruncher/guid-generator-hotkey
I hope that this helps with your needs!
-
- Posts: 9428
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert GUID?
About the question asked by Rick:
So a DITA @conref attribute has the following syntax:
conref="path/to/topic.dita#topicID/elementID"
The topicID is the ID attribute set on the <topic> element and the elementID is the ID attribute set on the target element.
So what you would actually want would be to generate ID attributes according to the UUID pattern on XML elements, right?
In the DITA main menu there is an ID Options dialog in which you can set the ID pattern to be:
${localName}_${uuid}
then if you right click inside any DITA element and choose Generate IDs an ID with that specific pattern will be generated for the element.
Regards,
Radu
So a DITA @conref attribute has the following syntax:
conref="path/to/topic.dita#topicID/elementID"
The topicID is the ID attribute set on the <topic> element and the elementID is the ID attribute set on the target element.
So what you would actually want would be to generate ID attributes according to the UUID pattern on XML elements, right?
In the DITA main menu there is an ID Options dialog in which you can set the ID pattern to be:
${localName}_${uuid}
then if you right click inside any DITA element and choose Generate IDs an ID with that specific pattern will be generated for the element.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Sat Mar 03, 2018 12:41 am
Re: Insert GUID?
Hello,
I am facing the exact opposite issue. I'm not sure how but when our authors create conrefs, sometimes, O2 uses a GUID for the ID.
I want that NOT to happen. We often run into merge issues that require me to fix a mess of broken conrefs. Without some clue from the conref ID, it's sometimes very, very difficult to figure out what the conref is.
So the human readable ID is what we need. Is there a way to disable the GUID insertion in O2?
I believe most our writers are using a recent version.
Thanks,
JPK
I am facing the exact opposite issue. I'm not sure how but when our authors create conrefs, sometimes, O2 uses a GUID for the ID.
I want that NOT to happen. We often run into merge issues that require me to fix a mess of broken conrefs. Without some clue from the conref ID, it's sometimes very, very difficult to figure out what the conref is.
So the human readable ID is what we need. Is there a way to disable the GUID insertion in O2?
I believe most our writers are using a recent version.
Thanks,
JPK
-
- Posts: 9428
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert GUID?
Hi,
So looking at a conref value:
do you want to disable the random ID generation for the topic ID or for the element ID?
If you want it disabled for the element ID, if you open a DITA topic in the Author visual editing mode, in the "DITA" main menu there should be an "ID Options..." action allowing you to disable auto generation of IDs on elements.
Regards,
Radu
So looking at a conref value:
Code: Select all
conref="path/to/topic.dita#topicID/elementID"
If you want it disabled for the element ID, if you open a DITA topic in the Author visual editing mode, in the "DITA" main menu there should be an "ID Options..." action allowing you to disable auto generation of IDs on elements.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service