com.oroad.stxx.plugin
Class RequestProcessorHelper

java.lang.Object
  extended bycom.oroad.stxx.plugin.RequestProcessorHelper

public class RequestProcessorHelper
extends java.lang.Object

A helper to request processors providing common functionality.

Author:
Jeff Pennal, Don Brown

Constructor Summary
RequestProcessorHelper(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig appConfig)
          Initialize
 
Method Summary
protected  java.util.Map findStrutsPlugInConfigProperties(javax.servlet.ServletContext ctx, org.apache.struts.config.ModuleConfig config)
          Method findStrutsPlugInConfigProperties
 boolean isXFormRequest(javax.servlet.http.HttpServletRequest request)
          Tests to see if incoming data should be processed by XForm's form population code
 org.apache.struts.action.ActionMapping processMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path)
          Select the mapping used to process the selection path for this request.
 void processPopulate(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form)
          Exactly like the normal Struts populateIf XMLForm libraries are present, populate the form using XMLForm.
 boolean processStxxDefinition(java.lang.String definitionName, boolean contextRelative, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process a Stxx definition name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestProcessorHelper

public RequestProcessorHelper(org.apache.struts.action.ActionServlet servlet,
                              org.apache.struts.config.ModuleConfig appConfig)
                       throws javax.servlet.ServletException
Initialize

Parameters:
servlet - The ActionServlet we are associated with
appConfig - The ModuleConfig we are associated with.
Throws:
javax.servlet.ServletException - If an error occur during initialization
Method Detail

processStxxDefinition

public boolean processStxxDefinition(java.lang.String definitionName,
                                     boolean contextRelative,
                                     javax.servlet.http.HttpServletRequest request,
                                     javax.servlet.http.HttpServletResponse response)
                              throws java.io.IOException,
                                     javax.servlet.ServletException
Process a Stxx definition name. This method try to process parameter definitionName as a definition name. It return true if a definition has been processed, false otherwise. Parameter contextRelative is not use in this implementation. Only names ending with ".dox" are processed.

Parameters:
definitionName - Definition name to insert.
contextRelative - Does the Definition is marked contextRelative ?
request - Current page request
response - Current page response
Returns:
True if the method has process uri as a definition name, false otherwise.
Throws:
java.io.IOException - If something goes wrong
javax.servlet.ServletException - If something goes wrong

processPopulate

public void processPopulate(javax.servlet.http.HttpServletRequest request,
                            org.apache.struts.action.ActionMapping mapping,
                            org.apache.struts.action.ActionForm form)
Exactly like the normal Struts populateIf XMLForm libraries are present, populate the form using XMLForm.

Parameters:
request - The request object
form - The action form to populate

isXFormRequest

public boolean isXFormRequest(javax.servlet.http.HttpServletRequest request)
Tests to see if incoming data should be processed by XForm's form population code

Parameters:
request - The request object
Returns:
true if it is a request using xforms

processMapping

public org.apache.struts.action.ActionMapping processMapping(javax.servlet.http.HttpServletRequest request,
                                                             javax.servlet.http.HttpServletResponse response,
                                                             java.lang.String path)
                                                      throws java.io.IOException
Select the mapping used to process the selection path for this request. The search order is as follows: specific mapping (usual Struts behavior), wildcard match, then the "unknown" mapping. If no mapping can be identified, create an error response and return null.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
path - The portion of the request URI for selecting a mapping
Returns:
The found and if applicable wildcard-populated action mapping
Throws:
java.io.IOException - if an input/output error occurs

findStrutsPlugInConfigProperties

protected java.util.Map findStrutsPlugInConfigProperties(javax.servlet.ServletContext ctx,
                                                         org.apache.struts.config.ModuleConfig config)
                                                  throws javax.servlet.ServletException
Method findStrutsPlugInConfigProperties

Parameters:
config - a ModuleConfig
Returns:
a Map
Throws:
javax.servlet.ServletException