Documentation Center

Creating a custom compare plugin

You can create custom compare plugins to meet specific needs and requirements. Follow the best practices and use the "publish compare plugin creation example" as guidelines for this task.

  1. Choose the category of the plugin. This plugin is called at a specific moment in time for every content or metadata file that exist in the current or compare version folder.
  2. Implement Initialize. Here the plugin should read its parameters and parse their values. The initialize is only called once.
  3. Implement CompareXml and CompareMetadata. Note that a filepath parameter passed into the method can contain an empty string to indicate this file does not exist (in this version). Both methods should create a result file (on the file path provided in the resultFilePath parameter) and return the proper compare result. Through the plugin configuration you can get:
    1. Common parameters for the complete publish operation
    2. Plugin specific parameters
    3. XmlResolver to resolve DTDs
    4. LogService and EventMonitor interface which can be used for logging
  4. Expose the plugin using the Export attribute to make sure that the plugin engine can discover the plugin.