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
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
FieldsModifier and TypeFieldDescriptionstatic 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 TypeMethodDescriptionMap<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.getLang()
Returns the language of this document which is either the empty string or a lowercase ISO 639 code.Returns the Locale of this document.Collection<? extends CMLocalized>
Returns theLocale
specific variants of thisCMLocalized
Returns the value of the document propertyMASTER
.int
Returns the value of the document propertyMASTER_VERSION
.Map<Locale,
? extends CMLocalized> Returns the variants of thisCMLocalized
indexed by theirLocale
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
-
NAME
Name of the ContentType
'CMLocalized'.- See Also:
-
MASTER
Name of the document property 'master'.- See Also:
-
MASTER_VERSION
Name of the document property 'masterVersion'.- See Also:
-
LOCALE
Name of the document property 'locale'.- See Also:
-
-
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 interfaceCMObject
- Returns:
- a Map from aspectIDs to Aspects
-
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 interfaceCMObject
- Returns:
- a list of Aspects
-
getVariantsByLocale
Map<Locale,? extends CMLocalized> getVariantsByLocale()Returns the variants of thisCMLocalized
indexed by theirLocale
- Returns:
- the variants of this
CMLocalized
indexed by theirLocale
-
getLocalizations
Collection<? extends CMLocalized> getLocalizations()Returns the
Locale
specific variants of thisCMLocalized
- 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 thisCMLocalized
-
getMaster
CMLocalized getMaster()Returns the value of the document propertyMASTER
.- Returns:
- a
CMLocalized
object
-
getMasterVersion
int getMasterVersion()Returns the value of the document propertyMASTER_VERSION
.- Returns:
- the value of the document property
MASTER_VERSION
-
getLocale
Locale getLocale()Returns the Locale of this document.
- Usage:
Given one entry
localization
ofgetLocalizations()
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
-