How to Write A Custom Protocol Plugin

For creating a custom protocol plugin, apply the following steps:
  1. Write the handler class for your protocol that implements the java.net.URLStreamHandler interface.
    Be careful to provide ways to correct and uncorrect the URLs of your files.
  2. Write the plugin class by extending ro.sync.exml.plugin.Plugin.
  3. Write the plugin extension class that implements the ro.sync.exml.plugin.urlstreamhandler.URLStreamHandlerPluginExtension interface.

    It is necessary that the plugin extension for the custom protocol implements the URLStreamHandlerPluginExtension interface. Without it, you cannot use your plugin, because Oxygen XML Developer is not able to find the protocol handler.

    You can choose also to implement the URLChooserPluginExtension interface. It allows you to write and display your own customized dialog for selecting resources that are loaded with the custom protocol.

    An implementation of the extension URLHandlerReadOnlyCheckerExtension allows you to:

    • mark a resource as read-only when it is opened
    • switch between marking the resource as read-only and read-write while it is edited

    It is useful when opening and editing CMS resources.

  4. Write the plugin.xml descriptor.
    Remember to set the name of the plugin class to the one from the second step and the plugin extension class name with the one you have chosen at step 3.
  5. Create a .jar archive with all these files.
  6. Install your new plugin in the plugins subfolder of the Oxygen XML Developer install folder.