apollo.Template
Class TemplatePage

java.lang.Object
  |
  +--apollo.Template.TemplatePage
All Implemented Interfaces:
java.io.Serializable

public class TemplatePage
extends java.lang.Object
implements java.io.Serializable

This is a TemplatePage. TemplatePages are instantiated with an html file and registered with the PageManager. When rendered, a hashtable of values are replaced in the html file. Copyright Joe Kislo, All Rights Reserved.

See Also:
Serialized Form

Constructor Summary
TemplatePage(ManagerTracker MT, java.lang.Object PH)
          Creates a TemplatePage.
TemplatePage(ManagerTracker MT, java.lang.Object PH, boolean missingEqualsTrue)
          Creates a TemplatePage.
TemplatePage(ManagerTracker MT, java.lang.Object PH, java.util.Hashtable PC)
          Creates a TemplatePage.
TemplatePage(ManagerTracker MT, java.lang.Object PH, java.util.Hashtable PC, java.lang.String filename)
           
TemplatePage(ManagerTracker MT, java.lang.Object PH, java.lang.String filename)
          Creates a TemplatePage.
TemplatePage(ManagerTracker MT, java.lang.Object PH, java.lang.String filename, boolean missingEqualsTrue)
          Creates a TemplatePage.
TemplatePage(ManagerTracker MT, java.lang.String filename)
           
 
Method Summary
 java.lang.String getDebug()
          Returns debugging information.
 HTMLTemplate getMainPage()
           
 java.lang.String getOriginalHTMLContents()
           
 java.lang.String getPageCacheID()
           
 java.util.Hashtable getPageConstants(java.util.Hashtable PC)
          Returns the pageConstants.
static void main(java.lang.String[] args)
           
 void reloadTemplate()
           
 HTTPResponse render(java.util.Hashtable replacementTable, WebSession thisSession)
          Renders the HTML file using a combination of the pageConstants and the replacementTable.
 void setMissingEqualsTrue(boolean missingEqualsTrue)
           
 void setPageConstants(java.util.Hashtable PC)
          Sets the pageConstants which will be merged in with all subseqent render requests
 java.lang.String toString(java.util.Hashtable replacementTable)
          Renders the HTML file using a combination of the pageConstants and the replacementTable.
 java.lang.String toString(java.util.Hashtable replacementTable, WebSession thisSession)
          Renders the HTML file using a combination of the pageConstants and the replacementTable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.Object PH)
Creates a TemplatePage. Operates on default.html.
Parameters:
fquid - The Fully Qualified Unique ID

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.Object PH,
                    boolean missingEqualsTrue)
Creates a TemplatePage. Operates on default.html.
Parameters:
fquid - The Fully Qualified Unique ID

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.Object PH,
                    java.lang.String filename)
Creates a TemplatePage. FQUID is parsed into directories.
Parameters:
fquid - The Fully Qualified Unique ID
filename - The filename for this template
missingEqualsTrue - If the element is missing, it's boolean value is this value

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.Object PH,
                    java.lang.String filename,
                    boolean missingEqualsTrue)
Creates a TemplatePage. FQUID is parsed into directories.
Parameters:
fquid - The Fully Qualified Unique ID
filename - The filename for this template
missingEqualsTrue - If the element is missing, it's boolean value is this value

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.Object PH,
                    java.util.Hashtable PC)
             throws TemplatePageException
Creates a TemplatePage. FQUID is parsed into directories appropriatly for locating the HTML file the TemplatePage will operate on.
Parameters:
fquid - The Fully Qualified Unique ID, includes the html file to operate on
PC - Defines pageConstants, which will be merged in with all render requests

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.Object PH,
                    java.util.Hashtable PC,
                    java.lang.String filename)

TemplatePage

public TemplatePage(ManagerTracker MT,
                    java.lang.String filename)
Method Detail

getPageCacheID

public java.lang.String getPageCacheID()

getMainPage

public HTMLTemplate getMainPage()

getOriginalHTMLContents

public java.lang.String getOriginalHTMLContents()

reloadTemplate

public void reloadTemplate()

setMissingEqualsTrue

public void setMissingEqualsTrue(boolean missingEqualsTrue)

setPageConstants

public void setPageConstants(java.util.Hashtable PC)
Sets the pageConstants which will be merged in with all subseqent render requests
Parameters:
PC - The pageConstants

getPageConstants

public java.util.Hashtable getPageConstants(java.util.Hashtable PC)
Returns the pageConstants.
Parameters:
UID - The Unique ID for this request
req - The HttpServletRequest

toString

public java.lang.String toString(java.util.Hashtable replacementTable)
                          throws TemplatePageException
Renders the HTML file using a combination of the pageConstants and the replacementTable. Returns a string
Parameters:
replacementTable - Table of elements to be replaced, and their replacements

toString

public java.lang.String toString(java.util.Hashtable replacementTable,
                                 WebSession thisSession)
Renders the HTML file using a combination of the pageConstants and the replacementTable. Returns a string
Parameters:
replacementTable - Table of elements to be replaced, and their replacements
thisSession - The session object for this request (optional)

render

public HTTPResponse render(java.util.Hashtable replacementTable,
                           WebSession thisSession)
Renders the HTML file using a combination of the pageConstants and the replacementTable. Return a HTTPResponse
Parameters:
replacementTable - Table of elements to be replaced, and their replacements
thisSession - The session object for this request (optional)

getDebug

public java.lang.String getDebug()
Returns debugging information. Specifically the raw parsed Text string

main

public static void main(java.lang.String[] args)