Class AbstractController
- java.lang.Object
-
- org.duracloud.account.app.controller.AbstractController
-
- Direct Known Subclasses:
AbstractAccountController,AbstractCrudController,AbstractRootController,HomeController,UserController
public abstract class AbstractController extends Object
Base class for all controllers.
-
-
Field Summary
Fields Modifier and Type Field Description static StringBY_ID_DELETE_MAPPINGstatic StringBY_ID_EDIT_MAPPINGstatic StringBY_ID_MAPPINGstatic StringEDIT_MAPPINGprotected org.slf4j.Loggerlogstatic StringNEW_MAPPINGstatic StringUSER_MAPPINGstatic StringUSERS_MAPPING
-
Constructor Summary
Constructors Constructor Description AbstractController()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccountHasMoreThanOneOwner(Set<org.duracloud.account.db.model.DuracloudUser> users, Long accountId)protected org.springframework.web.servlet.ModelAndViewcreateRedirectMav(String url)voiddestroy()protected static StringformatUserUrl(String username)org.duracloud.account.db.model.RolegetAdminRole()org.duracloud.account.db.model.RolegetOwnerRole()StringgetRecaptchaSecret()StringgetRecaptchaSiteKey()org.duracloud.account.db.model.RolegetUserRole()org.springframework.web.servlet.ModelAndViewhandleException(Exception e)voidinit()protected booleanisRecaptchaEnabled()protected voidsetError(Exception e)protected voidsetError(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)protected voidsetFailureFeedback(String message, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)protected voidsetSuccessFeedback(String message, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)protected voidsetUserRights(DuracloudUserService userService, Long accountId, Long userId, org.duracloud.account.db.model.Role role)protected booleanvalidateRecaptcha(String recaptchaResponse)
-
-
-
Field Detail
-
log
protected org.slf4j.Logger log
-
USERS_MAPPING
public static final String USERS_MAPPING
- See Also:
- Constant Field Values
-
USER_MAPPING
public static final String USER_MAPPING
- See Also:
- Constant Field Values
-
NEW_MAPPING
public static final String NEW_MAPPING
- See Also:
- Constant Field Values
-
EDIT_MAPPING
public static final String EDIT_MAPPING
- See Also:
- Constant Field Values
-
BY_ID_MAPPING
public static final String BY_ID_MAPPING
- See Also:
- Constant Field Values
-
BY_ID_EDIT_MAPPING
public static final String BY_ID_EDIT_MAPPING
- See Also:
- Constant Field Values
-
BY_ID_DELETE_MAPPING
public static final String BY_ID_DELETE_MAPPING
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init()
-
destroy
public void destroy()
-
getOwnerRole
@ModelAttribute("ownerRole") public org.duracloud.account.db.model.Role getOwnerRole()
-
getAdminRole
@ModelAttribute("adminRole") public org.duracloud.account.db.model.Role getAdminRole()
-
getUserRole
@ModelAttribute("userRole") public org.duracloud.account.db.model.Role getUserRole()
-
getRecaptchaSiteKey
@ModelAttribute("recaptchaSiteKey") public String getRecaptchaSiteKey()
-
isRecaptchaEnabled
@ModelAttribute("recaptchaEnabled") protected boolean isRecaptchaEnabled()
-
getRecaptchaSecret
public String getRecaptchaSecret()
-
setUserRights
protected void setUserRights(DuracloudUserService userService, Long accountId, Long userId, org.duracloud.account.db.model.Role role)
-
accountHasMoreThanOneOwner
protected boolean accountHasMoreThanOneOwner(Set<org.duracloud.account.db.model.DuracloudUser> users, Long accountId)
- Parameters:
users-- Returns:
-
handleException
@ExceptionHandler(java.lang.Exception.class) public org.springframework.web.servlet.ModelAndView handleException(Exception e)
-
setError
protected void setError(Exception e)
-
setError
protected void setError(Exception e, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
createRedirectMav
protected org.springframework.web.servlet.ModelAndView createRedirectMav(String url)
-
setSuccessFeedback
protected void setSuccessFeedback(String message, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
setFailureFeedback
protected void setFailureFeedback(String message, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
validateRecaptcha
protected boolean validateRecaptcha(String recaptchaResponse) throws IOException
- Throws:
IOException
-
-