Interface CMMedia

All Superinterfaces:
com.coremedia.objectserver.dataviews.AssumesIdentity, BelowRootNavigation, CMHasContexts, CMLinkable, CMLocalized, CMObject, CMTeasable, com.coremedia.objectserver.beans.ContentBean, HasViewTypeName, Linkable, com.coremedia.blueprint.common.datevalidation.ValidityPeriod
All Known Subinterfaces:
CMAudio, CMHTML, CMInteractive, CMPicture, CMSpinner, CMVideo, CMVisual

public interface CMMedia extends CMTeasable

The abstract CMMedia type starts the media hierarchy defining data, caption and an alt property.

All subtypes override and specialize the BlobProperty defining the MIME-type. To allow not only Blobs as data CMMedia defines the data return type to be Object and leave it to the developer to concretise the type by covariant overriding the return type.

Additionally needed properties can be attached on server-side via a DocTypeAspect and represented by aspect content beans on client-side.

Represents the document type CMMedia.

  • Field Details

  • Method Details

    • getMaster

      CMMedia getMaster()
      Returns the value of the document property CMLocalized.MASTER.
      Specified by:
      getMaster in interface CMHasContexts
      Specified by:
      getMaster in interface CMLinkable
      Specified by:
      getMaster in interface CMLocalized
      Specified by:
      getMaster in interface CMTeasable
      Returns:
      a list of CMMedia object
    • getVariantsByLocale

      Map<Locale,? extends CMMedia> getVariantsByLocale()
      Description copied from interface: CMLocalized
      Returns the variants of this CMLocalized indexed by their Locale
      Specified by:
      getVariantsByLocale in interface CMHasContexts
      Specified by:
      getVariantsByLocale in interface CMLinkable
      Specified by:
      getVariantsByLocale in interface CMLocalized
      Specified by:
      getVariantsByLocale in interface CMTeasable
      Returns:
      the variants of this CMLocalized indexed by their Locale
    • getLocalizations

      Collection<? extends CMMedia> getLocalizations()
      Description copied from interface: CMLocalized

      Returns the Locale specific variants of this CMLocalized

      Usage:

      Add elements for each variant excluding self (self is of type Page in this example).

      Freemarker:
      
       <#if (self.content.localizations)?has_content>
         <#assign localizations=self.content.localizations![] />
         <#list localizations as localization>
           <#if localization.locale != self.content.locale>
             <link rel="alternate" ... />
           </#if>
         </#list>
       </#if>
       
      JSP:
      
       <c:set var="locales" value="${self.content.localizations}"/>
       <c:if test="${not empty locales}">
         <c:forEach var="localization" items="${locales}">
           <c:if test="${localization.locale != self.content.locale}">
             <cm:link var="localitationLink" target="${localization}"/>
             <link rel="alternate" ... />
           </c:if>
         </c:forEach>
       </c:if>
       
      Specified by:
      getLocalizations in interface CMHasContexts
      Specified by:
      getLocalizations in interface CMLinkable
      Specified by:
      getLocalizations in interface CMLocalized
      Specified by:
      getLocalizations in interface CMTeasable
      Returns:
      the Locale specific variants of this CMLocalized
    • getAspectByName

      @Deprecated Map<String,? extends com.coremedia.cae.aspect.Aspect<? extends CMMedia>> getAspectByName()
      Deprecated.
      since 1907.1; Implement optional features as extensions.
      Description copied from interface: CMObject

      Returns a Map from aspectIDs to Aspects. AspectIDs consists of an aspectname with a prefix which identifies the plugin provider.

      Usage:

      Access an aspect named osmPlugin.

      Freemarker:
      
       <#assign osmSocialPlugin=self.aspectByName['osmPlugin'] />
       
      JSP:
      
       <c:set var="osmSocialPlugin" value="${self.aspectByName['osmPlugin']}"/>
       
      Specified by:
      getAspectByName in interface CMHasContexts
      Specified by:
      getAspectByName in interface CMLinkable
      Specified by:
      getAspectByName in interface CMLocalized
      Specified by:
      getAspectByName in interface CMObject
      Specified by:
      getAspectByName in interface CMTeasable
      Returns:
      a Map from aspectIDs to Aspects
    • getAspects

      @Deprecated List<? extends com.coremedia.cae.aspect.Aspect<? extends CMMedia>> getAspects()
      Deprecated.
      since 1907.1; Implement optional features as extensions.
      Description copied from interface: CMObject

      Returns a list of all Aspect from all available PlugIns that are registered to this contentbean.

      Usage:

      Add all aspects with view asHead.

      Freemarker:
      
       <#list self.aspects as aspect>
         <@cm.include self=aspect view="asHeader"/>
       </#list>
       
      JSP:
      
       <c:forEach items="${self.aspects}" var="aspect">
         <cm:include self="${aspect}" view="asHeader"/>
       </c:forEach>
       
      Specified by:
      getAspects in interface CMHasContexts
      Specified by:
      getAspects in interface CMLinkable
      Specified by:
      getAspects in interface CMLocalized
      Specified by:
      getAspects in interface CMObject
      Specified by:
      getAspects in interface CMTeasable
      Returns:
      a list of Aspects
    • getCopyright

      String getCopyright()
      Returns the value of the document property COPYRIGHT.
      Returns:
      the value of the document property COPYRIGHT
    • getData

      Object getData()
      Returns the value of the document property (@link #data}
      Returns:
      the value of the document property (@link #data}
    • getCaption

      com.coremedia.xml.Markup getCaption()
      Returns the value of the document property CAPTION.
      Returns:
      the value of the document property CAPTION
    • getAlt

      String getAlt()
      Returns the value of the document property ALT.
      Returns:
      the value of the document property ALT
    • getTransformedData

      com.coremedia.cap.common.Blob getTransformedData(String transformName)
      Returns the transformed data blob for the given transformName
      Parameters:
      transformName -
      Returns:
      the transformed data blob for the given transformName
    • getTransformMap

      Map<String,String> getTransformMap()
      provides the transformMap for this media
      Returns:
      the transformData if exists, an empty Map when no transform data exists.
    • getDisableCropping

      boolean getDisableCropping()
      In Studio an editor can disable cropping for specific media in general. This is the getter to check this.
      Returns:
      true, if the media should be general uncropped.