Class AbstractCrudController<T>
- java.lang.Object
-
- org.duracloud.account.app.controller.AbstractController
-
- org.duracloud.account.app.controller.AbstractCrudController<T>
-
- Direct Known Subclasses:
AbstractRootCrudController
public abstract class AbstractCrudController<T> extends AbstractController
- Author:
- Daniel Bernstein Date: Feb 27, 2012
-
-
Field Summary
-
Fields inherited from class org.duracloud.account.app.controller.AbstractController
BY_ID_DELETE_MAPPING, BY_ID_EDIT_MAPPING, BY_ID_MAPPING, EDIT_MAPPING, log, NEW_MAPPING, USER_MAPPING, USERS_MAPPING
-
-
Constructor Summary
Constructors Constructor Description AbstractCrudController(Class<T> clazz)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcreate(T form)org.springframework.web.servlet.ModelAndViewcreate(T form, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)protected StringcreateSuccessMessage()protected abstract voiddelete(Long id)org.springframework.web.servlet.ModelAndViewdelete(Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)protected StringdeleteSuccessMessage()org.springframework.web.servlet.ModelAndViewedit(Long id)Tform()abstract org.springframework.web.servlet.ModelAndViewget()protected abstract StringgetBaseViewId()protected StringgetEditViewId()protected abstract ObjectgetEntity(Long id)protected TgetFormById(Long id)org.springframework.web.servlet.ModelAndViewgetNew()protected StringgetNewViewId()protected abstract TloadForm(Object entity)protected abstract voidupdate(Long id, T form)org.springframework.web.servlet.ModelAndViewupdate(Long id, T form, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)protected StringupdateSuccessMessage()-
Methods inherited from class org.duracloud.account.app.controller.AbstractController
accountHasMoreThanOneOwner, createRedirectMav, destroy, formatUserUrl, getAdminRole, getOwnerRole, getRecaptchaSecret, getRecaptchaSiteKey, getUserRole, handleException, init, isRecaptchaEnabled, setError, setError, setFailureFeedback, setSuccessFeedback, setUserRights, validateRecaptcha
-
-
-
-
Method Detail
-
getBaseViewId
protected abstract String getBaseViewId()
-
form
@ModelAttribute("form") public T form()
-
getNewViewId
protected String getNewViewId()
-
getEditViewId
protected String getEditViewId()
-
get
@RequestMapping("") public abstract org.springframework.web.servlet.ModelAndView get()
-
getNew
@RequestMapping("/new") public org.springframework.web.servlet.ModelAndView getNew()
-
create
@RequestMapping(value="/new", method=POST) @Transactional public org.springframework.web.servlet.ModelAndView create(@ModelAttribute("form") T form, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
createSuccessMessage
protected String createSuccessMessage()
-
create
protected abstract void create(T form)
-
edit
@RequestMapping(value="/byid/{id}/edit", method=GET) @Transactional public org.springframework.web.servlet.ModelAndView edit(@PathVariable Long id)
-
update
@RequestMapping(value="/byid/{id}/edit", method=POST) @Transactional public org.springframework.web.servlet.ModelAndView update(@PathVariable Long id, @ModelAttribute("form") T form, org.springframework.validation.BindingResult bindingResult, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
updateSuccessMessage
protected String updateSuccessMessage()
-
delete
@RequestMapping(value="/byid/{id}/delete", method=POST) @Transactional public org.springframework.web.servlet.ModelAndView delete(@PathVariable Long id, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
deleteSuccessMessage
protected String deleteSuccessMessage()
-
delete
protected abstract void delete(Long id)
-
-