ro.sync.ecss.extensions.api.AuthorAccess in the ro.sync.ecss.extensions.api.StylesFilter

Oxygen general issues.
SSC
Posts: 206
Joined: Thu Dec 01, 2011 4:22 pm
Location: Hamburg, Germany

ro.sync.ecss.extensions.api.AuthorAccess in the ro.sync.ecss.extensions.api.StylesFilter

Post by SSC »

Hello,

in our Eclipse embedded ro.sync.ecss.extensions.api.StylesFilter we use the localization mechanism of Eclipse.
Now we also got customers, who use the standalone version of the oXygen Author and should also use our custom StyleFilter, where some localization is necessary.
In this case we came up with the idea to use your localization mechnism, but in order to gain access to it we need AuthorAccess or something similar.

Is it somehow possible to gain access to the AuthorAccess instance inside a StylesFilter?
Or do you have any other suggestions?

Best regards,

Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: ro.sync.ecss.extensions.api.AuthorAccess in the ro.sync.ecss.extensions.api.StylesFilter

Post by Radu »

Hi Simon,

Adding some connection between the StylesFilter and the AuthorAccess is already logged in as an improvement request (after our discussion at the Frankfurt Oxygen Users Meeting) but I could not find a decent way to operate the change. We'll keep digging and if we manage to come up with a fix I'll update this forum post.

What you could do from the StylesFilter would be to gain static access to the PluginWorkspace like:

Code: Select all

ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace()
Then you could check if the standalone or eclipse version is running for example:

Code: Select all

ro.sync.exml.workspace.api.Workspace.isStandalone()
or you could look where the frameworks folder is located:

Code: Select all

ro.sync.exml.workspace.api.util.UtilAccess.expandEditorVariables("${frameworksDir}", null)
You could use it and the name of your custom framework to construct a file path which leads to the XML file which translates the messages, parse the XML and build your own map of translations.
This should be done only once because the StylesFilter gets called a lot.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: ro.sync.ecss.extensions.api.AuthorAccess in the ro.sync.

Post by Radu »

Hi Simon,

In Oxygen 15.2 which we plan to release at the beginning of 2014 we plan to offer a feature which should fix this localization problem you previously had.
Basically all the static text (including the text you set via the styles filter) will be passed through our localization support. So if from the StylesFilter side you set a StringContent with text like ${i18n(delete.table.column_description)}, Oxygen will take the text value and try expand the delete.table.column_description key to a value mapped in the translation XML file located at framework level. So Oxygen will render in the Author visual mode the expanded value of the static text.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 8992
Joined: Fri Jul 09, 2004 5:18 pm

Re: ro.sync.ecss.extensions.api.AuthorAccess in the ro.sync.ecss.extensions.api.StylesFilter

Post by Radu »

Hi,

Just to update this thread, with Oxygen 19, if your StylesFilter implementation implements also ro.sync.ecss.extensions.api.AuthorExtensionStateListener, our code will automatically pass the AuthorAccess to it.

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