org.norther.tammi.spray.template
Class DefaultFormFilter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.spray.filter.DefaultFilter
          extended by org.norther.tammi.spray.filter.DefaultKeyFilter
              extended by org.norther.tammi.spray.filter.DefaultSecureKeyFilter
                  extended by org.norther.tammi.spray.template.DefaultFormFilter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Filter, Manageable, MBeanDelegate, Refreshable, CacheClient<String,FormProperties>, AccessController, KeyFilter, SecureFilter, SecureKeyFilter, FormFilter

public class DefaultFormFilter
extends DefaultSecureKeyFilter
implements FormFilter

A default implementation of FormFilter.

Version:
$Id: DefaultFormFilter.java,v 1.64 2010-06-24 08:44:21 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
protected static String ENUMERATION
          The enumeration type key.
protected static String ENUMERATIONS
          The enumeration array type key.
static String FORM_KEY
          The form key.
 
Fields inherited from class org.norther.tammi.spray.filter.DefaultKeyFilter
DEFAULT_KEY
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.spray.template.FormFilter
FORM_INDEX_FIELD, FORM_NAME_FIELD, FORM_SUBMIT_FIELD
 
Constructor Summary
DefaultFormFilter()
          Constructs a new filter.
DefaultFormFilter(String key)
          Constructs a new filter with a key.
 
Method Summary
 void clearCached()
          Clears all cached entries without notifying.
 void clearControlAttributes()
          Clears all control attributes.
 void clearFormProperties()
          Clears all form properties.
 void clearFormTemplates()
          Clears all form templates.
 void clearInfoTemplates()
          Clears all info templates.
 void clearInputTemplates()
          Clears all input templates.
 void clearOutputTemplates()
          Clears all output templates.
 void clearParameterMap(ServletRequest request, ServletResponse response, FilterChain chain)
          Clears the parameter map of the specified request.
 void clearParameterMap(String prefix, ServletRequest request, ServletResponse response, FilterChain chain)
          Clears the prefixed parameter map of the specified request.
 Set<String> controlAttributeSet()
          Returns a read-only set of control attribute qualifiers.
 Variable createVariable(String type)
          Creates a new variable instance of the specified type.
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
 void expireCached(long timestamp)
          Expires all cached entries notifying them about expiration.
 void expireFraction(long timestamp, float fraction)
          Expires the specified fraction of cached entries notifying them about expiration.
 Set<String> formPropertySet()
          Returns a read-only set of form property qualifiers.
 Set<String> formQualifierSet()
          Returns a read-only set of form template qualifiers.
 ConcurrentMap<String,FormProperties> getCache(boolean... create)
          Gets and optionally creates the cache.
 String getControlAttribute(String qualifier)
          Gets the qualified control attribute.
 String getCurrentForm(ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the current form of the specified request.
 String getDefaultFormTheme()
          Gets the theme of the default form.
 String getFormIndexField()
          Gets the name of the form index field.
 String getFormNameField()
          Gets the name of the form name field.
 String getFormProperty(String qualifier)
          Gets the qualified form property.
 String getFormTemplate()
          Gets the default form template.
 String getFormTemplate(String qualifier)
          Gets the qualified form template.
 String getInfoTemplate()
          Gets the default info template.
 String getInfoTemplate(String qualifier)
          Gets the qualified info template.
 String getInputTemplate()
          Gets the default input template.
 String getInputTemplate(String qualifier)
          Gets the qualified input template.
 Map<String,Object> getLocalizedMap(String prefix, Set<String> filter, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the parameter map of the specified variable.
 String getOutputTemplate()
          Gets the default output template.
 String getOutputTemplate(String qualifier)
          Gets the qualified output template.
 Map<String,Map<String,Object>> getParameterMap(ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the parameter map of the specified request.
 Map<String,Object> getParameterMap(String prefix, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the prefixed parameter map of the specified request.
 long getRefreshed()
          Gets the last refresh timestamp.
 ObjectName getSharedCacheName()
          Gets the the shared cache of this client.
 SortedMap<String,Exception> getValidationMap(String prefix, Set<String> filter, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the validation map of request parameters of the specified variable.
 ObjectName getVariableRegistryName()
          Gets the the variable registry of this filter.
 Set<String> infoQualifierSet()
          Returns a read-only set of info template qualifiers.
 Set<String> inputQualifierSet()
          Returns a read-only set of input template qualifiers.
 boolean isCachingDisabled()
          Checks whether the caching is disabled.
 boolean isLocalizedForms()
          Gets the localized forms flag.
 boolean isValidated(String prefix, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Checks whether the specified variable is validated.
 Set<String> outputQualifierSet()
          Returns a read-only set of output template qualifiers.
 void postmanaged()
          This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.
 void refresh()
          Refreshes the MBean.
 void removeCache()
          Removes the cache.
 void removeControlAttribute(String qualifier)
          Removes the qualified control attribute.
 void removeFormProperty(String qualifier)
          Removes the qualified form property.
 void removeFormTemplate(String qualifier)
          Removes the qualified form template.
 void removeInfoTemplate(String qualifier)
          Removes the qualified info template.
 void removeInputTemplate(String qualifier)
          Removes the qualified input template.
 void removeOutputTemplate(String qualifier)
          Removes the qualified output template.
 void removeVariable(String prefix, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Removes the specified form variable from a session.
 void render(String name, String type, Variable variable, boolean readonly, ServletRequest request, ServletResponse response, FilterChain chain)
          Renders a form as a variable.
 void render(String name, String type, Variable variable, MBeanAttributeInfo attribute, boolean readonly, ServletRequest request, ServletResponse response, FilterChain chain)
          Renders a control as the specified variable attribute.
 void render(String template, Variable variable, MBeanAttributeInfo attribute, ServletRequest request, ServletResponse response, FilterChain chain)
          Renders a control as the specified variable attribute using a fixed template.
 void render(String template, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Renders a form as a variable using a fixed template.
 String resetCurrentForm(ServletRequest request, ServletResponse response, FilterChain chain)
          Resets the current form of the specified request to the default form.
 String resetCurrentForm(String name, ServletRequest request, ServletResponse response, FilterChain chain)
          Resets the current form of the specified request to the named form.
 void resetParameterMap(ServletRequest request, ServletResponse response, FilterChain chain)
          Resets the parameter map of the specified request.
 void resetParameterMap(String prefix, ServletRequest request, ServletResponse response, FilterChain chain)
          Resets the prefixed parameter map of the specified request.
 ConcurrentMap<String,String> resolveFormProperties(String name, String type, Variable variable, MBeanAttributeInfo attribute)
          Resolves form properties of the specified variable attribute.
 String resolveInputTemplate(String name, String type, Variable variable, MBeanAttributeInfo attribute)
          Resolves the input template of the specified variable attribute.
 String resolveOutputTemplate(String name, String type, Variable variable, MBeanAttributeInfo attribute)
          Resolves the output template of the specified variable attribute.
 Variable restoreVariable(String prefix, String type, boolean create, ServletRequest request, ServletResponse response, FilterChain chain)
          Restores a saved form variable from a session or optionally creates a missing one.
 void saveVariable(String prefix, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Saves the specified form variable to a session.
 void setCachingDisabled(boolean flag)
          Sets the caching disabled flag.
 void setControlAttribute(String qualifier, String attribute)
          Sets the qualified control property.
 void setDefaultFormTheme(String theme)
          Sets the theme of the default form.
 void setFormIndexField(String name)
          Sets the name of the form index field to post the variable indices of the submitted form.
 void setFormNameField(String name)
          Sets the name of the form name field to post the unique name of the submitted form.
 void setFormProperty(String qualifier, String property)
          Sets the qualified form property.
 void setFormTemplate(String template)
          Sets the default form template.
 void setFormTemplate(String qualifier, String template)
          Sets the qualified form template.
 void setInfoTemplate(String template)
          Sets the default info template.
 void setInfoTemplate(String qualifier, String template)
          Sets the qualified info template.
 void setInputTemplate(String template)
          Sets the default input template.
 void setInputTemplate(String qualifier, String template)
          Sets the qualified input template.
 void setLocalizedForms(boolean flag)
          Sets the localized forms flag.
 void setOutputTemplate(String template)
          Sets the default output template.
 void setOutputTemplate(String qualifier, String template)
          Sets the qualified output template.
 void setSharedCacheName(ObjectName cache)
          Sets the shared cache of this client.
 void setVariableRegistryName(ObjectName registry)
          Sets the variable registry of this filter.
 void unmanaged()
          This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.
 VariableValidity updateForm(String prefix, Set<String> filter, Variable variable, MBeanAttributeInfo attribute, int index, ServletRequest request, ServletResponse response, FilterChain chain)
          Updates the specified variable attribute element with request parameters.
 VariableValidity updateForm(String prefix, Set<String> filter, Variable variable, MBeanAttributeInfo attribute, ServletRequest request, ServletResponse response, FilterChain chain)
          Updates the specified variable attribute with request parameters.
 VariableValidity updateForm(String prefix, Set<String> filter, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Updates the specified variable with request parameters.
 VariableValidity validateForm(String prefix, Set<String> filter, Variable variable, ServletRequest request, ServletResponse response, FilterChain chain)
          Validates the specified variable with request parameters.
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultSecureKeyFilter
addAllowedPermission, addDeniedPermission, allowedPermissions, allowedRoleSet, checkPermission, checkPermission, clearAllowedPermissions, clearDeniedPermissions, deniedPermissions, deniedRoleSet, getPermissibleRoles, isProtected, removeAllowedPermissions, removeDeniedPermissions, setAllowedPermissions, setDeniedPermissions
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultKeyFilter
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey
 
Methods inherited from class org.norther.tammi.spray.filter.DefaultFilter
destroy, getFilterConfig, getRequestMap, getSessionMap, init
 
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.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.spray.filter.KeyFilter
getKey, getKeyValue, getKeyValues, isLinkedKey, setKey, setLinkedKey
 
Methods inherited from interface javax.servlet.Filter
destroy, init
 

Field Detail

FORM_KEY

public static final String FORM_KEY
The form key.

See Also:
Constant Field Values

ENUMERATION

protected static final String ENUMERATION
The enumeration type key.

See Also:
Constant Field Values

ENUMERATIONS

protected static final String ENUMERATIONS
The enumeration array type key.

See Also:
Constant Field Values
Constructor Detail

DefaultFormFilter

public DefaultFormFilter()
Constructs a new filter.


DefaultFormFilter

public DefaultFormFilter(String key)
Constructs a new filter with a key.

Parameters:
key - the filter key.
Method Detail

postmanaged

public void postmanaged()
Description copied from interface: Manageable
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time.

Specified by:
postmanaged in interface Manageable
Overrides:
postmanaged in class Adaptee

unmanaged

public void unmanaged()
               throws Exception
Description copied from interface: Manageable
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time.

Specified by:
unmanaged in interface Manageable
Overrides:
unmanaged in class Adaptee
Throws:
Exception - if the adaptee refused to be unmanaged.

isCachingDisabled

public boolean isCachingDisabled()
Description copied from interface: CacheClient
Checks whether the caching is disabled.

Specified by:
isCachingDisabled in interface CacheClient<String,FormProperties>
Returns:
true if the caching is disabled, true otherwise.

setCachingDisabled

public void setCachingDisabled(boolean flag)
Description copied from interface: CacheClient
Sets the caching disabled flag.

Specified by:
setCachingDisabled in interface CacheClient<String,FormProperties>
Parameters:
flag - the caching disabled flag.

expireCached

public void expireCached(long timestamp)
Description copied from interface: CacheClient
Expires all cached entries notifying them about expiration.

Specified by:
expireCached in interface CacheClient<String,FormProperties>
Parameters:
timestamp - the timestamp of the expiration.

expireFraction

public void expireFraction(long timestamp,
                           float fraction)
Description copied from interface: CacheClient
Expires the specified fraction of cached entries notifying them about expiration.

Specified by:
expireFraction in interface CacheClient<String,FormProperties>
Parameters:
timestamp - the timestamp of the expiration.
fraction - the fraction of entries to expire (0.0..1.0).

clearCached

public void clearCached()
Description copied from interface: CacheClient
Clears all cached entries without notifying.

Specified by:
clearCached in interface CacheClient<String,FormProperties>

getCache

public ConcurrentMap<String,FormProperties> getCache(boolean... create)
Description copied from interface: CacheClient
Gets and optionally creates the cache.

Specified by:
getCache in interface CacheClient<String,FormProperties>
Parameters:
create - true to create a missing cache.
Returns:
the cache or null if disabled.

removeCache

public void removeCache()
Description copied from interface: CacheClient
Removes the cache.

Specified by:
removeCache in interface CacheClient<String,FormProperties>

getSharedCacheName

public ObjectName getSharedCacheName()
Description copied from interface: CacheClient
Gets the the shared cache of this client.

Specified by:
getSharedCacheName in interface CacheClient<String,FormProperties>
Returns:
the object name of the shared cache or a query.

setSharedCacheName

public void setSharedCacheName(ObjectName cache)
Description copied from interface: CacheClient
Sets the shared cache of this client. If it is not set, the default one will be used.

Specified by:
setSharedCacheName in interface CacheClient<String,FormProperties>
Parameters:
cache - the object name of the shared cache or a query.

refresh

public void refresh()
Description copied from interface: Refreshable
Refreshes the MBean.

Specified by:
refresh in interface Refreshable

getRefreshed

public long getRefreshed()
Description copied from interface: Refreshable
Gets the last refresh timestamp.

Specified by:
getRefreshed in interface Refreshable
Returns:
the timestamp of the last refresh.

isLocalizedForms

public boolean isLocalizedForms()
Description copied from interface: FormFilter
Gets the localized forms flag.

Specified by:
isLocalizedForms in interface FormFilter
Returns:
the localized forms flag.

setLocalizedForms

public void setLocalizedForms(boolean flag)
Description copied from interface: FormFilter
Sets the localized forms flag.

Specified by:
setLocalizedForms in interface FormFilter
Parameters:
flag - the localized forms flag.

getDefaultFormTheme

public String getDefaultFormTheme()
Description copied from interface: FormFilter
Gets the theme of the default form.

Specified by:
getDefaultFormTheme in interface FormFilter
Returns:
the default theme.

setDefaultFormTheme

public void setDefaultFormTheme(String theme)
Description copied from interface: FormFilter
Sets the theme of the default form.

Specified by:
setDefaultFormTheme in interface FormFilter
Parameters:
theme - the default theme.

getFormNameField

public String getFormNameField()
Description copied from interface: FormFilter
Gets the name of the form name field.

Specified by:
getFormNameField in interface FormFilter
Returns:
the form name field name.

setFormNameField

public void setFormNameField(String name)
Description copied from interface: FormFilter
Sets the name of the form name field to post the unique name of the submitted form.

Specified by:
setFormNameField in interface FormFilter
Parameters:
name - the form name field name.

getFormIndexField

public String getFormIndexField()
Description copied from interface: FormFilter
Gets the name of the form index field.

Specified by:
getFormIndexField in interface FormFilter
Returns:
the form index field name.

setFormIndexField

public void setFormIndexField(String name)
Description copied from interface: FormFilter
Sets the name of the form index field to post the variable indices of the submitted form.

Specified by:
setFormIndexField in interface FormFilter
Parameters:
name - the form index field name.

getFormTemplate

public String getFormTemplate()
Description copied from interface: FormFilter
Gets the default form template.

Specified by:
getFormTemplate in interface FormFilter
Returns:
the default template or null.

setFormTemplate

public void setFormTemplate(String template)
Description copied from interface: FormFilter
Sets the default form template.

Specified by:
setFormTemplate in interface FormFilter
Parameters:
template - the default template.

getInfoTemplate

public String getInfoTemplate()
Description copied from interface: FormFilter
Gets the default info template.

Specified by:
getInfoTemplate in interface FormFilter
Returns:
the default template or null.

setInfoTemplate

public void setInfoTemplate(String template)
Description copied from interface: FormFilter
Sets the default info template.

Specified by:
setInfoTemplate in interface FormFilter
Parameters:
template - the default template.

getInputTemplate

public String getInputTemplate()
Description copied from interface: FormFilter
Gets the default input template.

Specified by:
getInputTemplate in interface FormFilter
Returns:
the default template or null.

setInputTemplate

public void setInputTemplate(String template)
Description copied from interface: FormFilter
Sets the default input template.

Specified by:
setInputTemplate in interface FormFilter
Parameters:
template - the default template.

getOutputTemplate

public String getOutputTemplate()
Description copied from interface: FormFilter
Gets the default output template.

Specified by:
getOutputTemplate in interface FormFilter
Returns:
the default template or null.

setOutputTemplate

public void setOutputTemplate(String template)
Description copied from interface: FormFilter
Sets the default output template.

Specified by:
setOutputTemplate in interface FormFilter
Parameters:
template - the default template.

getFormTemplate

public String getFormTemplate(String qualifier)
Description copied from interface: FormFilter
Gets the qualified form template.

Specified by:
getFormTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
Returns:
the template or null.

setFormTemplate

public void setFormTemplate(String qualifier,
                            String template)
Description copied from interface: FormFilter
Sets the qualified form template.

Specified by:
setFormTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
template - the template.

removeFormTemplate

public void removeFormTemplate(String qualifier)
Description copied from interface: FormFilter
Removes the qualified form template.

Specified by:
removeFormTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.

clearFormTemplates

public void clearFormTemplates()
Description copied from interface: FormFilter
Clears all form templates.

Specified by:
clearFormTemplates in interface FormFilter

formQualifierSet

public Set<String> formQualifierSet()
Description copied from interface: FormFilter
Returns a read-only set of form template qualifiers.

Specified by:
formQualifierSet in interface FormFilter
Returns:
a set of template qualifiers.

getInfoTemplate

public String getInfoTemplate(String qualifier)
Description copied from interface: FormFilter
Gets the qualified info template.

Specified by:
getInfoTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
Returns:
the template or null.

setInfoTemplate

public void setInfoTemplate(String qualifier,
                            String template)
Description copied from interface: FormFilter
Sets the qualified info template.

Specified by:
setInfoTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
template - the template.

removeInfoTemplate

public void removeInfoTemplate(String qualifier)
Description copied from interface: FormFilter
Removes the qualified info template.

Specified by:
removeInfoTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.

clearInfoTemplates

public void clearInfoTemplates()
Description copied from interface: FormFilter
Clears all info templates.

Specified by:
clearInfoTemplates in interface FormFilter

infoQualifierSet

public Set<String> infoQualifierSet()
Description copied from interface: FormFilter
Returns a read-only set of info template qualifiers.

Specified by:
infoQualifierSet in interface FormFilter
Returns:
a set of template qualifiers.

getInputTemplate

public String getInputTemplate(String qualifier)
Description copied from interface: FormFilter
Gets the qualified input template.

Specified by:
getInputTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
Returns:
the template or null.

setInputTemplate

public void setInputTemplate(String qualifier,
                             String template)
Description copied from interface: FormFilter
Sets the qualified input template.

Specified by:
setInputTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
template - the template.

removeInputTemplate

public void removeInputTemplate(String qualifier)
Description copied from interface: FormFilter
Removes the qualified input template.

Specified by:
removeInputTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.

clearInputTemplates

public void clearInputTemplates()
Description copied from interface: FormFilter
Clears all input templates.

Specified by:
clearInputTemplates in interface FormFilter

inputQualifierSet

public Set<String> inputQualifierSet()
Description copied from interface: FormFilter
Returns a read-only set of input template qualifiers.

Specified by:
inputQualifierSet in interface FormFilter
Returns:
a set of template qualifiers.

getOutputTemplate

public String getOutputTemplate(String qualifier)
Description copied from interface: FormFilter
Gets the qualified output template.

Specified by:
getOutputTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
Returns:
the template or null.

setOutputTemplate

public void setOutputTemplate(String qualifier,
                              String template)
Description copied from interface: FormFilter
Sets the qualified output template.

Specified by:
setOutputTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.
template - the template.

removeOutputTemplate

public void removeOutputTemplate(String qualifier)
Description copied from interface: FormFilter
Removes the qualified output template.

Specified by:
removeOutputTemplate in interface FormFilter
Parameters:
qualifier - the qualifier.

clearOutputTemplates

public void clearOutputTemplates()
Description copied from interface: FormFilter
Clears all output templates.

Specified by:
clearOutputTemplates in interface FormFilter

outputQualifierSet

public Set<String> outputQualifierSet()
Description copied from interface: FormFilter
Returns a read-only set of output template qualifiers.

Specified by:
outputQualifierSet in interface FormFilter
Returns:
a set of template qualifiers.

getFormProperty

public String getFormProperty(String qualifier)
Description copied from interface: FormFilter
Gets the qualified form property.

Specified by:
getFormProperty in interface FormFilter
Parameters:
qualifier - the qualifier.
Returns:
the property or null.

setFormProperty

public void setFormProperty(String qualifier,
                            String property)
Description copied from interface: FormFilter
Sets the qualified form property.

Specified by:
setFormProperty in interface FormFilter
Parameters:
qualifier - the qualifier.
property - the property.

removeFormProperty

public void removeFormProperty(String qualifier)
Description copied from interface: FormFilter
Removes the qualified form property.

Specified by:
removeFormProperty in interface FormFilter
Parameters:
qualifier - the qualifier.

clearFormProperties

public void clearFormProperties()
Description copied from interface: FormFilter
Clears all form properties.

Specified by:
clearFormProperties in interface FormFilter

formPropertySet

public Set<String> formPropertySet()
Description copied from interface: FormFilter
Returns a read-only set of form property qualifiers.

Specified by:
formPropertySet in interface FormFilter
Returns:
a set of property qualifiers.

getControlAttribute

public String getControlAttribute(String qualifier)
Description copied from interface: FormFilter
Gets the qualified control attribute.

Specified by:
getControlAttribute in interface FormFilter
Parameters:
qualifier - the qualifier.
Returns:
the attribute or null.

setControlAttribute

public void setControlAttribute(String qualifier,
                                String attribute)
Description copied from interface: FormFilter
Sets the qualified control property.

Specified by:
setControlAttribute in interface FormFilter
Parameters:
qualifier - the qualifier.
attribute - the attribute.

removeControlAttribute

public void removeControlAttribute(String qualifier)
Description copied from interface: FormFilter
Removes the qualified control attribute.

Specified by:
removeControlAttribute in interface FormFilter
Parameters:
qualifier - the qualifier.

clearControlAttributes

public void clearControlAttributes()
Description copied from interface: FormFilter
Clears all control attributes.

Specified by:
clearControlAttributes in interface FormFilter

controlAttributeSet

public Set<String> controlAttributeSet()
Description copied from interface: FormFilter
Returns a read-only set of control attribute qualifiers.

Specified by:
controlAttributeSet in interface FormFilter
Returns:
a set of attribute qualifiers.

getVariableRegistryName

public ObjectName getVariableRegistryName()
Description copied from interface: FormFilter
Gets the the variable registry of this filter.

Specified by:
getVariableRegistryName in interface FormFilter
Returns:
the object name of the variable registry or a query.

setVariableRegistryName

public void setVariableRegistryName(ObjectName registry)
Description copied from interface: FormFilter
Sets the variable registry of this filter. If it is not set, the default one will be used.

Specified by:
setVariableRegistryName in interface FormFilter
Parameters:
registry - the object name of the variable registry or a query.

getParameterMap

public Map<String,Map<String,Object>> getParameterMap(ServletRequest request,
                                                      ServletResponse response,
                                                      FilterChain chain)
Description copied from interface: FormFilter
Gets the parameter map of the specified request.

Specified by:
getParameterMap in interface FormFilter
Parameters:
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the parameter map.

resetParameterMap

public void resetParameterMap(ServletRequest request,
                              ServletResponse response,
                              FilterChain chain)
Description copied from interface: FormFilter
Resets the parameter map of the specified request.

Specified by:
resetParameterMap in interface FormFilter
Parameters:
request - the servlet request.
response - the servlet response.
chain - the filter chain.

clearParameterMap

public void clearParameterMap(ServletRequest request,
                              ServletResponse response,
                              FilterChain chain)
Description copied from interface: FormFilter
Clears the parameter map of the specified request.

Specified by:
clearParameterMap in interface FormFilter
Parameters:
request - the servlet request.
response - the servlet response.
chain - the filter chain.

getParameterMap

public Map<String,Object> getParameterMap(String prefix,
                                          ServletRequest request,
                                          ServletResponse response,
                                          FilterChain chain)
Description copied from interface: FormFilter
Gets the prefixed parameter map of the specified request.

Specified by:
getParameterMap in interface FormFilter
Parameters:
prefix - the parameter name prefix.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the parameter map or null.

resetParameterMap

public void resetParameterMap(String prefix,
                              ServletRequest request,
                              ServletResponse response,
                              FilterChain chain)
Description copied from interface: FormFilter
Resets the prefixed parameter map of the specified request.

Specified by:
resetParameterMap in interface FormFilter
Parameters:
prefix - the parameter name prefix.
request - the servlet request.
response - the servlet response.
chain - the filter chain.

clearParameterMap

public void clearParameterMap(String prefix,
                              ServletRequest request,
                              ServletResponse response,
                              FilterChain chain)
Description copied from interface: FormFilter
Clears the prefixed parameter map of the specified request.

Specified by:
clearParameterMap in interface FormFilter
Parameters:
prefix - the parameter name prefix.
request - the servlet request.
response - the servlet response.
chain - the filter chain.

getLocalizedMap

public Map<String,Object> getLocalizedMap(String prefix,
                                          Set<String> filter,
                                          Variable variable,
                                          ServletRequest request,
                                          ServletResponse response,
                                          FilterChain chain)
Description copied from interface: FormFilter
Gets the parameter map of the specified variable. Localized values are converted into internal form if localized forms are enabled.

Specified by:
getLocalizedMap in interface FormFilter
Parameters:
prefix - an optional prefix.
filter - an optional filter.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the parameter map.

isValidated

public boolean isValidated(String prefix,
                           Variable variable,
                           ServletRequest request,
                           ServletResponse response,
                           FilterChain chain)
Description copied from interface: FormFilter
Checks whether the specified variable is validated.

Specified by:
isValidated in interface FormFilter
Parameters:
prefix - an optional prefix.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
true for a validated form.

getValidationMap

public SortedMap<String,Exception> getValidationMap(String prefix,
                                                    Set<String> filter,
                                                    Variable variable,
                                                    ServletRequest request,
                                                    ServletResponse response,
                                                    FilterChain chain)
Description copied from interface: FormFilter
Gets the validation map of request parameters of the specified variable.

Note that null is returned if no request parameters for the specified variable were available.

Specified by:
getValidationMap in interface FormFilter
Parameters:
prefix - an optional prefix.
filter - an optional filter.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the validation map or null.

validateForm

public VariableValidity validateForm(String prefix,
                                     Set<String> filter,
                                     Variable variable,
                                     ServletRequest request,
                                     ServletResponse response,
                                     FilterChain chain)
Description copied from interface: FormFilter
Validates the specified variable with request parameters.

Specified by:
validateForm in interface FormFilter
Parameters:
prefix - an optional prefix.
filter - an optional filter.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the form state.

updateForm

public VariableValidity updateForm(String prefix,
                                   Set<String> filter,
                                   Variable variable,
                                   ServletRequest request,
                                   ServletResponse response,
                                   FilterChain chain)
Description copied from interface: FormFilter
Updates the specified variable with request parameters.

Specified by:
updateForm in interface FormFilter
Parameters:
prefix - an optional prefix.
filter - an optional filter.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the form state.

updateForm

public VariableValidity updateForm(String prefix,
                                   Set<String> filter,
                                   Variable variable,
                                   MBeanAttributeInfo attribute,
                                   ServletRequest request,
                                   ServletResponse response,
                                   FilterChain chain)
Description copied from interface: FormFilter
Updates the specified variable attribute with request parameters.

Specified by:
updateForm in interface FormFilter
Parameters:
prefix - an optional prefix.
filter - an optional filter.
variable - the variable.
attribute - the attribute.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the form state.

updateForm

public VariableValidity updateForm(String prefix,
                                   Set<String> filter,
                                   Variable variable,
                                   MBeanAttributeInfo attribute,
                                   int index,
                                   ServletRequest request,
                                   ServletResponse response,
                                   FilterChain chain)
Description copied from interface: FormFilter
Updates the specified variable attribute element with request parameters.

Specified by:
updateForm in interface FormFilter
Parameters:
prefix - an optional prefix.
filter - an optional filter.
variable - the variable.
attribute - the attribute.
index - the element index.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the form state.

createVariable

public Variable createVariable(String type)
                        throws ConstructionException
Description copied from interface: FormFilter
Creates a new variable instance of the specified type.

Specified by:
createVariable in interface FormFilter
Parameters:
type - the variable type.
Returns:
the variable instance.
Throws:
ConstructionException - if construction fails.

restoreVariable

public Variable restoreVariable(String prefix,
                                String type,
                                boolean create,
                                ServletRequest request,
                                ServletResponse response,
                                FilterChain chain)
                         throws ConstructionException
Description copied from interface: FormFilter
Restores a saved form variable from a session or optionally creates a missing one. Created variables are automatically saved into the session if available.

Specified by:
restoreVariable in interface FormFilter
Parameters:
prefix - an optional prefix.
type - the variable type.
create - the create option.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the form variable.
Throws:
ConstructionException - if construction fails.

saveVariable

public void saveVariable(String prefix,
                         Variable variable,
                         ServletRequest request,
                         ServletResponse response,
                         FilterChain chain)
Description copied from interface: FormFilter
Saves the specified form variable to a session.

Specified by:
saveVariable in interface FormFilter
Parameters:
prefix - an optional prefix.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.

removeVariable

public void removeVariable(String prefix,
                           Variable variable,
                           ServletRequest request,
                           ServletResponse response,
                           FilterChain chain)
Description copied from interface: FormFilter
Removes the specified form variable from a session.

Specified by:
removeVariable in interface FormFilter
Parameters:
prefix - an optional prefix.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.

render

public void render(String name,
                   String type,
                   Variable variable,
                   boolean readonly,
                   ServletRequest request,
                   ServletResponse response,
                   FilterChain chain)
            throws TemplateException
Description copied from interface: FormFilter
Renders a form as a variable.

Specified by:
render in interface FormFilter
Parameters:
name - an optional theme.
type - the content type.
variable - the variable.
readonly - the readonly option.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Throws:
TemplateException - on errors.

render

public void render(String template,
                   Variable variable,
                   ServletRequest request,
                   ServletResponse response,
                   FilterChain chain)
            throws TemplateException
Description copied from interface: FormFilter
Renders a form as a variable using a fixed template.

Specified by:
render in interface FormFilter
Parameters:
template - the template.
variable - the variable.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Throws:
TemplateException - on errors.

render

public void render(String name,
                   String type,
                   Variable variable,
                   MBeanAttributeInfo attribute,
                   boolean readonly,
                   ServletRequest request,
                   ServletResponse response,
                   FilterChain chain)
            throws TemplateException
Description copied from interface: FormFilter
Renders a control as the specified variable attribute.

Specified by:
render in interface FormFilter
Parameters:
name - an optional theme.
type - the content type.
variable - the variable.
attribute - the attribute.
readonly - the read-only option.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Throws:
TemplateException - on errors.

render

public void render(String template,
                   Variable variable,
                   MBeanAttributeInfo attribute,
                   ServletRequest request,
                   ServletResponse response,
                   FilterChain chain)
            throws TemplateException
Description copied from interface: FormFilter
Renders a control as the specified variable attribute using a fixed template.

Specified by:
render in interface FormFilter
Parameters:
template - the template.
variable - the variable.
attribute - the attribute.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Throws:
TemplateException - on errors.

resolveInputTemplate

public String resolveInputTemplate(String name,
                                   String type,
                                   Variable variable,
                                   MBeanAttributeInfo attribute)
                            throws TemplateException
Description copied from interface: FormFilter
Resolves the input template of the specified variable attribute.

Specified by:
resolveInputTemplate in interface FormFilter
Parameters:
name - an optional theme.
type - the content type.
variable - the variable.
attribute - the attribute.
Returns:
a read-only map of propeties.
Throws:
TemplateException - on errors.

resolveOutputTemplate

public String resolveOutputTemplate(String name,
                                    String type,
                                    Variable variable,
                                    MBeanAttributeInfo attribute)
                             throws TemplateException
Description copied from interface: FormFilter
Resolves the output template of the specified variable attribute.

Specified by:
resolveOutputTemplate in interface FormFilter
Parameters:
name - an optional theme.
type - the content type.
variable - the variable.
attribute - the attribute.
Returns:
a read-only map of propeties.
Throws:
TemplateException - on errors.

resolveFormProperties

public ConcurrentMap<String,String> resolveFormProperties(String name,
                                                          String type,
                                                          Variable variable,
                                                          MBeanAttributeInfo attribute)
Description copied from interface: FormFilter
Resolves form properties of the specified variable attribute.

Specified by:
resolveFormProperties in interface FormFilter
Parameters:
name - an optional theme.
type - the content type.
variable - the variable.
attribute - the attribute.
Returns:
a read-only map of properties.

getCurrentForm

public String getCurrentForm(ServletRequest request,
                             ServletResponse response,
                             FilterChain chain)
Description copied from interface: FormFilter
Gets the current form of the specified request.

Specified by:
getCurrentForm in interface FormFilter
Parameters:
request - the servlet request.
response - the servlet response.
chain - the filter chain
Returns:
the current form or null.

resetCurrentForm

public String resetCurrentForm(ServletRequest request,
                               ServletResponse response,
                               FilterChain chain)
Description copied from interface: FormFilter
Resets the current form of the specified request to the default form.

Specified by:
resetCurrentForm in interface FormFilter
Parameters:
request - the servlet request.
response - the servlet response.
chain - the filter chain
Returns:
the reset form or null.

resetCurrentForm

public String resetCurrentForm(String name,
                               ServletRequest request,
                               ServletResponse response,
                               FilterChain chain)
Description copied from interface: FormFilter
Resets the current form of the specified request to the named form.

Specified by:
resetCurrentForm in interface FormFilter
Parameters:
name - the theme of the form.
request - the servlet request.
response - the servlet response.
chain - the filter chain
Returns:
the reset form or null.

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws ServletException,
                     IOException
Specified by:
doFilter in interface Filter
Overrides:
doFilter in class DefaultFilter
Throws:
ServletException
IOException


Copyright © 2004 The Norther Organization. All rights reserved.