Class DefaultAugmentationProvider

java.lang.Object
com.broadleafcommerce.metadata.core.service.DefaultAugmentationProvider
All Implemented Interfaces:
AugmentationProvider

@Order(0) public class DefaultAugmentationProvider extends Object implements AugmentationProvider
The primary provider for fetching and applying `Augmentation` domain on top of view container metadata. This provider handles augmentation by applying the `Augmentation` in order of creation and according to their `AugmentationChangeType` enum.
Author:
Nick Crum (ncrum)
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • augment

      public AugmentedContainer augment(com.broadleafcommerce.metadata.dsl.core.Component<?> container, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: AugmentationProvider
      Augments the provided `ViewComponent` with additional properties.
      Specified by:
      augment in interface AugmentationProvider
      Parameters:
      container - the view container component
      Returns:
      the mutated `ViewComponent`
    • applyQueryBuilderAugmentations

      protected void applyQueryBuilderAugmentations(com.broadleafcommerce.metadata.dsl.core.Component<?> container, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Recursively applies augmentations to a container's Component.getComponents(). This only supports field components of type FieldTypes.RULE_BUILDER and not FieldTypes.QUERY_BUILDER.
      Parameters:
      container - The container component
      contextInfo - Additional sandbox and multitenant info
    • getAugmentations

      @NonNull protected List<Augmentation> getAugmentations(String containerKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • getQueryBuilderAugmentations

      @NonNull protected List<Augmentation> getQueryBuilderAugmentations(String containerKey, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • processQueryBuilderAugmentation

      protected void processQueryBuilderAugmentation(com.broadleafcommerce.metadata.dsl.core.Component<?> component, com.broadleafcommerce.metadata.dsl.core.extension.BuilderFieldSource<?> fieldSource, Augmentation augmentation)
    • removeQueryBuilderField

      protected void removeQueryBuilderField(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
    • buildQueryBuilderField

      @NonNull protected com.broadleafcommerce.metadata.dsl.core.Field<?> buildQueryBuilderField(com.broadleafcommerce.metadata.dsl.core.extension.BuilderFieldSource<?> component, Augmentation augmentation, FieldAugmentationPayload payload)
    • getFieldAugmentationPayload

      protected FieldAugmentationPayload getFieldAugmentationPayload(Augmentation augmentation)
    • augmentationApplied

      protected boolean augmentationApplied(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
    • augment

      @Nullable protected com.broadleafcommerce.metadata.dsl.core.Component<?> augment(com.broadleafcommerce.metadata.dsl.core.Component<?> component, Augmentation augmentation)
      Augments the given component according to the given augmentation. This returns a new instance representing the augmented component, the original component passed in is unchanged
      Parameters:
      component - the component to augment
      augmentation - the definition of the changes to apply to the component
      Returns:
      a new component representing how this component was changed. null for AugmentationChangeType.REMOVE
    • augmentChildComponents

      protected void augmentChildComponents(Map<String,com.broadleafcommerce.metadata.dsl.core.Component<?>> components, Augmentation augmentation)
    • augmentChildActions

      protected void augmentChildActions(Map<String,com.broadleafcommerce.metadata.dsl.core.Action<?>> actions, Augmentation augmentation)