Interface CMAbstractCode

All Superinterfaces:
com.coremedia.objectserver.dataviews.AssumesIdentity, CMLocalized, CMObject, com.coremedia.objectserver.beans.ContentBean
All Known Subinterfaces:
CMCSS, CMJavaScript

public interface CMAbstractCode extends CMLocalized

Aka ClientCode. E.g. for CSS or JS. We represent script code as CoreMedia Richtext because of internal link support.

Represents the document type CMAbstractCode.

  • Field Details

  • Method Details

    • getMaster

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

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

      Collection<? extends CMAbstractCode> 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 CMLocalized
      Returns:
      the Locale specific variants of this CMLocalized
    • getAspectByName

      @Deprecated Map<String,? extends com.coremedia.cae.aspect.Aspect<? extends CMAbstractCode>> 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 CMLocalized
      Specified by:
      getAspectByName in interface CMObject
      Returns:
      a Map from aspectIDs to Aspects
    • getAspects

      @Deprecated List<? extends com.coremedia.cae.aspect.Aspect<? extends CMAbstractCode>> 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 CMLocalized
      Specified by:
      getAspects in interface CMObject
      Returns:
      a list of Aspects
    • getDescription

      String getDescription()
      Returns the value of the document property DESCRIPTION.
      Returns:
      the value of the document property DESCRIPTION
    • getCode

      com.coremedia.xml.Markup getCode()
      Returns the value of the document property CODE.
      Returns:
      the value of the document property CODE
    • getInclude

      @NonNull List<? extends CMAbstractCode> getInclude()
      Returns the value of the document property INCLUDE.
      Returns:
      a list of CMAbstractCode objects
    • getContentType

      String getContentType()
      Returns:
      the content type of the code, e.g. text/css
    • getDataUrl

      String getDataUrl()
      Returns the value of the document property DATA_URL.
      Returns:
      the value of the document property DATA_URL
    • getHtmlAttributes

      @NonNull Map<String,Object> getHtmlAttributes()
      Returns the value of the document property HTML_ATTRIBUTES.