atg.droplet
Class RestFormSubmissionHandler

java.lang.Object
  extended by atg.droplet.RestFormSubmissionHandler

public class RestFormSubmissionHandler
extends java.lang.Object

This class is the link between REST web services and the form handling logic in the platform. It handles calling the form handling logic from outside the traditional form submission process.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
RestFormSubmissionHandler(java.lang.Object pResContainer, BeanURI pParsedURI, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          Constructor
RestFormSubmissionHandler(java.lang.Object pResContainer, BeanURI pParsedURI, RestSecurityProcessor pRestSecurityProcessor, RestSecurityManager pRestSecurityManager, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
           
 
Method Summary
protected  void addFormInputs(FormTag pFormTag)
          This method sets up the form tag based on the parameter inputs given.
protected  java.util.Collection<java.lang.String> checkAccess(java.util.Collection<java.lang.String> pProperties)
          Remove properties from given Collection that don't have access based on the security configuration Does not filter if the RestSecurityProcessor is disabled, or RestSecurityManager.isCheckFormHandlerProperties is false.
 boolean execute(RestFormExceptions pFormErrors)
          This method handles execution of the form handler method.
 BeanURI getParsedURI()
           
 DynamoHttpServletRequest getRequest()
           
protected  RestHttpServletRequestWrapper getRequestWrapper()
          Wraps the current request with a RestHttpServletRequestWrapper object and returns the wrapper
 java.lang.Object getResourceContainer()
           
 DynamoHttpServletResponse getResponse()
           
protected  RestHttpServletResponseWrapper getResponseWrapper()
          Wraps the current response with a RestHttpServletResponseWrapper object and returns the wrapper
 RestSecurityManager getRestSecurityManager()
           
 RestSecurityProcessor getRestSecurityProcessor()
           
protected  java.util.Collection<java.lang.String> prioritizeFormTags(java.util.Map<java.lang.String,java.lang.Object> pParams)
          prioritize the form tags
 void setParsedURI(BeanURI pParsedURI)
           
 void setRequest(DynamoHttpServletRequest pRequest)
           
 void setResourceContainer(java.lang.Object pResourceContainer)
           
 void setResponse(DynamoHttpServletResponse pResponse)
           
 void setRestSecurityManager(RestSecurityManager pRestSecurityManager)
           
 void setRestSecurityProcessor(RestSecurityProcessor pRestSecurityProcessor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RestFormSubmissionHandler

public RestFormSubmissionHandler(java.lang.Object pResContainer,
                                 BeanURI pParsedURI,
                                 DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
Constructor


RestFormSubmissionHandler

public RestFormSubmissionHandler(java.lang.Object pResContainer,
                                 BeanURI pParsedURI,
                                 RestSecurityProcessor pRestSecurityProcessor,
                                 RestSecurityManager pRestSecurityManager,
                                 DynamoHttpServletRequest pRequest,
                                 DynamoHttpServletResponse pResponse)
Method Detail

getResourceContainer

public java.lang.Object getResourceContainer()
Returns:
the value of resourceContainer

setResourceContainer

public void setResourceContainer(java.lang.Object pResourceContainer)
Parameters:
pResourceContainer - the resourceContainer to set

getParsedURI

public BeanURI getParsedURI()
Returns:
the value of parsedURI

setParsedURI

public void setParsedURI(BeanURI pParsedURI)
Parameters:
pParsedURI - the parsedURI to set

getRestSecurityProcessor

public RestSecurityProcessor getRestSecurityProcessor()
Returns:
restSecurityProcessor

setRestSecurityProcessor

public void setRestSecurityProcessor(RestSecurityProcessor pRestSecurityProcessor)
Parameters:
pRestSecurityProcessor - - set restSecurityProcessor

getRestSecurityManager

public RestSecurityManager getRestSecurityManager()
Returns:
restSecurityManager

setRestSecurityManager

public void setRestSecurityManager(RestSecurityManager pRestSecurityManager)
Parameters:
pRestSecurityManager - - set restSecurityManager

getRequest

public DynamoHttpServletRequest getRequest()
Returns:
the value of request

setRequest

public void setRequest(DynamoHttpServletRequest pRequest)
Parameters:
pRequest - the request to set

getResponse

public DynamoHttpServletResponse getResponse()
Returns:
the value of response

setResponse

public void setResponse(DynamoHttpServletResponse pResponse)
Parameters:
pResponse - the response to set

execute

public boolean execute(RestFormExceptions pFormErrors)
                throws RestException,
                       java.io.IOException
This method handles execution of the form handler method. It is called from the REST framework.

Throws:
RestException - if a ServletException is thrown it is wrapped in a RestException
java.io.IOException - if an exception is thrown when sending the form events

addFormInputs

protected void addFormInputs(FormTag pFormTag)
                      throws javax.servlet.ServletException
This method sets up the form tag based on the parameter inputs given.

Parameters:
pFormTag - the form tag object representing the form to be executed
Throws:
javax.servlet.ServletException - if any of the tags could not be added

getRequestWrapper

protected RestHttpServletRequestWrapper getRequestWrapper()
Wraps the current request with a RestHttpServletRequestWrapper object and returns the wrapper

Returns:
the request wrapper

getResponseWrapper

protected RestHttpServletResponseWrapper getResponseWrapper()
Wraps the current response with a RestHttpServletResponseWrapper object and returns the wrapper

Returns:
the response wrapper

prioritizeFormTags

protected java.util.Collection<java.lang.String> prioritizeFormTags(java.util.Map<java.lang.String,java.lang.Object> pParams)
                                                             throws javax.servlet.ServletException
prioritize the form tags

Parameters:
pParams - the functional params for the request
Returns:
an Iterator containing the prioritized list of tags
Throws:
javax.servlet.ServletException - if there was an error prioritizing the tags

checkAccess

protected java.util.Collection<java.lang.String> checkAccess(java.util.Collection<java.lang.String> pProperties)
Remove properties from given Collection that don't have access based on the security configuration Does not filter if the RestSecurityProcessor is disabled, or RestSecurityManager.isCheckFormHandlerProperties is false. Returns an empty list if the ComponentSecurityConfiguration is false.

Parameters:
the - Collection of properties to check
Returns:
the Collection of properties, filtered for security