Class PublicationDAO
- java.lang.Object
-
- org.silverpeas.core.persistence.jdbc.AbstractDAO
-
- org.silverpeas.core.contribution.publication.dao.PublicationDAO
-
public class PublicationDAO extends AbstractDAO
This is the Publication Data Access Object.- Author:
- Nicolas Eysseric
-
-
Method Summary
-
Methods inherited from class org.silverpeas.core.persistence.jdbc.AbstractDAO
asDate, setDateParameter, setStringParameter
-
-
-
-
Method Detail
-
deleteComponentInstanceData
public static void deleteComponentInstanceData(String componentInstanceId) throws SQLException
Deletes all publications linked to the component instance represented by the given identifier.- Parameters:
componentInstanceId
- the identifier of the component instance for which the resources must be deleted.- Throws:
SQLException
- on SQL error
-
getNbPubByFatherPath
public static int getNbPubByFatherPath(Connection con, NodePK fatherPK, String fatherPath) throws SQLException
- Throws:
SQLException
-
getDistributionTree
public static Map<String,Integer> getDistributionTree(Connection con, DistributionTreeCriteria criteria) throws SQLException
- Throws:
SQLException
-
insertRow
public static void insertRow(Connection con, PublicationDetail detail)
-
deleteRow
public static void deleteRow(Connection con, PublicationPK pk) throws SQLException
- Throws:
SQLException
-
selectByPrimaryKey
public static PublicationDetail selectByPrimaryKey(Connection con, PublicationPK primaryKey) throws SQLException
- Throws:
SQLException
-
selectByPublicationName
public static PublicationDetail selectByPublicationName(Connection con, PublicationPK primaryKey, String name) throws SQLException
- Throws:
SQLException
-
selectByPublicationNameAndNodeId
public static PublicationDetail selectByPublicationNameAndNodeId(Connection con, PublicationPK primaryKey, String name, int nodeId) throws SQLException
- Throws:
SQLException
-
selectByFatherPK
public static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK) throws SQLException
- Throws:
SQLException
-
selectByFatherPK
public static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod) throws SQLException
- Throws:
SQLException
-
selectByFatherPK
public static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod, String userId) throws SQLException
- Throws:
SQLException
-
selectByFatherPK
public static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, String sorting) throws SQLException
- Throws:
SQLException
-
selectNotInFatherPK
public static Collection<PublicationDetail> selectNotInFatherPK(Connection con, NodePK fatherPK, String sorting) throws SQLException
- Throws:
SQLException
-
selectByFatherIds
public static List<PublicationDetail> selectByFatherIds(Connection con, List<String> fatherIds, String instanceId, String sorting, List<String> status, boolean filterOnVisibilityPeriod) throws SQLException
- Throws:
SQLException
-
getByIds
public static List<PublicationDetail> getByIds(Connection con, Collection<String> publicationIds, Set<PublicationPK> indexedPks)
-
getMinimalDataByIds
public static List<PublicationDetail> getMinimalDataByIds(Connection con, Collection<PublicationPK> ids) throws SQLException
Selects massively simple data about publications.For now, only the following data are retrieved:
- pubId
- pubStatus
- pubCloneId
- pubCloneStatus
- instanceId
- pubBeginDate
- pubEndDate
- pubBeginHour
- pubEndHour
- pubcreatorid
- pubupdaterid
The result is not necessarily into same ordering as the one of given parameter.- Parameters:
con
- the database connection.ids
- the instance ids aimed.- Returns:
- a list of
PublicationDetail
instances. - Throws:
SQLException
- on database error.
-
selectPksByCriteria
public static SilverpeasList<PublicationPK> selectPksByCriteria(Connection con, PublicationCriteria criteria) throws SQLException
- Throws:
SQLException
-
selectPublicationsByCriteria
public static SilverpeasList<PublicationDetail> selectPublicationsByCriteria(Connection con, PublicationCriteria criteria) throws SQLException
- Throws:
SQLException
-
selectAllPublications
public static Collection<PublicationDetail> selectAllPublications(Connection con, String instanceId, String sorting) throws SQLException
- Throws:
SQLException
-
selectByBeginDateDescAndStatus
public static Collection<PublicationDetail> selectByBeginDateDescAndStatus(Connection con, PublicationPK pubPK, String status) throws SQLException
- Throws:
SQLException
-
getOrphanPublications
public static Collection<PublicationDetail> getOrphanPublications(Connection con, String componentId) throws SQLException
- Throws:
SQLException
-
getUnavailablePublicationsByPublisherId
public static Collection<PublicationDetail> getUnavailablePublicationsByPublisherId(Connection con, PublicationPK pubPK, String publisherId, String nodeId) throws SQLException
- Throws:
SQLException
-
loadRow
public static PublicationDetail loadRow(Connection con, PublicationPK pk) throws SQLException
- Throws:
SQLException
-
changeInstanceId
public static void changeInstanceId(Connection con, PublicationPK pubPK, String newInstanceId) throws SQLException
- Throws:
SQLException
-
storeRow
public static void storeRow(Connection con, PublicationDetail detail) throws SQLException
- Throws:
SQLException
-
selectByName
public static PublicationDetail selectByName(Connection con, PublicationPK pubPK, String name) throws SQLException
- Throws:
SQLException
-
selectByNameAndNodeId
public static PublicationDetail selectByNameAndNodeId(Connection con, PublicationPK pubPK, String name, int nodeId) throws SQLException
- Throws:
SQLException
-
selectBetweenDate
public static Collection<PublicationDetail> selectBetweenDate(Connection con, String beginDate, String endDate, String instanceId) throws SQLException
- Throws:
SQLException
-
getAllPublicationsIDbyUserid
public static List<SocialInformation> getAllPublicationsIDbyUserid(Connection con, String userId, Date begin, Date end) throws SQLException
- Throws:
SQLException
-
getSocialInformationsListOfMyContacts
public static List<SocialInformationPublication> getSocialInformationsListOfMyContacts(Connection con, List<String> myContactsIds, List<String> options, Date begin, Date end) throws SQLException
- Throws:
SQLException
-
getDraftsByUser
public static Collection<PublicationDetail> getDraftsByUser(Connection con, String userId) throws SQLException
- Throws:
SQLException
-
getByTargetValidatorId
public static List<PublicationDetail> getByTargetValidatorId(Connection con, String userId) throws SQLException
- Throws:
SQLException
-
updateTargetValidatorIds
public static void updateTargetValidatorIds(Connection con, PublicationDetail detail) throws SQLException
- Throws:
SQLException
-
-