public abstract class JahiaController extends Object implements org.springframework.web.servlet.mvc.Controller
| Constructor and Description |
|---|
JahiaController() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkUserAuthorized() |
protected void |
checkUserAuthorized(JCRNodeWrapper node) |
protected void |
checkUserLoggedIn() |
protected JahiaUser |
getCurrentUser()
Returns the current user.
|
protected static int |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name)
Simple utility method to retrieve an integer parameter from a request and throws an
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found. |
protected static int |
getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
int defaultValue)
Retrieves the integer value of the specified request parameter.
|
protected static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name)
Simple utility method to retrieve a parameter from a request and throws an
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found. |
protected static String |
getParameter(javax.servlet.http.HttpServletRequest request,
String name,
String defaultValue)
Retrieves the value of the specified request parameter.
|
protected String |
getRequiredPermission()
Returns the permission, required to handle this action.
|
protected boolean |
isRequireAuthenticatedUser() |
protected boolean |
isUserGuest()
Returns
true if the current user is a non-authenticated user. |
void |
setRequireAuthenticatedUser(boolean requireAuthenticatedUser) |
void |
setRequiredPermission(String requiredPermission)
Sets the permission, required to handle this action.
|
protected static final int getIntParameter(javax.servlet.http.HttpServletRequest request,
String name)
throws JahiaBadRequestException
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found.request - The current HttpServletRequestname - The parameter nameJahiaBadRequestException - in case the parameter is not found in the request or a parsing exception occursprotected static final int getIntParameter(javax.servlet.http.HttpServletRequest request,
String name,
int defaultValue)
request - The current HttpServletRequestname - The parameter namedefaultValue - the default parameter valueprotected static final String getParameter(javax.servlet.http.HttpServletRequest request, String name) throws JahiaBadRequestException
JahiaBadRequestException (results in a 400 error)
in case the parameter is not found.request - The current HttpServletRequestname - The parameter nameJahiaBadRequestException - in case the parameter is not found in the requestprotected static final String getParameter(javax.servlet.http.HttpServletRequest request, String name, String defaultValue)
request - The current HttpServletRequestname - The parameter namedefaultValue - the default parameter valueprotected void checkUserAuthorized()
throws JahiaForbiddenAccessException
JahiaForbiddenAccessExceptionprotected void checkUserAuthorized(JCRNodeWrapper node) throws JahiaForbiddenAccessException
JahiaForbiddenAccessExceptionprotected void checkUserLoggedIn()
throws JahiaForbiddenAccessException
JahiaForbiddenAccessExceptionprotected JahiaUser getCurrentUser()
protected String getRequiredPermission()
null if no particular permission is required.null if no particular permission is requiredprotected boolean isRequireAuthenticatedUser()
protected boolean isUserGuest()
true if the current user is a non-authenticated user.true if the current user is a non-authenticated userpublic void setRequireAuthenticatedUser(boolean requireAuthenticatedUser)
public void setRequiredPermission(String requiredPermission)
null if no particular permission is required.requiredPermission - the permission, required to handle this action. null if no particular permission is requiredCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.