com.tenduke.services.objectmodel.formhandler
Class AbstractFormHandler

java.lang.Object
  extended by com.tenduke.services.objectmodel.formhandler.AbstractFormHandler
All Implemented Interfaces:
FormDataHandler
Direct Known Subclasses:
CreateOrUpdateObjectFormHandler, DeleteObjectsFormHandler, ProfileRolesFormHandler, RolePermissionsFormHandler, UpdateRelationsFormHandler, UpdateSetObjectIndexFormHandler

public abstract class AbstractFormHandler
extends java.lang.Object
implements FormDataHandler

Abstract base class for FormDataHandler implementations.

This class simply stores the key-value pairs of a form into a hash map for derived classes to use.


Constructor Summary
protected AbstractFormHandler(Profile modifiedBy, javax.servlet.http.HttpServletRequest request)
          Creates a new instance of the AbstractFormHandler class.
 
Method Summary
 Profile getModifyingProfile()
          Gets Profile used as modifying Profile for updates made by the handler.
 javax.servlet.http.HttpServletRequest getRequest()
          Gets request that is parsed by the handler.
 java.util.Map<java.lang.String,java.lang.String> getRequestParameters()
          Gets map with request parameters stored in handleParameterPart(java.lang.String, java.lang.String).
 void handleParameterPart(java.lang.String parameterName, java.lang.String parameterValue)
          Store single form field as a key-value entry to the hash map.
 void setModifyingProfile(Profile modifyingProfile)
          Sets Profile used as modifying Profile for updates made by the handler.
 void setRequest(javax.servlet.http.HttpServletRequest request)
          Sets request that is parsed by the handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tenduke.networking.http.FormDataHandler
beginHandling, endHandling, getPathForFileWrite, handleFilePart, handleHeader
 

Constructor Detail

AbstractFormHandler

protected AbstractFormHandler(Profile modifiedBy,
                              javax.servlet.http.HttpServletRequest request)
Creates a new instance of the AbstractFormHandler class.

Parameters:
modifiedBy - Profile used as modifying Profile for updates made by the handler.
request - Request that is parsed by the handler.
Method Detail

getModifyingProfile

public Profile getModifyingProfile()
Gets Profile used as modifying Profile for updates made by the handler.

Returns:
Profile used as modifying Profile for updates made by the handler.

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Gets request that is parsed by the handler.

Returns:
Request that is parsed by the handler.

getRequestParameters

public java.util.Map<java.lang.String,java.lang.String> getRequestParameters()
Gets map with request parameters stored in handleParameterPart(java.lang.String, java.lang.String).

Returns:
the request parameters Map.

handleParameterPart

public void handleParameterPart(java.lang.String parameterName,
                                java.lang.String parameterValue)
Store single form field as a key-value entry to the hash map. If either parameter name or value is null, no entries are stored.

Specified by:
handleParameterPart in interface FormDataHandler
Parameters:
parameterName - Parameter name
parameterValue - Parameter value

setModifyingProfile

public void setModifyingProfile(Profile modifyingProfile)
Sets Profile used as modifying Profile for updates made by the handler.

Parameters:
modifyingProfile - Profile used as modifying Profile for updates made by the handler.

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest request)
Sets request that is parsed by the handler.

Parameters:
request - Request that is parsed by the handler.