Overriding the Default Embed Layout

The embedding mechanism described in this section replaces an older, deprecated mechanism used in Live Center version 1.3. Since it is deprecated, documentation of this old mechanism has been removed. If for any reason you need access to the old documentation, see here.

You can override the default embed layout by modifying the following items as described below:

  • Two request handler configurations – an editorial request handler configuration and a presentation request handler configuration.

  • The JSP template to which embed requests are forwarded

Create your own editorial embed request handler as follows:

  1. Copy DefaultECERequestHandler.properties from the Live Center installation to the correct location in your common configuration layer:

    $ mkdir -p /etc/escenic/engine/common/com/escenic/livecenter/service/oembed/ece
    $ cp /opt/escenic/engine/plugins/live-center/misc/siteconfig/com/escenic/livecenter/service/oembed/ece/DefaultECERequestHandler.properties \
    > /etc/escenic/engine/common/com/escenic/livecenter/service/oembed/ece/
  2. Open DefaultECERequestHandler.properties file for editing and replace the default blockCodeTemplate setting:

    <iframe src="{{OEMBED_TEMPLATE_URL}}" width="480" height="300" frameBorder="0"
    scrolling="no" allowtransparency="true" allowfullscreen="true" /></iframe>

    with your required template code.

Then repeat the process to create your own presentation embed request handler:

  1. Copy DefaultPresentationECERequestHandler.properties from the Live Center installation to the correct location in your webapp configuration layer (not the common configuration layer):

    $ mkdir -p /etc/escenic/engine/webapp/live-center-presentation-webservice/com/escenic/livecenter/presentation/service/oembed/
    $ cp /opt/escenic/engine/plugins/live-center/misc/siteconfig/webapp/com/escenic/livecenter/presentation/service/oembed/DefaultPresentationECERequestHandler.properties \
    > /etc/escenic/engine/webapp/live-center-presentation-webservice/com/escenic/livecenter/presentation/service/oembed/
  2. Open DefaultPresentationECERequestHandler.properties file for editing and replace the default blockCodeTemplate setting:

    <iframe src="{{OEMBED_TEMPLATE_URL}}" width="480" height="300" frameBorder="0"
    scrolling="no" allowtransparency="true" allowfullscreen="true" /></iframe>

    with your required template code.

The placeholder {{OEMBED_TEMPLATE_URL}} in both templates is replaced by the URL of the content item in its embedded form. This "embedded" URL is formed by appending the string /oembed to the end of the content item's ordinary URL. For example, a content item with the standard URL http://myorg.com/dailynews/incoming/article123.ece will have the embedded URL http://myorg.com/dailynews/incoming/article123.ece/oembed.

Any request with such an "embedded" URL is forwarded to the JSP template publication/template/oembed/common.jsp. You can therefore determine the layout of all the content items embedded in your live blog by editing this JSP template in the usual way. The template included in the Live Center demo application looks like this:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.escenic.com/taglib/escenic-article" prefix="article"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="no" lang="no">
  <head>
      <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1"/>
      <title>${publication.name} :: ${article.fields.title}</title>

  </head>
  <body style="margin: 0; padding: 0;">
    <jsp:include page="${article.articleTypeName}.jsp"/>

  </body>
</html>