Page 1 of 1
Controlling @id generation when inserting elements in Author mode
Posted: Wed Apr 23, 2025 1:28 pm
by tmakita
Here is request from one of my users.
When I insert note element in Author mode, Oxygen automatically generates following.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="concept_q4w_3tg_cfc">
<title>Sample Concept</title>
<shortdesc></shortdesc>
<conbody>
<p>paragraph</p>
<note id="note_j2r_ktg_cfc">note text</note>
</conbody>
</concept>
We want control @id generation for any elements because several elements are not referenced from xref element.
How we can do it in Oxygen customization?
Re: Controlling @id generation when inserting elements in Author mode
Posted: Wed Apr 23, 2025 2:11 pm
by Radu
Hi Toshihiko,
When working with a DITA topic opened in the main editor in the Author visual editing mode the main menu "DITA->ID Options" dialog contains a list of elements for which IDs are auto generated.
There is an "OXYGEN_INSTALL_DIR/frameworks/dita/resources/idGenerationDefaultOptions.xml" file containing the defaults for ID generation and it can be overwritten from a DITA framework extension:
https://www.oxygenxml.com/doc/versions/ ... on_options
Regards,
Radu
Re: Controlling @id generation when inserting elements in Author mode
Posted: Wed Apr 23, 2025 2:28 pm
by tmakita
Thank you Radu!
I will customize it in my framework.
Re: Controlling @id generation when inserting elements in Author mode
Posted: Thu May 08, 2025 6:40 am
by yokota
We set our own idGenerationDefaultOption.xml (${framework}/resources/),
and set CLASSPATH it with our extended DITA framework and confirmed.
But when "ID Options" is set, idGenerationDefaultOption.xml is ignored
(and ID Options seems to be based on original ${baseFramework}/resources/).
Using ID Options once,
it is handled as high priority than ${framework}/resources/idGenerationDefaultOption.xml, right?
And we couldn't find the way
to reset ID Options target items other than by hand
or to use ${framework}/resources/idGenerationDefaultOption.xml again.
So, my questions are these 2;
* Is there a way to ID Option setting back to the default? ( GUI way is better)
* Is there a way to ID Option setting to set OUR(${framework}/resources/) default?
Cheked Oxygen Desktop versions are 26.1 and 27.0 .
Regards,
YOKOTA
Re: Controlling @id generation when inserting elements in Author mode
Posted: Thu May 08, 2025 7:14 am
by Radu
Hi,
Please see some remarks below:
* Is there a way to ID Option setting back to the default? ( GUI way is better)
We do not have a specific action to reset only those settings to defaults. We do have the main menu "Options->Reset Global" action which should reset all user specific options, including the framework specific options.
* Is there a way to ID Option setting to set OUR(${framework}/resources/) default?
Yes, the "Classpath" tab has a list of referenced resources, the reference to "${framework}/resources/" needs to be moved higher up in the list so that it comes before the reference to "${baseFramework/resources/}".
Regards,
Radu
Re: Controlling @id generation when inserting elements in Author mode
Posted: Thu May 08, 2025 9:00 am
by yokota
Thanks for your reply.
Radu wrote: ↑Thu May 08, 2025 7:14 am
Hi,
Please see some remarks below:
* Is there a way to ID Option setting back to the default? ( GUI way is better)
We do not have a specific action to reset only those settings to defaults. We do have the main menu "Options->Reset Global" action which should reset all user specific options, including the framework specific options.
It is too large scope.
I tried it now and my custom framework directories settings are removed (initialized).
It seems difficult to reccomend the way to our users.
As a feture request, it is useful that a reset button for only ID Options is implemented on its dialg.
* Is there a way to ID Option setting to set OUR(${framework}/resources/) default?
Yes, the "Classpath" tab has a list of referenced resources, the reference to "${framework}/resources/" needs to be moved higher up in the list so that it comes before the reference to "${baseFramework/resources/}".
I confirmed it works.
My thought for our framework is to add an action to override specific Option Setting values with OxygenSDK.
Is there a much better solution?
Regards,
Re: Controlling @id generation when inserting elements in Author mode
Posted: Thu May 08, 2025 11:57 am
by Radu
Hello Yokota,
So:
It is too large scope.
I tried it now and my custom framework directories settings are removed (initialized).
It seems difficult to reccomend the way to our users.
Yes, this was more of a suggestion to be used by you to check if the defaults work when the settings have not been intentionally changed in the dialog. So it was not a suggestion to pass to the end users.
As a feture request, it is useful that a reset button for only ID Options is implemented on its dialg.
There are lots of dialogs in Oxygen which may save their state, I would not be inclined to start adding "Reset to defaults" buttons in particular dialogs.
My thought for our framework is to add an action to override specific Option Setting values with OxygenSDK.
Is there a much better solution?
Do you want to impose certain settings completely? Prohibit the end user from changing the "ID Options..." at all?
Regards,
Radu
Re: Controlling @id generation when inserting elements in Author mode
Posted: Fri May 16, 2025 11:31 am
by yokota
I'm sorry for the late reply.
Yes, this was more of a suggestion to be used by you to check if the defaults work when the settings have not been intentionally changed in the dialog. So it was not a suggestion to pass to the end users.
There are lots of dialogs in Oxygen which may save their state, I would not be inclined to start adding "Reset to defaults" buttons in particular dialogs.
I got it.
Do you want to impose certain settings completely? Prohibit the end user from changing the "ID Options..." at all?
I thought the former.
But we decided not to custom the behaviour, for now.
Thanks for your advices.
Re: Controlling @id generation when inserting elements in Author mode
Posted: Fri May 16, 2025 2:56 pm
by Radu
Hi Tatsuro,
With pleasure!
Regards,
Radu