Class ClientlibDebugConsolePlugin
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.composum.sling.clientlibs.servlet.ClientlibDebugConsolePlugin
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class ClientlibDebugConsolePlugin extends javax.servlet.http.HttpServletPrints a rough overview over the structure of the client library, incl. dependent or embedded client libraries. Works as a Sling Console plugin.- Since:
- 10/2017
- Author:
- Hans-Peter Stoerr
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classClientlibDebugConsolePlugin.DebugVisitorprotected classClientlibDebugConsolePlugin.ProcessorEncapsulates stuff always needed during one request, to avoid passing it on through all methods as parameters.
-
Field Summary
Fields Modifier and Type Field Description protected ClientlibServiceclientlibServiceprotected static StringLOC_CSSLocation for the CSS.protected static StringREQUEST_PARAM_CLEAR_CACHERequest parameter that triggers clearing the clientlib cache.protected static StringREQUEST_PARAM_FILTERRequest parameter that sets a filter for clientlibs.protected static StringREQUEST_PARAM_IMPERSONATERequest parameter to check permissions / view clientlibs for one user.protected static StringREQUEST_PARAM_LIBRequest parameter to restrict output to one libraryprotected static StringREQUEST_PARAM_TYPERequest parameter that overrides the type selector, when used from the form.protected org.apache.sling.api.resource.ResourceResolverFactoryresolverFactoryprotected static PatternSELECTOR_REGEXExtracts the (single) selector from a URL.
-
Constructor Summary
Constructors Constructor Description ClientlibDebugConsolePlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected voiddoPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)protected voidinitResolvers(ClientlibDebugConsolePlugin.Processor processor, String impersonation)protected Clientlib.TyperequestedClientlibType(javax.servlet.http.HttpServletRequest request)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
SELECTOR_REGEX
protected static final Pattern SELECTOR_REGEX
Extracts the (single) selector from a URL.
-
REQUEST_PARAM_LIB
protected static final String REQUEST_PARAM_LIB
Request parameter to restrict output to one library- See Also:
- Constant Field Values
-
REQUEST_PARAM_IMPERSONATE
protected static final String REQUEST_PARAM_IMPERSONATE
Request parameter to check permissions / view clientlibs for one user.- See Also:
- Constant Field Values
-
REQUEST_PARAM_TYPE
protected static final String REQUEST_PARAM_TYPE
Request parameter that overrides the type selector, when used from the form.- See Also:
- Constant Field Values
-
REQUEST_PARAM_CLEAR_CACHE
protected static final String REQUEST_PARAM_CLEAR_CACHE
Request parameter that triggers clearing the clientlib cache. Obviously something to be used sparingly.- See Also:
- Constant Field Values
-
REQUEST_PARAM_FILTER
protected static final String REQUEST_PARAM_FILTER
Request parameter that sets a filter for clientlibs. When listing all clientlibs, Only clientlibs where the filter regex can be found in the name, path, category or description are shown.- See Also:
- Constant Field Values
-
LOC_CSS
protected static final String LOC_CSS
Location for the CSS.- See Also:
- Constant Field Values
-
clientlibService
protected ClientlibService clientlibService
-
resolverFactory
protected org.apache.sling.api.resource.ResourceResolverFactory resolverFactory
-
-
Method Detail
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
initResolvers
protected void initResolvers(ClientlibDebugConsolePlugin.Processor processor, String impersonation) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
requestedClientlibType
protected Clientlib.Type requestedClientlibType(javax.servlet.http.HttpServletRequest request)
-
-