There are several advanced services related to the rendering of content fragments. To use these services, the resource types of such components must make themselves known to the content fragments framework.
This is done by configuring the OSGi Service - Content Fragment Component Configuration.
If you do not need the advanced services described below, you can ignore this configuration.
When you are extending or using the out-of-the-box component(s), it is not recommended to change the configuration.
You can write a component from scratch that uses the Content Fragments API only, with no advanced services. However, in such a case, you will have to develop your component so that it handles the appropriate processing.
Therefore, it is recommended to use the core components.
The services that require the registration of a component are:
If you need one or more of these features, then (typically) it is easier to use the out-of-the-box functionality, instead of developing it from scratch.
The configuration needs to be bound to the OSGi service Content Fragment Component Configuration:
com.adobe.cq.dam.cfm.impl.component.ComponentConfigImpl
See Configuring OSGi for further details.
For example:
The OSGi configuration is:
Label | OSGi Configuration |
Description |
Resource type | dam.cfm.component.resourceType |
The resource type to register; e.g.
|
Reference property | dam.cfm.component.fileReferenceProp |
The name of the property that contains the reference to the fragment; e.g. fragmentPath or fileReference |
Element(s) property | dam.cfm.component.elementsProp |
The name of the property that contains the name(s) of the element(s) to render; e.g.elementName |
Variation property |
dam.cfm.component.variationProp |
The name of the property that contains the name of the variation to render; e.g.variationName |
For some functionality (e.g. to render only a paragraph range) you will have to adhere to some conventions:
Property Name | Description |
paragraphRange |
A string property that defines the range of paragraphs to be output if in single element render mode. Format:
|
paragraphScope |
A string property that defines how paragraphs are to be output if in single element render mode. Values:
|
paragraphHeadings |
A boolean property that defines if headings (for example, h1 , h2 , h3 ) are counted as paragraphs (true ) or not (false ) |
This may change in later 6.5 milestones.
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"