Creating an Open Graph Request Handler
To create a site-specific Open Graph request handler:
-
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/Flickr
OGPRequestHandler
.properties -
Open the copied file for editing and set the following properties as required:
urlPatterns
-
A comma-separated list of host names (not URL patterns as listed here) for which this handler is to be used. For Flickr, for example, you might want to set this property as follows:
urlPatterns=flickr.com,flic.kr
blockCodeTemplate
-
An HTML template from which the embedding code for your web pages will be generated. To include Open Graph property values in your template, enclose the property name in double braces thus:
{{property-name}}
providerName
-
The name of the provider for which you are implementing this handler (
Flickr
, for example). This property is optional: if you don't specify it, then the value returned forproviderNameKey
is used instead. providerNameKey
-
The name of the Open Graph property that the handler is to use as a provider name. This property is optional. If you don't specify it (and you haven't specified
providerName
either), then the provider name is read from the provider site'sog:site_name
property.
-
Register your request handler as described in Register Request Handlers.