it.eng.spagobi.tools.distributionlist.dao
Class DistributionListDaoImpl

java.lang.Object
  extended by it.eng.spagobi.commons.dao.AbstractHibernateDAO
      extended by it.eng.spagobi.tools.distributionlist.dao.DistributionListDaoImpl
All Implemented Interfaces:
ISpagoBIDao, IDistributionListDAO

public class DistributionListDaoImpl
extends AbstractHibernateDAO
implements IDistributionListDAO

Author:
Chiarelli Chiara (chiara.chiarelli@eng.it)

Constructor Summary
DistributionListDaoImpl()
           
 
Method Summary
 void eraseAllRelatedDistributionListObjects(java.lang.String triggername)
          Implements the query to erase all distribution list objects with the related triggername.
 void eraseDistributionList(DistributionList aDistributionList)
          Implements the query to erase a distribution list.
 void eraseDistributionListObjects(DistributionList dl, int biobId, java.lang.String triggername)
          Implements the query to erase distribution list objects.
 java.util.List getXmlRelated(DistributionList dl, int objId)
          Returns a list of the Xmls related to the specified Distribution List and the specified Document.
 boolean hasBIObjAssociated(java.lang.String dlId)
          Tells if a distribution list is associated to any BI Object.
 void insertDistributionList(DistributionList aDistributionList)
          Implements the query to insert a distribution list.
 void insertDLforDocument(DistributionList dl, int objId, java.lang.String xml)
          Inserts the document with id objId in the list of documents for the DIstributionList dl with the xml of its schedulation.
 boolean isDocScheduleAlreadyLinkedToDL(DistributionList dl, int objId, java.lang.String xml)
          Verifies if the document with id objId is already in the list of documents for the DIstributionList dl with the xml of its schedulation.
 boolean isDocScheduledInOtherTime(DistributionList dl, int objId, java.lang.String xml)
          Verifies if the document with id objId is already in the list of documents for the DIstributionList dl with another xml of schedulation.
 java.util.List loadAllDistributionLists()
          Loads all distribution lists.
 DistributionList loadDistributionListById(java.lang.Integer Id)
          Loads all detail information for a distribution list identified by its id.
 DistributionList loadDistributionListByName(java.lang.String name)
          Loads all detail information for a distribution list identified by its name.
 void modifyDistributionList(DistributionList aDistributionList)
          Implements the query to modify a distributionlist.
 void subscribeToDistributionList(DistributionList aDistributionList, Email user)
          Subscribes user to the distribution list.
 DistributionList toDistributionList(SbiDistributionList hibDistributionList)
          To distribution list.
 void unsubscribeFromDistributionList(DistributionList aDistributionList, java.lang.String user)
          Unubscribes user from the distribution list.
 
Methods inherited from class it.eng.spagobi.commons.dao.AbstractHibernateDAO
getSession, getUserProfile, logException, rollbackIfActiveAndClose, setUserID, setUserProfile, updateSbiCommonInfo4Insert, updateSbiCommonInfo4Update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.eng.spagobi.commons.dao.ISpagoBIDao
getUserProfile, setUserID, setUserProfile
 

Constructor Detail

DistributionListDaoImpl

public DistributionListDaoImpl()
Method Detail

eraseDistributionList

public void eraseDistributionList(DistributionList aDistributionList)
                           throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Implements the query to erase a distribution list. All information needed is stored into the input distributionlist object.

Specified by:
eraseDistributionList in interface IDistributionListDAO
Parameters:
aDistributionList - The object containing all informations to be deleted
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

eraseDistributionListObjects

public void eraseDistributionListObjects(DistributionList dl,
                                         int biobId,
                                         java.lang.String triggername)
                                  throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Implements the query to erase distribution list objects.

Specified by:
eraseDistributionListObjects in interface IDistributionListDAO
Parameters:
dl - the dl
biobId - The id of the document
triggername - The triggername regarding the schedulation of the document
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

eraseAllRelatedDistributionListObjects

public void eraseAllRelatedDistributionListObjects(java.lang.String triggername)
                                            throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Implements the query to erase all distribution list objects with the related triggername.

Specified by:
eraseAllRelatedDistributionListObjects in interface IDistributionListDAO
Parameters:
triggername - The triggername regarding the schedulation of the document
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

insertDistributionList

public void insertDistributionList(DistributionList aDistributionList)
                            throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Implements the query to insert a distribution list. All information needed is stored into the input distributionlist object.

Specified by:
insertDistributionList in interface IDistributionListDAO
Parameters:
aDistributionList - The object containing all insert information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

loadAllDistributionLists

public java.util.List loadAllDistributionLists()
                                        throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Loads all distribution lists. All these informations, achived by a query to the DB, are stored into a List object, which is returned.

Specified by:
loadAllDistributionLists in interface IDistributionListDAO
Returns:
A List object containing all distribution Lists
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

loadDistributionListById

public DistributionList loadDistributionListById(java.lang.Integer Id)
                                          throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Loads all detail information for a distribution list identified by its id. All these informations, achived by a query to the DB, are stored into a distributionlist object, which is returned.

Specified by:
loadDistributionListById in interface IDistributionListDAO
Parameters:
Id - The id for the distributionlist to load
Returns:
A distributionlist object containing all loaded information
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

loadDistributionListByName

public DistributionList loadDistributionListByName(java.lang.String name)
                                            throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Loads all detail information for a distribution list identified by its name. All these informations, achived by a query to the DB, are stored into a distributionlist object, which is returned.

Specified by:
loadDistributionListByName in interface IDistributionListDAO
Parameters:
name - The name for the distributionlist to load
Returns:
A distributionlist object containing all loaded informations
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

modifyDistributionList

public void modifyDistributionList(DistributionList aDistributionList)
                            throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Implements the query to modify a distributionlist. All information needed is stored into the input distributionlist object.

Specified by:
modifyDistributionList in interface IDistributionListDAO
Parameters:
aDistributionList - The object containing all modified informations
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

toDistributionList

public DistributionList toDistributionList(SbiDistributionList hibDistributionList)
To distribution list.

Parameters:
hibDistributionList - the hib distribution list
Returns:
the distribution list

hasBIObjAssociated

public boolean hasBIObjAssociated(java.lang.String dlId)
                           throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Tells if a distribution list is associated to any BI Object. It is useful because the user needs to know if he's deleting an empty distribution list or not

Specified by:
hasBIObjAssociated in interface IDistributionListDAO
Parameters:
dlId - The distribution list identifier
Returns:
True if the distribution list is used by one or more objects, else false
Throws:
it.eng.spago.error.EMFUserError - If any exception occurred

subscribeToDistributionList

public void subscribeToDistributionList(DistributionList aDistributionList,
                                        Email user)
                                 throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Subscribes user to the distribution list.

Specified by:
subscribeToDistributionList in interface IDistributionListDAO
Parameters:
aDistributionList - the a distribution list
user - The user to be subscribed
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

unsubscribeFromDistributionList

public void unsubscribeFromDistributionList(DistributionList aDistributionList,
                                            java.lang.String user)
                                     throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Unubscribes user from the distribution list.

Specified by:
unsubscribeFromDistributionList in interface IDistributionListDAO
Parameters:
aDistributionList - the a distribution list
user - The user to be unsubscribed
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

insertDLforDocument

public void insertDLforDocument(DistributionList dl,
                                int objId,
                                java.lang.String xml)
                         throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Inserts the document with id objId in the list of documents for the DIstributionList dl with the xml of its schedulation.

Specified by:
insertDLforDocument in interface IDistributionListDAO
Parameters:
dl - the dl
objId - The id of the document
xml - The xml regarding the schedulation of the document
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

isDocScheduleAlreadyLinkedToDL

public boolean isDocScheduleAlreadyLinkedToDL(DistributionList dl,
                                              int objId,
                                              java.lang.String xml)
                                       throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Verifies if the document with id objId is already in the list of documents for the DIstributionList dl with the xml of its schedulation.

Specified by:
isDocScheduleAlreadyLinkedToDL in interface IDistributionListDAO
Parameters:
dl - the dl
objId - The id of the document
xml - The xml regarding the schedulation of the document
Returns:
True if already exists, else false
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

isDocScheduledInOtherTime

public boolean isDocScheduledInOtherTime(DistributionList dl,
                                         int objId,
                                         java.lang.String xml)
                                  throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Verifies if the document with id objId is already in the list of documents for the DIstributionList dl with another xml of schedulation.

Specified by:
isDocScheduledInOtherTime in interface IDistributionListDAO
Parameters:
dl - the dl
objId - The id of the document
xml - The xml regarding the schedulation of the document
Returns:
True if already exists, else false
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred

getXmlRelated

public java.util.List getXmlRelated(DistributionList dl,
                                    int objId)
                             throws it.eng.spago.error.EMFUserError
Description copied from interface: IDistributionListDAO
Returns a list of the Xmls related to the specified Distribution List and the specified Document.

Specified by:
getXmlRelated in interface IDistributionListDAO
Parameters:
dl - the dl
objId - The id of the document
Returns:
List of Xml related to the DL and the doc with id objId
Throws:
it.eng.spago.error.EMFUserError - If an Exception occurred