Bug 860033 - Add ID values to topics when not present in topic source.
Add ID values to topics when not present in topic source.
Status: CLOSED CURRENTRELEASE
Product: Topic Tool
Classification: Other
Component: cli-Topic_Tool (Show other bugs)
1.0.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Stephen Gordon
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-24 12:54 EDT by Stephen Gordon
Modified: 2012-11-23 09:09 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-23 09:09:00 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stephen Gordon 2012-09-24 12:54:08 EDT
Description of problem:

When building hybrid books combining any of traditional DocBook / topicrepo content / skynet content the only way to get CSP style relationships in your book is manually. To do this the content being referred to has to have an ID.

When you assemble a book using the CSP it automatically generates the ID attribute of the root node based on the topic title - the topic tool should do the same. Note that for topic tool it will be key to look for the root node, not just a section, as on some legacy content that pre-dates the decision to use sections as the topic container we may have other root node types.
Comment 1 Stephen Gordon 2012-09-24 14:27:59 EDT
I have some initial code which does this but need to be mindful of the scenario where the same topic is included twice in a guide. Need to ensure we keep track of the IDs and make them unique, both among topics and the existing "normal" content.
Comment 2 Stephen Gordon 2012-10-02 09:40:08 EDT
Committed revision 85415.
Comment 4 Stephen Gordon 2012-10-02 10:30:45 EDT
Topic Tool has been updated to ensure that all exported topics include an ID attribute for the root node. This logic functions such that:

1) If the root node of the topic already has an ID no further action is taken (this will be the case for most SVN topicrepo topics).
2) If the root node of the topic does not have an ID an ID is generated based on the contents of the first title element within the root node.
  A) Where no title element is found, no ID will be generated.
  B) Where a title element is found, an ID will be generated:
     - Spaces are replaced with underscores (_).
     - Characters other than A-Z, a-z, 0-9, '-', '_', and '.' are removed.
     - Where the same ID has already been allocated (indicating that the topic has most likely been included twice) then an underscore an a number will be appended to ensure that the ID is unique. This number will also be appended to the filename of the topic on disk.

Note You need to log in before you can comment on or make changes to this bug.