Interface CMAbstractCode
- All Superinterfaces:
com.coremedia.objectserver.dataviews.AssumesIdentity,CMLocalized,CMObject,com.coremedia.objectserver.beans.ContentBean
- All Known Subinterfaces:
CMCSS,CMJavaScript
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the document property 'code'.static final StringName of the document property 'dataUrl'.static final StringName of the document property 'description'.static final StringName of the document property 'htmlAttributes'.static final StringName of the document property 'include'.static final StringName of the ContentType'CMAbstractCode'.Fields inherited from interface com.coremedia.blueprint.common.contentbeans.CMLocalized
LOCALE, MASTER, MASTER_VERSIONFields inherited from interface com.coremedia.objectserver.beans.ContentBean
METADATA_PROPERTIES_PREFIX -
Method Summary
Modifier and TypeMethodDescriptionMap<String,? extends com.coremedia.cae.aspect.Aspect<? extends CMAbstractCode>> Deprecated.since 1907.1; Implement optional features as extensions.List<? extends com.coremedia.cae.aspect.Aspect<? extends CMAbstractCode>>Deprecated.since 1907.1; Implement optional features as extensions.com.coremedia.xml.MarkupgetCode()Returns the value of the document propertyCODE.Returns the value of the document propertyDATA_URL.Returns the value of the document propertyDESCRIPTION.Returns the value of the document propertyHTML_ATTRIBUTES.List<? extends CMAbstractCode>Returns the value of the document propertyINCLUDE.Collection<? extends CMAbstractCode>Returns theLocalespecific variants of thisCMLocalizedReturns the value of the document propertyCMLocalized.MASTER.Map<Locale,? extends CMAbstractCode> Returns the variants of thisCMLocalizedindexed by theirLocaleMethods inherited from interface com.coremedia.objectserver.dataviews.AssumesIdentity
assumeIdentityMethods inherited from interface com.coremedia.blueprint.common.contentbeans.CMLocalized
getCountry, getLang, getLocale, getMasterVersionMethods inherited from interface com.coremedia.blueprint.common.contentbeans.CMObject
getAspectsProvider, getContentId, getUuidMethods inherited from interface com.coremedia.objectserver.beans.ContentBean
getContent, getContentBeanFactory
-
Field Details
-
NAME
Name of the ContentType'CMAbstractCode'.- See Also:
-
DESCRIPTION
Name of the document property 'description'.- See Also:
-
CODE
Name of the document property 'code'.- See Also:
-
INCLUDE
Name of the document property 'include'.- See Also:
-
DATA_URL
Name of the document property 'dataUrl'.- See Also:
-
HTML_ATTRIBUTES
Name of the document property 'htmlAttributes'.- See Also:
-
-
Method Details
-
getMaster
CMAbstractCode getMaster()Returns the value of the document propertyCMLocalized.MASTER.- Specified by:
getMasterin interfaceCMLocalized- Returns:
- a list of
CMAbstractCodeobject
-
getVariantsByLocale
Map<Locale,? extends CMAbstractCode> getVariantsByLocale()Description copied from interface:CMLocalizedReturns the variants of thisCMLocalizedindexed by theirLocale- Specified by:
getVariantsByLocalein interfaceCMLocalized- Returns:
- the variants of this
CMLocalizedindexed by theirLocale
-
getLocalizations
Collection<? extends CMAbstractCode> getLocalizations()Description copied from interface:CMLocalizedReturns the
Localespecific variants of thisCMLocalized- Usage:
Add elements for each variant excluding self (self is of type
Pagein 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:
getLocalizationsin interfaceCMLocalized- Returns:
- the
Localespecific variants of thisCMLocalized
-
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:CMObjectReturns 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:
getAspectByNamein interfaceCMLocalized- Specified by:
getAspectByNamein interfaceCMObject- Returns:
- a Map from aspectIDs to Aspects
-
getAspects
Deprecated.since 1907.1; Implement optional features as extensions.Description copied from interface:CMObjectReturns a list of all
Aspectfrom 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:
getAspectsin interfaceCMLocalized- Specified by:
getAspectsin interfaceCMObject- Returns:
- a list of Aspects
-
getDescription
String getDescription()Returns the value of the document propertyDESCRIPTION.- Returns:
- the value of the document property
DESCRIPTION
-
getCode
com.coremedia.xml.Markup getCode()Returns the value of the document propertyCODE.- Returns:
- the value of the document property
CODE
-
getInclude
Returns the value of the document propertyINCLUDE.- Returns:
- a list of
CMAbstractCodeobjects
-
getContentType
String getContentType()- Returns:
- the content type of the code, e.g. text/css
-
getDataUrl
String getDataUrl()Returns the value of the document propertyDATA_URL.- Returns:
- the value of the document property
DATA_URL
-
getHtmlAttributes
Returns the value of the document propertyHTML_ATTRIBUTES.
-