net.sf.zekr.engine.template
Class BaseViewTemplate

java.lang.Object
  extended by net.sf.zekr.engine.template.BaseViewTemplate
All Implemented Interfaces:
ITransformer
Direct Known Subclasses:
AbstractPageViewTemplate, AbstractSearchResultTemplate, AbstractSuraViewTemplate, ThemeTemplate

public abstract class BaseViewTemplate
extends java.lang.Object
implements ITransformer

Since:
Zekr 1.0
Author:
Mohsen Saboorian

Field Summary
protected static ApplicationConfig config
           
protected  TemplateEngine engine
           
protected  LanguageEngine langEngine
           
protected  Logger logger
           
protected static ResourceManager resource
           
 
Constructor Summary
protected BaseViewTemplate()
          Will put some initial properties into context (and some other): DIRECTION: "rtl" or "ltr" based on the current language pack TRANS_DIRECTION: "rtl" or "ltr" based on the current translation TRANS_LANG: 2-char language code, e.g.
 
Method Summary
abstract  java.lang.String doTransform()
           
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets a property in the context of transformer for further use in templates.
 java.lang.String transform()
          This method will generate the result string of a view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger

engine

protected TemplateEngine engine

config

protected static ApplicationConfig config

resource

protected static ResourceManager resource

langEngine

protected LanguageEngine langEngine
Constructor Detail

BaseViewTemplate

protected BaseViewTemplate()
Will put some initial properties into context (and some other): It will also put all processed properties related to the current theme (ThemeData.processedProps).

Method Detail

transform

public java.lang.String transform()
                           throws TemplateTransformationException
This method will generate the result string of a view.

Specified by:
transform in interface ITransformer
Returns:
the String representation of a view
Throws:
TemplateTransformationException

doTransform

public abstract java.lang.String doTransform()
                                      throws TemplateTransformationException
Throws:
TemplateTransformationException

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Description copied from interface: ITransformer
Sets a property in the context of transformer for further use in templates.

Specified by:
setProperty in interface ITransformer
Parameters:
key - property key to be accessed by that inside template
value - property value