Page 1 of 1

Defining Profiling values in Framework

Posted: Tue Feb 25, 2014 6:52 pm
by Pascale
Profiling values are currently defined in the global options of Oxygen, and must be entered one by one via a dialog box.

We would like to have the profiling values defined inside the framework directory, ideally as a separate XML file, so that any change to the profiling attributes and values can be propagated to the users when the add-on is updated (we use the update site technology for our custom framework).

Note: I know that
- you can export the global options and re-import them in other workstations, but this will change or reset all user specific preferences which is a bad idea ...
- for DITA you can upload DITAVAL files, but this is still in the global options, not in the DITA framework. And anyway we are using a custom DTD which is not DITA based.

Pascale

Re: Defining Profiling values in Framework

Posted: Wed Feb 26, 2014 4:53 pm
by Radu
Hi Pascale,

We have plans to offer in a future version the possibility to save profiling conditions at framework (document type) level but not as a separate XML file, probably as another settings page in the Document Type Edit dialog. You will be notified when this happens.

A workaround for you might be to pass the profiling options to Project level and use the same project for all users. This works if you have version control systems like SVN, CVS, GIT and each user has his own working copy. I don't know if this applies to your case.

About this remark:
you can export the global options and re-import them in other workstations, but this will change or reset all user specific preferences which is a bad idea ...
Indeed importing an XML file containing properties should not reset all other properties the user may have, we already have this issue registered and it will be fixed in a future version.

In Oxygen 16.0 we will also add this extra Java API method:

ro.sync.exml.workspace.api.PluginWorkspace.importGlobalOptions(File)

which will merge the specified XML options file with the global preferences without resetting all user preferences.
You will be able to call this method from a plugin or from a framework.

We also have this existing API property:

ro.sync.exml.workspace.api.PluginWorkspace.setGlobalObjectProperty(String, Object)

which could be used from a custom framework to solve your problem.
I do not know if you have any Java customizations to your framework.
For example if your framework has an ro.sync.ecss.extensions.api.ExtensionsBundle Java extension defined you could overwrite the method ExtensionsBundle.createAuthorExtensionStateListener() and on the callback AuthorExtensionStateListener.activated(AuthorAccess) you can do something like:

Code: Select all

    if(!"true".equals(this.authorAccess.getOptionsStorage().getOption("imposedProfilingConditions", ""))) {
//We can impose profiling conditions.
PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty(
"profiling.conditions.list", new ProfileConditionInfoPO[] {
ProfileConditionInfoPO.createDefaultProfileConditionInfoPO("audience", "Audience", true, new String[] { "novice", "expert" }, " ", "DITA*"),
ProfileConditionInfoPO.createDefaultProfileConditionInfoPO("platform", "Platform", true,new String[] { "linux", "windows", "mac", "solaris" }, " ", "DITA*")
});
this.authorAccess.getOptionsStorage().setOption("imposedProfilingConditions", "true");
}
Regards,
Radu

Re: Defining Profiling values in Framework

Posted: Wed Mar 26, 2014 4:13 pm
by damienr
One question, is it possible to use ro.sync.exml.workspace.api.PluginWorkspace.setGlobalObjectProperty(String, Object)
to add some new entries automatically for the code-templates ???

Re: Defining Profiling values in Framework

Posted: Wed Mar 26, 2014 4:34 pm
by Radu
Hi,

You cannot add to the list of existing code templates but you can set it to some custom set of code templates like:

Code: Select all

    PluginWorkspaceProvider.getPluginWorkspace().setGlobalObjectProperty("code-templates", new CTItem[] {
// new CTItem(contentType, renderString, unparsedInsertString, descriptionString),
new CTItem("text/xml", "CTTRIGGERNAME", "<a></a>", "CT DESCRIPTION"),
new CTItem("text/xml", "CTTRIGGERNAME2", "<a2></a2>", "CT DESCRIPTION"),
});
Regards,
Radu

Re: Defining Profiling values in Framework

Posted: Wed Apr 02, 2014 11:19 am
by Pascale
Hi Radu,

thanks, this is working now :-)

Pascale