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 Summary
ConstructorsConstructorDescriptionDefaultCloneCategoryRelationshipsManager(List<CloneCategoryRelationshipsService<P, R>> cloneCategoryRelationshipsServices, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidcloneRelationships(R request, P original, P cloned, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Clone theCategoryrelationships.protected List<CloneCategoryRelationshipsService<P,R>> protected com.broadleafcommerce.common.extension.TypeFactoryprotected com.broadleafcommerce.data.tracking.core.context.ContextInfoinitializeChangeContainerIfNecessary(@NonNull Category cloned, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Initializes theContextRequest.getChangeContainer()if applicable forcloned.
-
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:CloneCategoryRelationshipsManagerClone theCategoryrelationships.- Specified by:
cloneRelationshipsin interfaceCloneCategoryRelationshipsManager<P extends Category,R extends CloneCategoryRequest> - Parameters:
request- the request to perform the clone operationoriginal- the originalCategorycloned- theCategoryfor 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 theContextRequest.getChangeContainer()if applicable forcloned. This is important when cloning the related entities ofclonedso that those clones are part of the same context in a parent-child relationship.- Parameters:
cloned- The cloned categorycontext- TheContextInfothat may need the change container added for subsequent requests that clone the relatinships ofcloned- Returns:
- The initialized
ContextInfo.
-
getCloneCategoryRelationshipsServices
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-