Package com.composum.sling.core.servlet
Class AbstractConsoleServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- com.composum.sling.core.servlet.AbstractConsoleServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public abstract class AbstractConsoleServlet extends org.apache.sling.api.servlets.SlingSafeMethodsServlet
A base class for a general hook (servlet) for a console view.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.framework.BundleContext
bundleContext
-
Constructor Summary
Constructors Constructor Description AbstractConsoleServlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
activate(org.osgi.framework.BundleContext bundleContext)
protected boolean
checkConsoleAccess(BeanContext context)
Check access rights to the servlets path - is checking ACLs of the console pathprotected BeanContext
createContext(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
protected void
doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
protected String
getConsolePath(BeanContext context)
extension point to check access rights for a console feature by feature pathprotected abstract Pattern
getPathPattern(BeanContext context)
protected String
getRequestPath(org.apache.sling.api.SlingHttpServletRequest request)
protected abstract String
getResourceType(BeanContext context)
ServiceRestrictions.Key
getServiceKey()
protected abstract String
getServletPath(BeanContext context)
protected void
prepareForward(BeanContext context, org.apache.sling.api.request.RequestDispatcherOptions options)
-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
-
-
-
-
Method Detail
-
activate
protected void activate(org.osgi.framework.BundleContext bundleContext)
-
getServletPath
protected abstract String getServletPath(BeanContext context)
-
getPathPattern
protected abstract Pattern getPathPattern(BeanContext context)
-
getResourceType
protected abstract String getResourceType(BeanContext context)
-
getConsolePath
protected String getConsolePath(BeanContext context)
extension point to check access rights for a console feature by feature path- Returns:
- the path to the console feature (content); 'null' if no check supported or check switched off
-
getServiceKey
public ServiceRestrictions.Key getServiceKey()
-
getRequestPath
protected String getRequestPath(org.apache.sling.api.SlingHttpServletRequest request)
-
createContext
protected BeanContext createContext(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
-
doGet
protected void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classorg.apache.sling.api.servlets.SlingSafeMethodsServlet
- Throws:
javax.servlet.ServletException
IOException
-
prepareForward
protected void prepareForward(BeanContext context, org.apache.sling.api.request.RequestDispatcherOptions options)
-
checkConsoleAccess
protected boolean checkConsoleAccess(BeanContext context)
Check access rights to the servlets path - is checking ACLs of the console path- Parameters:
context
- the current request- Returns:
- 'true' if access granted or access check switched off
-
-