info.magnolia.module.templating
Class Template

java.lang.Object
  extended by info.magnolia.module.templating.AbstractRenderable
      extended by info.magnolia.module.templating.Template
All Implemented Interfaces:
RenderableDefinition
Direct Known Subclasses:
Template

public class Template
extends AbstractRenderable

Represents a template definition. Following are some of the most common properties you can use to configure your templates. Of course, if you're using specific subclasses, other properties could be available.

Name of Property Default Value Value Example or Range Description
class Template    
type jsp jsp, freemarker, … Determines which TemplateRenderer to use. Out of the box, Magnolia provides support for JSP and FreeMarker.
templatePath   Conventional path syntax is used for this property. This property defines the URI to the template which is normally a JSP. The path for the template is relative to the root and structure of the webapp folder.
visible true true, false This property determines if the template is visible in the template drop-down list. If a template is to be restricted so that only certain users can see it in the drop-down list, a role needs to be defined in security which denies access to the particular template definition content node.
modelClass   The fully qualified name of a class implementing RenderingModel The bean created by the renderer based on the modelClass defined on the paragraph or template definition. The current content, definition and the parent model are passed to the constructor. This object is instantiated for each rendering of a template or a paragraph.
subTemplates   Any valid node identifier. This property designates a node containing any subtemplates to be used by the template.
name nodeName Naming conventions should be followed using standard alphanumerical characters only. This property lists the name of the template.
i18nBasename   Naming conventions should be followed using standard alphanumerical characters only. This property defines the message bundle to use for this template.
title   The title or a message bundle key to be used with the bundle defined by i18nBasename. This property designates the title of the template. The i18nBasename (designated message bundle) renders the title.
description   The description or a message bundle key to be used with the bundle defined by i18nBasename. This property contains the description of the template. Descriptions should be intuitive and provide a context for users and/or developers to understand how the overall template functions.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Sameer Charles, Fabrizio Giustina

Constructor Summary
Template()
          Used internally for SubTemplates.
 
Method Summary
 void addSubTemplate(String extension, Template subTemplate)
           
 info.magnolia.cms.core.Content getContent()
           
 String getI18NTitle()
           
 String getParameter(String key)
           
 String getPath()
          Deprecated. since 4.0. use getTemplatePath() instead
 Template getSubTemplate(String extension)
           
 Map<String,Template> getSubTemplates()
           
 boolean isAvailable(info.magnolia.cms.core.Content node)
           
 boolean isVisible()
          Getter for visible.
 void setContent(info.magnolia.cms.core.Content content)
           
 void setPath(String path)
          Deprecated. since 4.0 use AbstractRenderable.setTemplatePath(String)
 void setSubTemplates(Map<String,Template> subTemplates)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class info.magnolia.module.templating.AbstractRenderable
determineTemplatePath, getDescription, getDialog, getI18nBasename, getModelClass, getName, getParameters, getTemplatePath, getTitle, getType, newModel, setDescription, setDialog, setI18nBasename, setModelClass, setName, setParameters, setTemplatePath, setTitle, setType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Template

public Template()
Used internally for SubTemplates.

Method Detail

getPath

public String getPath()
Deprecated. since 4.0. use getTemplatePath() instead

Getter for path.

Returns:
Returns the path.

getI18NTitle

public String getI18NTitle()

getParameter

public String getParameter(String key)

isVisible

public boolean isVisible()
Getter for visible.

Returns:
Returns the visible.

getSubTemplate

public Template getSubTemplate(String extension)

addSubTemplate

public void addSubTemplate(String extension,
                           Template subTemplate)

getSubTemplates

public Map<String,Template> getSubTemplates()

setSubTemplates

public void setSubTemplates(Map<String,Template> subTemplates)

setPath

public void setPath(String path)
Deprecated. since 4.0 use AbstractRenderable.setTemplatePath(String)


setVisible

public void setVisible(boolean visible)

isAvailable

public boolean isAvailable(info.magnolia.cms.core.Content node)

getContent

public info.magnolia.cms.core.Content getContent()

setContent

public void setContent(info.magnolia.cms.core.Content content)


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.