Page 1 of 1

Generate topic ID to match file name

Posted: Fri Jul 29, 2016 10:26 am
by ann.jensen
Hi,
I am in the midst of refactoring my DITA files to set the top-level topic id to match the file name so that it is both unique and informative. I have managed to allow many duplicate topic ids proliferate over time :-|
This is proving a tedious process and I wonder is there any short-cut to achieving this rather than doing each file manually?
Thanks in advance,
Ann

Re: Generate topic ID to match file name

Posted: Fri Jul 29, 2016 12:23 pm
by Radu
Hi Ann,

We do not have right now an automated way to change a topic's ID and automatically change it in all references made to that topic. We have a registered issue and I added your feedback on it.
If you contact us via our email address (support@oxygenxml.com) I could try to give you a custom refactoring action which renames IDs in all topics to use the file name (without extension). The refactoring action will not rename also references to those IDs from other topics. So you will still need to run the "Validate and check for completeness" action and manually fix all those broken links.
Speaking of the "Validate and check for completeness" action, it can also validate each topic using a Schematron schema. So you can add schematron checks for this condition (topic ID not matching file name) and you can run the "Validate and check for completeness" action to find all the topics where you should change the ID.

Regards,
Radu

Re: Generate topic ID to match file name

Posted: Mon Oct 17, 2016 6:24 pm
by dgallo
Hello,

We are also in need of a way to quickly update all of our topic id's to match the filename. Do you have a script of a quick solution for this?

Thanks,
Danielle

Re: Generate topic ID to match file name

Posted: Tue Oct 18, 2016 9:55 am
by Radu
Hi Danielle,

Oxygen 18.1 (which we plan to release in about a week) will come bundled with a default DITA refactoring action which replaces all topic IDs with the file name. Basically, you will open the main DITA Map in the DITA Maps Manager view, right click, choose Refactoring->XML Refactoring and you will find two DITA-related predefined actions, one of which is called Change topic ID to file name. The refactoring actions also have a Preview which allow you to see what the action will be doing before making changes on disk.

If you are using Oxygen 18.0 I can also provide you this refactoring action so that you can install it in your current Oxygen installation. So if you do not want to wait for the release just drop us an email (support@oxygenxml.com)

Regards,
Radu

Re: Generate topic ID to match file name

Posted: Fri Oct 28, 2016 9:58 am
by Radu
Hi,

Oxygen 18.1 was released a couple of weeks ago and it should come bundled with this special refactoring action we discussed.

Regards,
Radu

Re: Generate topic ID to match file name

Posted: Mon Jan 30, 2017 12:18 pm
by SathyaOX
Hi,
Do we have a workaround for this issue in version 17.1?

Re: Generate topic ID to match file name

Posted: Mon Jan 30, 2017 12:24 pm
by Radu
Hi Sathya,

If you drop us an email (support@oxygenxml.com) I could try to give you the XML refactoring actions as separate files so that you could install them in 17.1.

Regards,
Radu