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
ConstructorDescriptionDefaultCloneCategoryRelationshipsManager
(List<CloneCategoryRelationshipsService<P, R>> cloneCategoryRelationshipsServices, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneRelationships
(R request, P original, P cloned, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Clone theCategory
relationships.protected List<CloneCategoryRelationshipsService<P,
R>> protected com.broadleafcommerce.common.extension.TypeFactory
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
initializeChangeContainerIfNecessary
(@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:CloneCategoryRelationshipsManager
Clone theCategory
relationships.- Specified by:
cloneRelationships
in interfaceCloneCategoryRelationshipsManager<P extends Category,
R extends CloneCategoryRequest> - Parameters:
request
- the request to perform the clone operationoriginal
- the originalCategory
cloned
- theCategory
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 theContextRequest.getChangeContainer()
if applicable forcloned
. This is important when cloning the related entities ofcloned
so that those clones are part of the same context in a parent-child relationship.- Parameters:
cloned
- The cloned categorycontext
- TheContextInfo
that 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()
-