it.eng.spagobi.bo.dao.jdbc
Class LowFunctionalityDAOImpl

java.lang.Object
  extended by it.eng.spagobi.bo.dao.jdbc.AbstractJdbcDAO
      extended by it.eng.spagobi.bo.dao.jdbc.LowFunctionalityDAOImpl
All Implemented Interfaces:
ILowFunctionalityDAO

public class LowFunctionalityDAOImpl
extends AbstractJdbcDAO
implements ILowFunctionalityDAO

Defines the JDBC implementations for all DAO methods, for a low functionality.

Author:
zoppello

Constructor Summary
LowFunctionalityDAOImpl()
           
 
Method Summary
 void deleteInconsistentRoles(java.util.Set set)
           
 void eraseLowFunctionality(LowFunctionality aLowFunctionality, it.eng.spago.security.IEngUserProfile profile)
          Implements the query to erase a low functionality.
 java.lang.Integer existByCode(java.lang.String code)
          Control if exist a functionality with the given code
 void fillRoles(LowFunctionality aLowFunctionality)
          Sets the roles for a given low functionality.
 boolean hasChild(java.lang.Integer id)
          Control if the functionality with the given id has childs
 boolean hasChild(java.lang.String path)
           
 void insertLowFunctionality(LowFunctionality aLowFunctionality, it.eng.spago.security.IEngUserProfile profile)
          Implements the query to insert a low functionality.
private  void insertRolesFunctionality(it.eng.spago.dbaccess.sql.DataConnection dataConnection, LowFunctionality aLowFunctionality, java.lang.String strSql, Role[] roles, java.lang.String state)
          It is the implementation code for a DB insertion.
 java.util.List loadAllLowFunctionalities()
           
 java.util.List loadAllLowFunctionalities(boolean recoverBIObjects)
          Loads all the functionalities
 java.util.List loadChildFunctionalities(java.lang.Integer parentId, boolean recoverBIObjects)
          Loads all the child functionalities of the given parent functionality
 LowFunctionality loadLowFunctionalityByID(java.lang.Integer functionalityID)
           
 LowFunctionality loadLowFunctionalityByID(java.lang.Integer functionalityID, boolean recoverBIObjects)
          Loads all information for a low functionality identified by its functionalityID.
 LowFunctionality loadLowFunctionalityByPath(java.lang.String functionalityPath)
           
 LowFunctionality loadLowFunctionalityByPath(java.lang.String functionalityPath, boolean recoverBIObjects)
          Loads all information for a low functionality identified by its functionalityPath.
 LowFunctionality loadRootFunctionality()
           
 java.util.List loadSubLowFunctionalities(java.lang.String initialPath)
           
 java.util.List loadSubLowFunctionalities(java.lang.String initialPath, boolean recoverBIObjects)
          Loads all the sub functionalities of the given initial path
 void modifyLowFunctionality(LowFunctionality aLowFunctionality)
          Implements the query to modify a low functionality.
 
Methods inherited from class it.eng.spagobi.bo.dao.jdbc.AbstractJdbcDAO
getConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LowFunctionalityDAOImpl

public LowFunctionalityDAOImpl()
Method Detail

loadLowFunctionalityByID

public LowFunctionality loadLowFunctionalityByID(java.lang.Integer functionalityID)
                                          throws EMFUserError
Throws:
EMFUserError
See Also:
it.eng.spagobi.bo.dao.ILowFunctionalityDAO#loadLowFunctionalityByID(java.lang.Integer)

loadLowFunctionalityByPath

public LowFunctionality loadLowFunctionalityByPath(java.lang.String functionalityPath)
                                            throws EMFUserError
Throws:
EMFUserError
See Also:
it.eng.spagobi.bo.dao.ILowFunctionalityDAO#loadLowFunctionalityByPath(java.lang.String)

fillRoles

public void fillRoles(LowFunctionality aLowFunctionality)
               throws EMFUserError
Sets the roles for a given low functionality.

Parameters:
aLowFunctionality - The input Low Functionality
Throws:
EMFUserError - If any exception occurred

modifyLowFunctionality

public void modifyLowFunctionality(LowFunctionality aLowFunctionality)
                            throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Implements the query to modify a low functionality. All information needed is stored into the input LowFunctionality object.

Specified by:
modifyLowFunctionality in interface ILowFunctionalityDAO
Parameters:
aLowFunctionality - The object containing all modify information
Throws:
EMFUserError - If an Exception occurred
See Also:
ILowFunctionalityDAO.modifyLowFunctionality(it.eng.spagobi.bo.LowFunctionality)

insertRolesFunctionality

private void insertRolesFunctionality(it.eng.spago.dbaccess.sql.DataConnection dataConnection,
                                      LowFunctionality aLowFunctionality,
                                      java.lang.String strSql,
                                      Role[] roles,
                                      java.lang.String state)
                               throws java.lang.Exception
It is the implementation code for a DB insertion. All row inserted match a functionality with its roles and states.

Parameters:
dataConnection - The Data Connection object
aLowFunctionality - The low functionality object
strSql - The SQL code string
roles - The list of all roles associated
state - The String defining the state
Throws:
java.lang.Exception - If any exception occurred

insertLowFunctionality

public void insertLowFunctionality(LowFunctionality aLowFunctionality,
                                   it.eng.spago.security.IEngUserProfile profile)
                            throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Implements the query to insert a low functionality. All information needed is stored into the input LowFunctionality object.

Specified by:
insertLowFunctionality in interface ILowFunctionalityDAO
Parameters:
aLowFunctionality - The object containing all insert information
Throws:
EMFUserError - If an Exception occurred
See Also:
)

eraseLowFunctionality

public void eraseLowFunctionality(LowFunctionality aLowFunctionality,
                                  it.eng.spago.security.IEngUserProfile profile)
                           throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Implements the query to erase a low functionality. All information needed is stored into the input LowFunctionality object.

Specified by:
eraseLowFunctionality in interface ILowFunctionalityDAO
Parameters:
aLowFunctionality - The object containing all erase information
Throws:
EMFUserError - If an Exception occurred
See Also:
ILowFunctionalityDAO.eraseLowFunctionality(it.eng.spagobi.bo.LowFunctionality, it.eng.spago.security.IEngUserProfile)

existByCode

public java.lang.Integer existByCode(java.lang.String code)
                              throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Control if exist a functionality with the given code

Specified by:
existByCode in interface ILowFunctionalityDAO
Parameters:
code - The code of the functionality
Returns:
The functionality ID
Throws:
EMFUserError
See Also:
ILowFunctionalityDAO.existByCode(java.lang.String)

hasChild

public boolean hasChild(java.lang.String path)
                 throws EMFUserError
Throws:
EMFUserError
See Also:
it.eng.spagobi.bo.dao.ILowFunctionalityDAO#hasChild(java.lang.String)

deleteInconsistentRoles

public void deleteInconsistentRoles(java.util.Set set)
                             throws EMFUserError
Specified by:
deleteInconsistentRoles in interface ILowFunctionalityDAO
Throws:
EMFUserError

hasChild

public boolean hasChild(java.lang.Integer id)
                 throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Control if the functionality with the given id has childs

Specified by:
hasChild in interface ILowFunctionalityDAO
Parameters:
id - Integer id of the functionality
Throws:
EMFUserError

loadAllLowFunctionalities

public java.util.List loadAllLowFunctionalities()
                                         throws EMFUserError
Throws:
EMFUserError

loadSubLowFunctionalities

public java.util.List loadSubLowFunctionalities(java.lang.String initialPath)
                                         throws EMFUserError
Throws:
EMFUserError

loadAllLowFunctionalities

public java.util.List loadAllLowFunctionalities(boolean recoverBIObjects)
                                         throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all the functionalities

Specified by:
loadAllLowFunctionalities in interface ILowFunctionalityDAO
Parameters:
recoverBIObjects - If true each LowFunctionality at output will have the list of contained BIObject objects
Returns:
the list of functionalities
Throws:
EMFUserError

loadSubLowFunctionalities

public java.util.List loadSubLowFunctionalities(java.lang.String initialPath,
                                                boolean recoverBIObjects)
                                         throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all the sub functionalities of the given initial path

Specified by:
loadSubLowFunctionalities in interface ILowFunctionalityDAO
Parameters:
initialPath - The String representing the initial path
recoverBIObjects - If true each LowFunctionality at output will have the list of contained BIObject objects
Returns:
the list of functionalities
Throws:
EMFUserError

loadChildFunctionalities

public java.util.List loadChildFunctionalities(java.lang.Integer parentId,
                                               boolean recoverBIObjects)
                                        throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all the child functionalities of the given parent functionality

Specified by:
loadChildFunctionalities in interface ILowFunctionalityDAO
Parameters:
parentId - The Integer representing the parent id
recoverBIObjects - If true each LowFunctionality at output will have the list of contained BIObject objects
Returns:
the list of functionalities
Throws:
EMFUserError

loadLowFunctionalityByID

public LowFunctionality loadLowFunctionalityByID(java.lang.Integer functionalityID,
                                                 boolean recoverBIObjects)
                                          throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all information for a low functionality identified by its functionalityID. All these information, are stored into a LowFunctionality object, which is returned.

Specified by:
loadLowFunctionalityByID in interface ILowFunctionalityDAO
Parameters:
functionalityID - The id for the low functionality to load
recoverBIObjects - If true the LowFunctionality at output will have the list of contained BIObject objects
Returns:
A LowFunctionality object containing all loaded information
Throws:
EMFUserError - If an Exception occurred

loadLowFunctionalityByPath

public LowFunctionality loadLowFunctionalityByPath(java.lang.String functionalityPath,
                                                   boolean recoverBIObjects)
                                            throws EMFUserError
Description copied from interface: ILowFunctionalityDAO
Loads all information for a low functionality identified by its functionalityPath. All these information, are stored into a LowFunctionality object, which is returned.

Specified by:
loadLowFunctionalityByPath in interface ILowFunctionalityDAO
Parameters:
functionalityPath - The path for the low functionality to load
recoverBIObjects - If true the LowFunctionality at output will have the list of contained BIObject objects
Returns:
A LowFunctionality object containing all loaded information
Throws:
EMFUserError - If an Exception occurred

loadRootFunctionality

public LowFunctionality loadRootFunctionality()
                                       throws EMFUserError
Throws:
EMFUserError