|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.arsdigita.acs.TemplateTranslator
Translates ATS templates (aka "Karl's Templates") into JSP code. Performs a series of transforms on @...@ substitution, multiple, grid, etc. Handles translation of conditionals (if). handles master/slave, include.
| Inner Class Summary | |
static class |
TemplateTranslator.IncludeHandler
Helper class to perform the function of an include tag |
static class |
TemplateTranslator.MasterHandler
Helper class instantiated to perform the task involved with a master tag. |
| Field Summary | |
static java.lang.String |
cvsId
|
static java.lang.String |
SLAVE_ATTR
Convenience field; short for "com.arsdigita.acs.TemplateTranslator.slave" |
| Constructor Summary | |
TemplateTranslator()
Dummy no-arg public constructor |
|
TemplateTranslator(java.lang.String s,
java.lang.String docRoot)
Creates a new TemplateTranslator with a default global master template. |
|
| Method Summary | |
static java.lang.String |
emptyIfNull(java.lang.Object o)
A filter used by the translated template JSP. |
static java.lang.String |
getTemplate(javax.servlet.jsp.PageContext pageContext)
Returns the URL for the .adp template that should be served by the current request. |
static void |
main(java.lang.String[] args)
Translates the specified template. |
java.lang.String |
mungeName(java.lang.String baseName)
Generates a template URL for a translated JSP, given the base name for the template .adp file being translated |
java.lang.String |
translate(java.io.File inputFile,
java.lang.String relativePath)
Translates the specified template .adp file to a .template.jsp file. |
static SeekableSelection |
vectorToSeekableSelection(java.util.Vector list)
Wraps an incoming Vector as a SeekableSelection so it looks like a one-column table with the column named "item." This removes some of the asymmetries between <multiple> and <list>. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String cvsId
public static final java.lang.String SLAVE_ATTR
| Constructor Detail |
public TemplateTranslator()
public TemplateTranslator(java.lang.String s,
java.lang.String docRoot)
s - the default global master templatedocRoot - the document root, that is, the directory in the
file system where the acs-java-4 webapp is rooted. In Tomcat
this will probably be something like /tomcat/webapps/acs-java-4.| Method Detail |
public static java.lang.String getTemplate(javax.servlet.jsp.PageContext pageContext)
throws javax.servlet.jsp.JspException
pageContext - The page context of the calling JSP page.
The caller's URL should have already been resolved.
public final java.lang.String translate(java.io.File inputFile,
java.lang.String relativePath)
throws java.io.IOException,
ACSException
inputFile - the input .adp file to translaterelativePath - the pathname string of the input file,
relative to the webapp root (e.g., /packages/key/www/foo.adp).
This cannot be determined reliably given only a pathname
to an input file and the webapp root separately because of symlinks.
public static final void main(java.lang.String[] args)
throws java.lang.Exception
public static java.lang.String emptyIfNull(java.lang.Object o)
public java.lang.String mungeName(java.lang.String baseName)
Example: /path/to/page.jsp or /path/to/page.adp --> /templates/path/to/page.template.jsp
baseName - the resolved template URL to munge, which is
a path relative to the webapp rootpublic static SeekableSelection vectorToSeekableSelection(java.util.Vector list)
list - the incoming list
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||