eu.etaxonomy.cdm.model.media
Class Media

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.common.AnnotatableEntity
              extended by eu.etaxonomy.cdm.model.common.IdentifiableEntity<IIdentifiableEntityCacheStrategy>
                  extended by eu.etaxonomy.cdm.model.media.Media
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IIdentifiableEntity, IMultiLanguageTextHolder, ISourceable<IdentifiableSource>, IVersionableEntity, Serializable, Cloneable
Direct Known Subclasses:
MediaKey, ReferencedMediaBase

@Entity
@Indexed
public class Media
extends IdentifiableEntity<IIdentifiableEntityCacheStrategy>
implements Cloneable, IMultiLanguageTextHolder

A media is any kind of media that represents a media object. This media object can have multiple media representations that differ in MIME-type and/or quality. E.g. (1) an image can have a tiff and a jpg media representation. (2) an formatted text can have a text/html or an application/pdf representation.

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
cacheStrategy, NOT_PROTECTED, PROTECTED, protectedTitleCache, titleCache
 
Fields inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
annotations, markers
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
protected Media()
          Constructor
 
Method Summary
 void addDescription(LanguageString description)
           
 void addDescription(String text, Language language)
           
 void addRepresentation(MediaRepresentation representation)
           
 void addTitle(LanguageString title)
          Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putTitle method instead
 void addTitle(String title, Language language)
          Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putTitle method instead
 Object clone()
          Clones this versionable entity.
 int compareTo(Object o)
           
 Map<Language,LanguageString> getAllDescriptions()
           
 Map<Language,LanguageString> getAllTitles()
           
 AgentBase getArtist()
           
 LanguageString getDescription(Language language)
           
 org.joda.time.DateTime getMediaCreated()
           
 Set<MediaRepresentation> getRepresentations()
           
 LanguageString getTitle()
           
 LanguageString getTitle(Language language)
           
 String getTitleCache()
           
 String getTitleCacheByLanguage(Language lang)
           
static Media NewInstance()
          Factory method
static Media NewInstance(URI uri, Integer size, String mimeType, String suffix)
          Factory method which creates a new media, adds a reprsentation including mime type and suffix information and adds to the later a representation part for a given uri and size Returns null if uri is empty
 void putTitle(LanguageString title)
           
 void putTitle(Language language, String title)
          Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to be the title of this media.
 void removeDescription(Language language)
           
 void removeRepresentation(MediaRepresentation representation)
           
 void removeTitle(Language language)
           
 void setArtist(AgentBase artist)
           
 void setMediaCreated(org.joda.time.DateTime mediaCreated)
           
 void setTitleCache(String titleCache)
          Sets the title cache without changing the protectCache flag
 
Methods inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
addCredit, addCredit, addExtension, addExtension, addRights, addSource, addSource, compareTo, generateTitle, getCacheStrategy, getCredits, getCredits, getData, getExtensions, getExtensions, getExtensions, getLsid, getRights, getSources, getTruncatedCache, initListener, isProtectedTitleCache, regenerateTitleCache, removeCredit, removeCredit, removeExtension, removeRights, removeSource, setCacheStrategy, setLsid, setProtectedTitleCache, setTitleCache, toString
 
Methods inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
equals, getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IAnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IVersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Constructor Detail

Media

protected Media()
Constructor

Method Detail

NewInstance

public static Media NewInstance()
Factory method

Returns:

NewInstance

public static Media NewInstance(URI uri,
                                Integer size,
                                String mimeType,
                                String suffix)
Factory method which creates a new media, adds a reprsentation including mime type and suffix information and adds to the later a representation part for a given uri and size Returns null if uri is empty

Returns:
Media

getRepresentations

public Set<MediaRepresentation> getRepresentations()

addRepresentation

public void addRepresentation(MediaRepresentation representation)

removeRepresentation

public void removeRepresentation(MediaRepresentation representation)

getArtist

public AgentBase getArtist()

setArtist

public void setArtist(AgentBase artist)

getTitle

public LanguageString getTitle()

getTitle

public LanguageString getTitle(Language language)

getAllTitles

public Map<Language,LanguageString> getAllTitles()

addTitle

@Deprecated
public void addTitle(LanguageString title)
Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putTitle method instead

Adds the languageString to the multilanguage text used to be the title of this media.

Parameters:
title - the languageString with the title in a particular language
See Also:
getTitle(), #putTitle(Language String)

putTitle

public void putTitle(LanguageString title)

addTitle

@Deprecated
public void addTitle(String title,
                                Language language)
Deprecated. should follow the put semantic of maps, this method will be removed in v4.0 Use the putTitle method instead

Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to be the title of this media.

Parameters:
text - the title in a particular language
language - the language in which the title string is formulated
See Also:
getTitle(), putTitle(LanguageString)

putTitle

public void putTitle(Language language,
                     String title)
Creates a language string based on the given text string and the given language and adds it to the multilanguage text used to be the title of this media.

Parameters:
language - the language in which the title string is formulated
text - the title in a particular language
See Also:
getTitle(), putTitle(LanguageString)

removeTitle

public void removeTitle(Language language)

getTitleCacheByLanguage

public String getTitleCacheByLanguage(Language lang)

setTitleCache

public void setTitleCache(String titleCache)
Description copied from interface: IIdentifiableEntity
Sets the title cache without changing the protectCache flag

Specified by:
setTitleCache in interface IIdentifiableEntity
Overrides:
setTitleCache in class IdentifiableEntity<IIdentifiableEntityCacheStrategy>
See Also:
IIdentifiableEntity.setTitleCache(String, boolean)

getTitleCache

public String getTitleCache()
Specified by:
getTitleCache in interface IIdentifiableEntity
Overrides:
getTitleCache in class IdentifiableEntity<IIdentifiableEntityCacheStrategy>

getMediaCreated

public org.joda.time.DateTime getMediaCreated()

setMediaCreated

public void setMediaCreated(org.joda.time.DateTime mediaCreated)

getAllDescriptions

public Map<Language,LanguageString> getAllDescriptions()

getDescription

public LanguageString getDescription(Language language)

addDescription

public void addDescription(LanguageString description)

addDescription

public void addDescription(String text,
                           Language language)

removeDescription

public void removeDescription(Language language)

clone

public Object clone()
             throws CloneNotSupportedException
Description copied from class: VersionableEntity
Clones this versionable entity. Set fields for nextVersion, previousVersion, updated, updatedBy and createdBy are set to null The id is set to 0. The uuid is created new. The createdWhen is set to the current date.

Overrides:
clone in class IdentifiableEntity<IIdentifiableEntityCacheStrategy>
Throws:
CloneNotSupportedException
See Also:
Object.clone()

compareTo

public int compareTo(Object o)


Copyright © 2007-2013 EDIT. All Rights Reserved.