|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PageFilter
PageFilter executes and evaluates templates specified in URL parameters of the request. The filter key of the filter is applied to request parameters to find the name of the template. If the key doesn't specify a template, the path info is applied. If the path info fails, the default template is processed.
The template may have a builder, which is executed before redering the template. The plain class name of the builder can be the same as the plain name of the template. Alternatively, a qualified default builder may have a package name corresponding to any part of the template path and the most specific one is applied. The builder must implement the Task interface and be located in one of the defined packages of TaskLoader.
Templates can be protected with an access controller. Read permission is required. Permissions for a template are granted using its name as a resource. Access rights are checked only for the page template, not for separately processed sub-templates.
Based on TemplateService
in the Apache Jakarta Turbine project.
Field Summary | |
---|---|
static String |
ANY_EXTENSION
The wildcard. |
Fields inherited from interface org.norther.tammi.spray.engine.TemplateExecutor |
---|
PROPERTY_ENCODING, PROPERTY_EXTENSION |
Method Summary | |
---|---|
CharSequence |
evaluate(CharSequence raw,
String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Evaluates the named run-time content. |
CharSequence |
evaluate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Evaluates an optionally local template by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
CharSequence |
evaluate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Evaluates an optionally local template with the specified encoding by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
void |
execute(CharSequence raw,
String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Executes the named run-time content. |
void |
execute(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Executes an optionally local template by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
void |
execute(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Executes an optionally local template with the specified encoding by resolving its optionally localized name and template engine specific extension based on terminal properties of the request. |
String |
getDefaultBuilder()
Gets the default template builder. |
String |
getErrorTemplate()
Gets the error template. |
String |
getPageEncoding(ServletRequest request,
ServletResponse response)
Gets the current page encoding of the specified request. |
String |
getPageTemplate()
Gets the default page template. |
String |
getPageTemplate(ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the current page template of the specified request. |
ObjectName |
getTaskLoaderName()
Gets the the task loader of this filter. |
CharSequence |
resolve(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Resolves the named and optionally localized template content. |
CharSequence |
resolve(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Resolves the named and optionally localized template content with the specified encoding. |
String |
resolveTemplatePath(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Resolves an optionally localized template path for the specified request and response. |
void |
setDefaultBuilder(String name)
Sets the default template builder. |
void |
setErrorTemplate(String template)
Sets the error template. |
void |
setPageTemplate(String template)
Sets the default page template. |
void |
setPageTemplate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Sets the current page template of the specified request. |
void |
setPageTemplate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Sets the current page template of the specified request with encoding. |
void |
setTaskLoaderName(ObjectName loader)
Sets the task loader of this filter. |
boolean |
templateExists(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain,
boolean... options)
Checks whether the optionally localized template exists. |
Methods inherited from interface org.norther.tammi.spray.engine.TemplateExecutor |
---|
getTemplateEngine, isLocalContext, isLocalizedTemplates, setLocalContext, setLocalizedTemplates |
Methods inherited from interface org.norther.tammi.spray.filter.SecureFilter |
---|
checkPermission |
Methods inherited from interface org.norther.tammi.core.security.AccessController |
---|
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
Methods inherited from interface org.norther.tammi.core.base.Container |
---|
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
Methods inherited from interface org.norther.tammi.spray.filter.KeyFilter |
---|
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey |
Methods inherited from interface javax.servlet.Filter |
---|
destroy, doFilter, init |
Methods inherited from interface org.norther.tammi.core.cache.CacheClient |
---|
clearCached, expireCached, expireFraction, getCache, getSharedCacheName, isCachingDisabled, removeCache, setCachingDisabled, setSharedCacheName |
Methods inherited from interface org.norther.tammi.core.base.Refreshable |
---|
getRefreshed, refresh |
Field Detail |
---|
static final String ANY_EXTENSION
Method Detail |
---|
String getPageTemplate()
void setPageTemplate(String template)
template
- the name of the page template.String getErrorTemplate()
void setErrorTemplate(String template)
template
- the name of the error template.String getDefaultBuilder()
void setDefaultBuilder(String name)
name
- the name of the default builder.String getPageTemplate(ServletRequest request, ServletResponse response, FilterChain chain)
request
- the request.response
- the response.chain
- the filter chain.
void setPageTemplate(String template, ServletRequest request, ServletResponse response, FilterChain chain)
template
- the template.request
- the request.response
- the response.chain
- the filter chain.void setPageTemplate(String template, String encoding, ServletRequest request, ServletResponse response, FilterChain chain)
template
- the template.encoding
- the encoding.request
- the request.response
- the response.chain
- the filter chain.String getPageEncoding(ServletRequest request, ServletResponse response)
request
- the request.response
- the response.
ObjectName getTaskLoaderName()
void setTaskLoaderName(ObjectName loader)
loader
- the object name of the task loader or a query.void execute(String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
execute
in interface TemplateExecutor
template
- the template.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext, localized templates and encode xml
options.
TemplateException
- if processing fails.void execute(String template, String encoding, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
execute
in interface TemplateExecutor
template
- the template.encoding
- the encoding.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext, localized templates and encode xml
options.
TemplateException
- if processing fails.void execute(CharSequence raw, String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
execute
in interface TemplateExecutor
raw
- the content.template
- a virtual template for identifying the content.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext and encode xml options.
TemplateException
- if processing fails.CharSequence evaluate(String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
evaluate
in interface TemplateExecutor
template
- the template.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext, localized templates and encode xml
options.
TemplateException
- if processing fails.CharSequence evaluate(String template, String encoding, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
evaluate
in interface TemplateExecutor
template
- the template.encoding
- the encoding.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext, localized templates and encode xml
options.
TemplateException
- if processing fails.CharSequence evaluate(CharSequence raw, String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
evaluate
in interface TemplateExecutor
raw
- the content.template
- a virtual template for identifying the content.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext and encode xml options.
TemplateException
- if processing fails.CharSequence resolve(String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
resolve
in interface TemplateExecutor
template
- the template.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext, localized templates and encode xml
options.
TemplateException
- if processing fails.CharSequence resolve(String template, String encoding, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options) throws TemplateException
resolve
in interface TemplateExecutor
template
- the template.encoding
- the encoding.request
- the request.response
- the response.chain
- the filter chain.options
- the local coxtext, localized templates and encode xml
options.
TemplateException
- if processing fails.boolean templateExists(String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options)
templateExists
in interface TemplateExecutor
template
- the template.request
- the request.response
- the response.chain
- the filter chain.options
- the localized templates option.
String resolveTemplatePath(String template, ServletRequest request, ServletResponse response, FilterChain chain, boolean... options)
resolveTemplatePath
in interface TemplateExecutor
template
- the name of the template.request
- the template request.response
- the template response.chain
- the filter chain.options
- the localized templates option.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |