com.ivata.mask.web.struts
Class MaskRequestProcessorImplementation

java.lang.Object
  extended bycom.ivata.mask.web.struts.MaskRequestProcessorImplementation

public class MaskRequestProcessorImplementation
extends java.lang.Object

Mask request processor implementation - kept separate so we can share funcitonality between the regular (MaskRequestProcessor) and tiles ( MaskTilesRequestProcessor) versions.

Since:
ivata masks 0.4 (2004-12-23)
Version:
$Revision: 1.3 $
Author:
Colin MacLeod colin.macleod@ivata.com

Constructor Summary
MaskRequestProcessorImplementation(com.ivata.mask.MaskFactory maskFactoryParam, com.ivata.mask.persistence.PersistenceManager persistenceManagerParam, com.ivata.mask.field.FieldValueConvertorFactory fieldValueConvertorFactoryParam)
           Initializes the mask factory, the value object locator and the the standard field value convertors.
 
Method Summary
protected  org.apache.struts.action.Action createAction(java.lang.String className, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping, java.util.Map actions, org.apache.struts.action.ActionServlet servlet)
           Override this method to define how to create actions in your environment.
protected  org.apache.struts.action.ActionForm createActionForm(org.apache.struts.config.FormBeanConfig formBeanConfig, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionMapping mapping)
           Override this method to define how to create action forms in your environment.
 com.ivata.mask.field.FieldValueConvertorFactory getFieldValueConvertorFactory()
          Used to generate convertors to convert property types from strings.
 void init(org.apache.struts.action.ActionServlet servletParam, org.apache.struts.config.ModuleConfig moduleConfigParam)
          Refer to .
protected  void processPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
           Overridden to populate forms, and convert the string values of value object properties into the correct form for their class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaskRequestProcessorImplementation

public MaskRequestProcessorImplementation(com.ivata.mask.MaskFactory maskFactoryParam,
                                          com.ivata.mask.persistence.PersistenceManager persistenceManagerParam,
                                          com.ivata.mask.field.FieldValueConvertorFactory fieldValueConvertorFactoryParam)

Initializes the mask factory, the value object locator and the the standard field value convertors.

Parameters:
maskFactoryParam - needed to access the masks and groups of masks.
persistenceManagerParam - used to locate the value objects by their shared base class.
Method Detail

createAction

protected org.apache.struts.action.Action createAction(java.lang.String className,
                                                       javax.servlet.http.HttpServletRequest request,
                                                       javax.servlet.http.HttpServletResponse response,
                                                       org.apache.struts.action.ActionMapping mapping,
                                                       java.util.Map actions,
                                                       org.apache.struts.action.ActionServlet servlet)
                                                throws java.io.IOException,
                                                       com.ivata.mask.util.SystemException

Override this method to define how to create actions in your environment. This lets you use ivata masks with a standard framework.

The default implementation looks for the action classes it knows about and initializes them directly. This is a simple starting point; in real life it is better to use a standard framework such as picocontainer .

Parameters:
className - full path and name of the action class to be created.
request - request for which we are creating an action.
response - response we are sending.
mapping - Struts mapping.
Returns:
valid action for the path, or null if the action can and should be created using the default Struts framework.
Throws:
java.io.IOException - if the action cannot be created.
com.ivata.mask.util.SystemException

createActionForm

protected org.apache.struts.action.ActionForm createActionForm(org.apache.struts.config.FormBeanConfig formBeanConfig,
                                                               javax.servlet.http.HttpServletRequest request,
                                                               javax.servlet.http.HttpServletResponse response,
                                                               org.apache.struts.action.ActionMapping mapping)
                                                        throws com.ivata.mask.util.SystemException

Override this method to define how to create action forms in your environment. This lets you use ivata masks with a standard framework.

The default implementation looks for the form classes it knows about and initializes them directly. This is a simple starting point; in real life it is better to use a standard framework such as picocontainer .

Parameters:
formBeanConfig - instance of FormBeanConfig defining the form to be created.
request - request for which we are creating an action.
response - response we are sending.
mapping - Struts mapping.
Returns:
valid action for the path, or null if the form can and should be created using the default Struts framework.
Throws:
com.ivata.mask.util.SystemException - if the form cannot be created for any reason.

getFieldValueConvertorFactory

public com.ivata.mask.field.FieldValueConvertorFactory getFieldValueConvertorFactory()
Used to generate convertors to convert property types from strings.

Returns:
Returns the FieldValueConvertor factory.

init

public void init(org.apache.struts.action.ActionServlet servletParam,
                 org.apache.struts.config.ModuleConfig moduleConfigParam)
          throws javax.servlet.ServletException
Refer to .

Parameters:
servletParam -
moduleConfigParam -
Throws:
javax.servlet.ServletException
See Also:
RequestProcessor.init(org.apache.struts.action.ActionServlet, org.apache.struts.config.ModuleConfig)

processPopulate

protected void processPopulate(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               org.apache.struts.action.ActionForm form,
                               org.apache.struts.action.ActionMapping mapping)
                        throws javax.servlet.ServletException

Overridden to populate forms, and convert the string values of value object properties into the correct form for their class.

Parameters:
request - servlet request we are processing.
response - servlet response we are creating.
form - form instance we are populating.
mapping - Struts mapping we are using.
Throws:
javax.servlet.ServletException - if an exception is thrown while setting property values
See Also:
RequestProcessor.processPopulate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping)


Copyright © 2001-2005 ivata limited. All Rights Reserved.