Anyframe Web

anyframe.web.struts.action.ria.mip
Class AnyframeMiPAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by org.springframework.web.struts.ActionSupport
          extended by anyframe.web.struts.action.ria.mip.AnyframeMiPAction
Direct Known Subclasses:
AnyframeMiPDispatchAction

public abstract class AnyframeMiPAction
extends org.springframework.web.struts.ActionSupport

Abstract Action Class which provide token, exception, error logging, pre/post execution features.

Author:
Byunghun Woo

Field Summary
 java.lang.String default_charset
           
 int default_encode_method
           
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
Constructor Summary
AnyframeMiPAction()
           
 
Method Summary
 java.util.HashMap convertDatasetToListMap(java.lang.Class cls, com.tobesoft.platform.data.Dataset ds)
           This method converts Dataset into ListMap(VO LIST).
 java.util.HashMap convertDatasetToListMap(java.lang.Class cls, com.tobesoft.platform.data.Dataset ds, boolean convertToCamenCase)
           This method converts Dataset into ListMap(VO LIST).
 com.tobesoft.platform.data.Dataset convertVoListToDataset(java.lang.String dataSetName, java.util.List voList, boolean isCheck)
           This method converts Value Object(VO) List into Dataset(MiPlatform).
 com.tobesoft.platform.data.Dataset convertVoToDataset(java.lang.String dataSetName, java.lang.Object obj, boolean isCheck)
           This method converts Value Object(VO) into Dataset(MiPlatform).
 org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           Process the specified Platform request, and create the corresponding Platform response (or forward to another web component that will create it), with provision for handling exceptions thrown by the business logic.
abstract  org.apache.commons.logging.Log getLogger()
           Anyframe Core Delegation Util Method to get Logger
protected  java.lang.Object getService(java.lang.String name)
          This method gets Service in WebApplicationContext.
protected  void onInit()
          get Logger
 void postProcess(com.tobesoft.platform.PlatformRequest request, com.tobesoft.platform.data.VariableList inVl, com.tobesoft.platform.data.DatasetList in_dl, com.tobesoft.platform.data.VariableList out_vl, com.tobesoft.platform.data.DatasetList out_dl)
           This method which executes some post condition actions eg.
 void preProcess(com.tobesoft.platform.PlatformRequest request, com.tobesoft.platform.data.VariableList inVl, com.tobesoft.platform.data.DatasetList inDl, com.tobesoft.platform.data.VariableList outVl, com.tobesoft.platform.data.DatasetList outDl)
           This method which executes some pre condition actions eg.
abstract  void process(org.apache.struts.action.ActionMapping mapping, com.tobesoft.platform.PlatformRequest request, com.tobesoft.platform.data.VariableList inVl, com.tobesoft.platform.data.DatasetList inDl, com.tobesoft.platform.data.VariableList outVl, com.tobesoft.platform.data.DatasetList outDl)
           The abstract method which sub classes must implement
 void processCheckedException(com.tobesoft.platform.PlatformRequest request, com.tobesoft.platform.data.VariableList inVl, com.tobesoft.platform.data.DatasetList in_dl, com.tobesoft.platform.data.VariableList out_vl, com.tobesoft.platform.data.DatasetList out_dl, java.lang.Exception checkedException)
           When occur Exception, this method executes and sets exception message.
 void processFinally(com.tobesoft.platform.PlatformRequest request, com.tobesoft.platform.PlatformResponse response, com.tobesoft.platform.data.VariableList inVl, com.tobesoft.platform.data.DatasetList in_dl, com.tobesoft.platform.data.VariableList out_vl, com.tobesoft.platform.data.DatasetList out_dl)
           The basic method which execute some common condition actions
 void processUnCheckedException(com.tobesoft.platform.PlatformRequest request, com.tobesoft.platform.data.VariableList inVl, com.tobesoft.platform.data.DatasetList in_dl, com.tobesoft.platform.data.VariableList out_vl, com.tobesoft.platform.data.DatasetList out_dl, java.lang.Exception unCheckedException)
           When occur RunttimeException, this method executes and sets exception message.
 void setResultMessage(com.tobesoft.platform.data.VariableList out_vl, int code, java.lang.String msg)
           This method sets result message
 
Methods inherited from class org.springframework.web.struts.ActionSupport
getMessageSourceAccessor, getServletContext, getTempDir, getWebApplicationContext, initWebApplicationContext, onDestroy, setServlet
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

default_encode_method

public final int default_encode_method
See Also:
Constant Field Values

default_charset

public java.lang.String default_charset
Constructor Detail

AnyframeMiPAction

public AnyframeMiPAction()
Method Detail

onInit

protected void onInit()
get Logger

Overrides:
onInit in class org.springframework.web.struts.ActionSupport

getLogger

public abstract org.apache.commons.logging.Log getLogger()

Anyframe Core Delegation Util Method to get Logger


setResultMessage

public void setResultMessage(com.tobesoft.platform.data.VariableList out_vl,
                             int code,
                             java.lang.String msg)

This method sets result message

Parameters:
out_vl - VariableList to contain result messages.
code - Error Code
msg - Error Message

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception

Process the specified Platform request, and create the corresponding Platform response (or forward to another web component that will create it), with provision for handling exceptions thrown by the business logic. Return an ActionForward instance describing where and how control should be forwarded, or null if the response has already been completed.

The default implementation attempts to forward to the version of this method.

Overrides:
execute in class org.apache.struts.action.Action
Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The Platform request we are processing
response - The Platform response we are creating
Returns:
The forward to which control should be transferred, or null if the response has been completed.
Throws:
java.lang.Exception - if the application business logic throws an exception.

preProcess

public void preProcess(com.tobesoft.platform.PlatformRequest request,
                       com.tobesoft.platform.data.VariableList inVl,
                       com.tobesoft.platform.data.DatasetList inDl,
                       com.tobesoft.platform.data.VariableList outVl,
                       com.tobesoft.platform.data.DatasetList outDl)
                throws java.lang.Exception

This method which executes some pre condition actions eg.

Parameters:
request - the Platform request we are processing
inVl - a input VariableList
inDl - a input DatasetList
outVl - a output VariableList
outDl - a output DatasetList
Throws:
java.lang.Exception

postProcess

public void postProcess(com.tobesoft.platform.PlatformRequest request,
                        com.tobesoft.platform.data.VariableList inVl,
                        com.tobesoft.platform.data.DatasetList in_dl,
                        com.tobesoft.platform.data.VariableList out_vl,
                        com.tobesoft.platform.data.DatasetList out_dl)
                 throws java.lang.Exception

This method which executes some post condition actions eg.

Parameters:
request - the Platform request we are processing
inVl - a input VariableList
inDl - a input DatasetList
outVl - a output VariableList
outDl - a output DatasetList
Throws:
java.lang.Exception

processFinally

public void processFinally(com.tobesoft.platform.PlatformRequest request,
                           com.tobesoft.platform.PlatformResponse response,
                           com.tobesoft.platform.data.VariableList inVl,
                           com.tobesoft.platform.data.DatasetList in_dl,
                           com.tobesoft.platform.data.VariableList out_vl,
                           com.tobesoft.platform.data.DatasetList out_dl)
                    throws java.lang.Exception

The basic method which execute some common condition actions

Parameters:
request - the Platform request we are processing
response - the Platform response we are creating
inVl - a input VariableList
in_dl - a input DatasetList
out_vl - a output VariableList
out_dl - a output DatasetList
Throws:
java.lang.Exception

processCheckedException

public void processCheckedException(com.tobesoft.platform.PlatformRequest request,
                                    com.tobesoft.platform.data.VariableList inVl,
                                    com.tobesoft.platform.data.DatasetList in_dl,
                                    com.tobesoft.platform.data.VariableList out_vl,
                                    com.tobesoft.platform.data.DatasetList out_dl,
                                    java.lang.Exception checkedException)
                             throws java.lang.Exception

When occur Exception, this method executes and sets exception message.

Parameters:
request - the Platform request we are processing
inVl - a input VariableList
in_dl - a input DatasetList
out_vl - a output VariableList
out_dl - a output DatasetList
checkedException - Exception
Throws:
java.lang.Exception

processUnCheckedException

public void processUnCheckedException(com.tobesoft.platform.PlatformRequest request,
                                      com.tobesoft.platform.data.VariableList inVl,
                                      com.tobesoft.platform.data.DatasetList in_dl,
                                      com.tobesoft.platform.data.VariableList out_vl,
                                      com.tobesoft.platform.data.DatasetList out_dl,
                                      java.lang.Exception unCheckedException)
                               throws java.lang.Exception

When occur RunttimeException, this method executes and sets exception message.

Parameters:
request - the Platform request we are processing
inVl - a input VariableList
in_dl - a input DatasetList
out_vl - a output VariableList
out_dl - a output DatasetList
checkedException - RuntimeException
Throws:
java.lang.Exception

process

public abstract void process(org.apache.struts.action.ActionMapping mapping,
                             com.tobesoft.platform.PlatformRequest request,
                             com.tobesoft.platform.data.VariableList inVl,
                             com.tobesoft.platform.data.DatasetList inDl,
                             com.tobesoft.platform.data.VariableList outVl,
                             com.tobesoft.platform.data.DatasetList outDl)
                      throws java.lang.Exception

The abstract method which sub classes must implement

Parameters:
mapping - The ActionMapping used to select this instance
form - The optional ActionForm bean for this request (if any)
request - The Platform request we are processing
response - The Platform response we are creating
Throws:
java.lang.Exception - if the application business logic throws an exception.

convertVoListToDataset

public com.tobesoft.platform.data.Dataset convertVoListToDataset(java.lang.String dataSetName,
                                                                 java.util.List voList,
                                                                 boolean isCheck)
                                                          throws javax.servlet.ServletException,
                                                                 java.lang.Exception

This method converts Value Object(VO) List into Dataset(MiPlatform).

Parameters:
dataSetName - a name of Dataset
voList - VO List to be converted into Dataset
isCheck - if isCheck is 'true', when create Dataset, add check column to Dataset.
Returns:
Dataset
Throws:
javax.servlet.ServletException
java.lang.Exception

convertVoToDataset

public com.tobesoft.platform.data.Dataset convertVoToDataset(java.lang.String dataSetName,
                                                             java.lang.Object obj,
                                                             boolean isCheck)
                                                      throws javax.servlet.ServletException,
                                                             java.lang.Exception

This method converts Value Object(VO) into Dataset(MiPlatform).

Parameters:
dataSetName - a name of Dataset
obj - Value Object(VO) to be converted into Dataset
isCheck - if isCheck is 'true', when create Dataset, add check column to Dataset.
Returns:
Dataset
Throws:
javax.servlet.ServletException
java.lang.Exception

convertDatasetToListMap

public java.util.HashMap convertDatasetToListMap(java.lang.Class cls,
                                                 com.tobesoft.platform.data.Dataset ds)
                                          throws javax.servlet.ServletException,
                                                 java.lang.Exception

This method converts Dataset into ListMap(VO LIST). if Dataset's status is 'insert', a key of Map is 'insert' if Dataset's status is 'update', a key of Map is 'update' if Dataset's status is 'delete', a key of Map is 'delete'

Parameters:
cls - VO Class.
ds - Dataset to be converted into Value Object(VO) List.
Returns:
HashMap
Throws:
javax.servlet.ServletException
java.lang.Exception

convertDatasetToListMap

public java.util.HashMap convertDatasetToListMap(java.lang.Class cls,
                                                 com.tobesoft.platform.data.Dataset ds,
                                                 boolean convertToCamenCase)
                                          throws javax.servlet.ServletException,
                                                 java.lang.Exception

This method converts Dataset into ListMap(VO LIST). if Dataset's status is 'insert', a key of Map is 'insert' if Dataset's status is 'update', a key of Map is 'update' if Dataset's status is 'delete', a key of Map is 'delete'

Parameters:
cls - VO Class.
ds - Dataset to be converted into Value Object(VO) List.
convertToCamenCase - if Dataset's column name include '_'(underscore) and attribute names of VO are Camelcase, this is 'true' ex) Dataset's column name is 'test_sample', a attribute name of VO is 'testSample' this value must be true.
Returns:
HashMap
Throws:
javax.servlet.ServletException
java.lang.Exception

getService

protected java.lang.Object getService(java.lang.String name)

This method gets Service in WebApplicationContext.

Parameters:
name - a name of Service which in registered to container.(Bean name or Bean id)
Returns:
Object

Anyframe Web

Copyright © 2008-2009 Samsung SDS. All Rights Reserved.