Class CMSMediaItem

java.lang.Object
io.goobi.viewer.model.cms.media.CMSMediaItem
All Implemented Interfaces:
BrowseElementInfo, Serializable, Comparable<CMSMediaItem>

@Entity public class CMSMediaItem extends Object implements BrowseElementInfo, Comparable<CMSMediaItem>, Serializable

CMSMediaItem class.

See Also:
  • Field Details

    • CONTENT_TYPE_XML

      public static final String CONTENT_TYPE_XML
      Constant CONTENT_TYPE_XML="text/xml"
      See Also:
    • CONTENT_TYPE_SVG

      public static final String CONTENT_TYPE_SVG
      Constant CONTENT_TYPE_SVG="image/svg+xml"
      See Also:
    • CONTENT_TYPE_ICO

      public static final String CONTENT_TYPE_ICO
      Constant CONTENT_TYPE_SVG="image/svg+xml"
      See Also:
    • CONTENT_TYPE_PDF

      public static final String CONTENT_TYPE_PDF
      Constant CONTENT_TYPE_PDF="application/pdf"
      See Also:
    • CONTENT_TYPE_GIF

      public static final String CONTENT_TYPE_GIF
      Constant CONTENT_TYPE_GIF="application/gif"
      See Also:
    • CONTENT_TYPE_VIDEO

      public static final String CONTENT_TYPE_VIDEO
      Constant CONTENT_TYPE_VIDEO="video"
      See Also:
    • CONTENT_TYPE_AUDIO

      public static final String CONTENT_TYPE_AUDIO
      Constant CONTENT_TYPE_AUDIO="audio"
      See Also:
  • Constructor Details

    • CMSMediaItem

      public CMSMediaItem()
      default constructor
    • CMSMediaItem

      public CMSMediaItem(CMSMediaItem orig)
      copy constructor
      Parameters:
      orig - a CMSMediaItem object.
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getContentType

      public String getContentType()
      Determines this media item's file's content type via the extension.
      Returns:
      Content type string
    • isHasExportableText

      public boolean isHasExportableText()
      Checks whether this media item contains a text file that can be exported for indexing.
      Returns:
      true if item content types allows for text export; false otherwise
    • getId

      public Long getId()

      Getter for the field id.

      Returns:
      the id
    • setId

      public void setId(Long id)

      Setter for the field id.

      Parameters:
      id - the id to set
    • getFileName

      public String getFileName()

      Getter for the field fileName.

      Returns:
      the fileName
    • setFileName

      public void setFileName(String fileName)

      Setter for the field fileName.

      Parameters:
      fileName - the fileName to set
    • getAlternativeText

      public String getAlternativeText()

      Getter for the field alternativeText.

      Returns:
      the alternativeText
    • setAlternativeText

      public void setAlternativeText(String alternativeText)

      Setter for the field alternativeText.

      Parameters:
      alternativeText - the alternativeText to set
    • getMetadataForLocale

      public CMSMediaItemMetadata getMetadataForLocale(Locale locale)

      getMetadataForLocale.

      Parameters:
      locale - a Locale object.
      Returns:
      media item metadata for the given locale; null if no locale given
    • getMetadataForLanguage

      public CMSMediaItemMetadata getMetadataForLanguage(String language)

      getMetadataForLanguage.

      Parameters:
      language - a String object.
      Returns:
      media item metadata for the given locale
    • getMetadata

      public List<CMSMediaItemMetadata> getMetadata()

      Getter for the field metadata.

      Returns:
      the metadata
    • setMetadata

      public void setMetadata(List<CMSMediaItemMetadata> metadata)

      Setter for the field metadata.

      Parameters:
      metadata - the metadata to set
    • addMetadata

      public void addMetadata(CMSMediaItemMetadata metadata)
      Adds a metadata item to the list of image metadata. If a metadata item with the same language string exists, it is replaced
      Parameters:
      metadata - a CMSMediaItemMetadata object.
    • getCurrentLanguageMetadata

      public CMSMediaItemMetadata getCurrentLanguageMetadata()

      getCurrentLanguageMetadata.

      Returns:
      metadata list for the current language
    • hasCateories

      public boolean hasCateories()

      hasCateories.

      Returns:
      a boolean.
    • getCategories

      public List<CMSCategory> getCategories()
    • setCategories

      public void setCategories(List<CMSCategory> categories)

      Setter for the field categories.

      Parameters:
      categories - a List object.
    • removeCategory

      public boolean removeCategory(CMSCategory cat)

      removeCategory.

      Parameters:
      cat - a CMSCategory object.
      Returns:
      a boolean.
    • addCategory

      public boolean addCategory(CMSCategory cat)

      addCategory.

      Parameters:
      cat - a CMSCategory object.
      Returns:
      a boolean.
    • isImportant

      public boolean isImportant()
    • setImportant

      public void setImportant(boolean important)

      setImportant.

      Parameters:
      important - a boolean.
    • getPriority

      public CMSMediaItem.Priority getPriority()
    • setPriority

      public void setPriority(CMSMediaItem.Priority priority)

      Setter for the field priority.

      Parameters:
      priority - the priority to set
    • getLinkURI

      public URI getLinkURI()

      getLinkURI.

      Specified by:
      getLinkURI in interface BrowseElementInfo
      Returns:
      a URI object.
    • getLinkURI

      public URI getLinkURI(javax.servlet.http.HttpServletRequest request)

      getLinkURI.

      Specified by:
      getLinkURI in interface BrowseElementInfo
      Parameters:
      request - a HttpServletRequest object.
      Returns:
      a URI object.
    • getLink

      public String getLink()

      Getter for the field link.

      Returns:
      the entered link url
    • setLink

      public void setLink(String linkUrl)
      set the link for this media item
      Parameters:
      linkUrl - a String object.
      Throws:
      URISyntaxException - if any.
    • getDescription

      public String getDescription()

      getDescription.

      Specified by:
      getDescription in interface BrowseElementInfo
      Returns:
      a String object.
    • getName

      public String getName()

      getName.

      Specified by:
      getName in interface BrowseElementInfo
      Returns:
      a String object.
    • getIconURI

      public URI getIconURI()

      getIconURI.

      Specified by:
      getIconURI in interface BrowseElementInfo
      Returns:
      a URI object.
    • getIconURI

      public URI getIconURI(int width, int height)

      getIconURI.

      Specified by:
      getIconURI in interface BrowseElementInfo
      Parameters:
      width - a int.
      height - a int.
      Returns:
      a URI object.
    • getIconURI

      public URI getIconURI(int size)

      getIconURI.

      Specified by:
      getIconURI in interface BrowseElementInfo
      Parameters:
      size - a int.
      Returns:
      a URI object.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getName

      public String getName(String language)
    • getDescription

      public String getDescription(String language)
      Specified by:
      getDescription in interface BrowseElementInfo
      Returns:
      a String object.
    • getDisplayOrder

      public int getDisplayOrder()
    • setDisplayOrder

      public void setDisplayOrder(int displayOrder)

      Setter for the field displayOrder.

      Parameters:
      displayOrder - the displayOrder to set
    • getImageURI

      public String getImageURI()

      getImageURI.

      Returns:
      a String object.
    • getTranslationsForName

      public de.intranda.metadata.multilanguage.IMetadataValue getTranslationsForName()

      getTranslationsForName.

      Specified by:
      getTranslationsForName in interface BrowseElementInfo
      Returns:
      a IMetadataValue object.
    • getTranslationsForDescription

      public de.intranda.metadata.multilanguage.IMetadataValue getTranslationsForDescription()

      getTranslationsForDescription.

      Specified by:
      getTranslationsForDescription in interface BrowseElementInfo
      Returns:
      a IMetadataValue object.
    • isFinished

      public boolean isFinished(Locale locale)

      isFinished.

      Parameters:
      locale - a Locale object.
      Returns:
      a boolean.
    • getFinishedLocales

      public List<Locale> getFinishedLocales()

      getFinishedLocales.

      Returns:
      a List object.
    • compareTo

      public int compareTo(CMSMediaItem o)
      Specified by:
      compareTo in interface Comparable<CMSMediaItem>
    • getLastModifiedTime

      public FileTime getLastModifiedTime()

      Getter for the field lastModifiedTime.

      Returns:
      the lastModifiedTime. May be null only if no file exists or last modified time cannot be read
    • getFilePath

      public Path getFilePath()

      getFilePath.

      Returns:
      a Path object.
    • wrapCategories

      public List<Selectable<CMSCategory>> wrapCategories(List<CMSCategory> categories)

      wrapCategories.

      Parameters:
      categories - a List object.
      Returns:
      the categoryMap. Never null. If it isn't defined yet, create a map from all categories