com.stratelia.webactiv.util.publication.control
Class PublicationDAO

java.lang.Object
  extended by com.stratelia.webactiv.util.publication.control.PublicationDAO

public class PublicationDAO
extends Object

This is the Publication Data Access Object.

Author:
Nicolas Eysseric

Constructor Summary
PublicationDAO()
          This class must not be instanciated
 
Method Summary
static void changeInstanceId(Connection con, PublicationPK pubPK, String newInstanceId)
           
static void deleteOrphanPublicationsByCreatorId(Connection con, PublicationPK pubPK, String creatorId)
          Method declaration
static void deleteRow(Connection con, PublicationPK pk)
          Method declaration
static List<SocialInformation> getAllPublicationsIDbyUserid(Connection con, String userId, Date begin, Date end)
          get my SocialInformationPublication accordint to the type of data base used(PostgreSQL,Oracle,MMS) .
static Map<String,Integer> getDistributionTree(Connection con, String instanceId, String statusSubQuery, boolean checkVisibility)
           
static Collection<PublicationDetail> getDraftsByUser(Connection con, String userId)
           
static int getNbPubByFatherPath(Connection con, NodePK fatherPK, String fatherPath)
          Method declaration
static int getNbPubInFatherPKs(Connection con, Collection<NodePK> fatherPKs)
          Method declaration
static Collection<PublicationDetail> getNotOrphanPublications(Connection con, PublicationPK pubPK)
          Method declaration
static Collection<PublicationDetail> getOrphanPublications(Connection con, PublicationPK pubPK)
          Method declaration
static Collection<PublicationDetail> getPublicationsToDraftOut(Connection con, boolean useClone)
           
static List<SocialInformationPublication> getSocialInformationsListOfMyContacts(Connection con, List<String> myContactsIds, List<String> options, Date begin, Date end)
          get list of socialInformation of my contacts according to the type of data base used(PostgreSQL,Oracle,MMS) .
static Collection<PublicationDetail> getUnavailablePublicationsByPublisherId(Connection con, PublicationPK pubPK, String publisherId, String nodeId)
          Method declaration
static void insertRow(Connection con, PublicationDetail detail)
          Method declaration
static void invalidateLastPublis(String instanceId)
          Invalidate last publications for a given instance
static PublicationDetail loadRow(Connection con, PublicationPK pk)
          Method declaration
static Collection<PublicationDetail> searchByKeywords(Connection con, String query, PublicationPK pubPK)
          Method declaration
static Collection<PublicationDetail> selectAllPublications(Connection con, PublicationPK pubPK)
          Method declaration
static Collection<PublicationDetail> selectAllPublications(Connection con, PublicationPK pubPK, String sorting)
           
static Collection<PublicationDetail> selectBetweenDate(Connection con, String beginDate, String endDate, String instanceId)
           
static Collection<PublicationDetail> selectByBeginDateDesc(Connection con, PublicationPK pubPK)
          Method declaration
static Collection<PublicationDetail> selectByBeginDateDescAndStatus(Connection con, PublicationPK pubPK, String status)
          Method declaration
static Collection<PublicationDetail> selectByBeginDateDescAndStatusAndNotLinkedToFatherId(Connection con, PublicationPK pubPK, String status, String fatherId, int fetchSize)
           
static ArrayList<PublicationDetail> selectByFatherIds(Connection con, List<String> fatherIds, PublicationPK pubPK, String sorting, List<String> status, boolean filterOnVisibilityPeriod)
           
static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK)
          Method declaration
static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, boolean filterOnVisibilityPeriod)
           
static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, String sorting)
           
static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod)
           
static Collection<PublicationDetail> selectByFatherPK(Connection con, NodePK fatherPK, String sorting, boolean filterOnVisibilityPeriod, String userId)
           
static PublicationDetail selectByName(Connection con, PublicationPK pubPK, String name)
           
static PublicationDetail selectByNameAndNodeId(Connection con, PublicationPK pubPK, String name, int nodeId)
           
static PublicationPK selectByPrimaryKey(Connection con, PublicationPK primaryKey)
           
static PublicationPK selectByPublicationName(Connection con, PublicationPK primaryKey, String name)
           
static PublicationPK selectByPublicationNameAndNodeId(Connection con, PublicationPK primaryKey, String name, int nodeId)
           
static Collection<PublicationDetail> selectByPublicationPKs(Connection con, Collection<PublicationPK> publicationPKs)
           
static Collection<PublicationDetail> selectByStatus(Connection con, List<String> componentIds, String status)
           
static Collection<PublicationDetail> selectByStatus(Connection con, PublicationPK pubPK, String status)
          Method declaration
static Collection<PublicationDetail> selectNotInFatherPK(Connection con, NodePK fatherPK)
          Method declaration
static Collection<PublicationDetail> selectNotInFatherPK(Connection con, NodePK fatherPK, String sorting)
           
static Collection<PublicationPK> selectPKsByStatus(Connection con, List<String> componentIds, String status)
           
static Collection<PublicationPK> selectUpdatedPublicationsSince(Connection con, List<String> componentIds, String status, Date since, int maxSize)
           
static void storeRow(Connection con, PublicationDetail detail)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublicationDAO

public PublicationDAO()
This class must not be instanciated

Since:
1.0
Method Detail

invalidateLastPublis

public static void invalidateLastPublis(String instanceId)
Invalidate last publications for a given instance

Parameters:
instanceId -

getNbPubInFatherPKs

public static int getNbPubInFatherPKs(Connection con,
                                      Collection<NodePK> fatherPKs)
                               throws SQLException
Method declaration

Parameters:
con -
fatherPKs -
Returns:
Throws:
SQLException
See Also:

getNbPubByFatherPath

public static int getNbPubByFatherPath(Connection con,
                                       NodePK fatherPK,
                                       String fatherPath)
                                throws SQLException
Method declaration

Parameters:
con -
fatherPK -
fatherPath -
Returns:
Throws:
SQLException
See Also:

getDistributionTree

public static Map<String,Integer> getDistributionTree(Connection con,
                                                      String instanceId,
                                                      String statusSubQuery,
                                                      boolean checkVisibility)
                                               throws SQLException
Throws:
SQLException

insertRow

public static void insertRow(Connection con,
                             PublicationDetail detail)
                      throws SQLException
Method declaration

Parameters:
con -
detail -
Throws:
SQLException
See Also:

deleteRow

public static void deleteRow(Connection con,
                             PublicationPK pk)
                      throws SQLException
Method declaration

Parameters:
con -
pk -
Throws:
SQLException
See Also:

selectByPrimaryKey

public static PublicationPK selectByPrimaryKey(Connection con,
                                               PublicationPK primaryKey)
                                        throws SQLException
Throws:
SQLException

selectByPublicationName

public static PublicationPK selectByPublicationName(Connection con,
                                                    PublicationPK primaryKey,
                                                    String name)
                                             throws SQLException
Throws:
SQLException

selectByPublicationNameAndNodeId

public static PublicationPK 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
Method declaration

Parameters:
con -
fatherPK -
Returns:
Throws:
SQLException
See Also:

selectByFatherPK

public static Collection<PublicationDetail> selectByFatherPK(Connection con,
                                                             NodePK fatherPK,
                                                             boolean filterOnVisibilityPeriod)
                                                      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)
                                                         throws SQLException
Method declaration

Parameters:
con -
fatherPK -
Returns:
Throws:
SQLException
See Also:

selectNotInFatherPK

public static Collection<PublicationDetail> selectNotInFatherPK(Connection con,
                                                                NodePK fatherPK,
                                                                String sorting)
                                                         throws SQLException
Throws:
SQLException

selectByFatherIds

public static ArrayList<PublicationDetail> selectByFatherIds(Connection con,
                                                             List<String> fatherIds,
                                                             PublicationPK pubPK,
                                                             String sorting,
                                                             List<String> status,
                                                             boolean filterOnVisibilityPeriod)
                                                      throws SQLException
Throws:
SQLException

selectByPublicationPKs

public static Collection<PublicationDetail> selectByPublicationPKs(Connection con,
                                                                   Collection<PublicationPK> publicationPKs)

selectByStatus

public static Collection<PublicationDetail> selectByStatus(Connection con,
                                                           PublicationPK pubPK,
                                                           String status)
                                                    throws SQLException
Method declaration

Parameters:
con -
pubPK -
status -
Returns:
Throws:
SQLException
See Also:

selectByStatus

public static Collection<PublicationDetail> selectByStatus(Connection con,
                                                           List<String> componentIds,
                                                           String status)
                                                    throws SQLException
Throws:
SQLException

selectPKsByStatus

public static Collection<PublicationPK> selectPKsByStatus(Connection con,
                                                          List<String> componentIds,
                                                          String status)
                                                   throws SQLException
Throws:
SQLException

selectUpdatedPublicationsSince

public static Collection<PublicationPK> selectUpdatedPublicationsSince(Connection con,
                                                                       List<String> componentIds,
                                                                       String status,
                                                                       Date since,
                                                                       int maxSize)
                                                                throws SQLException
Throws:
SQLException

selectAllPublications

public static Collection<PublicationDetail> selectAllPublications(Connection con,
                                                                  PublicationPK pubPK)
                                                           throws SQLException
Method declaration

Parameters:
con -
pubPK -
Returns:
Throws:
SQLException
See Also:

selectAllPublications

public static Collection<PublicationDetail> selectAllPublications(Connection con,
                                                                  PublicationPK pubPK,
                                                                  String sorting)
                                                           throws SQLException
Throws:
SQLException

selectByBeginDateDescAndStatus

public static Collection<PublicationDetail> selectByBeginDateDescAndStatus(Connection con,
                                                                           PublicationPK pubPK,
                                                                           String status)
                                                                    throws SQLException
Method declaration

Parameters:
con -
pubPK -
status -
Returns:
Throws:
SQLException
See Also:

selectByBeginDateDescAndStatusAndNotLinkedToFatherId

public static Collection<PublicationDetail> selectByBeginDateDescAndStatusAndNotLinkedToFatherId(Connection con,
                                                                                                 PublicationPK pubPK,
                                                                                                 String status,
                                                                                                 String fatherId,
                                                                                                 int fetchSize)
                                                                                          throws SQLException
Throws:
SQLException

selectByBeginDateDesc

public static Collection<PublicationDetail> selectByBeginDateDesc(Connection con,
                                                                  PublicationPK pubPK)
                                                           throws SQLException
Method declaration

Parameters:
con -
pubPK -
Returns:
Throws:
SQLException
See Also:

getOrphanPublications

public static Collection<PublicationDetail> getOrphanPublications(Connection con,
                                                                  PublicationPK pubPK)
                                                           throws SQLException
Method declaration

Parameters:
con -
pubPK -
Returns:
Throws:
SQLException
See Also:

getNotOrphanPublications

public static Collection<PublicationDetail> getNotOrphanPublications(Connection con,
                                                                     PublicationPK pubPK)
                                                              throws SQLException
Method declaration

Parameters:
con -
pubPK -
Returns:
Throws:
SQLException
See Also:

deleteOrphanPublicationsByCreatorId

public static void deleteOrphanPublicationsByCreatorId(Connection con,
                                                       PublicationPK pubPK,
                                                       String creatorId)
                                                throws SQLException
Method declaration

Parameters:
con -
pubPK -
creatorId -
Throws:
SQLException
See Also:

getUnavailablePublicationsByPublisherId

public static Collection<PublicationDetail> getUnavailablePublicationsByPublisherId(Connection con,
                                                                                    PublicationPK pubPK,
                                                                                    String publisherId,
                                                                                    String nodeId)
                                                                             throws SQLException
Method declaration

Parameters:
con -
pubPK -
publisherId -
nodeId -
Returns:
Throws:
SQLException
See Also:

searchByKeywords

public static Collection<PublicationDetail> searchByKeywords(Connection con,
                                                             String query,
                                                             PublicationPK pubPK)
Method declaration

Parameters:
con -
query -
pubPK -
Returns:
Throws:
SQLException
See Also:

loadRow

public static PublicationDetail loadRow(Connection con,
                                        PublicationPK pk)
                                 throws SQLException
Method declaration

Parameters:
con -
pk -
Returns:
Throws:
SQLException
See Also:

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
get my SocialInformationPublication accordint to the type of data base used(PostgreSQL,Oracle,MMS) .

Parameters:
con -
userId -
firstIndex -
nbElement -
Returns:
List
Throws:
SQLException

getSocialInformationsListOfMyContacts

public static List<SocialInformationPublication> getSocialInformationsListOfMyContacts(Connection con,
                                                                                       List<String> myContactsIds,
                                                                                       List<String> options,
                                                                                       Date begin,
                                                                                       Date end)
                                                                                throws SQLException
get list of socialInformation of my contacts according to the type of data base used(PostgreSQL,Oracle,MMS) .

Parameters:
: - String myId
:List - myContactsIds
:List - options list of Available Components name
int - numberOfElement, int firstIndex
Throws:
SQLException

getPublicationsToDraftOut

public static Collection<PublicationDetail> getPublicationsToDraftOut(Connection con,
                                                                      boolean useClone)
                                                               throws SQLException
Throws:
SQLException

getDraftsByUser

public static Collection<PublicationDetail> getDraftsByUser(Connection con,
                                                            String userId)
                                                     throws SQLException
Throws:
SQLException


Copyright © 2016 Silverpeas. All Rights Reserved.