Creating a syndicator class

A syndicator plugin is used to run additional functionality on the syndicator when a syndication event is invoked.

About this task

To create a syndicator plugin, you must create a syndicator class and then register the syndicator class by deploying it on the server.

Procedure

  1. Create a java class that implements the interface com.ibm.workplace.wcm.api.extensions.syndication.SyndicatorStarted. This class must implement the following methods:
    public ResultDirective onSyndicatorStarted(SyndicatorEvent eventInfo)
    • This method contains the code that will be executed when the syndication run starts.
    • This method is executed after the plug-ins for the SubscriberReady extension point are run.
    • The extensions are executed only when there are changes on the syndicator.
    • The extension is not executed every time automatic syndication queues the syndicator.

    See the Javadoc documentation for further information. The Javadoc files for Web Content Manager are located in the wp_profile_root/installedApps/node_name/wcm.ear/ilwwcm.war/webinterface/api-javadoc directory.

  2. Implement the onSyndicatorStarted method.
    • This method contains the code that is run on the syndicator when there are changes that are available for syndication to the subscriber.
    • This method must return a com.ibm.workplace.wcm.api.extensions.syndication.ResultDirective object to indicate whether the syndication engine can continue or stop the syndication process.
  3. A plugin.xml file is needed whether the deployment is done using a WAR or EAR, or using a loose jar. If deploying via an application in a WAR or EAR, include the plugin.xml file in the application's "WEB-INF" folder. When using a jar, include the plugin.xml in the root of the jar.
    <?xml version="1.0" encoding="UTF-8"?>
    <plugin id="com.ibm.workplace.wcm.sample.syndicatorstarted"
            name="Sample Syndicator Started Extension"
            version="1.0.0"
            provider-name="IBM">        
      <extension
         point="com.ibm.workplace.wcm.api.SyndicatorStarted"
         id="SyndicatorStartedExtension" >
         <provider class="com.ibm.workplace.wcm.sample.syndicatorstarted.SyndicatorStartedExtension"/>
      </extension> 
    </plugin>
  4. Ensure syndication.extensions.enabled is set to true in the WCM WCMConfigService custom properties in the WebSphere® Integrated Solutions Console under Resource Environment Providers. If the property does not exist, you need to add it.

What to do next

  • The ID of each plugin must be unique.
  • You must replace the plugin ID specified in this example, com.ibm.workplace.wcm.sample.syndicatorstarted, with a different ID for each SyndicatorStarted extension you create.
  • Each SyndicatorStarted extension is represented by a single <extension></extension> tag.
  • The value of the point attribute must be com.ibm.workplace.wcm.api.SyndicatorStarted.
  • Provide an id value of your choice.
  • Specify the provider class for your SyndicatorStarted extension.
Naming conventions:
If you create a new plugin application with the same names and IDs as an existing plugin, the new plugin may override the first. When creating plugin applications ensure that the following are unique across your system:
  • The plugin ID, plugin name and extension ID of the plugin.xml file.
  • The fully qualified class name plus path of all classes within the application.
  • The file path of any files within the application.