Class PageTemplateCustomPersistenceHandler
java.lang.Object
org.broadleafcommerce.openadmin.server.service.handler.CustomPersistenceHandlerAdapter
org.broadleafcommerce.cms.admin.server.handler.PageTemplateCustomPersistenceHandler
- All Implemented Interfaces:
CustomPersistenceHandler
,DynamicEntityRetriever
,org.springframework.core.Ordered
@Component("blPageTemplateCustomPersistenceHandler")
public class PageTemplateCustomPersistenceHandler
extends CustomPersistenceHandlerAdapter
implements DynamicEntityRetriever
Created by jfischer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DynamicFieldPersistenceHandlerHelper
protected jakarta.persistence.EntityManager
protected PageService
protected SandBoxService
Fields inherited from interface org.broadleafcommerce.openadmin.server.service.handler.CustomPersistenceHandler
DEFAULT_ORDER
Fields 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 Entity
addOrUpdate
(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) canHandleAdd
(PersistencePackage persistencePackage) Is this persistence handler capable of dealing with an add request from the admincanHandleFetch
(PersistencePackage persistencePackage) Is this persistence handler capable of dealing with an fetch request from the admincanHandleInspect
(PersistencePackage persistencePackage) Is this persistence handler capable of dealing with an inspect request from the admincanHandleRemove
(PersistencePackage persistencePackage) Is this persistence handler capable of dealing with a remove request from the admincanHandleUpdate
(PersistencePackage persistencePackage) Is this persistence handler capable of dealing with an update request from the adminfetch
(PersistencePackage persistencePackage, CriteriaTransferObject cto, DynamicEntityDao dynamicEntityDao, RecordHelper helper) fetchDynamicEntity
(Serializable root, List<String> dirtyFields, boolean includeId) fetchEntityBasedOnId
(String pageId, List<String> dirtyFields) protected List<FieldGroup>
getFieldGroups
(Page page, PageTemplate template) protected List<FieldGroup>
getFieldGroups
(PersistencePackage pp, DynamicEntityDao dynamicEntityDao) protected SandBox
inspect
(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper helper) protected void
populateFKLookupValues
(DynamicEntityDao dynamicEntityDao, Entity entity) Some of the values in this entity might be foreign key lookups.protected void
processFieldGroups
(List<String> dirtyFields, Map<String, PageField> pageFieldMap, List<Property> propertiesList, List<FieldGroup> fieldGroups) protected void
processIncludeId
(boolean includeId, Page page, List<Property> propertiesList) update
(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) Methods inherited from class org.broadleafcommerce.openadmin.server.service.handler.CustomPersistenceHandlerAdapter
getClassForName, getMetadata, getOrder, getPolymorphicClasses, getResultSet, isAdornedListOperation, isAssignableFrom, isBasicOperation, isMapOperation, meetsCustomCriteria, remove, willHandleSecurity
-
Field Details
-
pageService
-
sandBoxService
-
dynamicFieldUtil
-
em
protected jakarta.persistence.EntityManager em
-
-
Constructor Details
-
PageTemplateCustomPersistenceHandler
public PageTemplateCustomPersistenceHandler()
-
-
Method Details
-
canHandleFetch
Description copied from interface:CustomPersistenceHandler
Is this persistence handler capable of dealing with an fetch request from the admin- Specified by:
canHandleFetch
in interfaceCustomPersistenceHandler
- Overrides:
canHandleFetch
in classCustomPersistenceHandlerAdapter
- Parameters:
persistencePackage
- details about the fetch operation- Returns:
- whether or not this handler supports fetches
-
canHandleAdd
Description copied from interface:CustomPersistenceHandler
Is this persistence handler capable of dealing with an add request from the admin- Specified by:
canHandleAdd
in interfaceCustomPersistenceHandler
- Overrides:
canHandleAdd
in classCustomPersistenceHandlerAdapter
- Parameters:
persistencePackage
- details about the add operation- Returns:
- whether or not this handler supports adds
-
canHandleInspect
Description copied from interface:CustomPersistenceHandler
Is this persistence handler capable of dealing with an inspect request from the admin- Specified by:
canHandleInspect
in interfaceCustomPersistenceHandler
- Overrides:
canHandleInspect
in classCustomPersistenceHandlerAdapter
- Parameters:
persistencePackage
- details about the inspect operation- Returns:
- whether or not this handler supports inspects
-
canHandleRemove
Description copied from interface:CustomPersistenceHandler
Is this persistence handler capable of dealing with a remove request from the admin- Specified by:
canHandleRemove
in interfaceCustomPersistenceHandler
- Overrides:
canHandleRemove
in classCustomPersistenceHandlerAdapter
- Parameters:
persistencePackage
- details about the remove operation- Returns:
- whether or not this handler supports remove
-
canHandleUpdate
Description copied from interface:CustomPersistenceHandler
Is this persistence handler capable of dealing with an update request from the admin- Specified by:
canHandleUpdate
in interfaceCustomPersistenceHandler
- Overrides:
canHandleUpdate
in classCustomPersistenceHandlerAdapter
- Parameters:
persistencePackage
- details about the update operation- Returns:
- whether or not this handler supports updatess
-
getSandBox
-
getFieldGroups
-
getFieldGroups
-
inspect
public DynamicResultSet inspect(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, InspectHelper helper) throws ServiceException - Specified by:
inspect
in interfaceCustomPersistenceHandler
- Overrides:
inspect
in classCustomPersistenceHandlerAdapter
- Throws:
ServiceException
-
fetch
public DynamicResultSet fetch(PersistencePackage persistencePackage, CriteriaTransferObject cto, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException - Specified by:
fetch
in interfaceCustomPersistenceHandler
- Overrides:
fetch
in classCustomPersistenceHandlerAdapter
- Throws:
ServiceException
-
populateFKLookupValues
protected void populateFKLookupValues(DynamicEntityDao dynamicEntityDao, Entity entity) throws ClassNotFoundException Some of the values in this entity might be foreign key lookups. In this case, we need to set the display value appropriately- Parameters:
dynamicEntityDao
-entity
-- Throws:
ClassNotFoundException
-
getFieldContainerClassName
- Specified by:
getFieldContainerClassName
in interfaceDynamicEntityRetriever
-
fetchEntityBasedOnId
- Specified by:
fetchEntityBasedOnId
in interfaceDynamicEntityRetriever
- Throws:
Exception
-
fetchDynamicEntity
public Entity fetchDynamicEntity(Serializable root, List<String> dirtyFields, boolean includeId) throws Exception - Specified by:
fetchDynamicEntity
in interfaceDynamicEntityRetriever
- Throws:
Exception
-
processFieldGroups
-
processIncludeId
-
update
public Entity update(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException - Specified by:
update
in interfaceCustomPersistenceHandler
- Overrides:
update
in classCustomPersistenceHandlerAdapter
- Throws:
ServiceException
-
add
public Entity add(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException - Specified by:
add
in interfaceCustomPersistenceHandler
- Overrides:
add
in classCustomPersistenceHandlerAdapter
- Throws:
ServiceException
-
addOrUpdate
protected Entity addOrUpdate(PersistencePackage persistencePackage, DynamicEntityDao dynamicEntityDao, RecordHelper helper) throws ServiceException - Throws:
ServiceException
-