What is the best way to manage profiling attribute, global options, custom options ?

Post here questions and problems related to oXygen frameworks/document types.
sebastienlavandier
Posts: 124

What is the best way to manage profiling attribute, global options, custom options ?

Fri Mar 18, 2016 4:20 pm

Hi,

I develop a CMS Plugin for Oxygen Author, to work with DITA filesa and a CMS.

When my custom plugin is started, I must use custom options like user 'login', 'password', etc... to connect user to the CMS.
This informations is actualy managed by pluginWorkspace.getOptionsStorage().setOption(KEY_LOGIN, userLogin
But can be managed by a specific project file (*c.xpr) too ?

I must too, set some Oxygen global options, actualy manage by this way:

Code: Select all

// Can't edit read only files.
PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty(OptionTags.CAN_EDIT_READ_ONLY_FILES, Boolean.FALSE);

// Set display without tags.
PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty(OptionTags.TAGS_DISPLAY_MODE, 1);

// Force to open DITA Map in DITA Maps Manager.
PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty(OptionTags.ASK_OPEN_DITA_MAP_IN_DITAMANAGER, 0);

// Force track changes by default.
PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty(OptionTags.TRACK_CHANGES_INITIAL_STATE, 1);

But can be managed by a specific project file (*.xpr) ?


Also, I want to use custom profiling attributes (This list can be updated by CMS). And I want to know what is the best way to manage this point ?
I think the project file is the best way, but need to restart Oxygen author to get the updated project file (with updated profiling attributes).

Do you think I have an other solution to manage custom profiling attributes ?

Thanks in advance for your help.
Sébastien.L
Radu
Posts: 5376

Re: What is the best way to manage profiling attribute, global options, custom options ?

Fri Mar 18, 2016 5:31 pm

Hi Sébastien,

Please see some answers below:

But can be managed by a specific project file (*c.xpr) too ?


You cannot save custom settings at project level.

I must too, set some Oxygen global options, actualy manage by this way:
But can be managed by a specific project file (*.xpr) ?


Only specific settings can be set and automatically loaded from the XPR when it gets opened in the Project view. Those settings are defined in specific preference pages which have the "Project level" radio button on them.
But you also have API to import options from an XML file format:

Code: Select all

PluginWorkspaceProvider.getPluginWorkspace().importGlobalOptions(File optionsFile)


Also, I want to use custom profiling attributes (This list can be updated by CMS). And I want to know what is the best way to manage this point ?
I think the project file is the best way, but need to restart Oxygen author to get the updated project file (with updated profiling attributes).
Do you think I have an other solution to manage custom profiling attributes ?


You can also impose profiling attribute values using the "setGlobalObjectProperty" API.
Something like:

Code: Select all

PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty("profiling.conditions.list", new ProfileConditionInfoPO[]{new ProfileConditionInfoPO(attributeName, attributeRenderName, allowsMultipleValues, values, valuesSeparator, "*DITA*")});


or you can import them from an external XML file using the API I previously mentioned. You can generate an XML options file by using the Options menu->Export Global options action in a standalone Oxygen.

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

Re: What is the best way to manage profiling attribute, global options, custom options ?

Fri Mar 18, 2016 6:59 pm

Hi Radu,

Thank you for your answer, but when I update global options by import or set global options, user lost his custom profiling attributes (don't come from CMS).
But If you say is it possible to add new profiling attributes by this way. I'm ok !

I think isn't possible, so that why I think project file is the best way.
So, when my custom plugin will be started, I could open the specific project file with the updated profiling attributes (from CMS).

What do you think about thihs way ?

Is it possible from API to change/close project file when my custom plugin closing?

Sébastien
Radu
Posts: 5376

Re: What is the best way to manage profiling attribute, global options, custom options ?

Mon Mar 21, 2016 12:27 pm

Hi Sébastien,

Please see some more answers below:

Thank you for your answer, but when I update global options by import or set global options, user lost his custom profiling attributes (don't come from CMS).
But If you say is it possible to add new profiling attributes by this way. I'm ok !


Once you set the ""profiling.conditions.list"" option, you will overwrite all the user settings.
For Oxygen 18.0 (which will be released in a couple of weeks) we added some API to allow you to retrieve the existing user settings, then possibly merge them with your settings and then set them back.

So, when my custom plugin will be started, I could open the specific project file with the updated profiling attributes (from CMS).
What do you think about thihs way ?
Is it possible from API to change/close project file when my custom plugin closing?


Your custom plugin starts when Oxygen starts and it ends when Oxygen ends. The user cannot start and stop it manually while Oxygen is running.
You also do not have API to change the current project file.

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

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest