org.openmobileis.embedded.webserver.templates
Class TemplateManager

java.lang.Object
  extended byorg.openmobileis.embedded.webserver.templates.TemplateManager

public class TemplateManager
extends java.lang.Object

Title: OpenMobileIS project source
Description: Manage pattern (templates) for HTML forms used by the PDA web server

It is based on singleton model. The path gives the location of the patterns (should terminate by a file separator). The API getHTMLFile (patternName, variables) allow to get the HTML file from a pattern and a list of variables. The default implementation use the freemarker template manager. See freemarker for more information. Inside the pattern, the variables are tagged by ${}.

Since:
JDK 1.1
Version:
1.0.
Author:
Philippe Delrieu

Method Summary
static TemplateManager getManager()
           
 TemplateModelRoot getTemplateModelRoot()
          initialize template structure for this request.
protected  void init()
          init template and cache management.
static void registerTemplateDelegate(TemplateManagerDelegate indelegate)
           
 void sendResponse(java.lang.String templateName, TemplateModelRoot modelRoot, HttpServletResponse res)
           
 void updateTemplateWithNavigationBarData(java.lang.Object modelRoot, java.lang.String data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getManager

public static TemplateManager getManager()

registerTemplateDelegate

public static void registerTemplateDelegate(TemplateManagerDelegate indelegate)

init

protected void init()
init template and cache management. cache template is use to detect cache update during synchronization


updateTemplateWithNavigationBarData

public void updateTemplateWithNavigationBarData(java.lang.Object modelRoot,
                                                java.lang.String data)

getTemplateModelRoot

public TemplateModelRoot getTemplateModelRoot()
initialize template structure for this request.


sendResponse

public void sendResponse(java.lang.String templateName,
                         TemplateModelRoot modelRoot,
                         HttpServletResponse res)
                  throws java.io.IOException,
                         TemplateNotFoundException
Throws:
java.io.IOException
TemplateNotFoundException


Copyright 2006 OpenMobileIS. All Rights Reserved.