Question
How can I change the way DocBook 4 xref's display in author view based on
what element is at the linkend?
Please follow the steps below:
- Create a Maven Java project and add a dependency on the oXygen
classes:
<dependency>
<groupId>com.oxygenxml</groupId>
<artifactId>oxygen-sdk</artifactId>
<version>${oxygen.version}</version>
</dependency>
where
${oxygen.version} is the version of Oxygen XML Author.Alternatively, if
the project does not use Maven, all the transitive dependencies of the above Maven
artifact need to be added to the classpath of the project.
- Also add to the project's class path the:
"[OXYGEN_DIR]\frameworks\docbook\docbook.jar".
- Create a class that extends ro.sync.ecss.extensions.docbook.DocBook4ExtensionsBundle
and overwrites the method: ro.sync.ecss.extensions.api.ExtensionsBundle#createLinkTextResolver()
- For your custom resolver implementation you can start from the Java sources of the
ro.sync.ecss.extensions.docbook.link.DocbookLinkTextResolver
(the
Java code for the entire DocBook customization is present in a subfolder in the Author
SDK).
- Pack your extension classes in a JAR file. Copy the JAR to:
"[OXYGEN_DIR]\frameworks\docbook\custom.jar".
- Start Oxygen XML Author.
- Open the
Preferences dialog box and go to
Document Type Association. Edit the DocBook 4 document type. In
the Classpath list add the path to the new JAR. In the extensions list select
your custom extension instead of the regular DocBook one.
- You can rename the document type and also the "docbook" framework folder to something
else like "custom_docbook" and share it with others. A
document type can also be installed using our add-on
support.