|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.locator.JetspeedTemplateLocator
public class JetspeedTemplateLocator
Jetspeed's default implementation of a template locator.
Field Summary | |
---|---|
private String |
appRoot
Root of the application running this locator |
private String |
defaultLocatorType
the default locator type |
private Class |
locatorClass
the TemplateLocator class is factory created |
private static org.apache.commons.logging.Log |
log
|
private static String |
PATH_SEPARATOR
|
private List |
roots
the template root directories, all application root relative |
private Class |
templateClass
the Template class is factory created |
private Map |
templateMap
template name cache used to speed up searches for templates |
private boolean |
useNameCache
use the name cache when looking up a template |
Constructor Summary | |
---|---|
private |
JetspeedTemplateLocator()
|
|
JetspeedTemplateLocator(List roots,
List omClasses,
String defaultLocatorType,
String appRoot)
Assemble with list resource directory roots and OM classes and a defaultLocatorType. |
|
JetspeedTemplateLocator(List roots,
String appRoot)
Minimal assembly with a list of resource directory roots. |
|
JetspeedTemplateLocator(List roots,
String defaultLocatorType,
String appRoot)
Construct with a root list and a default locator type. |
Method Summary | |
---|---|
org.apache.jetspeed.locator.LocatorDescriptor |
createFromString(String path)
|
org.apache.jetspeed.locator.LocatorDescriptor |
createLocatorDescriptor(String type)
|
private org.apache.jetspeed.locator.TemplateDescriptor |
createTemplate()
|
private org.apache.jetspeed.locator.TemplateDescriptor |
createTemplateFromPath(String path,
String name,
String realPath,
String relativePath)
Given a path, name and realPath creates a new template object |
private void |
loadNameCache(String path,
String name)
Loads the template name cache map to accelerate template searches. |
org.apache.jetspeed.locator.TemplateDescriptor |
locateTemplate(org.apache.jetspeed.locator.LocatorDescriptor locator)
|
private org.apache.jetspeed.locator.TemplateDescriptor |
locateTemplate(org.apache.jetspeed.locator.LocatorDescriptor locator,
String root,
boolean useCache)
General template location algorithm. |
Iterator |
query(org.apache.jetspeed.locator.LocatorDescriptor locator)
|
void |
start()
|
void |
stop()
|
boolean |
templateExists(String templateKey)
|
boolean |
templateExists(String templateKey,
boolean useCache)
Checks for the existence of a template resource given a key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static final String PATH_SEPARATOR
private List roots
private String appRoot
private Class templateClass
private Class locatorClass
private String defaultLocatorType
private Map templateMap
private boolean useNameCache
Constructor Detail |
---|
private JetspeedTemplateLocator()
public JetspeedTemplateLocator(List roots, String appRoot) throws FileNotFoundException
roots
- A list of resource root directories where templates are located.appRoot
- Root from where this application runs
FileNotFoundException
public JetspeedTemplateLocator(List roots, String defaultLocatorType, String appRoot) throws FileNotFoundException
roots
- A list of resource root directories where templates are located.defaultLocatorType
- Under root directories, subdirectories represent locator types.
A locator type represents a classification of templates.
Any value is allowed. Use locator types to group templates together.
FileNotFoundException
public JetspeedTemplateLocator(List roots, List omClasses, String defaultLocatorType, String appRoot) throws FileNotFoundException
roots
- A list of resource root directories where templates are located.omClasses
- Template replacable object model implementations for Template and TemplateLocator.
Required order, with second optional: [ Template
, TemplateLocator
implementations.defaultLocatorType
- Under root directories, subdirectories represent locator types.
A locator type represents a classification of templates.
Any value is allowed. Use locator types to group templates together.
FileNotFoundException
Method Detail |
---|
public org.apache.jetspeed.locator.TemplateDescriptor locateTemplate(org.apache.jetspeed.locator.LocatorDescriptor locator)
locateTemplate
in interface org.apache.jetspeed.locator.TemplateLocator
private org.apache.jetspeed.locator.TemplateDescriptor locateTemplate(org.apache.jetspeed.locator.LocatorDescriptor locator, String root, boolean useCache)
locator
- The template locatorroot
- The root directory to search
public boolean templateExists(String templateKey, boolean useCache)
key
- The absolute path to the template resource.
public boolean templateExists(String templateKey)
public org.apache.jetspeed.locator.LocatorDescriptor createFromString(String path) throws org.apache.jetspeed.locator.TemplateLocatorException
createFromString
in interface org.apache.jetspeed.locator.TemplateLocator
org.apache.jetspeed.locator.TemplateLocatorException
private org.apache.jetspeed.locator.TemplateDescriptor createTemplateFromPath(String path, String name, String realPath, String relativePath)
path
- the relative path to the templatename
- the template namerealPath
- the real path on the file system
public org.apache.jetspeed.locator.LocatorDescriptor createLocatorDescriptor(String type) throws org.apache.jetspeed.locator.TemplateLocatorException
createLocatorDescriptor
in interface org.apache.jetspeed.locator.TemplateLocator
org.apache.jetspeed.locator.TemplateLocatorException
private org.apache.jetspeed.locator.TemplateDescriptor createTemplate()
public void start()
public void stop()
public Iterator query(org.apache.jetspeed.locator.LocatorDescriptor locator)
query
in interface org.apache.jetspeed.locator.TemplateLocator
private void loadNameCache(String path, String name)
path
- The templatename
- just the name of the resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |