Class Template

  extended by info.magnolia.module.templating.AbstractRenderable
      extended by info.magnolia.module.templating.Template
All Implemented Interfaces:
Direct Known Subclasses:
SampleTemplate, 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.

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

Constructor Summary
          Used internally for SubTemplates.
Method Summary
 void addSubTemplate(String extension, Template subTemplate)
 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(Content node)
 boolean isVisible()
          Getter for visible.
 void setContent(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


public Template()
Used internally for SubTemplates.

Method Detail


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

Getter for path.

Returns the path.


public String getI18NTitle()


public String getParameter(String key)


public boolean isVisible()
Getter for visible.

Returns the visible.


public Template getSubTemplate(String extension)


public void addSubTemplate(String extension,
                           Template subTemplate)


public Map<String,Template> getSubTemplates()


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


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


public void setVisible(boolean visible)


public boolean isAvailable(Content node)


public Content getContent()


public void setContent(Content content)

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