Hi Simon,
Before you read my detailed answers about the styles filter:
It might not be necessary to set a styles filter.
You could try to alter the CSS:
[b]OXYGEN_PLUGIN_INSTALL_DIR/frameworks/dita/css_classed/topic.csswhich has the following selector:
- Code: Select all
*[class~="topic/image"],
*[class~="topic/image"][placement="inline"] {
display: inline;
content: attr(href, url);
width:attr(width, length);
height:attr(height, length);
}
We have a lot of CSS extension functions:
http://www.oxygenxml.com/doc/ug-oxygen/index.html?q=/doc/ug-oxygen/topics/dg-oxygen-css-functions.htmlFor example you could do something like this:
- Code: Select all
content: url("http://www.oxygenxml.com/images", attr(src));
or some more complicated concatenation of the URL where the XML is located with another folder path and then with the attribute @href:
- Code: Select all
content: url(oxy_parent-url(oxy_base-uri()), oxy_concat("../path/to/another/dir/", attr(href)));
Please see some answers related to the styles filter below:
How do I get a compiled class of the java file, when there is no main method in it?
I do not quite understand what you mean but I will describe the steps that a developer using our Java API usually does.
1) Download the Author SDK:
http://www.oxygenxml.com/oxygen_sdk.html#XML_Editor_Authoring_SDK2) Create a new Java Eclipse project which has the libraries bundled with the Author SDK in its classpath
3) Create your custom Java class which implements the
StylesFilter interface.
The Java class is automatically compiled by the Eclipse platform and it is present in the
bin or
classes folder.
How do I package it into a jar file afterwards?
You could use ANT for example. You could create and run an ANT build file which uses the
<jar> task for this.
Then the ANT build file could also copy the JAR library to the appropriate place (
OXYGEN_PLUGIN_INSTALL_DIR/frameworks/dita/yourLibrary.jar).
Or you could simply open in the explorer the directory where Eclipse compiles all Java classes and zip its entire content renaming the resulting zip file with the ".jar" extension, then copy the JAR to the right place.
The JAR should contain inside it a folder structure like:
your/package/name/YourStylesFilterImpl.classDoes the Eclipse version use a different approach?
No.
Where do I find the correct class path file?
The topic you are reading is out of context.
Basically the support Oxygen has for various vocabularies is based on document types:
http://www.oxygenxml.com/doc/ug-editorEclipse/index.html?q=/doc/ug-editorEclipse/topics/dg-author-settings.htmlThe list of document types in an Oxygen installation can be located in the Eclipse
Preferences->Oxygen->Document Type Association preference page.
If you edit the DITA document type from the list, the document type edit dialog contains a tab called
Classpath in which you should add a reference to the JAR you have previously copied to the
OXYGEN_PLUGIN_INSTALL_DIR/frameworks/dita/yourLibrary.jar.
The reference should use editor variables so that it can be expanded correctly for all users who will use this customized DITA document type.
After you add the jar to the Classpath you should switch to the
Extensions tab where you can choose an implementation for
CSS Style Filter. If all went well, you should find your own implementation when you click the
Choose button.
Then save the dialog and press "Ok" in the preferecences page.
This will rezult in a change of the XML customization file:
OXYGEN_PLUGIN_INSTALL_DIR/frameworks/dita/dita.framework which now will contain a reference to the new jar + reference to the styles filter implementation.
After this, opening a DITA topic should call your styles filter for each of the elements.
Regards,
Radu