|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.abstracthorizon.danube.freemarker.FreeMarkerViewAdapter
public class FreeMarkerViewAdapter
This is implementation of View
that uses Velocity template engine. Model map is used as map of parameters for
Velocity.
| Nested Class Summary | |
|---|---|
class |
FreeMarkerViewAdapter.LocalTemplateLoader
Local template loader that uses templates path or templates URL (which ever is supplied). |
| Field Summary | |
|---|---|
protected Configuration |
configuration
Configuration |
static String |
DEFAULT_SUFFIX
Default pages suffix is ".page" |
protected org.slf4j.Logger |
logger
Logger |
protected String |
suffix
Suffix to be used for templates |
protected File |
templatesPath
Path where templates are stored |
protected URL |
templatesURL
URL where templates are stored |
| Constructor Summary | |
|---|---|
FreeMarkerViewAdapter()
Constructor. |
|
| Method Summary | |
|---|---|
protected TemplateLoader |
createTemplateLoader()
|
String |
getSuffix()
Returns suffix of the templates |
File |
getTemplatesPath()
Returns path where templates are stored |
URL |
getTemplatesURL()
Returns URL where templaes are to be read from |
void |
init()
This metod initialises Velocity engine. |
protected String |
makeTemplateName(String view)
Creates name of the template |
void |
render(Connection connection,
ModelAndView modelAndView)
This method renders output |
void |
setSuffix(String suffix)
Sets suffix of the templates |
void |
setTemplatesPath(File templatesPath)
Sets path where templates are stored. |
void |
setTemplatesURL(URL templatesURL)
Sets URL templates are to be read from. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.slf4j.Logger logger
public static final String DEFAULT_SUFFIX
protected File templatesPath
protected URL templatesURL
protected String suffix
protected Configuration configuration
| Constructor Detail |
|---|
public FreeMarkerViewAdapter()
| Method Detail |
|---|
public void init()
throws RuntimeIOException
RuntimeIOException
protected TemplateLoader createTemplateLoader()
throws RuntimeIOException
RuntimeIOException
public void render(Connection connection,
ModelAndView modelAndView)
throws ConnectionException
render in interface Viewconnection - http connectionmodelAndView - view name to be used as template's name and model map to be used as attributes
ConnectionExceptionpublic File getTemplatesPath()
public void setTemplatesPath(File templatesPath)
templatesPath - path where templates are stored.public URL getTemplatesURL()
public void setTemplatesURL(URL templatesURL)
templatesURL - URL templates are to be read fromprotected String makeTemplateName(String view)
view - name of the view
public String getSuffix()
public void setSuffix(String suffix)
suffix - suffix
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||