org.cofax
Class FilesTemplateLoader
java.lang.Object
|
+--org.cofax.TemplateLoader
|
+--org.cofax.FilesTemplateLoader
- public class FilesTemplateLoader
- extends TemplateLoader
Loads templates from the file system.
A subclass of TemplateLoader
.
This is not tied to the TemplateProcessor
being used by Cofax. Any Cofax compatible TemplateProcessor
like WysiwygTemplate
can use this to load templates.
There is no mention of the FilesTemplateLoader
class in CofaxServlet
.
TemplateLoader
classes are listed in the configuration.
- Version:
- 1.5
- Author:
- Rajiv Pant, Karl Martino, Hung Dao
Method Summary |
java.lang.String |
choose(java.lang.String templateSearchBegin,
java.lang.String templateFile,
java.lang.String overrideTemplate)
Chooses a template based on its arguments. |
static java.lang.String |
find(java.lang.String pathToEndAt,
java.lang.String path,
java.lang.String fileName)
Walks up the path sent to find the first matching file and returns that file. |
CofaxPage |
load(java.lang.String templateFileName)
Gets the template from the file set in templateFileName, from
the file system. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilesTemplateLoader
public FilesTemplateLoader()
find
public static java.lang.String find(java.lang.String pathToEndAt,
java.lang.String path,
java.lang.String fileName)
- Walks up the path sent to find the first matching file and returns that file.
It returns an empty string on failure.
load
public final CofaxPage load(java.lang.String templateFileName)
- Gets the template from the file set in templateFileName, from
the file system.
- Overrides:
load
in class TemplateLoader
choose
public final java.lang.String choose(java.lang.String templateSearchBegin,
java.lang.String templateFile,
java.lang.String overrideTemplate)
- Chooses a template based on its arguments. Then calls find(...) to locate it.
- Overrides:
choose
in class TemplateLoader
- Parameters:
templateSearchBegin
- The path, not including the file, to begin the searchtemplateFile
- Either an empty string, or a specific file
to use as a template.overrideTemplate
- Usually an empty string, this is to be used instead of
the templateFile if sent a value.
Copyright 2001 KnightRidder.com. All Rights Reserved.