it.eng.spagobi.services.modules
Class DetailBIObjectModule

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.DetailBIObjectModule
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 DetailBIObjectModule
extends it.eng.spago.dispatching.module.AbstractModule

Implements a module which handles all BI objects management: has methods for BI Objects 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
private  java.lang.String actor
           
private  it.eng.spago.error.EMFErrorHandler errorHandler
           
static java.lang.String MODULE_PAGE
           
static java.lang.String NAME_ATTR_LIST_ENGINES
           
static java.lang.String NAME_ATTR_LIST_OBJ_TYPES
           
static java.lang.String NAME_ATTR_LIST_STATES
           
static java.lang.String NAME_ATTR_OBJECT
           
static java.lang.String NAME_ATTR_OBJECT_PAR
           
protected  it.eng.spago.security.IEngUserProfile profile
           
(package private)  it.eng.spago.base.SessionContainer session
           
 
Constructor Summary
DetailBIObjectModule()
           
 
Method Summary
private  void checkForDependancies(java.lang.Integer objParFatherId)
          Controls if there are some BIObjectParameter objects that depend by the BIObjectParameter object at input, given its id.
private  BIObject clone(BIObject obj)
           
private  BIObjectParameter clone(BIObjectParameter biObjPar)
           
private  BIObjectParameter createNewBIObjectParameter(java.lang.Integer objId)
           
private  void delateLoopbackContext()
           
private  void delDetailObject(it.eng.spago.base.SourceBean request, java.lang.String mod, it.eng.spago.base.SourceBean response)
          Deletes a BI Object choosed by user.
 void eraseVersion(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
           
private  void exitFromDetail(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Clean the SessionContainer from no more useful objects.
 void fillRequestContainer(it.eng.spago.base.SourceBean request, it.eng.spago.error.EMFErrorHandler errorHandler)
          Fills the request container object with some BIObject and BIObjectParameter information contained into the request Source Bean (they are all attributes).
private  void fillResponse(it.eng.spago.base.SourceBean response)
          Fills the response SourceBean with some needed BI Objects information.
 int findBIObjParId(java.lang.Object objParIdObj)
           
private  java.lang.Integer getBIObjectIdFromLoopbackContext()
           
private  void getDetailObject(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Gets the detail of a BI object choosed by the user from the BI objects list.
 void init(it.eng.spago.base.SourceBean config)
           
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 modBIObject(it.eng.spago.base.SourceBean request, java.lang.String mod, it.eng.spago.base.SourceBean response)
          Inserts/Modifies the detail of a BI Object according to the user request.
private  void newBIObject(it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Instantiates a new BIObject object when a new BI object insertion is required, in order to prepare the page for the insertion.
private  void prepareBIObjectDetailPage(it.eng.spago.base.SourceBean response, BIObject obj, BIObjectParameter biObjPar, java.lang.String selectedObjParIdStr, java.lang.String detail_mod, boolean initialBIObject, boolean initialBIObjectParameter)
          Fills the response SourceBean with the elements that will be displayed in the BIObject detail page: the BIObject itself and the required BIObjectParameter.
private  BIObject recoverBIObjectDetails(it.eng.spago.base.SourceBean request, java.lang.String mod)
           
private  BIObjectParameter recoverBIObjectParameterDetails(it.eng.spago.base.SourceBean request, java.lang.Integer biobjIdInt)
           
private  BIObjectParameter reloadBIObjectParameter(java.lang.Integer objId, java.lang.String objParUrlName)
           
private  void reloadCMSInformation(BIObject obj)
          Reloads the CMS information of a BIObject: the versioned templates.
 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.
private  void setLoopbackContext(it.eng.spago.base.SourceBean request, java.lang.String message)
           
private  void startLinksLookupHandler(it.eng.spago.base.SourceBean request, java.lang.String message, it.eng.spago.base.SourceBean response)
           
private  void startParametersLookupHandler(it.eng.spago.base.SourceBean request, java.lang.String message, it.eng.spago.base.SourceBean response)
           
private  void urlNameControl(java.lang.Integer objId, BIObjectParameter biObjPar)
          Controls that the BIObjectParameter url name is not in use by another BIObjectParameter
 
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

MODULE_PAGE

public static final java.lang.String MODULE_PAGE
See Also:
Constant Field Values

NAME_ATTR_OBJECT

public static final java.lang.String NAME_ATTR_OBJECT
See Also:
Constant Field Values

NAME_ATTR_LIST_OBJ_TYPES

public static final java.lang.String NAME_ATTR_LIST_OBJ_TYPES
See Also:
Constant Field Values

NAME_ATTR_LIST_ENGINES

public static final java.lang.String NAME_ATTR_LIST_ENGINES
See Also:
Constant Field Values

NAME_ATTR_LIST_STATES

public static final java.lang.String NAME_ATTR_LIST_STATES
See Also:
Constant Field Values

NAME_ATTR_OBJECT_PAR

public static final java.lang.String NAME_ATTR_OBJECT_PAR
See Also:
Constant Field Values

actor

private java.lang.String actor

errorHandler

private it.eng.spago.error.EMFErrorHandler errorHandler

profile

protected it.eng.spago.security.IEngUserProfile profile

session

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

DetailBIObjectModule

public DetailBIObjectModule()
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

setLoopbackContext

private void setLoopbackContext(it.eng.spago.base.SourceBean request,
                                java.lang.String message)
                         throws EMFUserError
Throws:
EMFUserError

delateLoopbackContext

private void delateLoopbackContext()

getBIObjectIdFromLoopbackContext

private java.lang.Integer getBIObjectIdFromLoopbackContext()

startParametersLookupHandler

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

startLinksLookupHandler

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

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

lookupReturnHandler

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

getDetailObject

private void getDetailObject(it.eng.spago.base.SourceBean request,
                             it.eng.spago.base.SourceBean response)
                      throws EMFUserError
Gets the detail of a BI object choosed by the user from the BI objects list. It reaches the key from the request and asks to the DB all detail BI objects information, by calling the method loadBIObjectForDetail.

Parameters:
request - The request Source Bean
response - The response Source Bean
Throws:
EMFUserError - If an exception occurs

modBIObject

private void modBIObject(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 BI Object according to the user request. When a BI Object is modified, the modifyBIObject method is called; when a new BI Object is added, the insertBIObjectmethod 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

checkForDependancies

private void checkForDependancies(java.lang.Integer objParFatherId)
                           throws EMFUserError
Controls if there are some BIObjectParameter objects that depend by the BIObjectParameter object at input, given its id.

Parameters:
objParFatherId - The id of the BIObjectParameter object to check
Throws:
EMFUserError

urlNameControl

private void urlNameControl(java.lang.Integer objId,
                            BIObjectParameter biObjPar)
Controls that the BIObjectParameter url name is not in use by another BIObjectParameter

Parameters:
objId - The id of the document
biObjPar - The BIObjectParameter to control before inserting/modifying

reloadBIObjectParameter

private BIObjectParameter reloadBIObjectParameter(java.lang.Integer objId,
                                                  java.lang.String objParUrlName)
                                           throws it.eng.spago.error.EMFInternalError,
                                                  EMFUserError
Throws:
it.eng.spago.error.EMFInternalError
EMFUserError

reloadCMSInformation

private void reloadCMSInformation(BIObject obj)
                           throws EMFUserError
Reloads the CMS information of a BIObject: the versioned templates. Changes the current version template if it is required but without writing on CMS. Other details remain unchanged.

Parameters:
obj - THe BIObject that will be filled with its own CMS information.
Throws:
EMFUserError

prepareBIObjectDetailPage

private void prepareBIObjectDetailPage(it.eng.spago.base.SourceBean response,
                                       BIObject obj,
                                       BIObjectParameter biObjPar,
                                       java.lang.String selectedObjParIdStr,
                                       java.lang.String detail_mod,
                                       boolean initialBIObject,
                                       boolean initialBIObjectParameter)
                                throws it.eng.spago.base.SourceBeanException,
                                       EMFUserError
Fills the response SourceBean with the elements that will be displayed in the BIObject detail page: the BIObject itself and the required BIObjectParameter.

Parameters:
response - The response SourceBean to be filled
obj - The BIObject to be displayed
biObjPar - The BIObjectParameter to be displayed: if it is null the selectedObjParIdStr will be considered.
selectedObjParIdStr - The id of the BIObjectParameter to be displayed. If it is blank or null the first BIObjectParameter will be diplayed but in case the BIObject has no BIObjectParameter a new empty BIObjectParameter will be displayed. If it is "-1" a new empty BIObjectParameter will be displayed.
detail_mod - The modality
initialBIObject - Boolean: if true the BIObject to be visualized is the initial BIObject and a clone will be put in session.
initialBIObjectParameter - Boolean: if true the BIObjectParameter to be visualized is the initial BIObjectParameter and a clone will be put in session.
Throws:
it.eng.spago.base.SourceBeanException
EMFUserError

clone

private BIObjectParameter clone(BIObjectParameter biObjPar)

clone

private BIObject clone(BIObject obj)

recoverBIObjectParameterDetails

private BIObjectParameter recoverBIObjectParameterDetails(it.eng.spago.base.SourceBean request,
                                                          java.lang.Integer biobjIdInt)

createNewBIObjectParameter

private BIObjectParameter createNewBIObjectParameter(java.lang.Integer objId)
                                              throws EMFUserError
Throws:
EMFUserError

recoverBIObjectDetails

private BIObject recoverBIObjectDetails(it.eng.spago.base.SourceBean request,
                                        java.lang.String mod)
                                 throws EMFUserError
Throws:
EMFUserError

findBIObjParId

public int findBIObjParId(java.lang.Object objParIdObj)

delDetailObject

private void delDetailObject(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 BI Object choosed by user. If the folder id is specified, it deletes only the instance of the object in that folder. If the folder id is not specified: if the user is an administrator the object is deleted from all the folders, else it is deleted from the folder on which the user is a developer.

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

newBIObject

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

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

fillResponse

private void fillResponse(it.eng.spago.base.SourceBean response)
Fills the response SourceBean with some needed BI Objects information.

Parameters:
response - The SourceBean to fill

fillRequestContainer

public void fillRequestContainer(it.eng.spago.base.SourceBean request,
                                 it.eng.spago.error.EMFErrorHandler errorHandler)
                          throws java.lang.Exception
Fills the request container object with some BIObject and BIObjectParameter information contained into the request Source Bean (they are all attributes). It is useful for validation process.

Parameters:
request - The request Source Bean
Throws:
it.eng.spago.base.SourceBeanException - If any exception occurred
java.lang.Exception

eraseVersion

public void eraseVersion(it.eng.spago.base.SourceBean request,
                         it.eng.spago.base.SourceBean response)
                  throws EMFUserError
Throws:
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