net.sf.zekr.engine.template
Class BaseViewTemplate
java.lang.Object
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
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 |
logger
protected final Logger logger
engine
protected TemplateEngine engine
config
protected static ApplicationConfig config
resource
protected static ResourceManager resource
langEngine
protected LanguageEngine langEngine
BaseViewTemplate
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. "fa" for Farsi, "en" for English, ...
- APP_PATH: an absolute URI ending with slash
- CSS_DIR: an absolute URI ending with slash
- UI_DIR: relative UI directory path
It will also put all processed properties related to the current theme (ThemeData.processedProps
).
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 templatevalue
- property value