How to set ditaval file programmically

Post here questions and problems related to oXygen frameworks/document types.
aeijohn
Posts: 4
Joined: Thu Dec 10, 2015 6:23 pm

How to set ditaval file programmically

Post by aeijohn » Wed Sep 22, 2021 5:27 pm

In the Perferences section, there is
"Editor / Edit Modes / Author / Profiling/Conditional Text / Attributes and Condition Sets" where you can use the "Import from DITAVAL..." button to select a ditaval file to set the profiling attributes. After selecting the ditaval file you are given choice to "Merge" or "Replace".

I am interested in knowing what class(es) are evoked once the "Replace" buttom is clicked.

My goal is to programmically set the ditaval file based using an attribute value in the topic when the topic is opened.

Radu
Posts: 7639
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to set ditaval file programmically

Post by Radu » Thu Sep 23, 2021 8:03 am

Hi,

Those classes are not public API so they cannot be used from plugins.
Also the settings are global, so if you have two opened topics, you cannot have at the same time some settings for one and some settings for the other.
We do have API to import a set of global options from an options XML file in Oxygen:

PluginWorkspaceProvider.getPluginWorkspace().importGlobalOptions(optionsFile);

https://www.oxygenxml.com/InstData/Edit ... orage.html

For example this sample Javascript-based Oxygen plugin imports an options.xml in the Oxygen global options:
https://github.com/oxygenxml/wsaccess-j ... se-options

An XML containing options can be created by using the Oxygen main menu "Options->Export Global Options", or you can go to the Preferences->"Editor / Edit Modes / Author / Profiling/Conditional Text / Attributes and Condition Sets" page, switch it to Project level options, configure the settings there, save and the settings should be saved in the Oxygen project XPR file currently opened in the Project view, you can open the XPR file as an XML and it should have serialized XML options inside it.

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

aeijohn
Posts: 4
Joined: Thu Dec 10, 2015 6:23 pm

Re: How to set ditaval file programmically

Post by aeijohn » Mon Sep 27, 2021 5:01 pm

Thanks, Radu. I will see what I can do using importGlobalOptions.

I do understand the global setting where all open file use the same settings. We usually only have one topic opened at a time for editng. We rely heavily on profiling conditions and the ditaval file used for the topic changes quite frequently for some writers. While setting the ditaval file is easy, it often gets overlooked at crunch time, making it easy to apply the wrong profiling value.

Post Reply