Class 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 Detail

      • bundleContext

        protected org.osgi.framework.BundleContext bundleContext
    • Constructor Detail

      • AbstractConsoleServlet

        public AbstractConsoleServlet()
    • Method Detail

      • activate

        protected void activate​(org.osgi.framework.BundleContext bundleContext)
      • 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
      • 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 class org.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