Interface ContentFragmentManager
-
public interface ContentFragmentManager
Implementations of this interface provide means to manage content fragments.Actions available from this interface:
- Creating new content fragments from a fragment template
- Utilities for handling associated content
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ContentFragment
create(Resource parent, Resource template, java.lang.String name, java.lang.String title)
Deprecated.java.util.Map<Resource,java.util.List<Resource>>
resolveAssociatedContent(ContentFragment fragment)
Resolves the associated content of the specified content fragment.java.util.List<Resource>
resolveAssociatedContentFlat(ContentFragment fragment)
Resolves the associated content of the specified content fragment.
-
-
-
Method Detail
-
create
@Deprecated ContentFragment create(Resource parent, Resource template, java.lang.String name, java.lang.String title) throws ContentFragmentException
Deprecated.Creates a new content fragment from the specified template.Transactional behavior: The caller is responsible for committing the respective
ResourceResolver
after the content fragment was created by this method.This method is deprecated since 1.1. Instead, use the following pattern:
template.adaptTo(FragmentTemplate.class).createFragment(parent, name, title)
- Parameters:
parent
- The parent for the new content fragmenttemplate
- The template to be usedname
- The (technical) name of the fragment to be createdtitle
- The (human-readable) title of the fragment to be created- Returns:
- The newly created content fragment
- Throws:
ContentFragmentException
- if the fragment could not be created
-
resolveAssociatedContent
java.util.Map<Resource,java.util.List<Resource>> resolveAssociatedContent(ContentFragment fragment)
Resolves the associated content of the specified content fragment.This means that references to collections are resolved to their content, whereas non-collections are simply taken over.
The method returns a table, which contains a list of resolved resources (value) per collection (key). Assets (like linked assets) are also added to this table, with the asset being both the key and the only member of the value's list.
- Parameters:
fragment
- The content fragment- Returns:
- List of resolved associated content, per collection/asset (for the latter, the asset is used as a key, and the value is a single list, containing the same asset)
-
resolveAssociatedContentFlat
java.util.List<Resource> resolveAssociatedContentFlat(ContentFragment fragment)
Resolves the associated content of the specified content fragment.This means that references to collections are resolved to their content, whereas non-collections are simply taken over.
This method returns a "flat" list of all resources that are either referenced (collection) or part of the associated content themselves (asset).
If a resource is part of multiple associated collection, it appears only once in this list.
- Parameters:
fragment
- The content fragment- Returns:
- List of resolved associated content, per collection/asset (for the latter, the asset is used as a key, and the value is a single list, containing the same asset)
-
-