For some document types there is a natural tendency to provide a unique identifier. This include documents that specify requirements or issues on an issue tracker.
To administrate these values by hand is a bit cumbersome. Therefore the projectdoc Toolbox provides some support to manage identifiers and add them to the title of generated documents.
Use Cases in Action
The following screencasts show typical uses cases using the Auto Increment Feature to place a unique ID in the title of a projectdoc document.
The blueprint context is provided with the Auto Identifier (projectdoc.doctype.common.autoIdentifier) variable that contains the generated identifier.
Artificial Property
The projectdoc Toolbox generates an artificial property named Auto ID that contains the generated identifier.
Sequences
The sequences are stored as content properties with the parent page. This makes the generation process quick, even if there are more than a few hundred siblings.
Please note that sequences are not incremented atomically. In case of a sequence clash, a single identifier is used twice. These clashes need to be resolved manually.
A sequence id is compared by splitting it into its parts. Parts are delimited by the dash ('-') character. Each part which represents an integer is compared as a number. Non-numbers are considered strings and are compared lexicographically. Shorter strings that are prefixes of other strings are considered smaller.
Please note that the natural sort order of titles in Confluence is not changed. So although the Auto Increment service understands that REQ-COMP1-123 is larger than REQ-COMP1-23, the natural sort order of documents being displayed in a list, sorted by the title will still be REQ-COMP1-23, REQ-COMP1-123. To compensate this, you could add leading zeros: REQ-COMP1-00123, REQ-COMP1-00023.