Class CategoryCustomPersistenceHandler
java.lang.Object
org.broadleafcommerce.openadmin.server.service.handler.CustomPersistenceHandlerAdapter
org.broadleafcommerce.admin.server.service.handler.CategoryCustomPersistenceHandler
- All Implemented Interfaces:
CustomPersistenceHandler,org.springframework.core.Ordered
@Component("blCategoryCustomPersistenceHandler")
public class CategoryCustomPersistenceHandler
extends CustomPersistenceHandlerAdapter
- Author:
- jfischer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected static final Stringprotected CategoryDaoprotected static final Stringprotected static final Stringprotected org.broadleafcommerce.common.sandbox.SandBoxHelperFields inherited from interface org.broadleafcommerce.openadmin.server.service.handler.CustomPersistenceHandler
DEFAULT_ORDERFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) protected voidaddCategoryLink(StringBuilder productLinks, String categoryName) canHandleAdd(PersistencePackage persistencePackage) canHandleInspect(PersistencePackage persistencePackage) canHandleRemove(PersistencePackage persistencePackage) canHandleUpdate(PersistencePackage persistencePackage) protected voidcheckIfHasSubCategories(PersistencePackage persistencePackage, String id) protected CategoryXrefgetCurrentDefaultXref(Category category) protected CategorygetExistingDefaultCategory(Category category) inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper helper) protected Booleanvoidremove(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) protected voidremoveOldDefault(Category adminInstance, CategoryXref oldDefault, Entity entity) protected voidupdate(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) protected voidvalidateCategories(Entity entity, Category category, Long id, StringBuilder categoryLinks) protected voidvalidateCategory(Entity entity) protected voidvalidateRecursiveRelationship(Entity entity) protected voidvalidateSelfLink(Entity entity) Methods inherited from class org.broadleafcommerce.openadmin.server.service.handler.CustomPersistenceHandlerAdapter
canHandleFetch, fetch, getClassForName, getMetadata, getOrder, getPolymorphicClasses, getResultSet, isAdornedListOperation, isAssignableFrom, isBasicOperation, isMapOperation, meetsCustomCriteria, willHandleSecurity
-
Field Details
-
DEFAULT_PARENT_CATEGORY
- See Also:
-
ID_PROPERTY
- See Also:
-
CATEGORY_SEPARATOR
- See Also:
-
allowCategoryDeleteWithChildren
@Value("${allow.category.delete.with.children:false}") protected boolean allowCategoryDeleteWithChildren -
extensionManager
-
categoryDao
-
sandBoxHelper
protected org.broadleafcommerce.common.sandbox.SandBoxHelper sandBoxHelper
-
-
Constructor Details
-
CategoryCustomPersistenceHandler
public CategoryCustomPersistenceHandler()
-
-
Method Details
-
canHandleAdd
- Specified by:
canHandleAddin interfaceCustomPersistenceHandler- Overrides:
canHandleAddin classCustomPersistenceHandlerAdapter
-
canHandleInspect
- Specified by:
canHandleInspectin interfaceCustomPersistenceHandler- Overrides:
canHandleInspectin classCustomPersistenceHandlerAdapter
-
canHandleUpdate
- Specified by:
canHandleUpdatein interfaceCustomPersistenceHandler- Overrides:
canHandleUpdatein classCustomPersistenceHandlerAdapter
-
canHandleRemove
- Specified by:
canHandleRemovein interfaceCustomPersistenceHandler- Overrides:
canHandleRemovein classCustomPersistenceHandlerAdapter
-
inspect
public DynamicResultSet inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper helper) throws org.broadleafcommerce.common.exception.ServiceException - Specified by:
inspectin interfaceCustomPersistenceHandler- Overrides:
inspectin classCustomPersistenceHandlerAdapter- Throws:
org.broadleafcommerce.common.exception.ServiceException
-
add
public Entity add(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws org.broadleafcommerce.common.exception.ServiceException - Specified by:
addin interfaceCustomPersistenceHandler- Overrides:
addin classCustomPersistenceHandlerAdapter- Throws:
org.broadleafcommerce.common.exception.ServiceException
-
update
public Entity update(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws org.broadleafcommerce.common.exception.ServiceException - Specified by:
updatein interfaceCustomPersistenceHandler- Overrides:
updatein classCustomPersistenceHandlerAdapter- Throws:
org.broadleafcommerce.common.exception.ServiceException
-
remove
public void remove(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws org.broadleafcommerce.common.exception.ServiceException - Specified by:
removein interfaceCustomPersistenceHandler- Overrides:
removein classCustomPersistenceHandlerAdapter- Throws:
org.broadleafcommerce.common.exception.ServiceException
-
validateCategory
- Throws:
ValidationException
-
validateSelfLink
- Throws:
ValidationException
-
validateRecursiveRelationship
- Throws:
ValidationException
-
validateCategories
protected void validateCategories(Entity entity, Category category, Long id, StringBuilder categoryLinks) throws ValidationException - Throws:
ValidationException
-
addCategoryLink
-
checkIfHasSubCategories
protected void checkIfHasSubCategories(PersistencePackage persistencePackage, String id) throws ValidationException - Throws:
ValidationException
-
isDefaultCategoryLegacyMode
-
getExistingDefaultCategory
-
removeOldDefault
-
setupXref
-
getCurrentDefaultXref
-