The Wireframe Template

wireframe/default.jsp has an overall structure that matches the page layout diagram in The Published View: it consists of four HTML div elements representing the main page layout areas: header, footer, menu (or site map) and content (i.e, page content - a content item or a section page).

<%@ 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://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://www.escenic.com/taglib/escenic-section" prefix="section" %>
<%@ taglib uri="http://www.escenic.com/taglib/escenic-view" prefix="view" %>
<div id="body">
  <div id="header">
    <h1>${section.name}</h1>
   </div>
  <div id="menu">
    <bean:define id="rootSection" name="publication" property="rootSection" type="neo.xredsys.api.Section"/>
    <section:recursiveView id="secView" name="rootSection" depth="2"/>
    <c:url var="arrow" value="/gfx/arrow.gif" scope="request"/>
    <view:iterate view="<%=secView%>" id="item" type="neo.xredsys.api.Section"> 
     <section:use section="<%=item%>">
            <view:forEachLevel>&nbsp;</view:forEachLevel>
            &nbsp;<img src="${arrow}" alt="escenic"/>&nbsp;<section:link styleClass="menu_item"><section:name/></section:link><br/>
     </section:use>
    </view:iterate>
  </div>
  <div id="content">
    <c:choose>
      <c:when test="${requestScope['com.escenic.context']=='art'}">
        <jsp:include page="../article/ats.jsp"/>
      </c:when>
      <c:otherwise>
        <jsp:include page="../group/${pool.rootElement.type}.jsp" />
      </c:otherwise>
    </c:choose>
  </div>
  <div id="footer">Copyright © 2009 Escenic AS</div>
</div>

The header div consists of an h1 element containing an expression that returns the name of the current section. section, like publication is an Escenic request bean that is added to all requests by the Escenic servlet filters. It is a Section bean representing either the section requested by the user or the owning section of the content item requested by the user.

The footer div simply contains a logo image. Note the use of the contextUrl variable created in common.jsp.

The menu div makes use of tags from the Escenic section Tag Library and view Tag Library taglibs to generate a link menu or site map.

The content div contains a JSTL choose element that tests the content of com.escenic.context to find out whether this is a content item request ("art") or a section request ("sec"), and then passes control to the appropriate template.

For content item requests, control is passed to article/ats.jsp (article type selector). This template simply calls a new template that depends on the content of the article bean's articleTypeName property:

<jsp:include page="markup/${article.articleTypeName}.jsp"/>

In the context of our very simple publication, this means that if the selected content item was defined in Content Studio as being of type News, then article/markup/news.jsp will be called, and if it was created as being of type Picture, then article/markup/image.jsp will be called. For a description of these templates, see Content Item Templates.

For section requests, the template to which control is now passed depends upon the content of another Escenic request bean created by the servlet filters: pool.

<jsp:include page="../group/${pool.rootElement.type}.jsp" />

pool is a PresentationPool bean that represents the active section page. Its rootElement property is a PresentationElement bean that represents one of several possible section page layouts defined by group elements in the layout-group resource file (see group). The name of the particular layout required for this request is held in this PresentationElement bean's type property. The content of this type property is therefore used to select the template to call. The temp-dev publication has only one section page layout defined in the layout-group resource, called news. For a description of the section page template that is therefore called (group/news.jsp), see Section Page Templates.