fop.xconf and add-on framework

Here should go questions about transforming XML with XSLT and FOP.
LBarth
Posts: 26
Joined: Mon Mar 04, 2013 1:42 pm

fop.xconf and add-on framework

Post by LBarth »

Hi,

I have an add-on installating a framework. I would like to have a specific fop configuration file in this framework.

When I put ${framework}/fop/fop.xconf in the fop panel of the oxygen preferences the transformation scenario do not work because the fop.xconf is searched in the main oxygen installation folder instead of the add-on installation folder.

The fop.xconf file is ok because if I copy it into the lib folder of oxygen and put ${oxygenInstallDir}/lib/fop.xconf in the fop panel of the oxygen preferences the transformation scenario works.

What should I put in the fop panel of the oxygen preferences to point my add-on framework ?

Regards,
Lionel
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: fop.xconf and add-on framework

Post by Radu »

Hi Lionel,

The ${framework} editor variable is only expanded when using it inside a document type configuration, including in transformation scenarios defined in a document type configuration.
It is not expanded in any global preference for example.
In Oxygen 16.1 (which should be released probably in September this year) we added a new editor variable which can be used to refer to a specific framework by name like:

${frameworkDir(framework_name)}/fop/fop.xconf

from any place in Oxygen.

so this will probably help you with your use case.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
LBarth
Posts: 26
Joined: Mon Mar 04, 2013 1:42 pm

Re: fop.xconf and add-on framework

Post by LBarth »

Hi Radu,

My problem is not to refer to a specific framework by name, when I write :
${frameworksDir}/gdr/fop/fop.xconf
I have the error :
java.io.FileNotFoundException: /Applications/oxygenEditor16.0/frameworks/gdr/fop/fop.xconf (No such file or directory)
because the file is actually in :
~/Library/Preferences/com.oxygenxml/extensions/v16.0/frameworks/http___oxygen.remix.rece.hachette_livre.fr_oxygenUpdate.xml/gdr/fop/fop.xconf

I have not found a way to tell where the fop configuration file is in the document type configuration.

By the way, I am looking too for a way to express the base fonts folder to override the fop.xconf <font-base/> element because all the fonts I need are already in the css folder I use in the framework.
Can I use the custom editor variables for this ?

Best regards,
Lionel
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: fop.xconf and add-on framework

Post by Radu »

Hi Lionel,

Exactly, as you said, when a framework is installed as an add-on, it is not copied to the main ${frameworksDir} folder (for example in your case "/Applications/oxygenEditor16.0/frameworks/").
So that's why referring to a framework by name makes sense because Oxygen can use that framework's name to find the folder where it actually is installed, even if it is installed as an add-on.
I have not found a way to tell where the fop configuration file is in the document type configuration.
There is no such way, we cannot add at framework configuration level all settings which can be set globally in Oxygen.
A workaround would be to create and pack as an extra add-on a plugin for Oxygen which could use for example the Java API ro.sync.exml.workspace.api.PluginWorkspace.setGlobalObjectProperty(String, Object) to set a system property the first time it is started.
In our Plugins SDK:

http://www.oxygenxml.com/oxygen_sdk.htm ... ne_plugins

we have a sample plugin called "Impose Options".
By the way, I am looking too for a way to express the base fonts folder to override the fop.xconf <font-base/> element because all the fonts I need are already in the css folder I use in the framework.
The Apache FOP processor is launched as an external process by us and parses this fop.xconf directly.
So if you implement a plugin you could possibly create from the plugin's Java code a fop.xconf tailored for that specific user the first time the application is started with the plugin enabled.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
LBarth
Posts: 26
Joined: Mon Mar 04, 2013 1:42 pm

Re: fop.xconf and add-on framework

Post by LBarth »

Ok Radu, thanks a lot for your help.

Lionel
Post Reply