Page 1 of 1

Generating an ID for a topic/concept/task/etc...and DITA map

Posted: Fri Mar 26, 2010 8:13 pm
by dmbyerly
Firstly - I am brand new to using Oxygen. We are converting from FrameMaker.

We will use a concept as the example, but this applies to maps, references and tasks as well:

When creating a DITA concept I need to automatically generate the id at the topic level (do not want to remember to right click on the element and generate id because people never remember). I have found where I can auto generate for some of the lower level elements contained with the concept, but the concept level generates with the id assigned in the template - which is NOT unique. Maps generate with no id at all.

How do I do this? Thanks for your patience with a newb.

Re: Generating an ID for a topic/concept/task/etc...and DITA map

Posted: Mon Mar 29, 2010 10:00 am
by Radu
Hi,

The New Templates in Oxygen are actually XML files saved in the associated Document Types directories.
If in those XML files you use known Oxygen editor variables, they will get expanded when the file gets created to their specific value.
For example if I edit in the
OXYGEN_INSTALL_DIR/frameworks/dita/templates/topic/Topic.xml template and set its id value like:

Code: Select all


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN"
"http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd">
<topic id="topic_${timeStamp}">
<title>Topic title</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
The file template will show a validation error but when a new topic gets created from the template its id value will be unique (in this case the current system time in milliseconds).
Another editor variable which you can use is:
${date(yyyy-MM-dd)}
The pattern in the date can be very flexible, see this link:
http://java.sun.com/j2se/1.4.2/docs/api ... ormat.html

Templates for DITA Map are saved here:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\map
Templates for DITA Topics are saved here:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\topic

Hope this helps,
Regards,
Radu

Re: Generating an ID for a topic/concept/task/etc...and DITA map

Posted: Mon Mar 29, 2010 4:38 pm
by dmbyerly
Thank you so much!