+

Search Tips   |   Advanced Search

Create a subscriber class

A subscriber plugin is used to run additional functionality on the subscriber used to determine if the subscriber is ready for syndication when a syndication event is invoked. To create a subscriber plugin, create a subscriber class and then register the subscriber class by deploying it on the server.

  1. Create a java class that implements the interface com.ibm.workplace.wcm.api.extensions.syndication.SubscriberReady. This class implement the following methods:

      public ResultDirective onSubscriberReady(SubscriberEvent eventInfo)

      • This method contains the code that will be executed when the syndication run starts.

      • This method is executed on the subscriber.

      • The extensions are executed only when there are changes in 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 PORTAL_HOME/doc/Javadoc/spi_docs/com/ibm/workplace/wcm directory.

  2. Implement the onSubscriberReady method. 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 
            name="Sample Subscriber Ready Extension"
            version="1.0.0"
            provider-name="IBM">          <extension
         point="com.ibm.workplace.wcm.api.SubscriberReady"
          >
         <provider class="com.ibm.workplace.wcm.sample.subscriberready.SubscriberReadyExtension"/>
      </extension>  </plugin>


What to do next

  • The ID of each plugin must be unique.

  • Replace the plugin ID specified in this example, com.ibm.workplace.wcm.sample.subscriberready, with a different ID for each SubscriberReady extension we create.

  • Each SubscriberReady extension is represented by a single <extension></extension> tag.

  • The value of the point attribute must be com.ibm.workplace.wcm.api.SubscriberReady.

  • Provide an id value of the choice.

  • Specify the provider class for the SubscriberReady extension.

Naming conventions:

If we 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 the following are unique across the 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.


Parent Create custom plug-ins