Download InfoGlue - Developer Manual

Transcript
InfoGlue – Developer Manual
Building a basic content presentation component
When it comes to presenting content on the site you typically have the content taglibs to
your aid if you use JSP. Check them out in the appendix.
JSP style
<%@ taglib uri="infoglue-content" prefix="content" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<content:contentAttribute id="title" propertyName="Article" attributeName="Title"/>
<content:contentAttribute id="fullText" propertyName="Article" attributeName="FullText"/>
<h1><c:out value="${title}"/></h1>
<p><c:out value="${fullText}"/></p>
And the properties would for this simple article be:
<?xml version='1.0' encoding='UTF-8'?><properties><property name='Article' type='binding'
entity='Content' multiple='false' allowedContentTypeDefinitionNames='Article' description='The
article this component should show'/></properties>
Velocity style
#set($cl = $templateLogic.componentLogic)
#set($title = $cl.getContentAttribute("Article", "Title"))
#set($fullText = $cl.getParsedContentAttribute("Article", "FullText"))
<h1>$title</h1>
<p>$fullText</p>
And the properties would for this simple article be:
<?xml version='1.0' encoding='UTF-8'?><properties><property name='Article' type='binding'
entity='Content' multiple='false' allowedContentTypeDefinitionNames='Article' description='The
article this component should show'/></properties>
Author: Mattias Bogeblad
Page 62
2009/01/19