Class EntityDuplicatorImpl
java.lang.Object
org.broadleafcommerce.common.copy.MultiTenantCopier
org.broadleafcommerce.common.persistence.EntityDuplicatorImpl
- All Implemented Interfaces:
EntityDuplicator,org.springframework.core.Ordered
@Service("blEntityDuplicator")
public class EntityDuplicatorImpl
extends MultiTenantCopier
implements EntityDuplicator
- Author:
- Jeff Fischer
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection<EntityDuplicationHelper>protected EntityDuplicatorExtensionManagerprotected booleanprotected MultiTenantCopierExtensionManagerFields inherited from class org.broadleafcommerce.common.copy.MultiTenantCopier
catalogCopierOptimizationEnabled, classExcludeRegexPatternList, genericEntityService, LOG, order, transUtilFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TCreate a production duplicate of the entity specified in the params.<T> Tcopy(Class<T> entityClass, Long id, Map<String, String> copyHints, EntityDuplicateModifier... modifiers) Deprecated.<T> Tcopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity) Create a production duplicate of the entity specified in the params.<T> Tcopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity, Map<String, String> copyHints, EntityDuplicateModifier... modifiers) Deprecated.voidcopyEntities(MultiTenantCopyContext context) Main method that should be implemented by eachMultiTenantCopierto drive the logic of copying that particular entity to the new derived catalog.protected Set<EntityDuplicationHelper>protected <T> TperformCopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity) protected <T> TperformCopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity, Map<String, String> copyHints, EntityDuplicateModifier... modifiers) Deprecated.protected voidputAllCopyHints(MultiTenantCopyContext context, Set<EntityDuplicationHelper> helpers) booleanValidate whether or not this feature is enabled and whether the passed entity params are valid for duplication.booleanValidate whether or not this feature is enabled and whether or not the passed entity params are valid for duplication.Methods inherited from class org.broadleafcommerce.common.copy.MultiTenantCopier
addPattern, copyEntitiesOfType, dontTraversThroughEntityFromTheDB, excludeFromCopyRegexPattern, getOrder, needToAdd, persistCopyObjectTree, persistCopyObjectTreeInternal, persistNode, readAll, readAll, readAllIds, readCount, save, setOrder
-
Field Details
-
isActive
@Value("${admin.entity.duplication.isactive:false}") protected boolean isActive -
extensionManager
-
mtCopierExtensionManager
-
entityDuplicationHelpers
-
-
Constructor Details
-
EntityDuplicatorImpl
public EntityDuplicatorImpl()
-
-
Method Details
-
copyEntities
Description copied from class:MultiTenantCopierMain method that should be implemented by eachMultiTenantCopierto drive the logic of copying that particular entity to the new derived catalog.- Specified by:
copyEntitiesin classMultiTenantCopier- Throws:
Exception
-
validate
Description copied from interface:EntityDuplicatorValidate whether or not this feature is enabled and whether the passed entity params are valid for duplication.- Specified by:
validatein interfaceEntityDuplicator- Returns:
-
validate
Description copied from interface:EntityDuplicatorValidate whether or not this feature is enabled and whether or not the passed entity params are valid for duplication.- Specified by:
validatein interfaceEntityDuplicator- Returns:
-
copy
@Deprecated public <T> T copy(Class<T> entityClass, Long id, Map<String, String> copyHints, EntityDuplicateModifier... modifiers) Deprecated.Instead of passing inEntityDuplicateModifiers, add the beans toEntityDuplicationHelpers. Additionally, add copy hints to the helpers. Also, note that you should implementAbstractEntityDuplicationHelpernow instead asEntityDuplicateModifieris deprecated.- Specified by:
copyin interfaceEntityDuplicator
-
copy
@Deprecated public <T> T copy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity, Map<String, String> copyHints, EntityDuplicateModifier... modifiers) Deprecated.Instead of passing inEntityDuplicateModifiers, add the beans toEntityDuplicationHelpers. Additionally, add copy hints to the helpers. Also, note that you should implementAbstractEntityDuplicationHelpernow instead asEntityDuplicateModifieris deprecated.- Specified by:
copyin interfaceEntityDuplicator
-
copy
Description copied from interface:EntityDuplicatorCreate a production duplicate of the entity specified in the params. The is the most oft used copy method.- Specified by:
copyin interfaceEntityDuplicator- Type Parameters:
T- the entity type- Parameters:
entityClass- the class for the entityid- the primary key- Returns:
- the duplicated entity
-
copy
@Transactional("blTransactionManager") public <T> T copy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity) Description copied from interface:EntityDuplicatorCreate a production duplicate of the entity specified in the params. The is the least oft used copy method.- Specified by:
copyin interfaceEntityDuplicator- Type Parameters:
T- the entity type- Parameters:
context- prepopulated copy context that is setup for catalog and/or siteentity- the instance to duplicate- Returns:
- the duplicated entity
-
performCopy
@Deprecated protected <T> T performCopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity, Map<String, String> copyHints, EntityDuplicateModifier... modifiers) throws ExceptionDeprecated.Instead of passing inEntityDuplicateModifiers, add the beans toEntityDuplicationHelpers. Additionally, add copy hints to the helpers. Also, note that you should implementAbstractEntityDuplicationHelpernow instead asEntityDuplicateModifieris deprecated.- Throws:
Exception
-
performCopy
protected <T> T performCopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity) throws Exception - Throws:
Exception
-
filterDuplicationHelpers
-
putAllCopyHints
protected void putAllCopyHints(MultiTenantCopyContext context, Set<EntityDuplicationHelper> helpers)
-