Skip navigation links

Package com.adobe.cq.dam.cfm

Defines the basic API for creating and managing Content Fragments.

See: Description

Package com.adobe.cq.dam.cfm Description

Defines the basic API for creating and managing Content Fragments.

Main purpose of this API is to abstract the corresponding content structure and provide convenience methods to manage a fragment.

Elements

Each content fragment must have at least one element, but can finally consist of multiple elements. Variations are completely optional.

Content (= text fragments) is managed both on the element and the variation level. This means: To access an element's text, first retrieve the element, then use the respective methods to access the text and its MIME type (note that the com.adobe.cq.dam.cfm.converter API provides means to get a standardized HTML representation of the fragment).

Basic usage

To create a ContentFragment from a Sling resource, simply adapt the resource to ContentFragment.

After adapting the resource, you can access and manipulate the fragment using the respective methods of the API.

Note that the API doesn't assume auto-commit. This means that you have to commit the org.apache.sling.api.resource.ResourceResolver explicitly after manipulating the fragment.

Concurrency

The API is not explicitly designed for sharing its objects between multiple thread, so the user has to take care of correct synchronization should the use case require shared access.

References

The com.adobe.cq.dam.cfm.converter API provides means to create an HTML representation for content that leverages other formats like plain text or Markdown. It is also used to convert formats back and forth.

The com.adobe.cq.dam.cfm.content API is leveraged for post-processing the content of a fragment instance, before it eventually gets rendered within a specific context. "Fragment instance" in this case means a single occurrence of the fragment in a page (for example).

Skip navigation links

"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"