org.norther.tammi.spray.template
Class DefaultLayoutFilter
java.lang.Object
org.norther.tammi.core.base.Adaptee
org.norther.tammi.core.base.DefaultContainer
org.norther.tammi.core.security.DefaultSecureContainer
org.norther.tammi.spray.filter.AbstractSecureContainerFilter
org.norther.tammi.spray.filter.AbstractSecureContainerKeyFilter
org.norther.tammi.spray.filter.DefaultSecureContainerKeyFilter
org.norther.tammi.spray.template.DefaultPageFilter
org.norther.tammi.spray.template.DefaultLayoutFilter
- All Implemented Interfaces:
- Serializable, NotificationBroadcaster, NotificationEmitter, Filter, Container, Manageable, MBeanDelegate, Refreshable, CacheClient, AccessController, SecureContainer, TemplateExecutor, ContainerFilter, ContainerKeyFilter, KeyFilter, SecureContainerFilter, SecureContainerKeyFilter, SecureFilter, LayoutFilter, PageFilter
public class DefaultLayoutFilter
- extends DefaultPageFilter
- implements LayoutFilter
A default implementation of LayoutFilter.
Based on TurbineTemplateService in the Apache Jakarta Turbine
project.
- Author:
- John D. McNally, Dave Bryson, Jason van Zyl, Daniel Rall, Ilkka Priha
- See Also:
- Serialized Form
|
Method Summary |
String |
getLayoutEncoding(ServletRequest request,
ServletResponse response)
Gets the current layout encoding of the specified request. |
String |
getLayoutTemplate()
Gets the default layout template. |
String |
getLayoutTemplate(ServletRequest request,
ServletResponse response,
FilterChain chain)
Gets the current layout template of the specified request. |
protected CharSequence |
resolve(StringBuilder buffer,
String encoding,
boolean local,
boolean localized,
boolean directly,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Resolves the template content either by evaluation or execution. |
void |
setLayoutTemplate(String template)
Sets the default layout template. |
void |
setLayoutTemplate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Sets the current layout template of the specified request. |
void |
setLayoutTemplate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
Sets the current layout template of the specified request with encoding. |
| Methods inherited from class org.norther.tammi.spray.template.DefaultPageFilter |
checkPermission, checkPermission, clearCached, doFilter, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, execute, execute, execute, execute, execute, execute, execute, execute, expireCached, expireFraction, getCache, getDefaultBuilder, getErrorTemplate, getPageEncoding, getPageTemplate, getPageTemplate, getRefreshed, getTaskLoaderName, getTemplateEngine, isCachingDisabled, isLocalContext, isLocalizedTemplates, postmanaged, refresh, removeCache, resolve, resolve, resolve, resolve, resolveTemplatePath, resolveTemplatePath, setCachingDisabled, setDefaultBuilder, setErrorTemplate, setLocalContext, setLocalizedTemplates, setPageTemplate, setPageTemplate, setPageTemplate, setTaskLoaderName, templateExists, templateExists, unmanaged |
| Methods inherited from class org.norther.tammi.core.security.DefaultSecureContainer |
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions |
| Methods inherited from class org.norther.tammi.core.base.DefaultContainer |
clear, containsKey, get, getContainerKey, getContainerKey, getContainerKey, getMBean, getMBeanHandle, getMBeanHandles, getMBeanInterface, getMBeanInterface, getObjectName, getObjectNames, getQueryPattern, registryKeySet, registryKeySet, registryKeySet, registryKeySet, registryMap, registrySize, remove, setMBeanInterface, setQueryPattern, setQueryPattern |
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.norther.tammi.spray.template.PageFilter |
evaluate, evaluate, evaluate, evaluate, evaluate, execute, execute, execute, execute, execute, getDefaultBuilder, getPageEncoding, getPageTemplate, getPageTemplate, getTaskLoaderName, resolve, resolve, resolveTemplatePath, setDefaultBuilder, setPageTemplate, setPageTemplate, setPageTemplate, setTaskLoaderName, templateExists |
| Methods inherited from interface org.norther.tammi.spray.engine.TemplateExecutor |
evaluate, evaluate, evaluate, execute, execute, execute, getErrorTemplate, getTemplateEngine, isLocalContext, isLocalizedTemplates, resolve, resolve, resolveTemplatePath, setErrorTemplate, setLocalContext, setLocalizedTemplates, templateExists |
| 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.core.security.AccessController |
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, getPermissibleRoles, 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 |
DefaultLayoutFilter
public DefaultLayoutFilter()
- Constructs a new filter.
DefaultLayoutFilter
public DefaultLayoutFilter(String key)
- Constructs a new filter with a key.
- Parameters:
key - the filter key.
getLayoutTemplate
public String getLayoutTemplate()
- Description copied from interface:
LayoutFilter
- Gets the default layout template.
- Specified by:
getLayoutTemplate in interface LayoutFilter
- Returns:
- the name of the default layout template.
setLayoutTemplate
public void setLayoutTemplate(String template)
- Description copied from interface:
LayoutFilter
- Sets the default layout template. The layout template is processed after
the target template. The content of the target template is available to
the layout template through the content tool.
- Specified by:
setLayoutTemplate in interface LayoutFilter
- Parameters:
template - the name of the layout template.
getLayoutTemplate
public String getLayoutTemplate(ServletRequest request,
ServletResponse response,
FilterChain chain)
- Description copied from interface:
LayoutFilter
- Gets the current layout template of the specified request.
- Specified by:
getLayoutTemplate in interface LayoutFilter
- Parameters:
request - the request.response - the response.chain - the filter chain.
- Returns:
- the template or null.
setLayoutTemplate
public void setLayoutTemplate(String template,
ServletRequest request,
ServletResponse response,
FilterChain chain)
- Description copied from interface:
LayoutFilter
- Sets the current layout template of the specified request.
- Specified by:
setLayoutTemplate in interface LayoutFilter
- Parameters:
template - the template.request - the request.response - the response.chain - the filter chain.
setLayoutTemplate
public void setLayoutTemplate(String template,
String encoding,
ServletRequest request,
ServletResponse response,
FilterChain chain)
- Description copied from interface:
LayoutFilter
- Sets the current layout template of the specified request with encoding.
- Specified by:
setLayoutTemplate in interface LayoutFilter
- Parameters:
template - the template.encoding - the encoding.request - the request.response - the response.chain - the filter chain.
getLayoutEncoding
public String getLayoutEncoding(ServletRequest request,
ServletResponse response)
- Description copied from interface:
LayoutFilter
- Gets the current layout encoding of the specified request.
- Specified by:
getLayoutEncoding in interface LayoutFilter
- Parameters:
request - the request.response - the response.
- Returns:
- the encoding.
resolve
protected CharSequence resolve(StringBuilder buffer,
String encoding,
boolean local,
boolean localized,
boolean directly,
ServletRequest request,
ServletResponse response,
FilterChain chain)
throws TemplateException
- Resolves the template content either by evaluation or execution. This
method overrides the one in PageFilter and implements layout based
template processing.
- Overrides:
resolve in class DefaultPageFilter
- Parameters:
buffer - the resolved template path/builder (input/output).encoding - the default encoding.local - the local context option.localized - the localized option.directly - the mode.request - the request.response - the response.chain - the filter chain.
- Returns:
- the resolved content.
- Throws:
TemplateException - if processing fails.
Copyright © 2004 The Norther Organization. All rights reserved.