info.magnolia.module.templating
Class AbstractRenderable

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

public class AbstractRenderable
extends Object
implements RenderableDefinition

Base implementation for paragraph and template definitions. Provides the modelClass property which is used in the method newModel(Content, RenderableDefinition , RenderingModel)

Version:
$Id: AbstractRenderable.java 32667 2010-03-13 00:37:06Z gjoseph $
Author:
pbracher

Constructor Summary
AbstractRenderable()
           
 
Method Summary
 String determineTemplatePath(String actionResult, RenderingModel model)
          Return always the templatePath property.
 String getDescription()
           
 String getDialog()
           
 String getI18nBasename()
           
 Class<? extends RenderingModel> getModelClass()
           
 String getName()
           
 Map getParameters()
          An arbitrary list of parameters.
 String getTemplatePath()
           
 String getTitle()
           
 String getType()
           
 RenderingModel newModel(info.magnolia.cms.core.Content content, RenderableDefinition definition, RenderingModel parentModel)
          Instantiates the model based on the class defined by the modelClass property.
 void setDescription(String description)
           
 void setDialog(String dialog)
           
 void setI18nBasename(String basename)
           
 void setModelClass(Class<? extends RenderingModel> modelClass)
           
 void setName(String name)
           
 void setParameters(Map params)
           
 void setTemplatePath(String templatePath)
           
 void setTitle(String title)
           
 void setType(String type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRenderable

public AbstractRenderable()
Method Detail

determineTemplatePath

public String determineTemplatePath(String actionResult,
                                    RenderingModel model)
Return always the templatePath property.

Specified by:
determineTemplatePath in interface RenderableDefinition

newModel

public RenderingModel newModel(info.magnolia.cms.core.Content content,
                               RenderableDefinition definition,
                               RenderingModel parentModel)
                        throws IllegalArgumentException,
                               InstantiationException,
                               IllegalAccessException,
                               InvocationTargetException
Instantiates the model based on the class defined by the modelClass property. The class must provide a constructor similar to RenderingModelImpl.RenderingModelImpl(Content, RenderableDefinition, RenderingModel). All the request parameters are then mapped to the model's properties.

Specified by:
newModel in interface RenderableDefinition
Throws:
IllegalArgumentException
InstantiationException
IllegalAccessException
InvocationTargetException

getName

public String getName()
Specified by:
getName in interface RenderableDefinition

getTitle

public String getTitle()
Specified by:
getTitle in interface RenderableDefinition

getTemplatePath

public String getTemplatePath()
Specified by:
getTemplatePath in interface RenderableDefinition

getType

public String getType()
Specified by:
getType in interface RenderableDefinition

getDescription

public String getDescription()
Specified by:
getDescription in interface RenderableDefinition

setDescription

public void setDescription(String description)

setName

public void setName(String name)

setTemplatePath

public void setTemplatePath(String templatePath)

setType

public void setType(String type)

setTitle

public void setTitle(String title)

getDialog

public String getDialog()
Specified by:
getDialog in interface RenderableDefinition

setDialog

public void setDialog(String dialog)

getI18nBasename

public String getI18nBasename()
Specified by:
getI18nBasename in interface RenderableDefinition

setI18nBasename

public void setI18nBasename(String basename)

getParameters

public Map getParameters()
Description copied from interface: RenderableDefinition
An arbitrary list of parameters. Used to omit subclass with getters and setters for each extra parameter.

Specified by:
getParameters in interface RenderableDefinition

setParameters

public void setParameters(Map params)

getModelClass

public Class<? extends RenderingModel> getModelClass()

setModelClass

public void setModelClass(Class<? extends RenderingModel> modelClass)

toString

public String toString()
Overrides:
toString in class Object


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