it.eng.spagobi.behaviouralmodel.lov.bo
Class QueryDetail

java.lang.Object
  extended by it.eng.spagobi.behaviouralmodel.lov.bo.QueryDetail
All Implemented Interfaces:
ILovDetail, java.io.Serializable

public class QueryDetail
extends java.lang.Object
implements ILovDetail

Defines the QueryDetail objects. This object is used to store Query Wizard detail information.

See Also:
Serialized Form

Field Summary
static java.lang.String DIALECT_HSQL
           
static java.lang.String DIALECT_INGRES
           
static java.lang.String DIALECT_MYSQL
           
static java.lang.String DIALECT_ORACLE
           
static java.lang.String DIALECT_ORACLE9i10g
           
static java.lang.String DIALECT_POSTGRES
           
static java.lang.String DIALECT_SQLSERVER
           
 
Constructor Summary
QueryDetail()
          constructor.
QueryDetail(java.lang.String dataDefinition)
          constructor.
 
Method Summary
 QueryDetail clone()
           
static QueryDetail fromXML(java.lang.String dataDefinition)
          Splits an XML string by using some SourceBean object methods in order to obtain the source QueryDetail objects whom XML has been built.
 java.lang.String getDataSource()
          Gets the data source.
 java.lang.String getDescriptionColumnName()
          Gets the description column name.
 java.util.List getInvisibleColumnNames()
          Gets the invisible column names.
 java.lang.String getLovResult(it.eng.spago.security.IEngUserProfile profile, java.util.List<ObjParuse> dependencies, ExecutionInstance executionInstance)
          Returns the result of the lov for a given user and for a particular execution instance with the given dependencies (optional).
 java.util.List getProfileAttributeNames()
          Gets the list of names of the profile attributes required.
 java.lang.String getQueryDefinition()
          Gets the query definition.
 java.lang.String getValueColumnName()
          Gets the value column name.
 java.util.List getVisibleColumnNames()
          Gets the visible column names.
 java.lang.String getWrappedStatement(java.util.List<ObjParuse> dependencies, ExecutionInstance executionInstance)
          This methods builds the in-line view that filters the original lov using the dependencies.
 void loadFromXML(java.lang.String dataDefinition)
          loads the lov from an xml string.
 boolean requireProfileAttributes()
          Checks if the lov requires one or more profile attributes.
 void setDataSource(java.lang.String dataSource)
          Sets the data source.
 void setDescriptionColumnName(java.lang.String descriptionColumnName)
          Sets the description column name.
 void setInvisibleColumnNames(java.util.List invisibleColumnNames)
          Sets the invisible column names.
 void setQueryDefinition(java.lang.String queryDefinition)
          Sets the query definition.
 void setValueColumnName(java.lang.String valueColumnName)
          Sets the value column name.
 void setVisibleColumnNames(java.util.List visibleColumnNames)
          Sets the visible column names.
 java.lang.String toXML()
          serialize the lov to an xml string.
 java.util.List validateValues(it.eng.spago.security.IEngUserProfile profile, BIObjectParameter biparam)
          This methods find out if the input parameters' values are admissible for this QueryDetail instance, i.e.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIALECT_MYSQL

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

DIALECT_POSTGRES

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

DIALECT_ORACLE

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

DIALECT_HSQL

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

DIALECT_ORACLE9i10g

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

DIALECT_SQLSERVER

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

DIALECT_INGRES

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

QueryDetail

public QueryDetail()
constructor.


QueryDetail

public QueryDetail(java.lang.String dataDefinition)
            throws it.eng.spago.base.SourceBeanException
constructor.

Parameters:
dataDefinition - the xml representation of the lov
Throws:
it.eng.spago.base.SourceBeanException - the source bean exception
Method Detail

loadFromXML

public void loadFromXML(java.lang.String dataDefinition)
                 throws it.eng.spago.base.SourceBeanException
loads the lov from an xml string.

Specified by:
loadFromXML in interface ILovDetail
Parameters:
dataDefinition - the xml definition of the lov
Throws:
it.eng.spago.base.SourceBeanException - the source bean exception

toXML

public java.lang.String toXML()
serialize the lov to an xml string.

Specified by:
toXML in interface ILovDetail
Returns:
the serialized xml string

getLovResult

public java.lang.String getLovResult(it.eng.spago.security.IEngUserProfile profile,
                                     java.util.List<ObjParuse> dependencies,
                                     ExecutionInstance executionInstance)
                              throws java.lang.Exception
Description copied from interface: ILovDetail
Returns the result of the lov for a given user and for a particular execution instance with the given dependencies (optional).

Specified by:
getLovResult in interface ILovDetail
Parameters:
profile - the profile of the user
dependencies - the dependencies to be considered for the lov. It may be null, since when testing a lov, there is no correlation.
executionInstance - the execution instance object, that contains the BIObject being executed. It may be null, since when testing a lov, there is no execution instance.
Returns:
the string result of the lov
Throws:
java.lang.Exception - the exception
See Also:
throws Exception;

getWrappedStatement

public java.lang.String getWrappedStatement(java.util.List<ObjParuse> dependencies,
                                            ExecutionInstance executionInstance)
This methods builds the in-line view that filters the original lov using the dependencies. For example, suppose the lov definition is SELECT country, state_province, city FROM REGION and there is a dependency that set country to be "USA", this method returns SELECT * FROM (SELECT country, state_province, city FROM REGION) T WHERE ( country = 'USA' )

Parameters:
dependencies - The dependencies' configuration to be considered into the query
executionInstance - The execution instance (useful to retrieve dependencies values)
Returns:
the in-line view that filters the original lov using the dependencies.

validateValues

public java.util.List validateValues(it.eng.spago.security.IEngUserProfile profile,
                                     BIObjectParameter biparam)
                              throws java.lang.Exception
This methods find out if the input parameters' values are admissible for this QueryDetail instance, i.e. if the values are contained in the query result.

Parameters:
profile - The user profile
biparam - The BIObjectParameter with the values that must be validated
Returns:
a list of errors: it is empty if all values are admissible, otherwise it will contain a EMFUserError for each wrong value
Throws:
java.lang.Exception

getProfileAttributeNames

public java.util.List getProfileAttributeNames()
                                        throws java.lang.Exception
Gets the list of names of the profile attributes required.

Specified by:
getProfileAttributeNames in interface ILovDetail
Returns:
list of profile attribute names
Throws:
java.lang.Exception - the exception

requireProfileAttributes

public boolean requireProfileAttributes()
                                 throws java.lang.Exception
Checks if the lov requires one or more profile attributes.

Specified by:
requireProfileAttributes in interface ILovDetail
Returns:
true if the lov require one or more profile attributes, false otherwise
Throws:
java.lang.Exception - the exception

fromXML

public static QueryDetail fromXML(java.lang.String dataDefinition)
                           throws it.eng.spago.base.SourceBeanException
Splits an XML string by using some SourceBean object methods in order to obtain the source QueryDetail objects whom XML has been built.

Parameters:
dataDefinition - The XML input String
Returns:
The corrispondent QueryDetail object
Throws:
it.eng.spago.base.SourceBeanException - If a SourceBean Exception occurred

getDataSource

public java.lang.String getDataSource()
Gets the data source.

Returns:
the data source

setDataSource

public void setDataSource(java.lang.String dataSource)
Sets the data source.

Parameters:
dataSource - the new data source

getQueryDefinition

public java.lang.String getQueryDefinition()
Gets the query definition.

Returns:
the query definition

setQueryDefinition

public void setQueryDefinition(java.lang.String queryDefinition)
Sets the query definition.

Parameters:
queryDefinition - the new query definition

getDescriptionColumnName

public java.lang.String getDescriptionColumnName()
Description copied from interface: ILovDetail
Gets the description column name.

Specified by:
getDescriptionColumnName in interface ILovDetail
Returns:
the description column name

setDescriptionColumnName

public void setDescriptionColumnName(java.lang.String descriptionColumnName)
Description copied from interface: ILovDetail
Sets the description column name.

Specified by:
setDescriptionColumnName in interface ILovDetail
Parameters:
descriptionColumnName - the new description column name

getInvisibleColumnNames

public java.util.List getInvisibleColumnNames()
Description copied from interface: ILovDetail
Gets the invisible column names.

Specified by:
getInvisibleColumnNames in interface ILovDetail
Returns:
the invisible column names

setInvisibleColumnNames

public void setInvisibleColumnNames(java.util.List invisibleColumnNames)
Description copied from interface: ILovDetail
Sets the invisible column names.

Specified by:
setInvisibleColumnNames in interface ILovDetail
Parameters:
invisibleColumnNames - the new invisible column names

getValueColumnName

public java.lang.String getValueColumnName()
Description copied from interface: ILovDetail
Gets the value column name.

Specified by:
getValueColumnName in interface ILovDetail
Returns:
the value column name

setValueColumnName

public void setValueColumnName(java.lang.String valueColumnName)
Description copied from interface: ILovDetail
Sets the value column name.

Specified by:
setValueColumnName in interface ILovDetail
Parameters:
valueColumnName - the new value column name

getVisibleColumnNames

public java.util.List getVisibleColumnNames()
Description copied from interface: ILovDetail
Gets the visible column names.

Specified by:
getVisibleColumnNames in interface ILovDetail
Returns:
the visible column names

setVisibleColumnNames

public void setVisibleColumnNames(java.util.List visibleColumnNames)
Description copied from interface: ILovDetail
Sets the visible column names.

Specified by:
setVisibleColumnNames in interface ILovDetail
Parameters:
visibleColumnNames - the new visible column names

clone

public QueryDetail clone()
Overrides:
clone in class java.lang.Object