Class ContentBundleMergeStrategy
java.lang.Object
org.craftercms.core.xml.mergers.impl.strategies.ContentBundleMergeStrategy
- All Implemented Interfaces:
DescriptorMergeStrategy
DescriptorMergeStrategy that returns the level descriptors in the hierarchy and the base descriptors
when some of the parent folders are part of a content bundle (which is similar to a resource bundle, but instead
of simple properties, a content bundle is formed by XML content (descriptors)). E.g., for a descriptor path
folder1/folder2_es/file.xml, the descriptor folder1/folder2/file.xml is returned for
the merge.- Author:
- Sumer Jabri, Alfonso Vásquez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.dom4j.DocumentgetDescriptorDom(Context context, CachingOptions cachingOptions, String url) getDescriptors(Context context, CachingOptions cachingOptions, String mainDescriptorUrl, org.dom4j.Document mainDescriptorDom) Returns the list of descriptors in the order they should be merged, given the URI of the primary descriptor.getDescriptors(Context context, CachingOptions cachingOptions, String mainDescriptorUrl, org.dom4j.Document mainDescriptorDom, boolean mainDescriptorOptional) Returns the list of descriptors in the order they should be merged, given the URI of the primary descriptor.voidsetBaseDelimiter(String baseDelimiter) voidsetBaseMergeStrategyResolver(DescriptorMergeStrategyResolver baseMergeStrategyResolver) voidsetRegularMergeStrategy(DescriptorMergeStrategy regularMergeStrategy) voidsetUrlParser(ContentBundleUrlParser urlParser)
-
Constructor Details
-
ContentBundleMergeStrategy
public ContentBundleMergeStrategy()
-
-
Method Details
-
setUrlParser
-
setBaseDelimiter
-
setBaseMergeStrategyResolver
-
setRegularMergeStrategy
-
getDescriptors
public List<MergeableDescriptor> getDescriptors(Context context, CachingOptions cachingOptions, String mainDescriptorUrl, org.dom4j.Document mainDescriptorDom) throws XmlMergeException Description copied from interface:DescriptorMergeStrategyReturns the list of descriptors in the order they should be merged, given the URI of the primary descriptor.- Specified by:
getDescriptorsin interfaceDescriptorMergeStrategy- Parameters:
context- the current contextcachingOptions- caching options in case you need access to itemsmainDescriptorUrl- the URL of the main descriptormainDescriptorDom- the DOM of the main descriptor- Returns:
- a list of
MergeableDescriptors representing the descriptors to merge - Throws:
XmlMergeException
-
getDescriptors
public List<MergeableDescriptor> getDescriptors(Context context, CachingOptions cachingOptions, String mainDescriptorUrl, org.dom4j.Document mainDescriptorDom, boolean mainDescriptorOptional) throws XmlMergeException Description copied from interface:DescriptorMergeStrategyReturns the list of descriptors in the order they should be merged, given the URI of the primary descriptor.- Specified by:
getDescriptorsin interfaceDescriptorMergeStrategy- Parameters:
context- the current contextcachingOptions- caching options in case you need access to itemsmainDescriptorUrl- the URL of the primary descriptormainDescriptorDom- the DOM of the main descriptormainDescriptorOptional- if the primary descriptor should be marked as optional- Returns:
- a list of
MergeableDescriptors representing the descriptors to merge - Throws:
XmlMergeException
-
getDescriptorDom
protected org.dom4j.Document getDescriptorDom(Context context, CachingOptions cachingOptions, String url)
-