org.melati.app
Class TemplateApp

Package class diagram package TemplateApp
java.lang.Object
  extended by org.melati.app.AbstractConfigApp
      extended by org.melati.app.AbstractPoemApp
          extended by org.melati.app.AbstractTemplateApp
              extended by org.melati.app.TemplateApp
All Implemented Interfaces:
App

public class TemplateApp
extends AbstractTemplateApp

An example of how to use a Template Engine with a Poem database from the command line. Invoke: java -cp melati.jar:site\properties:lib\hsqldb.jar: \ lib\webmacro.jar:lib\servlet.jar \ org.melati.app.TemplateApp poemtest user 0 \ org/melati/app/TemplateAppExample Where poemtest is your database, user is your table, 0 is the record id and org/melati/app/TemplateAppExample is the full name of a template. From within Maven try: org.codehaus.mojo exec-maven-plugin generate test java org.melati.app.TemplateApp mydb mytable mytroid mytemplate -output ${basedir}/src/main/webapp/WEB-INF/web.xml true


Field Summary
 
Fields inherited from class org.melati.app.AbstractTemplateApp
templateEngine
 
Fields inherited from class org.melati.app.AbstractConfigApp
melatiConfig, output
 
Constructor Summary
TemplateApp()
           
 
Method Summary
protected  String doTemplateRequest(Melati melati, TemplateContext templateContext)
          The main method to override.
static void main(String[] args)
          The main entry point.
 
Methods inherited from class org.melati.app.AbstractTemplateApp
addExtension, doPoemRequest, init
 
Methods inherited from class org.melati.app.AbstractPoemApp
_handleException, doConfiguredRequest, handleException, poemContext, poemContextWithLDB, prePoemSession, setTableTroidMethod, term
 
Methods inherited from class org.melati.app.AbstractConfigApp
applyNamedArguments, getSysAdminEmail, getSysAdminName, melatiConfig, run, setOutput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.melati.app.App
run, setOutput
 

Constructor Detail

TemplateApp

public TemplateApp()
Method Detail

doTemplateRequest

protected String doTemplateRequest(Melati melati,
                                   TemplateContext templateContext)
                            throws Exception
The main method to override.

Specified by:
doTemplateRequest in class AbstractTemplateApp
Parameters:
melati - A Melati with arguments and properties set
templateContext - A TemplateContext containing a Melati
Returns:
the name of a template to expand
Throws:
Exception - if anything goes wrong
See Also:
(org.melati.Melati, org.melati.template.ServletTemplateContext)

main

public static void main(String[] args)
                 throws Exception
The main entry point.

Parameters:
args - in format db table troid method where method is a template name
Throws:
Exception


Copyright © 2000-2010 PanEris. All Rights Reserved.