com.silverpeas.gallery.dao
Class MediaDAO

java.lang.Object
  extended by com.silverpeas.gallery.dao.MediaDAO

public class MediaDAO
extends Object


Method Summary
static void deleteAllMediaPath(Connection con, Media media)
          Deletes the paths of the specified media.
static void deleteMedia(Connection con, Media media)
          Deletes the specified media (and its paths).
static List<Media> findByCriteria(Connection con, MediaCriteria criteria)
          Finds media according to the given criteria.
static Collection<String> getAlbumIdsOf(Connection con, Media media)
          Gets the paths of a media.
static List<com.silverpeas.socialnetwork.model.SocialInformation> getAllMediaIdByUserId(Connection con, String userId, org.silverpeas.date.Period period)
          get my SocialInformationGallery according to the type of data base used(PostgreSQL,Oracle,MMS) .
static Media getByCriteria(Connection con, MediaCriteria criteria)
          Gets the media behind the specified criteria.
static List<com.silverpeas.socialnetwork.model.SocialInformation> getSocialInformationListOfMyContacts(Connection con, List<String> userIds, List<String> availableComponents, org.silverpeas.date.Period period)
          get list of socialInformationGallery of my contacts according to the type of data base used(PostgreSQL,Oracle,MMS) .
static String saveMedia(Connection con, org.silverpeas.persistence.repository.OperationContext context, Media media)
          Saves (insert or update) a media.
static void saveMediaPath(Connection con, Media media, String albumId)
          Saves the path of the media.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getByCriteria

public static Media getByCriteria(Connection con,
                                  MediaCriteria criteria)
                           throws SQLException,
                                  IllegalArgumentException
Gets the media behind the specified criteria.

Parameters:
con - the database connection.
criteria - the media criteria.
Returns:
the media behind the criteria, null if no media found and throws IllegalArgumentException if several media are found.
Throws:
SQLException
IllegalArgumentException

findByCriteria

public static List<Media> findByCriteria(Connection con,
                                         MediaCriteria criteria)
                                  throws SQLException
Finds media according to the given criteria.

Parameters:
con - the database connection.
criteria - the media criteria.
Returns:
the media list corresponding to the given criteria.
Throws:
SQLException

saveMedia

public static String saveMedia(Connection con,
                               org.silverpeas.persistence.repository.OperationContext context,
                               Media media)
                        throws SQLException,
                               com.stratelia.webactiv.util.exception.UtilException
Saves (insert or update) a media.

Parameters:
con -
context -
media -
Returns:
the id of the saved media.
Throws:
SQLException
com.stratelia.webactiv.util.exception.UtilException

deleteMedia

public static void deleteMedia(Connection con,
                               Media media)
                        throws SQLException
Deletes the specified media (and its paths).

Parameters:
con -
media -
Throws:
SQLException

saveMediaPath

public static void saveMediaPath(Connection con,
                                 Media media,
                                 String albumId)
                          throws SQLException,
                                 com.stratelia.webactiv.util.exception.UtilException
Saves the path of the media.

Parameters:
con -
media -
albumId -
Throws:
SQLException
com.stratelia.webactiv.util.exception.UtilException

deleteAllMediaPath

public static void deleteAllMediaPath(Connection con,
                                      Media media)
                               throws SQLException
Deletes the paths of the specified media.

Parameters:
con -
media -
Throws:
SQLException

getAlbumIdsOf

public static Collection<String> getAlbumIdsOf(Connection con,
                                               Media media)
                                        throws SQLException
Gets the paths of a media.

Parameters:
con -
media -
Returns:
Throws:
SQLException

getAllMediaIdByUserId

public static List<com.silverpeas.socialnetwork.model.SocialInformation> getAllMediaIdByUserId(Connection con,
                                                                                               String userId,
                                                                                               org.silverpeas.date.Period period)
                                                                                        throws SQLException
get my SocialInformationGallery according to the type of data base used(PostgreSQL,Oracle,MMS) .

Parameters:
con -
userId -
period -
Returns:
List
Throws:
SQLException
ParseException

getSocialInformationListOfMyContacts

public static List<com.silverpeas.socialnetwork.model.SocialInformation> getSocialInformationListOfMyContacts(Connection con,
                                                                                                              List<String> userIds,
                                                                                                              List<String> availableComponents,
                                                                                                              org.silverpeas.date.Period period)
                                                                                                       throws SQLException
get list of socialInformationGallery of my contacts according to the type of data base used(PostgreSQL,Oracle,MMS) .

Parameters:
con -
userIds -
availableComponents -
period -
Returns:
Throws:
SQLException
ParseException


Copyright © 2016 Silverpeas. All Rights Reserved.