Creating a Custom Open Graph Request Handler

If creating a request handler based on OGPRequestHandler does not meet your requirements, you can create a custom request handler, which will allow you to control exactly how the provider's content is embedded into your pages. Making a custom request handler requires Java programming skills.

To make a custom request handler:

  1. Create a Java class that extends the abstract class com.escenic.livecenter.service.proxy.api.AbstractOGPRequestHandler.

  2. Override the method buildBlockCodeImpl(String pTemplate, Map <String, String> pOGPValues). This gives you full control over how the Open Graph properties supplied by the provider site are merged with your HTML template.

  3. Compile your class and add it to your web application's classpath.

  4. Copy OGPRequestHandler.properties from the plug-in installation into your webapp configuration layer (not the common configuration layer), and rename it appropriately. For Flickr, for example, you might enter:

    $ cp /opt/escenic/engine/plugins/live-center/misc/siteconfig/com/escenic/livecenter/service/proxy/OGPRequestHandler.properties \
    > /etc/escenic/engine/common/com/escenic/livecenter/service/proxy/FlickrCustomOGPRequestHandler.properties
  5. Open the copied file for editing and set the properties as required. See Creating an Open Graph Request Handler for a description of the properties.

  6. Register your request handler as described in Register Request Handlers.