|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.openadmin.web.controller.BroadleafAdminAbstractController
org.broadleafcommerce.openadmin.web.controller.entity.BroadleafAdminAbstractEntityController
public abstract class BroadleafAdminAbstractEntityController
An abstract controller that provides sensible operations for admin actions. It is very dynamic in nature and does not have any custom-tailored logic for any one given screen.
| Field Summary | |
|---|---|
protected EntityConfiguration |
entityConfiguration
|
protected EntityFormValidator |
entityValidator
|
protected FormBuilderService |
formService
|
protected AdminEntityService |
service
|
| Fields inherited from class org.broadleafcommerce.openadmin.web.controller.BroadleafAdminAbstractController |
|---|
adminNavigationService, currentSectionKey |
| Constructor Summary | |
|---|---|
BroadleafAdminAbstractEntityController()
|
|
| Method Summary | |
|---|---|
String |
addCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
EntityForm entityForm)
Adds the requested collection item |
String |
addEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
EntityForm entityForm,
org.springframework.validation.BindingResult result)
|
protected void |
attachSectionSpecificInfo(PersistencePackageRequest ppr)
|
protected List<ClassTree> |
getAddEntityTypes(ClassTree classTree)
|
protected EntityForm |
getBlankDynamicFieldTemplateForm(DynamicEntityFormInfo info)
|
protected String |
getClassNameForSection(String sectionKey)
|
String |
getCollectionFieldRecords(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
CriteriaForm criteriaForm)
Returns the records for a given collectionField filtered by a particular criteria |
protected ListGrid |
getCollectionListGrid(ClassMetadata mainMetadata,
Entity entity,
Property collectionProperty,
FilterAndSortCriteria[] criteria,
String sectionKey)
Convenience method for obtaining a ListGrid DTO object for a collection. |
protected String |
getDefaultEntityType()
|
protected EntityForm |
getDynamicFieldTemplateForm(DynamicEntityFormInfo info,
String entityId)
|
String |
getDynamicForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
DynamicEntityFormInfo info)
Returns a partial representing a dynamic form. |
protected String[] |
getSectionCustomCriteria()
|
protected PersistencePackageRequest |
getSectionPersistencePackageRequest(String sectionClassName)
|
protected PersistencePackageRequest |
getSectionPersistencePackageRequest(String sectionClassName,
FilterAndSortCriteria[] filterAndSortCriteria)
|
void |
initBinder(org.springframework.web.bind.WebDataBinder binder)
|
String |
removeCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
String collectionItemId)
Removes the requested collection item Note that the request must contain a parameter called "key" when attempting to remove a collection item from a map collection. |
String |
removeEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
EntityForm entityForm,
org.springframework.validation.BindingResult result)
Attempts to remove the given entity. |
String |
saveEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
EntityForm entityForm,
org.springframework.validation.BindingResult result,
org.springframework.web.servlet.mvc.support.RedirectAttributes ra)
Attempts to save the given entity. |
protected void |
setModelAttributes(org.springframework.ui.Model model,
String sectionKey)
|
String |
showAddCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField)
Shows the modal dialog that is used to add an item to a given collection. |
String |
showSelectCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String collectionField,
CriteriaForm criteriaForm)
Shows the modal dialog that is used to select a "to-one" collection item. |
String |
showUpdateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
String collectionItemId)
|
String |
updateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
String collectionItemId,
EntityForm entityForm)
Updates the specified collection item |
String |
viewAddEntityForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String entityType)
Renders the modal form that is used to add a new parent level entity. |
String |
viewCollectionItemDetails(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String collectionField,
String id)
Shows the modal popup for the current selected "to-one" field. |
String |
viewEntityForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id)
Renders the main entity form for the specified entity |
String |
viewEntityList(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
CriteriaForm criteriaForm)
Renders the main entity listing for the specified class, which is based on the current sectionKey with some optional criteria. |
| Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController |
|---|
getContextPath, isAjaxRequest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AdminEntityService service
protected FormBuilderService formService
protected EntityConfiguration entityConfiguration
protected EntityFormValidator entityValidator
| Constructor Detail |
|---|
public BroadleafAdminAbstractEntityController()
| Method Detail |
|---|
public String viewEntityList(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
CriteriaForm criteriaForm)
throws Exception
request - response - model - sectionKey - criteriaForm - criteria from the frontend; can be null
Exception
public String viewAddEntityForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String entityType)
throws Exception
request - response - model - sectionKey - entityType -
Exception
public String addEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
EntityForm entityForm,
org.springframework.validation.BindingResult result)
throws Exception
Exception
public String viewEntityForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id)
throws Exception
request - response - model - sectionKey - id - modal - - whether or not to show the entity in a read-only modal
Exception
public String saveEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
EntityForm entityForm,
org.springframework.validation.BindingResult result,
org.springframework.web.servlet.mvc.support.RedirectAttributes ra)
throws Exception
request - response - model - sectionKey - id - entityForm - result -
Exception
public String removeEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
EntityForm entityForm,
org.springframework.validation.BindingResult result)
throws Exception
request - response - model - sectionKey - id -
Exception
public String getDynamicForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
DynamicEntityFormInfo info)
throws Exception
request - response - model - id - propertyName - propertyTypeId - criteriaName - ceilingClassName -
Exception
public String getCollectionFieldRecords(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
CriteriaForm criteriaForm)
throws Exception
request - response - model - sectionKey - collectionField - criteriaForm -
Exception
public String showSelectCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String collectionField,
CriteriaForm criteriaForm)
throws Exception
request - response - model - sectionKey - collectionField -
Exception
public String viewCollectionItemDetails(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String collectionField,
String id)
throws Exception
request - response - model - sectionKey - collectionField - id -
Exception
public String showAddCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField)
throws Exception
request - response - model - sectionKey - id - collectionField -
Exception
public String showUpdateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
String collectionItemId)
throws Exception
Exception
public String addCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
EntityForm entityForm)
throws Exception
request - response - model - sectionKey - id - collectionField - entityForm -
Exception
public String updateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
String collectionItemId,
EntityForm entityForm)
throws Exception
request - response - model - sectionKey - id - collectionField - entityForm -
Exception
public String removeCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
String sectionKey,
String id,
String collectionField,
String collectionItemId)
throws Exception
request - response - model - sectionKey - id - collectionField - collectionItemId -
Exceptionpublic void initBinder(org.springframework.web.bind.WebDataBinder binder)
protected List<ClassTree> getAddEntityTypes(ClassTree classTree)
protected String getDefaultEntityType()
protected EntityForm getBlankDynamicFieldTemplateForm(DynamicEntityFormInfo info)
throws ServiceException,
com.gwtincubator.security.exception.ApplicationSecurityException
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException
protected EntityForm getDynamicFieldTemplateForm(DynamicEntityFormInfo info,
String entityId)
throws ServiceException,
com.gwtincubator.security.exception.ApplicationSecurityException
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException
protected ListGrid getCollectionListGrid(ClassMetadata mainMetadata,
Entity entity,
Property collectionProperty,
FilterAndSortCriteria[] criteria,
String sectionKey)
throws ServiceException,
com.gwtincubator.security.exception.ApplicationSecurityException
mainMetadata - class metadata for the root entity that this collectionProperty relates toid - foreign key from the root entity for collectionPropertycollectionProperty - property that this collection should be based on from the root entitycriteria - criteria to filter the subcollection list by, can be nullsectionKey - the current main section key
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityExceptionprotected String getClassNameForSection(String sectionKey)
protected void setModelAttributes(org.springframework.ui.Model model,
String sectionKey)
protected PersistencePackageRequest getSectionPersistencePackageRequest(String sectionClassName)
protected PersistencePackageRequest getSectionPersistencePackageRequest(String sectionClassName,
FilterAndSortCriteria[] filterAndSortCriteria)
protected String[] getSectionCustomCriteria()
protected void attachSectionSpecificInfo(PersistencePackageRequest ppr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||