Class DefaultCloneCategoryRelationshipsManager<P extends Category,R extends CloneCategoryRequest>

java.lang.Object
com.broadleafcommerce.catalog.clone.category.DefaultCloneCategoryRelationshipsManager<P,R>
All Implemented Interfaces:
CloneCategoryRelationshipsManager<P,R>

public class DefaultCloneCategoryRelationshipsManager<P extends Category,R extends CloneCategoryRequest> extends Object implements CloneCategoryRelationshipsManager<P,R>
Default implementation for CloneCategoryRelationshipsManager.
Author:
Chad Harchar (charchar)
  • Constructor Details

    • DefaultCloneCategoryRelationshipsManager

      public DefaultCloneCategoryRelationshipsManager(List<CloneCategoryRelationshipsService<P,R>> cloneCategoryRelationshipsServices, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
  • Method Details

    • cloneRelationships

      public void cloneRelationships(@NonNull R request, @NonNull P original, @NonNull P cloned, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: CloneCategoryRelationshipsManager
      Clone the Category relationships.
      Specified by:
      cloneRelationships in interface CloneCategoryRelationshipsManager<P extends Category,R extends CloneCategoryRequest>
      Parameters:
      request - the request to perform the clone operation
      original - the original Category
      cloned - the Category for which to clone relationships. The cloned relationships will be assigned to this Category.
      context - context information surrounding sandboxing and multitenant state
    • initializeChangeContainerIfNecessary

      @Nullable protected com.broadleafcommerce.data.tracking.core.context.ContextInfo initializeChangeContainerIfNecessary(@NonNull @NonNull Category cloned, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Initializes the ContextRequest.getChangeContainer() if applicable for cloned. This is important when cloning the related entities of cloned so that those clones are part of the same context in a parent-child relationship.
      Parameters:
      cloned - The cloned category
      context - The ContextInfo that may need the change container added for subsequent requests that clone the relatinships of cloned
      Returns:
      The initialized ContextInfo.
    • getCloneCategoryRelationshipsServices

      protected List<CloneCategoryRelationshipsService<P,R>> getCloneCategoryRelationshipsServices()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()