Creating an oEmbed Request Handler

To create your own site-specific oEmbed request handler:

  1. Copy LiveCenterOEmbedRequestHandler.properties from the CUE Live installation into your webapp configuration layer (not the common configuration layer), and rename appropriately. For Flickr, for example, you might enter:

    $ cp engine-installation/plugins/live/misc/siteconfig/com/escenic/livecenter/service/proxy/LiveCenterOEmbedRequestHandler.properties \
    > /etc/escenic/engine/common/com/escenic/livecenter/service/proxy/FlickrOEmbedRequestHandler.properties
  2. 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 oEmbed property values in your template, enclose the property name in braces thus:

    {property-name}

    Alternatively, you can specify the path of a file in which you have saved the template, for example:

    blockCodeTemplate=file:/path/to/block/code/template

    The path must be specified as a file system URL (that is, it must have a file: prefix). The URL must be absolute.

    requestHeaders.field-name

    These are optional properties that you can add if you want to include any special fields in the headers of your embed requests. field-name must be the name of an HTTP header field. To set the User-Agent field to some special value, for example, you would need to specify:

    requestHeaders.User-Agent=user-agent-string
  3. Register your request handler as described in Register Request Handlers.