fc.util.pagetemplate
Class TemplatePage

java.lang.Object
  extended by fc.util.pagetemplate.TemplatePage

public abstract class TemplatePage
extends Object

A superclass for generated template pages. All templates derive from this class. Runs outside the web environment (intended to be invoked from the command line)

Pages are always assumed to be written in UTF-8 (a superset of regular ascii/IS0-8859-1). If the template page is sent as HTML to a device (via some outside mechanism that uses the templates as part of its workflow), then the HTML contained in the page template should set the appropriate content type/encoding meta header to say UTF-8, if UTF-8 characters (such as emojis) are used in the page.

See TemplateMgr


Field Summary
 Connection con
           
 Map context
           
static String DEFAULT_ENCODING
           
 Log log
           
 Writer out
           
static String PACKAGE_NAME
           
 File templateFile
           
 
Constructor Summary
TemplatePage()
           
 
Method Summary
 void bug(Writer writer, Object str1)
          Prints a debug statement if debugging is turned on for this page.
 void bug(Writer writer, Object str1, Object... args)
           
 void dbg(boolean val)
           
 String getSourcePath()
           
 void render(File out)
           
 void render(OutputStream out)
           
abstract  void render(PrintWriter out)
           
 void render(Writer out)
           
 void setConnection(Connection con)
           
 void setContext(Map m)
           
 void setSourcePath(File templateFile)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE_NAME

public static String PACKAGE_NAME

DEFAULT_ENCODING

public static String DEFAULT_ENCODING

log

public Log log

out

public Writer out

templateFile

public File templateFile

con

public Connection con

context

public Map context
Constructor Detail

TemplatePage

public TemplatePage()
Method Detail

setSourcePath

public void setSourcePath(File templateFile)

getSourcePath

public String getSourcePath()

setConnection

public void setConnection(Connection con)

setContext

public void setContext(Map m)

render

public void render(Writer out)
            throws Exception
Throws:
Exception

render

public void render(File out)
            throws Exception
Throws:
Exception

render

public void render(OutputStream out)
            throws Exception
Throws:
Exception

render

public abstract void render(PrintWriter out)
                     throws Exception
Throws:
Exception

dbg

public final void dbg(boolean val)

bug

public final void bug(Writer writer,
                      Object str1)
               throws IOException
Prints a debug statement if debugging is turned on for this page.

Typically the implicit page printwriter (the out variable) will be passed to this method and debug statements will be printed at the point where they are lexically invoked at the page.

Throws:
IOException

bug

public final void bug(Writer writer,
                      Object str1,
                      Object... args)
               throws IOException
Throws:
IOException