|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.webmacro.resource.CachingProvider
org.webmacro.resource.URLTemplateProvider
This is a "drop-in" replacement for the standard TemplateProvider in the WebMacro distribution. The primary benefit is to allow template to be loaded by a variety of means, without requiring an absolute path. This should make applications more portable.
Each path should be a full URL specification or one of the special cases listed below. If the path cannot be interpreted, it will be tried as file:path
CachingProvider
,
TemplateProvider
Field Summary | |
static java.lang.String |
RCS
CVS Revision tag |
Fields inherited from class org.webmacro.resource.CachingProvider |
_cacheSupportsReload |
Constructor Summary | |
URLTemplateProvider()
|
Method Summary | |
java.lang.String |
getType()
Supports the "template" type. |
void |
init(Broker b,
Settings config)
Create a new TemplateProvider that uses the specified directory as the source for Template objects that it will return |
java.lang.Object |
load(java.lang.String name,
CacheElement ce)
Grab a template based on its name, setting the request event to contain it if we found it. |
java.lang.Object |
load(java.lang.String name,
java.net.URL base)
Find the specified template in the directory managed by this template store. |
boolean |
shouldReload(java.lang.String name)
|
Methods inherited from class org.webmacro.resource.CachingProvider |
destroy, flush, get, load, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String RCS
Constructor Detail |
public URLTemplateProvider()
Method Detail |
public final java.lang.String getType()
public void init(Broker b, Settings config) throws InitException
init
in interface Provider
init
in class CachingProvider
b
- A brokerconfig
- Settings from the webmacro initialization file
InitException
- thrown when the provider fails to initializepublic final java.lang.Object load(java.lang.String name, CacheElement ce) throws ResourceException
name
- The name of the template to load
NotFoundException
- if no matching template can be found
ResourceException
- if template cannot be loadedpublic final java.lang.Object load(java.lang.String name, java.net.URL base) throws ResourceException
name
- relative to the current directory fo the store
ResourceException
public final boolean shouldReload(java.lang.String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |