Styles.KEY_MIXED_CONTENT does not work with Oxygen Component
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 24
- Joined: Tue Jun 05, 2012 10:34 am
Styles.KEY_MIXED_CONTENT does not work with Oxygen Component
Hi all, i have implemented a custom framework that provide a StylesFilter.
This filter works fine with Oxygen Author version, but i'm trying to switch my app to the Oxygen Component, and it seems that the Styles.KEY_MIXED_CONTENT property is not applied to my document.
Here is my code :
Result in Component version : my images nodes are in red but the image does not appear.
Result in Author version : my images nodes are in red and the images appear.
In debug mode, i don't see any difference in the property, do you have any idea? should i test anything else?
This filter works fine with Oxygen Author version, but i'm trying to switch my app to the Oxygen Component, and it seems that the Styles.KEY_MIXED_CONTENT property is not applied to my document.
Here is my code :
Code: Select all
@Override
public Styles filter(Styles styles, AuthorNode authorNode) {
if (isImageNode(authorNode)) {
ro.sync.exml.view.graphics.Color red = ro.sync.exml.view.graphics.Color.COLOR_RED;
styles.setProperty(Styles.KEY_BACKGROUND_COLOR, red);
File test = new File("C:/test.jpg");
styles.setProperty(Styles.KEY_MIXED_CONTENT, getImageContent(test));
}
return styles;
}
private StaticContent[] getImageContent(File imageFile) {
return new StaticContent[] {new URIContent(imageFile.getParentFile().toURI().toString(), imageFile.getName())};
}
Result in Author version : my images nodes are in red and the images appear.
In debug mode, i don't see any difference in the property, do you have any idea? should i test anything else?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Styles.KEY_MIXED_CONTENT does not work with Oxygen Component
Hi Benoit,
Well, if you add a System.err in custom the styles filter implementation, does it get called when running the Author Component?
Are you running the Author Component as an applet or embedded in another Java application?
Could you try to remove its local cache and try again? It is step (4) in the following procedure:
http://www.oxygenxml.com/doc/ug-oxygen/ ... oting.html
After you create your custom filter implementation, do you bundle it in a separate JAR file? Does your framework .framework file correctly reference this extra extension?
After this, do you pack the entire framework directory and copy it to the Author Component Project as a file called frameworks.zip.jar in the resources folder?
When running the component, does it report any problems? If the component is embedded as an applet, the Java Console should be enabled in order to show the messages.
Regards,
Radu
Well, if you add a System.err in custom the styles filter implementation, does it get called when running the Author Component?
Are you running the Author Component as an applet or embedded in another Java application?
Could you try to remove its local cache and try again? It is step (4) in the following procedure:
http://www.oxygenxml.com/doc/ug-oxygen/ ... oting.html
After you create your custom filter implementation, do you bundle it in a separate JAR file? Does your framework .framework file correctly reference this extra extension?
After this, do you pack the entire framework directory and copy it to the Author Component Project as a file called frameworks.zip.jar in the resources folder?
When running the component, does it report any problems? If the component is embedded as an applet, the Java Console should be enabled in order to show the messages.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Styles.KEY_MIXED_CONTENT does not work with Oxygen Component
One more idea:
Your posted code is just an example, right?
How exactly do you construct the absolute URL to the image? Do you use constructs like new File("relative/path/some.file")? Because such constructs depend on the folder in which the Java VM starts.
So maybe the base folder for the images is not properly computed when running the component.
Anyway, adding some logging in the filter implementation should help.
Regards,
Radu
Your posted code is just an example, right?
How exactly do you construct the absolute URL to the image? Do you use constructs like new File("relative/path/some.file")? Because such constructs depend on the folder in which the Java VM starts.
So maybe the base folder for the images is not properly computed when running the component.
Anyway, adding some logging in the filter implementation should help.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
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