Bug 860033 - Add ID values to topics when not present in topic source.
Summary: Add ID values to topics when not present in topic source.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Topic Tool
Classification: Other
Component: cli-Topic_Tool
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Stephen Gordon
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-24 16:54 UTC by Stephen Gordon
Modified: 2012-11-23 14:09 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-23 14:09:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Gordon 2012-09-24 16:54:08 UTC
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 18:27:59 UTC
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 13:40:08 UTC
Committed revision 85415.

Comment 4 Stephen Gordon 2012-10-02 14:30:45 UTC
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.