com.niggle.templates
Interface Page

All Known Implementing Classes:
FreemarkerPage

public interface Page

An abstract encapsulation of a page template. Currently, our implementation uses the Freemarker library.

Author:
Jonathan Revusky

Method Summary
 void expose(java.lang.String key, boolean b)
          Expose internal data, publishing it to make it available to a Freemarker Template.
 void expose(java.lang.String key, java.lang.Object item)
          Expose internal data, publishing it to make it available to the page template.
 void outputPage(javax.servlet.http.HttpServletResponse response, boolean isStatic)
          Prepare the cooked output, filling in the parameters with data values, and send it to the end user via the servlet's response stream.
 

Method Detail

outputPage

public void outputPage(javax.servlet.http.HttpServletResponse response,
                       boolean isStatic)
                throws java.io.IOException
Prepare the cooked output, filling in the parameters with data values, and send it to the end user via the servlet's response stream. NB: the template extension should determine the content type to generate.

These should be supported:

Parameters:
response - handle to where the output should go.
Throws:
java.io.IOException -  

expose

public void expose(java.lang.String key,
                   java.lang.Object item)
Expose internal data, publishing it to make it available to the page template.
Parameters:
key - name of the field in the template
item - source of the data to populate the template

expose

public void expose(java.lang.String key,
                   boolean b)
Expose internal data, publishing it to make it available to a Freemarker Template.
Parameters:
key - name of the field in the template
b - sets to boolean value according to: b ? "true" : ""