I'm assembling several hundred topics for import via RTF and it would be useful if I could pre-determine how topic IDs will be generated from outline levels. Specifically, I'd like to be able to truncate the topic title after a specific number of characters, or when a delimiter is reached.
For example, given the text "5-9-3: Collect Benefits baseline data" as heading 3 in MS Word, I might wish to restrict the topic ID to just the leftmost five characters of the title (at the moment ID's are truncated after 50 chars so it's not as though similar functionality isn't already in place). Alternatively, I'd like to be able to break just before some delimiter like a colon or non-breaking space. Is there any – perhaps undocumented – way of doing this?
I don't mind doing some work with regular expressions if necessary. Indeed I'm already using Tim's excellent toolbox to create topic links by regex-ing anchors like [5-9-3] after import. That's one of the reasons I need to ensure predictable topic IDs are generated on import.
Thanks as always.
Topic ID delimiters on import?
Moderators: Alexander Halser, Tim Green
-
- Posts: 454
- Joined: Thu Nov 16, 2006 1:29 pm
- Location: London, UK
- Tim Green
- Site Admin
- Posts: 23186
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Topic ID delimiters on import?
Hi Simon,
I've asked Alex to have a look at this...
I've asked Alex to have a look at this...
Regards,
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
- Alexander Halser
- EC-Software Support
- Posts: 4105
- Joined: Mon Jun 24, 2002 7:24 pm
- Location: Salzburg, Austria
- Contact:
Re: Topic ID delimiters on import?
The topic IDs automatically created from outlines in the RTF document are restricted to a maxium of 50 characters to avoid excessive ID lengths. 50 characters is reasonable, in older versions of H&M it was restricted to 32 characters, which was extended after several customer requests.
Alexander Halser
Senior Software Architect, EC Software GmbH
Senior Software Architect, EC Software GmbH
-
- Posts: 454
- Joined: Thu Nov 16, 2006 1:29 pm
- Location: London, UK
Re: Topic ID delimiters on import?
Hi Alex
I wasn't asking for longer IDs. My situation is the opposite: I would like to create short IDs when importing long titles via RTF. For example, if the title is "A-B-C Defg hijklm no pqrs", recognize the entire string as the topic heading and TOC caption, but recognize only "A-B-C" as the topic ID.
The use case is as part of an automated import, where links in the body of the RTF file are marked-up with special characters, e.g. [A-B-C Defg hijklm no pqrs]. Once imported, I can use the Toolbox to separate the "A-B-C" part into a regex group and use it as the href, e.g. <link type="topiclink", href="$1" etc.
As far as I can see, in the current 7.0.6 build illegal characters in titles are skipped when topic IDs are created during import. What would be interesting is any undocumented character that instead acts as a delimiter, such that the topic ID importer ignores the rest of the title once the delimiter has been reached. I am OK to use a delimiter to separate the parts because I can always remove it later using search/replace via H&M or Tim's Toolbox. I'm equally OK using an explicit length, 5 chars in this example, because I can pad the ID part in advance, but that would require new UI to specify the maximum ID length during the import.
I wasn't asking for longer IDs. My situation is the opposite: I would like to create short IDs when importing long titles via RTF. For example, if the title is "A-B-C Defg hijklm no pqrs", recognize the entire string as the topic heading and TOC caption, but recognize only "A-B-C" as the topic ID.
The use case is as part of an automated import, where links in the body of the RTF file are marked-up with special characters, e.g. [A-B-C Defg hijklm no pqrs]. Once imported, I can use the Toolbox to separate the "A-B-C" part into a regex group and use it as the href, e.g. <link type="topiclink", href="$1" etc.
As far as I can see, in the current 7.0.6 build illegal characters in titles are skipped when topic IDs are created during import. What would be interesting is any undocumented character that instead acts as a delimiter, such that the topic ID importer ignores the rest of the title once the delimiter has been reached. I am OK to use a delimiter to separate the parts because I can always remove it later using search/replace via H&M or Tim's Toolbox. I'm equally OK using an explicit length, 5 chars in this example, because I can pad the ID part in advance, but that would require new UI to specify the maximum ID length during the import.