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:
-
Create a Java class that extends the abstract class
com.escenic.livecenter.service.proxy.api.AbstractOGPRequestHandler
. -
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. -
Compile your class and add it to your web application's classpath.
-
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/FlickrCustom
OGPRequestHandler
.properties -
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.
-
Register your request handler as described in Register Request Handlers.