it.eng.spagobi.services.modules
Class DetailParameterModule

java.lang.Object
  extended by it.eng.spago.dispatching.service.DefaultRequestContext
      extended by it.eng.spago.dispatching.module.AbstractModule
          extended by it.eng.spagobi.services.modules.DetailParameterModule
All Implemented Interfaces:
it.eng.spago.dispatching.module.ModuleIFace, it.eng.spago.dispatching.service.RequestContextIFace, it.eng.spago.dispatching.service.ServiceIFace, it.eng.spago.init.InitializerIFace, java.io.Serializable

public class DetailParameterModule
extends it.eng.spago.dispatching.module.AbstractModule

Implements a module which handles all parameters management: has methods for parameters load detail, modify/insertion and deleting operations. The service method has a switch for all these operations, differentiated the ones from the others by a message String.

Author:
sulis
See Also:
Serialized Form

Field Summary
(package private)  it.eng.spago.error.EMFErrorHandler errorHandler
           
private  java.lang.String modalita
           
(package private)  it.eng.spago.base.SessionContainer session
           
 
Constructor Summary
DetailParameterModule()
           
 
Method Summary
private  Parameter clone(Parameter parameter)
           
private  ParameterUse clone(ParameterUse paruse)
           
private  Parameter createNewParameter()
          Create a new empty Parameter
private  ParameterUse createNewParameterUse(java.lang.Integer parId)
           
private  void delDetailParameter(it.eng.spago.base.SourceBean request, java.lang.String mod, it.eng.spago.base.SourceBean response)
          Deletes a parameter choosed by user from the parameters list.
private  void exitFromDetail(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Clean the SessionContainer from no more useful objects.
 int findParuseId(java.lang.Object paruseIdObj)
           
private  void getDetailParameter(java.lang.String key, it.eng.spago.base.SourceBean response)
          Gets the detail of a parameter choosed by the user from the parameters list.
 void init(it.eng.spago.base.SourceBean config)
           
private  void loadValuesDomain(it.eng.spago.base.SourceBean response)
          Loads all possible domain values which can be choosed for a parameter.
private  void lookupLoadHandler(it.eng.spago.base.SourceBean request, java.lang.String modality, it.eng.spago.base.SourceBean response)
           
private  void lookupReturnBackHandler(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
           
private  void lookupReturnHandler(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
           
private  void modDetailParameter(it.eng.spago.base.SourceBean request, java.lang.String mod, it.eng.spago.base.SourceBean response)
          Inserts/Modifies the detail of a parameter according to the user request.
private  void newDetailParameter(it.eng.spago.base.SourceBean response)
          Instantiates a new Parameter object when a new parameter insertion is required, in order to prepare the page for the insertion.
private  void parameterLabelControl(Parameter parameter, java.lang.String operation)
          Controls if the name of the Parameter is already in use.
private  void parameterUseLabelControl(ParameterUse paruse, java.lang.String operation)
          Controls if the name of the ParameterUse is already in use.
private  void prepareParameterDetailPage(it.eng.spago.base.SourceBean response, Parameter parameter, ParameterUse paruse, java.lang.String selected_paruse_idStr, java.lang.String modality, boolean initialParameter, boolean initialParameterUse)
          Fills the response SourceBean with the elements that will be displayed in the Parameter detail page: the Parameter itself and the required ParameterUse.
private  Parameter recoverParameterDetails(it.eng.spago.base.SourceBean request, java.lang.String mod)
           
private  ParameterUse recoverParameterUseDetails(it.eng.spago.base.SourceBean request, java.lang.Integer parIdInt, java.lang.Integer paruseIdInt)
           
private  Parameter reloadParameter(java.lang.String label)
          Reload a Parameter from its label.
private  ParameterUse reloadParuse(java.lang.Integer parIdInt, java.lang.String label)
          Reload a ParameterUse from its Parameter id and its label.
 void service(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Reads the operation asked by the user and calls the insertion, modify, detail and deletion methods
 
Methods inherited from class it.eng.spago.dispatching.module.AbstractModule
getConfig, getModule, getPage, getSharedData, setModule, setPage, setSharedData
 
Methods inherited from class it.eng.spago.dispatching.service.DefaultRequestContext
getErrorHandler, getRequestContainer, getResponseContainer, getServiceRequest, getServiceResponse, setRequestContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

modalita

private java.lang.String modalita

errorHandler

it.eng.spago.error.EMFErrorHandler errorHandler

session

it.eng.spago.base.SessionContainer session
Constructor Detail

DetailParameterModule

public DetailParameterModule()
Method Detail

init

public void init(it.eng.spago.base.SourceBean config)
Specified by:
init in interface it.eng.spago.init.InitializerIFace
Overrides:
init in class it.eng.spago.dispatching.module.AbstractModule

service

public void service(it.eng.spago.base.SourceBean request,
                    it.eng.spago.base.SourceBean response)
             throws java.lang.Exception
Reads the operation asked by the user and calls the insertion, modify, detail and deletion methods

Parameters:
request - The Source Bean containing all request parameters
response - The Source Bean containing all response parameters
Throws:
exception - If an exception occurs
java.lang.Exception

getDetailParameter

private void getDetailParameter(java.lang.String key,
                                it.eng.spago.base.SourceBean response)
                         throws EMFUserError
Gets the detail of a parameter choosed by the user from the parameters list. It reaches the key from the request and asks to the DB all detail parameter information, by calling the method loadForDetailByParameterID.

Parameters:
key - The choosed engine id key
response - The response Source Bean
Throws:
EMFUserError - If an exception occurs

prepareParameterDetailPage

private void prepareParameterDetailPage(it.eng.spago.base.SourceBean response,
                                        Parameter parameter,
                                        ParameterUse paruse,
                                        java.lang.String selected_paruse_idStr,
                                        java.lang.String modality,
                                        boolean initialParameter,
                                        boolean initialParameterUse)
                                 throws EMFUserError,
                                        it.eng.spago.base.SourceBeanException
Fills the response SourceBean with the elements that will be displayed in the Parameter detail page: the Parameter itself and the required ParameterUse.

Parameters:
response - The response SourceBean to be filled
parameter - The Parameter to be displayed
paruse - The ParameterUse to be displayed: if it is null the selected_paruse_idStr will be considered.
selected_paruse_idStr - The id of the ParameterUse to be displayed. If it is blank or null the first ParameterUse will be diplayed but in case the Parameter has no ParameterUse a new empty ParameterUse will be displayed. If it is "-1" a new empty ParameterUse will be displayed.
initialParameter - Boolean: if true the Parameter to be visualized is the initial Parameter and a clone will be put in session.
initialParameterUse - Boolean: if true the ParameterUse to be visualized is the initial ParameterUse and a clone will be put in session.
detail_mod - The modality
Throws:
EMFUserError
it.eng.spago.base.SourceBeanException

clone

private Parameter clone(Parameter parameter)

clone

private ParameterUse clone(ParameterUse paruse)

createNewParameterUse

private ParameterUse createNewParameterUse(java.lang.Integer parId)

modDetailParameter

private void modDetailParameter(it.eng.spago.base.SourceBean request,
                                java.lang.String mod,
                                it.eng.spago.base.SourceBean response)
                         throws EMFUserError,
                                it.eng.spago.base.SourceBeanException
Inserts/Modifies the detail of a parameter according to the user request. When a parameter is modified, the modifyParameter method is called; when a new parameter is added, the insertParametermethod is called. These two cases are differentiated by the mod String input value

Parameters:
request - The request information contained in a SourceBean Object
mod - A request string used to differentiate insert/modify operations
response - The response SourceBean
Throws:
EMFUserError - If an exception occurs
it.eng.spago.base.SourceBeanException - If a SourceBean exception occurs

reloadParuse

private ParameterUse reloadParuse(java.lang.Integer parIdInt,
                                  java.lang.String label)
                           throws it.eng.spago.error.EMFInternalError
Reload a ParameterUse from its Parameter id and its label.

Parameters:
parIdInt - The Parameter id
label - The ParameterUse label
Returns:
The reloaded ParameterUse
Throws:
it.eng.spago.error.EMFInternalError

reloadParameter

private Parameter reloadParameter(java.lang.String label)
                           throws it.eng.spago.error.EMFInternalError
Reload a Parameter from its label.

Parameters:
label - The Parameter label
Returns:
The reloaded Parameter
Throws:
it.eng.spago.error.EMFInternalError

recoverParameterUseDetails

private ParameterUse recoverParameterUseDetails(it.eng.spago.base.SourceBean request,
                                                java.lang.Integer parIdInt,
                                                java.lang.Integer paruseIdInt)
                                         throws java.lang.NumberFormatException,
                                                EMFUserError
Throws:
java.lang.NumberFormatException
EMFUserError

findParuseId

public int findParuseId(java.lang.Object paruseIdObj)

recoverParameterDetails

private Parameter recoverParameterDetails(it.eng.spago.base.SourceBean request,
                                          java.lang.String mod)

delDetailParameter

private void delDetailParameter(it.eng.spago.base.SourceBean request,
                                java.lang.String mod,
                                it.eng.spago.base.SourceBean response)
                         throws EMFUserError,
                                it.eng.spago.base.SourceBeanException
Deletes a parameter choosed by user from the parameters list.

Parameters:
request - The request SourceBean
mod - A request string used to differentiate delete operation
response - The response SourceBean
Throws:
EMFUserError - If an Exception occurs
it.eng.spago.base.SourceBeanException - If a SourceBean Exception occurs

newDetailParameter

private void newDetailParameter(it.eng.spago.base.SourceBean response)
                         throws EMFUserError
Instantiates a new Parameter object when a new parameter insertion is required, in order to prepare the page for the insertion.

Parameters:
response - The response SourceBean
Throws:
EMFUserError - If an Exception occurred

createNewParameter

private Parameter createNewParameter()
Create a new empty Parameter

Returns:
the new Parameter

loadValuesDomain

private void loadValuesDomain(it.eng.spago.base.SourceBean response)
                       throws EMFUserError
Loads all possible domain values which can be choosed for a parameter. Each of them is stored in a list of Domain objects put into response. When the isertion/modify parameters page is loaded, the user selects a domain value for the parameter by the Data Selection CD Check Button.

Parameters:
response - The response SourceBean
Throws:
EMFUserError - If an Exception occurred

parameterLabelControl

private void parameterLabelControl(Parameter parameter,
                                   java.lang.String operation)
                            throws EMFUserError
Controls if the name of the Parameter is already in use.

Parameters:
parameter - The Parameter to check
operation - Defines if the operation is of insertion or modify
Throws:
EMFUserError - If any Exception occurred

parameterUseLabelControl

private void parameterUseLabelControl(ParameterUse paruse,
                                      java.lang.String operation)
                               throws EMFUserError
Controls if the name of the ParameterUse is already in use.

Parameters:
paruse - The paruse to check
operation - Defines if the operation is of insertion or modify
Throws:
EMFUserError - If any Exception occurred

lookupLoadHandler

private void lookupLoadHandler(it.eng.spago.base.SourceBean request,
                               java.lang.String modality,
                               it.eng.spago.base.SourceBean response)
                        throws EMFUserError,
                               it.eng.spago.base.SourceBeanException
Throws:
EMFUserError
it.eng.spago.base.SourceBeanException

lookupReturnHandler

private void lookupReturnHandler(it.eng.spago.base.SourceBean request,
                                 it.eng.spago.base.SourceBean response)
                          throws it.eng.spago.base.SourceBeanException,
                                 EMFUserError
Throws:
it.eng.spago.base.SourceBeanException
EMFUserError

lookupReturnBackHandler

private void lookupReturnBackHandler(it.eng.spago.base.SourceBean request,
                                     it.eng.spago.base.SourceBean response)
                              throws it.eng.spago.base.SourceBeanException,
                                     EMFUserError
Throws:
it.eng.spago.base.SourceBeanException
EMFUserError

exitFromDetail

private void exitFromDetail(it.eng.spago.base.SourceBean request,
                            it.eng.spago.base.SourceBean response)
                     throws it.eng.spago.base.SourceBeanException
Clean the SessionContainer from no more useful objects.

Parameters:
request - The request SourceBean
response - The response SourceBean
Throws:
it.eng.spago.base.SourceBeanException