Class ExplicitParentMergeStrategy

java.lang.Object
org.craftercms.core.xml.mergers.impl.strategies.ExplicitParentMergeStrategy
All Implemented Interfaces:
DescriptorMergeStrategy

public class ExplicitParentMergeStrategy extends Object implements DescriptorMergeStrategy
Implementation of DescriptorMergeStrategy that merges the descriptor with an explicitly named parent. The parent is also checked for any other descriptors to merge.
Author:
avasquez
  • Constructor Details

    • ExplicitParentMergeStrategy

      public ExplicitParentMergeStrategy()
  • Method Details

    • setMergeStrategyResolver

      public void setMergeStrategyResolver(DescriptorMergeStrategyResolver mergeStrategyResolver)
    • setParentDescriptorElementXPathQuery

      public void setParentDescriptorElementXPathQuery(String parentDescriptorElementXPathQuery)
    • getDescriptors

      public List<MergeableDescriptor> getDescriptors(Context context, CachingOptions cachingOptions, String mainDescriptorUrl, org.dom4j.Document mainDescriptorDom) throws XmlMergeException
      Description copied from interface: DescriptorMergeStrategy
      Returns the list of descriptors in the order they should be merged, given the URI of the primary descriptor.
      Specified by:
      getDescriptors in interface DescriptorMergeStrategy
      Parameters:
      context - the current context
      cachingOptions - caching options in case you need access to items
      mainDescriptorUrl - the URL of the main descriptor
      mainDescriptorDom - 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: DescriptorMergeStrategy
      Returns the list of descriptors in the order they should be merged, given the URI of the primary descriptor.
      Specified by:
      getDescriptors in interface DescriptorMergeStrategy
      Parameters:
      context - the current context
      cachingOptions - caching options in case you need access to items
      mainDescriptorUrl - the URL of the primary descriptor
      mainDescriptorDom - the DOM of the main descriptor
      mainDescriptorOptional - 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)