Autogenerating File Names

Post here questions and problems related to editing and publishing DITA content.
Eddie
Posts: 106
Joined: Wed Dec 18, 2013 3:07 am

Autogenerating File Names

Post by Eddie »

Hello,
Many thanks for the Use title to generate the file name and Use the file name as the value of the root ID attribute check boxes, which are very useful. However...

Is there are any way of customising the pattern of the generated file name? I'm thinking of 2 things in particular:
1: Using hyphens instead of underscores.
2: adding a prefix for each topic type (e.g.: "t-" for a task topic).

Cheers,
Eddie
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Autogenerating File Names

Post by Radu »

Hi Eddie,

Request (2) will be available in Oxygen 18.0 which we plan to release in a week or two.
For request (1) we have a registered issue to allow more flexible configuration of the generation pattern. Possibly we'll be able to do this in Oxygen 18.1 (this summer).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Eddie
Posts: 106
Joined: Wed Dec 18, 2013 3:07 am

Re: Autogenerating File Names

Post by Eddie »

Hello Radu,

Thanks for the reply. Will look forward to the new features.

Eddie.
Eddie
Posts: 106
Joined: Wed Dec 18, 2013 3:07 am

Re: Autogenerating File Names

Post by Eddie »

Hello,

I've been using oXygen 18.0, trying out the filenamePrefix function.
I uncommented "filenamePrefix=" in the properties file for the default Concept, Task, Reference and Glossgroup templates with "c-", "t-", "r-" and "g-" as the respective values.
I found that oXygen adds the prefix correctly for all except Task, which adds no prefix.

I also added our own Concept, Task, Reference and Glossgroup templates with the same "filenamePrefix=" setting, and all 4 types add the prefix correctly.

Is there something different about the way the default task template is used to create files?

Cheers,
Eddie.
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: Autogenerating File Names

Post by mihaela »

Hi Eddie,

There is no difference between filename prefix usage between task template and other templates.
We tried to reproduce the problem you reported but the filename prefix set on the task template is correctly used when a task is created.

However, there is a possibility to obtain this situation when you choose the "Task" template from the "Recently used" category from the "New" dialog.
The "Recently used" category actually contains a copy of the templates from the first time they are used.
Maybe you used the template, then you added the "filenamePrefix" property, then you used the old template saved in "Recently used".
If this is your case, you must choose again the template from the "DITA" category (after that, the "Recently used" category will the contain the template updated with the prefix information).

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Eddie
Posts: 106
Joined: Wed Dec 18, 2013 3:07 am

Re: Autogenerating File Names

Post by Eddie »

Thanks, Mihaela,

That's exactly what was happening and worth knowing.

Eddie.
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Autogenerating File Names

Post by sorin_carbunaru »

Hello,

I am glad to announce that in the newly released oXygen 18.1 we added some more options that allow for a more customized file name generation when creating topics from the DITA Maps Manager. The options are all grouped in the File name generation rules for new topics section from the DITA preferences page. More information about the options can be found at https://www.oxygenxml.com/doc/versions/ ... -dita.html.

Regards,
Sorin Carbunaru
oXygen XML
hutz
Posts: 10
Joined: Thu Feb 18, 2016 5:15 pm

Re: Autogenerating File Names

Post by hutz »

What is the most straight-forward way from the oXygen UI to generate my id attrbute for a root map (${cfn} in the map template)?

File > New does not seem to work still and I do not use a Project at the moment.
For topic types it's not a problem as I am doing it from the DITA Maps Manager.

Thoughts?
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Autogenerating File Names

Post by Radu »

Hi,

The problem with "File->New" is that it creates an untitled file, a file which is not saved anywhere so it's impossible to expand the ${cfn} editor variable when choosing this route.
Indeed creating the DITA Map from the Project view would work because it requests you to input a file path before creating the file.
Or if your DITA Map is a submap you can also create in in the DITA Maps manager by using the "Append->New topic" contextual menu action that you are using for topics.

In Oxygen 19 (we plan to release it in Spring next year) the "File->New" dialog will also allow you as an end user to choose the file name and path where to save it. If you will choose to do that instead of creating an untitled file, the ${cfn} editor variable will be properly expanded.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
hutz
Posts: 10
Joined: Thu Feb 18, 2016 5:15 pm

Re: Autogenerating File Names

Post by hutz »

Thanks for confirming the current behaviour, we will use a savehook to mitigate this until the next version.

Regards,
François
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Autogenerating File Names

Post by sorin_carbunaru »

Hello all,

I wanted to let you know that in the newly released oXygen 19.0, the New dialog has a Save As check box that can be used to avoid creating "untitled" documents and allows you to choose the file name and path where to save them.

All the best wishes,
Sorin Carbunaru
oXygen XML
Post Reply