Change the CSS filepath of a framework at runtime
Oxygen general issues.
-
- Posts: 206
- Joined: Thu Dec 01, 2011 4:22 pm
- Location: Hamburg, Germany
Change the CSS filepath of a framework at runtime
Hello,
We are using the Eclipse version 14.1 of Oxygen.
I have added the http://www.pi-mod.de/ framework to the Document Type Association and defined certain rules for it.
Unfortunately some of our customers have individually customized the CSS and Schema files, so that the XML document, its Schema and CSS is downloaded together from the customers server and then should be used by the XML editor.
So we cannot exactly define, which CSS and Schema should be chosen beforehand.
The CSS and Schema files have the same location like the XML document itself.
It seems that the correct Schema file is detected automatically by the Oxygen Author(Maybe because it is located in the same folder). But the CSS only works, if I define the right path in the Document Type Association.
Do you have an API to change the CSS URI at runtime, when a certain xml document is opened?
Best regards,
Simon
We are using the Eclipse version 14.1 of Oxygen.
I have added the http://www.pi-mod.de/ framework to the Document Type Association and defined certain rules for it.
Unfortunately some of our customers have individually customized the CSS and Schema files, so that the XML document, its Schema and CSS is downloaded together from the customers server and then should be used by the XML editor.
So we cannot exactly define, which CSS and Schema should be chosen beforehand.
The CSS and Schema files have the same location like the XML document itself.
It seems that the correct Schema file is detected automatically by the Oxygen Author(Maybe because it is located in the same folder). But the CSS only works, if I define the right path in the Document Type Association.
Do you have an API to change the CSS URI at runtime, when a certain xml document is opened?
Best regards,
Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
vogella GmbH
http://www.vogella.com
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Change the CSS filepath of a framework at runtime
Hi Simon,
I do not quite understand.
So in some XML files is the CSS referenced like this?
When the user opens the XML, is the relatively referenced CSS also available as a resource?
Regards,
Radu
I do not quite understand.
So in some XML files is the CSS referenced like this?
Code: Select all
<?xml-stylesheet type="text/css" href="personal.css"?>
In the case it does not work, when switching the XML to the Author page is there any problem reported?But the CSS only works, if I define the right path in the Document Type Association.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 206
- Joined: Thu Dec 01, 2011 4:22 pm
- Location: Hamburg, Germany
Re: Change the CSS filepath of a framework at runtime
Hello Radu,
the approach with the PI <?xml-stylesheet type="text/css" href="personal.css"?> works.
I was just wonderung, if I could change some properties of a certain Framework programmatically at runtime.
So we define the CSS via PI and DTD via Doctype.
Though we have to define certain actions for inserting tables and other framework specific elements inside the frameworks preferences.
For tables I just copied the docbook.jar, because it contains methods for inserting cals Tables.
Could you explain how I can create my own actions, which can be used for the PI-Mod framework?
Do you have a certain Interface, which I have to implement in order to provide actions for the menu, toolbar and context menu for the framework?
Best regards,
Simon
the approach with the PI <?xml-stylesheet type="text/css" href="personal.css"?> works.
I was just wonderung, if I could change some properties of a certain Framework programmatically at runtime.
So we define the CSS via PI and DTD via Doctype.
Though we have to define certain actions for inserting tables and other framework specific elements inside the frameworks preferences.
For tables I just copied the docbook.jar, because it contains methods for inserting cals Tables.
Could you explain how I can create my own actions, which can be used for the PI-Mod framework?
Do you have a certain Interface, which I have to implement in order to provide actions for the menu, toolbar and context menu for the framework?
Best regards,
Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
vogella GmbH
http://www.vogella.com
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Change the CSS filepath of a framework at runtime
Hi Simon,
If you want to make modifications, our Author SDK contains the entire Java code for the Docbook extensions:
http://www.oxygenxml.com/oxygen_sdk.htm ... horing_SDK
http://www.oxygenxml.com/doc/ug-oxygen/ ... intro.html
Basically when editing a custom framework there is an Author tab which contains an Actions tab.
You create actions which can have more than one XPath contexts in which certain operations can be invoked. Out of the box we provide a list of built-in operations like ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation which can be used to insert a small XML fragment in a certain place.
But you can also implement a custom operation (extend the interface ro.sync.ecss.extensions.api.AuthorOperation). The JAR library with the implementation will need to be added to the Classpath list when editing the document type.
Then these actions can be added to the toolbar, main or contextual menus.
Regards,
Radu
No, sorry. As long as the XML references the custom XML Schema, it should not be a problem for it to reference the custom CSS as well, right?I was just wonderung, if I could change some properties of a certain Framework programmatically at runtime.
Right, Docbook tables adhere to the CALS table standard so if you use the same standard the existing implementations should work.For tables I just copied the docbook.jar, because it contains methods for inserting cals Tables.
If you want to make modifications, our Author SDK contains the entire Java code for the Docbook extensions:
http://www.oxygenxml.com/oxygen_sdk.htm ... horing_SDK
Our Author Developer guide covers this:Could you explain how I can create my own actions, which can be used for the PI-Mod framework?
Do you have a certain Interface, which I have to implement in order to provide actions for the menu, toolbar and context menu for the framework?
http://www.oxygenxml.com/doc/ug-oxygen/ ... intro.html
Basically when editing a custom framework there is an Author tab which contains an Actions tab.
You create actions which can have more than one XPath contexts in which certain operations can be invoked. Out of the box we provide a list of built-in operations like ro.sync.ecss.extensions.commons.operations.InsertFragmentOperation which can be used to insert a small XML fragment in a certain place.
But you can also implement a custom operation (extend the interface ro.sync.ecss.extensions.api.AuthorOperation). The JAR library with the implementation will need to be added to the Classpath list when editing the document type.
Then these actions can be added to the toolbar, main or contextual menus.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 206
- Joined: Thu Dec 01, 2011 4:22 pm
- Location: Hamburg, Germany
Re: Change the CSS filepath of a framework at runtime
Hello Radu,
Thanks for the hint with the SDK Sources.
The ro.sync.ecss.extensions.api.AuthorOperation was actually what I needed.
I did implement some PI-Mod custom actions and it works fine.
Because it is not so easy to include our bundles into the oxygen extensions I decided to use your localisation mechanism using a translation.xml in the i18n folder, which is referenced as classpath in the framework file.
With the ro.sync.ecss.extensions.api.AuthorResourceBundle.getMessage I get the text from the translation.xml file, but only the en_US ones and not the german de_DE ones, even though I have set the -nl de arguments.
Is there any additional language configuration required?
Best regards,
Simon
RightIt should not be a problem for it to reference the custom CSS as well, right?

Thanks for the hint with the SDK Sources.
The ro.sync.ecss.extensions.api.AuthorOperation was actually what I needed.
I did implement some PI-Mod custom actions and it works fine.
Because it is not so easy to include our bundles into the oxygen extensions I decided to use your localisation mechanism using a translation.xml in the i18n folder, which is referenced as classpath in the framework file.
With the ro.sync.ecss.extensions.api.AuthorResourceBundle.getMessage I get the text from the translation.xml file, but only the en_US ones and not the german de_DE ones, even though I have set the -nl de arguments.
Is there any additional language configuration required?
Best regards,
Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
vogella GmbH
http://www.vogella.com
-
- Posts: 9445
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Change the CSS filepath of a framework at runtime
Hi Simon,
Are the tooltips which appear over the Author toolbar custom operations in German?
Does any action from the Oxygen plugin appear translated in German.
Did you install the German language pack (or copy the plugin_de.properties properties file to the plugin installation folder) in the Oxygen plugin?
When started with a certain locale, Oxygen looks if the plugin_locale.properties is available and if so will also try to use the locale for the extension actions and other Oxygen actions which are not available in the plugin.xml.
Regards,
Radu
Are the tooltips which appear over the Author toolbar custom operations in German?
Does any action from the Oxygen plugin appear translated in German.
Did you install the German language pack (or copy the plugin_de.properties properties file to the plugin installation folder) in the Oxygen plugin?
When started with a certain locale, Oxygen looks if the plugin_locale.properties is available and if so will also try to use the locale for the extension actions and other Oxygen actions which are not available in the plugin.xml.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 206
- Joined: Thu Dec 01, 2011 4:22 pm
- Location: Hamburg, Germany
Re: Change the CSS filepath of a framework at runtime
Hello Radu,
somehow the localisation fragment was not activated any more in my run configurations.
Now everything works fine.
Thanks a lot.
Best regards,
Simon
somehow the localisation fragment was not activated any more in my run configurations.
Now everything works fine.
Thanks a lot.
Best regards,
Simon
Simon Scholz
vogella GmbH
http://www.vogella.com
vogella GmbH
http://www.vogella.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service