it.eng.spagobi.commons.services
Class DelegatedBasicListService

java.lang.Object
  extended by it.eng.spagobi.commons.services.DelegatedBasicListService
Direct Known Subclasses:
DelegatedHibernateConnectionListService

public class DelegatedBasicListService
extends java.lang.Object

Provides all methods to handle a list of objects. Its methods are called from a list module class to get the objects list.

Author:
sulis

Field Summary
static java.lang.String LIST_CURRENT
           
static java.lang.String LIST_DELETE
           
static java.lang.String LIST_FIRST
           
static java.lang.String LIST_LAST
           
static java.lang.String LIST_NEXT
           
static java.lang.String LIST_NOCACHE
           
static java.lang.String LIST_PAGE
           
static java.lang.String LIST_PREV
           
 
Constructor Summary
DelegatedBasicListService()
          Instantiates a new delegated basic list service.
 
Method Summary
static boolean delete(it.eng.spago.dispatching.service.ServiceIFace service, it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Function that controls if the deletion of a row in a DB table has success or not.
static java.lang.Object executeSelect(it.eng.spago.base.RequestContainer requestContainer, it.eng.spago.base.ResponseContainer responseContainer, java.lang.String pool, java.lang.String statement)
          Executes a select statement.
static it.eng.spago.paginator.basic.ListIFace filterList(it.eng.spago.paginator.basic.ListIFace list, java.util.List valuesfilter, java.lang.String valuetypefilter, java.lang.String columnfilter, java.lang.String typeFilter, it.eng.spago.error.EMFErrorHandler errorHandler)
          Filters the list with a list of filtering values.
static it.eng.spago.paginator.basic.ListIFace filterList(it.eng.spago.paginator.basic.ListIFace list, java.lang.String valuefilter, java.lang.String valuetypefilter, java.lang.String columnfilter, java.lang.String typeFilter, it.eng.spago.error.EMFErrorHandler errorHandler)
          Filters the list with a unique value filter.
static java.util.List filterList(java.util.List list, java.lang.String[] valuesfilter, java.lang.String valuetypefilter, java.lang.String columnfilter, java.lang.String typeFilter)
          Filters the list with a list of filtering values.
static java.util.List filterList(java.util.List list, java.lang.String valuefilter, java.lang.String valuetypefilter, java.lang.String columnfilter, java.lang.String typeFilter)
           
static it.eng.spago.base.SourceBean filterList(it.eng.spago.base.SourceBean allrowsSB, java.lang.String valuefilter, java.lang.String valuetypefilter, java.lang.String columnfilter, java.lang.String typeFilter, it.eng.spago.error.EMFErrorHandler errorHandler)
          Filters the list with a unique value filter.
static it.eng.spago.paginator.basic.ListIFace getList(it.eng.spago.dispatching.service.ServiceIFace service, it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          Gets the list for a particular SpagoBI object.
static java.lang.String getMessage(it.eng.spago.base.SourceBean request)
          Gets the information contained in a Source Bean attribute identified by the key "MESSAGE".
static void service(it.eng.spago.dispatching.service.ServiceIFace service, it.eng.spago.base.SourceBean request, it.eng.spago.base.SourceBean response)
          The service method for this class.
static java.util.Date toDate(java.lang.String dateStr, java.lang.String format)
          Converts a String representing a date into a Date object, given the date format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST_PAGE

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

LIST_FIRST

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

LIST_PREV

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

LIST_NEXT

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

LIST_LAST

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

LIST_CURRENT

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

LIST_NOCACHE

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

LIST_DELETE

public static final java.lang.String LIST_DELETE
See Also:
Constant Field Values
Constructor Detail

DelegatedBasicListService

public DelegatedBasicListService()
Instantiates a new delegated basic list service.

Method Detail

service

public static void service(it.eng.spago.dispatching.service.ServiceIFace service,
                           it.eng.spago.base.SourceBean request,
                           it.eng.spago.base.SourceBean response)
                    throws java.lang.Exception
The service method for this class.

Parameters:
service - The service interface object
request - The request Source Bean
response - The response Source Bean
Throws:
java.lang.Exception - If any Exception occurred

getList

public static it.eng.spago.paginator.basic.ListIFace getList(it.eng.spago.dispatching.service.ServiceIFace service,
                                                             it.eng.spago.base.SourceBean request,
                                                             it.eng.spago.base.SourceBean response)
                                                      throws java.lang.Exception
Gets the list for a particular SpagoBI object.

Parameters:
service - The service interface object
request - The request Source Bean
response - The response Source Bean
Returns:
the list
Throws:
java.lang.Exception - If any exception occurred

filterList

public static it.eng.spago.paginator.basic.ListIFace filterList(it.eng.spago.paginator.basic.ListIFace list,
                                                                java.util.List valuesfilter,
                                                                java.lang.String valuetypefilter,
                                                                java.lang.String columnfilter,
                                                                java.lang.String typeFilter,
                                                                it.eng.spago.error.EMFErrorHandler errorHandler)
Filters the list with a list of filtering values.

Parameters:
list - The list to be filtered
valuesfilter - The list of filtering values
valuetypefilter - The type of the value of the filter (STRING/NUM/DATE)
columnfilter - The column to be filtered
typeFilter - The type of the filter
errorHandler - The EMFErrorHandler object, in which errors are stored if they occurs
Returns:
the filtered list

filterList

public static it.eng.spago.base.SourceBean filterList(it.eng.spago.base.SourceBean allrowsSB,
                                                      java.lang.String valuefilter,
                                                      java.lang.String valuetypefilter,
                                                      java.lang.String columnfilter,
                                                      java.lang.String typeFilter,
                                                      it.eng.spago.error.EMFErrorHandler errorHandler)
Filters the list with a unique value filter.

Parameters:
list - The list to be filtered
valuefilter - The value of the filter
valuetypefilter - The type of the value of the filter (STRING/NUM/DATE)
columnfilter - The column to be filtered
typeFilter - The type of the filter
errorHandler - The EMFErrorHandler object, in which errors are stored if they occurs
Returns:
the filtered list

filterList

public static it.eng.spago.paginator.basic.ListIFace filterList(it.eng.spago.paginator.basic.ListIFace list,
                                                                java.lang.String valuefilter,
                                                                java.lang.String valuetypefilter,
                                                                java.lang.String columnfilter,
                                                                java.lang.String typeFilter,
                                                                it.eng.spago.error.EMFErrorHandler errorHandler)
Filters the list with a unique value filter.

Parameters:
list - The list to be filtered
valuefilter - The value of the filter
valuetypefilter - The type of the value of the filter (STRING/NUM/DATE)
columnfilter - The column to be filtered
typeFilter - The type of the filter
errorHandler - The EMFErrorHandler object, in which errors are stored if they occurs
Returns:
the filtered list

filterList

public static java.util.List filterList(java.util.List list,
                                        java.lang.String[] valuesfilter,
                                        java.lang.String valuetypefilter,
                                        java.lang.String columnfilter,
                                        java.lang.String typeFilter)
Filters the list with a list of filtering values.

Parameters:
list - The list to be filtered
valuesfilter - The list of filtering values
valuetypefilter - The type of the value of the filter (STRING/NUM/DATE)
columnfilter - The column to be filtered
typeFilter - The type of the filter
errorHandler - The EMFErrorHandler object, in which errors are stored if they occurs
Returns:
the filtered list

filterList

public static java.util.List filterList(java.util.List list,
                                        java.lang.String valuefilter,
                                        java.lang.String valuetypefilter,
                                        java.lang.String columnfilter,
                                        java.lang.String typeFilter)

toDate

public static java.util.Date toDate(java.lang.String dateStr,
                                    java.lang.String format)
                             throws java.lang.Exception
Converts a String representing a date into a Date object, given the date format.

Parameters:
dateStr - The String representing the date
format - The date format
Returns:
the relevant Date object
Throws:
java.lang.Exception - if any parsing exception occurs

executeSelect

public static java.lang.Object executeSelect(it.eng.spago.base.RequestContainer requestContainer,
                                             it.eng.spago.base.ResponseContainer responseContainer,
                                             java.lang.String pool,
                                             java.lang.String statement)
                                      throws it.eng.spago.error.EMFInternalError
Executes a select statement.

Parameters:
requestContainer - The request container object
responseContainer - The response container object
pool - The pool definition string
statement - The statement definition string
Returns:
A generic object containing the Execution results
Throws:
it.eng.spago.error.EMFInternalError - the EMF internal error

delete

public static boolean delete(it.eng.spago.dispatching.service.ServiceIFace service,
                             it.eng.spago.base.SourceBean request,
                             it.eng.spago.base.SourceBean response)
Function that controls if the deletion of a row in a DB table has success or not.

Parameters:
service - The service interface object
request - The request Source Bean
response - The response SourceBean
Returns:
Boolean true (succeeded) or false (not succeeded)

getMessage

public static java.lang.String getMessage(it.eng.spago.base.SourceBean request)
Gets the information contained in a Source Bean attribute identified by the key "MESSAGE".

Parameters:
request - The input Source Bean
Returns:
the message