topic/@id uniqueness

Post here questions and problems related to editing and publishing DITA content.
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

topic/@id uniqueness

Post by tmakita »

[Question]
  • How does each Oxygen XML author program generate topic/@id in the local file system-based environment?
  • To what extent does Oxygen XML Author guarantee the uniqueness of topic/@id?
[Background: DITA-OT]
As you know, DITA-OT preprocessing & topic merge for PDF output handles the following problem:
  • Same topic file names in the different folder hierarchy are processed with no problem. All of the maps and topics are merged into one middle file.
  • topic/@id is replaced by "unique_NNN" notation. As a result, duplicated topic/@id in the different topic files are processed normally.
  • Image references are corrected as root map relative.
The "topic Merge" generates "xxx_MERGED.xml" in the temporary folder (called merged middle file).

[Background: Our specific requirements from user]
Based on the complex document generation requirement, we developer must input several merged middle files from multiple volume authoring and edit/generate into another merged middle file for PDF output.
(You may think this requirement as crazy. Yes, I also assume that it is not the normal PDF generation method. But surely it is needed.)
When inputting several merged middle files, we face the problem of topic/@id in them.
As described earlier, merged middle file has "unique_NNN" values for each topic/@id. These values are not unique if we must input plural merged middle file.
So, our idea is to use topic/@oid (Oxygen XML author assigned) as topic/@id. We hope topic/@oid attribute should be unique over multiple volume authoring result.
As a result, I came across the first written questions.
I know that Oxygen XML author generates topic/@id such like topic/@id="topic_vgy_ktm_czb". Also, if it is connected to CCMS system, it become such like topic/@id="ikv1639112450070" or topic/@id="GUID-3B1CE9C7-F19B-40F4-A666-63A5A94D820A".
But the prereqsite is file system based (Git repository) solution, it does not use CCMS system.
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: topic/@id uniqueness

Post by Radu »

Hi Toshishiko,
How does each Oxygen XML author program generate topic/@id in the local file system-based environment?
Our new file templates use editor variables which expand to IDs like:
"OXYGEN_EDITOR_VARIABLES/frameworks/dita/templates/topic/Concept.dita"

Code: Select all

<concept id="concept_${id}">
The ${id} editor variable will expand to something like:

Code: Select all

<concept id="concept_uzv_dyy_czb">
So if you control the new file templates (maybe you can provide your own using a DITA framework extension) maybe you can use ${uuid} instead of ${id} as a more unique value:
https://blog.oxygenxml.com/topics/autho ... lates.html

Our small ${id} generated value is based on the current computer's current date-time expressed in milliseconds and converted to a sequence of about 6-7 letters. It's guaranteed to be unique when generated on a certain computer but if you are asking for a probability of how unique it is when multiple people are generating such IDs on multiple machines I have no idea how to calculate such probability. Probably if two people at the same time invoke the "Create new topic" in Oxygen when they have the same date time on their computer in milliseconds they could potentially create the same ID value, for me the odds are small, you could for example do a sanity check in the XSLT for that and break the publishing just in case.

As I said you can use the universal unique ID instead ${uuid} if you want which we expand using the regular Java library UUID.
To what extent does Oxygen XML Author guarantee the uniqueness of topic/@id?
We are a software company, most software companies have a limitation of liability section in their EULA so nothing is guaranteed:
https://www.oxygenxml.com/eula.html
I know that Oxygen XML author generates topic/@id such like topic/@id="topic_vgy_ktm_czb". Also, if it is connected to CCMS system, it become such like topic/@id="ikv1639112450070" or topic/@id="GUID-3B1CE9C7-F19B-40F4-A666-63A5A94D820A".
Probably as I said either the CMS integration has its own new file templates (that last example looks like an UUID to me) or when Oxygen commits to the CMS, the CMS automatically sets the topic ID to their own custom value.

One problem I would see with your use case would be if a certain topic is included multiple times in the same publication.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
tmakita
Posts: 100
Joined: Fri Apr 08, 2011 7:58 am

Re: topic/@id uniqueness

Post by tmakita »

Thank you for your detailed reply.
Much appreciated!
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Post Reply