Controlling @id generation when inserting elements in Author mode

Post here questions and problems related to editing and publishing DITA content.
tmakita
Posts: 116
Joined: Fri Apr 08, 2011 7:58 am

Controlling @id generation when inserting elements in Author mode

Post 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?
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Radu
Posts: 9467
Joined: Fri Jul 09, 2004 5:18 pm

Re: Controlling @id generation when inserting elements in Author mode

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
tmakita
Posts: 116
Joined: Fri Apr 08, 2011 7:58 am

Re: Controlling @id generation when inserting elements in Author mode

Post by tmakita »

Thank you Radu!
I will customize it in my framework.
--
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
yokota
Posts: 6
Joined: Wed Mar 13, 2024 4:22 am

Re: Controlling @id generation when inserting elements in Author mode

Post 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
Tatsuro YOKOTA
Antenna House, Inc.
http://www.antenna.co.jp/
http://www.antennahouse.com/
Radu
Posts: 9467
Joined: Fri Jul 09, 2004 5:18 pm

Re: Controlling @id generation when inserting elements in Author mode

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yokota
Posts: 6
Joined: Wed Mar 13, 2024 4:22 am

Re: Controlling @id generation when inserting elements in Author mode

Post 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,
Tatsuro YOKOTA
Antenna House, Inc.
http://www.antenna.co.jp/
http://www.antennahouse.com/
Radu
Posts: 9467
Joined: Fri Jul 09, 2004 5:18 pm

Re: Controlling @id generation when inserting elements in Author mode

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yokota
Posts: 6
Joined: Wed Mar 13, 2024 4:22 am

Re: Controlling @id generation when inserting elements in Author mode

Post 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.
Tatsuro YOKOTA
Antenna House, Inc.
http://www.antenna.co.jp/
http://www.antennahouse.com/
Radu
Posts: 9467
Joined: Fri Jul 09, 2004 5:18 pm

Re: Controlling @id generation when inserting elements in Author mode

Post by Radu »

Hi Tatsuro,

With pleasure!

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply