|
||||||||||
| 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.AdminAbstractController
org.broadleafcommerce.openadmin.web.controller.entity.AdminBasicEntityController
@Controller(value="blAdminBasicEntityController")
@RequestMapping(value="/{sectionKey}")
public class AdminBasicEntityController
The default implementation of the #BroadleafAdminAbstractEntityController. This delegates every call to
super and does not provide any custom-tailored functionality. It is responsible for rendering the admin for every
entity that is not explicitly customized by its own controller.
| Field Summary | |
|---|---|
protected EntityConfiguration |
entityConfiguration
|
protected EntityFormValidator |
entityValidator
|
protected FormBuilderService |
formService
|
protected AdminEntityService |
service
|
| Fields inherited from class org.broadleafcommerce.openadmin.web.controller.AdminAbstractController |
|---|
adminNavigationService |
| Constructor Summary | |
|---|---|
AdminBasicEntityController()
|
|
| Method Summary | |
|---|---|
String |
addCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
EntityForm entityForm,
org.springframework.validation.BindingResult result)
Processes the request to add a new entity. |
protected void |
attachSectionSpecificInfo(PersistencePackageRequest ppr)
A hook method that is invoked every time the getSectionPersistencePackageRequest(String) method is invoked. |
protected List<ClassTree> |
getAddEntityTypes(ClassTree classTree)
If there are certain types of entities that should not be allowed to be created, an override of this method would be able to specify that. |
protected EntityForm |
getBlankDynamicFieldTemplateForm(DynamicEntityFormInfo info)
Convenience method for obtaining a blank dynamic field template form. |
protected String |
getClassNameForSection(String sectionKey)
Gets the fully qualified ceiling entity classname for this section. |
String |
getCollectionFieldRecords(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
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()
This method is called when attempting to add new entities that have a polymorphic tree. |
protected EntityForm |
getDynamicFieldTemplateForm(DynamicEntityFormInfo info,
String entityId)
Convenience method for obtaining a dynamic field template form for a particular entity. |
protected String |
getDynamicForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
DynamicEntityFormInfo info)
Returns a partial representing a dynamic form. |
protected String[] |
getSectionCustomCriteria()
This method is invoked for every request for this controller. |
protected String |
getSectionKey(Map<String,String> pathVars)
This method is used to determine the current section key. |
protected PersistencePackageRequest |
getSectionPersistencePackageRequest(String sectionClassName)
Returns a PersistencePackageRequest for the given sectionClassName. |
protected PersistencePackageRequest |
getSectionPersistencePackageRequest(String sectionClassName,
FilterAndSortCriteria[] filterAndSortCriteria)
Returns the result of a call to getSectionPersistencePackageRequest(String) with the additional filter
and sort criteria attached. |
void |
initBinder(org.springframework.web.bind.WebDataBinder binder)
Invoked on every request to provide the ability to register specific binders for Spring's binding process. |
String |
removeCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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)
Attributes to add to the model on every request |
String |
showAddCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
String id,
String collectionField,
String collectionItemId)
Shows the appropriate modal dialog to edit the selected collection item |
String |
updateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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,
Map<String,String> pathVars,
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 AdminBasicEntityController()
| Method Detail |
|---|
@RequestMapping(value="",
method=GET)
public String viewEntityList(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@ModelAttribute
CriteriaForm criteriaForm)
throws Exception
request - response - model - pathVars - criteriaForm - criteria from the frontend; can be null
Exception
@RequestMapping(value="/add",
method=GET)
public String viewAddEntityForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@RequestParam(defaultValue="")
String entityType)
throws Exception
request - response - model - pathVars - entityType -
Exception
@RequestMapping(value="/add",
method=POST)
public String addEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@ModelAttribute
EntityForm entityForm,
org.springframework.validation.BindingResult result)
throws Exception
request - response - model - pathVars - entityForm - result -
Exception
@RequestMapping(value="/{id}",
method=GET)
public String viewEntityForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id)
throws Exception
request - response - model - pathVars - id - modal - - whether or not to show the entity in a read-only modal
Exception
@RequestMapping(value="/{id}",
method=POST)
public String saveEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@ModelAttribute
EntityForm entityForm,
org.springframework.validation.BindingResult result,
org.springframework.web.servlet.mvc.support.RedirectAttributes ra)
throws Exception
request - response - model - pathVars - id - entityForm - result -
Exception
@RequestMapping(value="/{id}/delete",
method=POST)
public String removeEntity(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@ModelAttribute
EntityForm entityForm,
org.springframework.validation.BindingResult result)
throws Exception
request - response - model - pathVars - id -
Exception
@RequestMapping(value="/{collectionField}/select",
method=GET)
public String showSelectCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String collectionField,
@ModelAttribute
CriteriaForm criteriaForm)
throws Exception
request - response - model - pathVars - collectionField -
Exception
@RequestMapping(value="/{collectionField}/{id}/view",
method=GET)
public String viewCollectionItemDetails(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String collectionField,
@PathVariable
String id)
throws Exception
request - response - model - pathVars - collectionField - id -
Exception
@RequestMapping(value="/{id}/{collectionField}",
method=GET)
public String getCollectionFieldRecords(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@PathVariable
String collectionField,
@ModelAttribute
CriteriaForm criteriaForm)
throws Exception
request - response - model - pathVars - collectionField - criteriaForm -
Exception
@RequestMapping(value="/{id}/{collectionField}/add",
method=GET)
public String showAddCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@PathVariable
String collectionField)
throws Exception
request - response - model - sectionKey - id - collectionField -
Exception
@RequestMapping(value="/{id}/{collectionField}/{collectionItemId}",
method=GET)
public String showUpdateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@PathVariable
String collectionField,
@PathVariable
String collectionItemId)
throws Exception
request - response - model - pathVars - id - collectionField - collectionItemId -
Exception
@RequestMapping(value="/{id}/{collectionField}/add",
method=POST)
public String addCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@PathVariable
String collectionField,
@ModelAttribute
EntityForm entityForm)
throws Exception
request - response - model - pathVars - id - collectionField - entityForm -
Exception
@RequestMapping(value="/{id}/{collectionField}/{collectionItemId}",
method=POST)
public String updateCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@PathVariable
String collectionField,
@PathVariable
String collectionItemId,
@ModelAttribute
EntityForm entityForm)
throws Exception
request - response - model - pathVars - id - collectionField - entityForm -
Exception
@RequestMapping(value="/{id}/{collectionField}/{collectionItemId}/delete",
method=POST)
public String removeCollectionItem(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
@PathVariable
Map<String,String> pathVars,
@PathVariable
String id,
@PathVariable
String collectionField,
@PathVariable
String collectionItemId)
throws Exception
request - response - model - pathVars - id - collectionField - collectionItemId -
Exception@InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder)
binder -
protected String getDynamicForm(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.ui.Model model,
Map<String,String> pathVars,
DynamicEntityFormInfo info)
throws Exception
request - response - model - pathVars - info -
Exception
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.ApplicationSecurityException
protected EntityForm getBlankDynamicFieldTemplateForm(DynamicEntityFormInfo info)
throws ServiceException,
com.gwtincubator.security.exception.ApplicationSecurityException
info -
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException
protected EntityForm getDynamicFieldTemplateForm(DynamicEntityFormInfo info,
String entityId)
throws ServiceException,
com.gwtincubator.security.exception.ApplicationSecurityException
getBlankDynamicFieldTemplateForm(DynamicEntityFormInfo) in that it will fill out the current values for
the fields in this dynamic form from the database. This method is invoked when the initial view of a page containing
a dynamic form is triggered.
info - entityId -
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityExceptionprotected String getSectionKey(Map<String,String> pathVars)
pathVars - - the map of all currently bound path variables for this request
protected String getClassNameForSection(String sectionKey)
sectionKey -
protected List<ClassTree> getAddEntityTypes(ClassTree classTree)
classTree - protected String getDefaultEntityType()
protected String[] getSectionCustomCriteria()
protected void attachSectionSpecificInfo(PersistencePackageRequest ppr)
getSectionPersistencePackageRequest(String) method is invoked.
This allows specialized controllers to hook into every request and manipulate the persistence package request as
desired.
ppr -
protected void setModelAttributes(org.springframework.ui.Model model,
String sectionKey)
model - sectionKey - protected PersistencePackageRequest getSectionPersistencePackageRequest(String sectionClassName)
getSectionCustomCriteria() and attachSectionSpecificInfo(PersistencePackageRequest) to allow
specialized controllers to manipulate the request for every action in this controller.
sectionClassName -
protected PersistencePackageRequest getSectionPersistencePackageRequest(String sectionClassName,
FilterAndSortCriteria[] filterAndSortCriteria)
getSectionPersistencePackageRequest(String) with the additional filter
and sort criteria attached.
sectionClassName - filterAndSortCriteria -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||