@Service(value="blEntityDuplicator") public class EntityDuplicatorImpl extends MultiTenantCopier implements EntityDuplicator
EntityDuplicator
Modifier and Type | Field and Description |
---|---|
protected EntityDuplicatorExtensionManager |
extensionManager |
protected boolean |
isActive |
protected MultiTenantCopierExtensionManager |
mtCopierExtensionManager |
classExcludeRegexList, genericEntityService, LOG, order, transUtil
Constructor and Description |
---|
EntityDuplicatorImpl() |
Modifier and Type | Method and Description |
---|---|
<T> T |
copy(Class<T> entityClass,
Long id,
Map<String,String> copyHints,
EntityDuplicateModifier... modifiers)
Create a production duplicate of the entity specified in the params.
|
<T> T |
copy(MultiTenantCopyContext context,
MultiTenantCloneable<T> entity,
Map<String,String> copyHints,
EntityDuplicateModifier... modifiers)
Create a production duplicate of the entity specified in the params.
|
void |
copyEntities(MultiTenantCopyContext context)
Main method that should be implemented by each
MultiTenantCopier to drive the logic of
copying that particular entity to the new derived catalog. |
protected <T> T |
performCopy(MultiTenantCopyContext context,
MultiTenantCloneable<T> entity,
Map<String,String> copyHints,
EntityDuplicateModifier... modifiers) |
boolean |
validate(Class<?> entityClass,
Long id)
Validate whether or not this feature is enabled and whether or not the passed entity params are valid for duplication.
|
boolean |
validate(Object entity)
Validate whether or not this feature is enabled and whether or not the passed entity params are valid for duplication.
|
copyEntitiesOfType, excludeFromCopyRegex, getOrder, persistCopyObjectTree, persistCopyObjectTreeInternal, persistNode, readAll, readAll, readAllIds, readCount, save, setOrder
@Value(value="${admin.entity.duplication.isactive:false}") protected boolean isActive
protected EntityDuplicatorExtensionManager extensionManager
protected MultiTenantCopierExtensionManager mtCopierExtensionManager
public void copyEntities(MultiTenantCopyContext context) throws Exception
MultiTenantCopier
MultiTenantCopier
to drive the logic of
copying that particular entity to the new derived catalog.copyEntities
in class MultiTenantCopier
Exception
public boolean validate(Class<?> entityClass, Long id)
EntityDuplicator
validate
in interface EntityDuplicator
public boolean validate(Object entity)
EntityDuplicator
validate
in interface EntityDuplicator
public <T> T copy(Class<T> entityClass, Long id, Map<String,String> copyHints, EntityDuplicateModifier... modifiers)
EntityDuplicator
copy
in interface EntityDuplicator
T
- the entity typeentityClass
- the class for the entityid
- the primary keycopyHints
- hints used to fine tune copying - generally support for hints is included in MultiTenantCloneable.createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext)
implementations.modifiers
- list of modifications to perform to the resulting duplicate prior to persistencepublic <T> T copy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity, Map<String,String> copyHints, EntityDuplicateModifier... modifiers)
EntityDuplicator
copy
in interface EntityDuplicator
T
- the entity typecontext
- prepopulated copy context that is setup for catalog and/or siteentity
- the instance to duplicatecopyHints
- hints used to fine tune copying - generally support for hints is included in MultiTenantCloneable.createOrRetrieveCopyInstance(org.broadleafcommerce.common.copy.MultiTenantCopyContext)
implementations.modifiers
- list of modifications to perform to the resulting duplicate prior to persistenceprotected <T> T performCopy(MultiTenantCopyContext context, MultiTenantCloneable<T> entity, Map<String,String> copyHints, EntityDuplicateModifier... modifiers) throws Exception
Exception
Copyright © 2019. All rights reserved.