Extending the Java Functionality of an Existing Framework (Document Type)

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:
  1. 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 Editor.

    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.

  2. Also add to the project's class path the: "[OXYGEN_DIR]\frameworks\docbook\docbook.jar".
  3. Create a class that extends ro.sync.ecss.extensions.docbook.DocBook4ExtensionsBundle and overwrites the method: ro.sync.ecss.extensions.api.ExtensionsBundle#createLinkTextResolver()
  4. 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).
  5. Pack your extension classes in a JAR file. Copy the JAR to: "[OXYGEN_DIR]\frameworks\docbook\custom.jar".
  6. Start Oxygen XML Editor.
  7. 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.
  8. 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.