Definition of Advanced Services that need Configuration

The services that require the registration of a component are:

  • Determining dependencies correctly during publication (that is, ensure that fragments & models can be automatically published with a page if they have changed since last publication).
  • Support for content fragments in full text search.
  • The management/handling of in-between content.
  • The management/handling of mixed media assets.
  • Dispatcher flush for referenced fragments (if a page containing a fragment is re-published).
  • Using paragraph-based rendering.

If you need one or more of these features, then (typically) it is easier to use the out-of-the-box Advanced Services, instead of developing them from scratch.

OSGi Service - Content Fragment Component Configuration

The configuration must be bound to the OSGi service Content Fragment Component Configuration:

com.adobe.cq.dam.cfm.impl.component.ComponentConfigImpl

NOTE
See OSGi Configuration for further details.

For example:

OSGi Configuration Content Fragment Component Configuration

The OSGi configuration is:

LabelOSGi ConfigurationDescription
Resource typedam.cfm.component.resourceType

The resource type to register; for example,

core/wcm/components/contentfragment/v1/contentfragment

Reference propertydam.cfm.component.fileReferencePropThe name of the property that contains the reference to the fragment; for example, fragmentPath or fileReference
Element(s) propertydam.cfm.component.elementsPropThe name of the property that contains the name(s) of the element(s) to render; for example,elementName
Variation propertydam.cfm.component.variationPropThe name of the property that contains the name of the variation to render; for example,variationName

For some functionality your component will have to adhere to predefined conventions. The following table details the properties that need to be defined, by your component, for each paragraph (that is, jcr:paragraph for each component instance) so that the services can detect and process them correctly.

Property NameDescription
paragraphScope

A string property that defines how paragraphs are to be output if in single element render mode.

Values:

  • all : to render all paragraphs
  • range : to render the range of paragraphs provided by paragraphRange
paragraphRange

A string property that defines the range of paragraphs to be output if in single element render mode.

Format:

  • 1 or 1-3 or 1-3;6;7-8 or *-3;5-*

    • - range indicator
    • ; list separator
    • * wildcard
  • only evaluated if paragraphScope is set to range

paragraphHeadingsA boolean property that defines if headings (for example, h1, h2, h3) are counted as paragraphs (true) or not (false)

Example

As an example, see the following (on an out-of-the-box AEM instance):

/apps/core/wcm/config/com.adobe.cq.dam.cfm.impl.component.ComponentConfigImpl-core-comp-v1.config

This contains:

dam.cfm.component.resourceType="core/wcm/components/contentfragment/v1/contentfragment"
dam.cfm.component.fileReferenceProp="fragmentPath"
dam.cfm.component.elementsProp="elementName"
dam.cfm.component.variationProp="variationName"

Experience Manager