com.silverpeas.gallery.model
Class Media

java.lang.Object
  extended by com.silverpeas.gallery.model.Media
All Implemented Interfaces:
com.silverpeas.SilverpeasContent, com.stratelia.silverpeas.contentManager.SilverContentInterface, Serializable
Direct Known Subclasses:
InternalMedia, Streaming

public abstract class Media
extends Object
implements com.silverpeas.SilverpeasContent, com.stratelia.silverpeas.contentManager.SilverContentInterface, Serializable

This class represents a Media and provides all the common data.

See Also:
Serialized Form

Field Summary
static org.silverpeas.process.io.file.FileBasePath BASE_PATH
           
 
Constructor Summary
Media()
           
 
Method Summary
 void addToAlbums(String... albumIds)
          Adds the current media to the album represented by specified identifiers.
 boolean canBeAccessedBy(com.stratelia.webactiv.beans.admin.UserDetail user)
           
 boolean equals(Object o)
           
 String getApplicationEmbedUrl(MediaResolution mediaResolution)
          Gets the Application URL thumbnail of the media according the specified media resolution.
 String getApplicationOriginalUrl()
          Gets the original URL of a media with cache handling.
 String getApplicationThumbnailUrl(MediaResolution mediaResolution)
          Gets the Application URL thumbnail of the media according the specified media resolution.
 String getAuthor()
           
 String getComponentInstanceId()
           
 String getContributionType()
           
 Date getCreationDate()
           
 com.stratelia.webactiv.beans.admin.UserDetail getCreator()
           
 String getCreatorId()
           
 String getCreatorName()
           
 String getDate()
           
 String getDescription()
           
 String getDescription(String language)
           
abstract  org.silverpeas.file.SilverpeasFile getFile(MediaResolution mediaResolution)
          Gets the Silverpeas file.
protected  com.stratelia.webactiv.SilverpeasRole getGreatestUserRole(com.stratelia.webactiv.beans.admin.UserDetail user)
          Retrieve greatest user role
 String getIconUrl()
           
 String getId()
           
 String getInstanceId()
           
 InternalMedia getInternalMedia()
          Gets the internal media instance if type of the current media is MediaType.Photo or MediaType.Video or MediaType.Sound.
 String getKeyWord()
           
 Iterator<String> getLanguages()
           
 Date getLastUpdateDate()
           
 String getLastUpdatedBy()
           
 com.stratelia.webactiv.beans.admin.UserDetail getLastUpdater()
           
 String getLastUpdaterName()
           
 MediaPK getMediaPK()
           
 String getName()
           
 String getName(String language)
           
 String getPermalink()
          Gets the permalink of a media.
 Photo getPhoto()
          Gets the photo instance if type of the current media is MediaType.Photo.
 String getSilverCreationDate()
           
 String getSilverpeasContentId()
           
 Sound getSound()
          Gets the sound instance if type of the current media is MediaType.Sound.
 Streaming getStreaming()
          Gets the streaming instance if type of the current media is MediaType.Streaming.
 String getTitle()
           
abstract  MediaType getType()
           
 String getURL()
           
 Video getVideo()
          Gets the video instance if type of the current media is MediaType.Video.
 org.silverpeas.date.Period getVisibilityPeriod()
           
 String getWorkspaceSubFolderName()
          Gets the sub folder name of the media in the Silverpeas workspace.
 int hashCode()
           
 boolean isDownloadable()
          Indicated if the download is possible.
 boolean isPreviewable()
          Indicates if the media is previewable.
 boolean isVisible()
           
protected  boolean isVisible(Date today)
           
 void removeFromAllAlbums()
          Removes the current media from all albums which it is attached to.
 void setAuthor(String author)
           
 void setComponentInstanceId(String instanceId)
           
 void setCreationDate(Date createDate)
           
 void setCreator(com.stratelia.webactiv.beans.admin.UserDetail creator)
           
 void setCreatorId(String creatorId)
           
 void setDescription(String description)
           
 void setIconUrl(String iconUrl)
           
 void setId(String mediaId)
           
 void setKeyWord(String keyWord)
           
 void setLastUpdateDate(Date lastUpdateDate)
           
 void setLastUpdatedBy(String lastUpdatedBy)
           
 void setLastUpdater(com.stratelia.webactiv.beans.admin.UserDetail lastUpdater)
           
 void setMediaPK(MediaPK mediaPK)
           
 void setSilverpeasContentId(String silverpeasContentId)
           
 void setTitle(String title)
           
 void setToAlbums(String... albumIds)
          Sets the current media to the album represented by specified identifiers.
 void setVisibilityPeriod(org.silverpeas.date.Period visibilityPeriod)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_PATH

public static final org.silverpeas.process.io.file.FileBasePath BASE_PATH
Constructor Detail

Media

public Media()
Method Detail

getMediaPK

public MediaPK getMediaPK()

setMediaPK

public void setMediaPK(MediaPK mediaPK)

setId

public void setId(String mediaId)

getId

public String getId()
Specified by:
getId in interface com.silverpeas.SilverpeasContent
Specified by:
getId in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

setComponentInstanceId

public void setComponentInstanceId(String instanceId)

getInstanceId

public String getInstanceId()
Specified by:
getInstanceId in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getComponentInstanceId

public String getComponentInstanceId()
Specified by:
getComponentInstanceId in interface com.silverpeas.SilverpeasContent

getContributionType

public String getContributionType()
Specified by:
getContributionType in interface com.silverpeas.SilverpeasContent

getType

public abstract MediaType getType()

getTitle

public String getTitle()
Specified by:
getTitle in interface com.silverpeas.SilverpeasContent

setTitle

public void setTitle(String title)

getDescription

public String getDescription()
Specified by:
getDescription in interface com.silverpeas.SilverpeasContent
Specified by:
getDescription in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

setDescription

public void setDescription(String description)

getAuthor

public String getAuthor()

setAuthor

public void setAuthor(String author)

getKeyWord

public String getKeyWord()

setKeyWord

public void setKeyWord(String keyWord)

getVisibilityPeriod

public org.silverpeas.date.Period getVisibilityPeriod()

setVisibilityPeriod

public void setVisibilityPeriod(org.silverpeas.date.Period visibilityPeriod)

isVisible

public boolean isVisible()

isVisible

protected boolean isVisible(Date today)

getCreationDate

public Date getCreationDate()
Specified by:
getCreationDate in interface com.silverpeas.SilverpeasContent

setCreationDate

public void setCreationDate(Date createDate)

getCreator

public com.stratelia.webactiv.beans.admin.UserDetail getCreator()
Specified by:
getCreator in interface com.silverpeas.SilverpeasContent

setCreator

public void setCreator(com.stratelia.webactiv.beans.admin.UserDetail creator)

getCreatorId

public String getCreatorId()
Specified by:
getCreatorId in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

setCreatorId

public void setCreatorId(String creatorId)

getCreatorName

public String getCreatorName()

getLastUpdateDate

public Date getLastUpdateDate()

setLastUpdateDate

public void setLastUpdateDate(Date lastUpdateDate)

getLastUpdater

public com.stratelia.webactiv.beans.admin.UserDetail getLastUpdater()

setLastUpdater

public void setLastUpdater(com.stratelia.webactiv.beans.admin.UserDetail lastUpdater)

getLastUpdatedBy

public String getLastUpdatedBy()

setLastUpdatedBy

public void setLastUpdatedBy(String lastUpdatedBy)

getLastUpdaterName

public String getLastUpdaterName()

canBeAccessedBy

public boolean canBeAccessedBy(com.stratelia.webactiv.beans.admin.UserDetail user)
Specified by:
canBeAccessedBy in interface com.silverpeas.SilverpeasContent

getWorkspaceSubFolderName

public String getWorkspaceSubFolderName()
Gets the sub folder name of the media in the Silverpeas workspace.

Returns:
the sub folder name of the media.

getPermalink

public String getPermalink()
Gets the permalink of a media.

Returns:
the permalink string of a media.

isPreviewable

public boolean isPreviewable()
Indicates if the media is previewable.

Returns:
true if the media is previewable, false otherwise.

getApplicationThumbnailUrl

public String getApplicationThumbnailUrl(MediaResolution mediaResolution)
Gets the Application URL thumbnail of the media according the specified media resolution.

Parameters:
mediaResolution -
Returns:
the URL of media thumbnail.

getApplicationEmbedUrl

public String getApplicationEmbedUrl(MediaResolution mediaResolution)
Gets the Application URL thumbnail of the media according the specified media resolution.

Parameters:
mediaResolution -
Returns:
the URL of media thumbnail.

getApplicationOriginalUrl

public String getApplicationOriginalUrl()
Gets the original URL of a media with cache handling.

Returns:

getFile

public abstract org.silverpeas.file.SilverpeasFile getFile(MediaResolution mediaResolution)
Gets the Silverpeas file.

Parameters:
mediaResolution -
Returns:

getSilverpeasContentId

public String getSilverpeasContentId()
Specified by:
getSilverpeasContentId in interface com.silverpeas.SilverpeasContent

setSilverpeasContentId

public void setSilverpeasContentId(String silverpeasContentId)

setIconUrl

public void setIconUrl(String iconUrl)

getIconUrl

public String getIconUrl()
Specified by:
getIconUrl in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

isDownloadable

public boolean isDownloadable()
Indicated if the download is possible.

Returns:
true if download is possible, false otherwise.

getURL

public String getURL()
Specified by:
getURL in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getDate

public String getDate()
Specified by:
getDate in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getSilverCreationDate

public String getSilverCreationDate()
Specified by:
getSilverCreationDate in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getName

public String getName()
Specified by:
getName in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getName

public String getName(String language)
Specified by:
getName in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getDescription

public String getDescription(String language)
Specified by:
getDescription in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

getLanguages

public Iterator<String> getLanguages()
Specified by:
getLanguages in interface com.stratelia.silverpeas.contentManager.SilverContentInterface

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getInternalMedia

public InternalMedia getInternalMedia()
Gets the internal media instance if type of the current media is MediaType.Photo or MediaType.Video or MediaType.Sound.

Returns:
internal media instance, null if media type is not MediaType.Photo or MediaType.Video or MediaType.Sound.

getPhoto

public Photo getPhoto()
Gets the photo instance if type of the current media is MediaType.Photo.

Returns:
photo instance, null if media type is not MediaType.Photo.

getVideo

public Video getVideo()
Gets the video instance if type of the current media is MediaType.Video.

Returns:
video instance, null if media type is not MediaType.Video.

getSound

public Sound getSound()
Gets the sound instance if type of the current media is MediaType.Sound.

Returns:
sound instance, null if media type is not MediaType.Sound.

getStreaming

public Streaming getStreaming()
Gets the streaming instance if type of the current media is MediaType.Streaming.

Returns:
streaming instance, null if media type is not MediaType.Streaming.

removeFromAllAlbums

public void removeFromAllAlbums()
Removes the current media from all albums which it is attached to.


addToAlbums

public void addToAlbums(String... albumIds)
Adds the current media to the album represented by specified identifiers.

Parameters:
albumIds - the identifier of albums.

setToAlbums

public void setToAlbums(String... albumIds)
Sets the current media to the album represented by specified identifiers. (all not specified album attachments will be deleted)

Parameters:
albumIds - the identifier of albums.

getGreatestUserRole

protected com.stratelia.webactiv.SilverpeasRole getGreatestUserRole(com.stratelia.webactiv.beans.admin.UserDetail user)
Retrieve greatest user role

Parameters:
user - the current user detail
Returns:
the greatest user role


Copyright © 2016 Silverpeas. All Rights Reserved.