Package com.adobe.cq.dam.cfm
Interface FragmentTemplate
-
- All Superinterfaces:
Adaptable
public interface FragmentTemplate extends Adaptable
Implementations of this interface allow to access the fragment template in a standardized way, independently of the actual content structure.
Each content fragment carries a copy of the template it was created from, hence it is independent from the original template (and from changes that happened there after the fragment was created).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ContentFragment
createFragment(Resource parent, java.lang.String name, java.lang.String title)
Creates a fragment from this fragment template.java.lang.String
getDescription()
Gets a description for the template (if available).java.util.Iterator<ElementTemplate>
getElements()
Gets an iterator on the templates for predefined elements.ElementTemplate
getForElement(ContentElement element)
Gets the template for the specified content element.VariationTemplate
getForVariation(ContentVariation variation)
Gets the template for the specified global content variation.java.util.Iterator<java.lang.String>
getInitialAssociatedContent()
Gets an iterator on the initial references that form the associated content of the fragment.MetaDataDefinition
getMetaDataDefinition()
Gets the meta data definition.java.lang.String
getThumbnailPath()
Gets the repository path to the template's thumbnail.java.lang.String
getTitle()
Gets the title of the template.java.util.Iterator<VariationTemplate>
getVariations()
Gets an iterator on the templates of predefined global variations.
-
-
-
Method Detail
-
getTitle
java.lang.String getTitle()
Gets the title of the template.- Returns:
- The title
-
getDescription
java.lang.String getDescription()
Gets a description for the template (if available).- Returns:
- The description; empty string if none is available
-
getThumbnailPath
java.lang.String getThumbnailPath()
Gets the repository path to the template's thumbnail.- Returns:
- The repository path to the template's thumbnail
- Since:
- 1.1
-
createFragment
ContentFragment createFragment(Resource parent, java.lang.String name, java.lang.String title) throws ContentFragmentException
Creates a fragment from this fragment template.- Parameters:
parent
- The parent of the fragment to be createdname
- The name of the fragment to be createdtitle
- The title of the fragment to be created- Returns:
- The newly created fragment
- Throws:
ContentFragmentException
- if the fragment could not be created- Since:
- 1.1
-
getElements
java.util.Iterator<ElementTemplate> getElements()
Gets an iterator on the templates for predefined elements.- Returns:
- Iterator on element templates
-
getForElement
ElementTemplate getForElement(ContentElement element)
Gets the template for the specified content element.- Parameters:
element
- The content element- Returns:
- The element template;
null
if there is no template for the specified element
-
getVariations
java.util.Iterator<VariationTemplate> getVariations()
Gets an iterator on the templates of predefined global variations.- Returns:
- Iterator on variation templates
-
getForVariation
VariationTemplate getForVariation(ContentVariation variation)
Gets the template for the specified global content variation.- Parameters:
variation
- The content variation- Returns:
- The variation template;
null
if there is no template for the specified variation
-
getInitialAssociatedContent
java.util.Iterator<java.lang.String> getInitialAssociatedContent()
Gets an iterator on the initial references that form the associated content of the fragment.- Returns:
- Iterator on the initial associated content
-
getMetaDataDefinition
MetaDataDefinition getMetaDataDefinition()
Gets the meta data definition.- Returns:
- The meta data definition
-
-