Interface CMLocalized

All Superinterfaces:
com.coremedia.objectserver.dataviews.AssumesIdentity, CMObject, com.coremedia.objectserver.beans.ContentBean
All Known Subinterfaces:
CMAbstractCode, CMAction, CMArticle, CMAudio, CMChannel, CMCollection<T>, CMContext, CMCSS, CMDownload, CMDynamicList<T>, CMExternalLink, CMFolderProperties, CMGallery<T>, CMHasContexts, CMHTML, CMImage, CMImageMap, CMInteractive, CMJavaScript, CMLinkable, CMLocTaxonomy, CMMedia, CMNavigation, CMPerson, CMPicture, CMPlaceholder, CMQueryList, CMResourceBundle, CMSettings, CMSite, CMSitemap, CMSpinner, CMSymbol, CMTaxonomy, CMTeasable, CMTeaser, CMTheme, CMVideo, CMViewtype, CMVisual

public interface CMLocalized extends CMObject

Nearly everything except very technical entities is localizable, so this type is nearly top level.

Derived doctypes must override the master linklist and restrict it to exactly their own type.

Represents the document type CMLocalized.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the document property 'locale'.
    static final String
    Name of the document property 'master'.
    static final String
    Name of the document property 'masterVersion'.
    static final String
    Name of the ContentType 'CMLocalized'.

    Fields inherited from interface com.coremedia.objectserver.beans.ContentBean

    METADATA_PROPERTIES_PREFIX
  • Method Summary

    Modifier and Type
    Method
    Description
    Map<String,? extends com.coremedia.cae.aspect.Aspect<? extends CMLocalized>>
    Deprecated.
    since 1907.1; Implement optional features as extensions.
    List<? extends com.coremedia.cae.aspect.Aspect<? extends CMLocalized>>
    Deprecated.
    since 1907.1; Implement optional features as extensions.
    Returns the country/region of this document which will either be the empty string or an uppercase ISO 3166 2-letter code.
    Returns the language of this document which is either the empty string or a lowercase ISO 639 code.
    Returns the Locale of this document.
    Returns the Locale specific variants of this CMLocalized
    Returns the value of the document property MASTER.
    int
    Returns the value of the document property MASTER_VERSION.
    Returns the variants of this CMLocalized indexed by their Locale

    Methods inherited from interface com.coremedia.objectserver.dataviews.AssumesIdentity

    assumeIdentity

    Methods inherited from interface com.coremedia.blueprint.common.contentbeans.CMObject

    getAspectsProvider, getContentId, getUuid

    Methods inherited from interface com.coremedia.objectserver.beans.ContentBean

    getContent, getContentBeanFactory
  • Field Details

  • Method Details

    • getAspectByName

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

      @Deprecated List<? extends com.coremedia.cae.aspect.Aspect<? extends CMLocalized>> 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 CMObject
      Returns:
      a list of Aspects
    • getVariantsByLocale

      Map<Locale,? extends CMLocalized> getVariantsByLocale()
      Returns the variants of this CMLocalized indexed by their Locale
      Returns:
      the variants of this CMLocalized indexed by their Locale
    • getLocalizations

      Collection<? extends CMLocalized> getLocalizations()

      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>
       
      Returns:
      the Locale specific variants of this CMLocalized
    • getMaster

      CMLocalized getMaster()
      Returns the value of the document property MASTER.
      Returns:
      a CMLocalized object
    • getMasterVersion

      int getMasterVersion()
      Returns the value of the document property MASTER_VERSION.
      Returns:
      the value of the document property MASTER_VERSION
    • getLocale

      Locale getLocale()

      Returns the Locale of this document.

      Usage:

      Given one entry localizationof getLocalizations() above, render a link to a alternate locale of the current document.

      Freemarker:
      
       <link rel="alternate"
             hreflang="${localization.locale.toLanguageTag()}"
             href="${cm.getLink(localization)}"
             title="${localization.locale.getDisplayName(self.content.locale)} | ${localization.locale.getDisplayName()}"/>
       
      JSP:
      
       <cm:link var="localitationLink" target="${localization}"/>
       <link rel="alternate"
             hreflang="${localization.locale.toLanguageTag()}"
             href="${localitationLink}"
             title="${localization.locale.getDisplayName(self.content.locale)} | ${localization.locale.getDisplayName()}" />
       
      Returns:
      the Locale of this document.
    • getLang

      String getLang()
      Returns the language of this document which is either the empty string or a lowercase ISO 639 code.
      Returns:
      the language of this document
    • getCountry

      String getCountry()
      Returns the country/region of this document which will either be the empty string or an uppercase ISO 3166 2-letter code.
      Returns:
      the country/region of this document