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.HttpServlet
Prints 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 class
ClientlibDebugConsolePlugin.DebugVisitor
protected class
ClientlibDebugConsolePlugin.Processor
Encapsulates 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 ClientlibService
clientlibService
protected static String
LOC_CSS
Location for the CSS.protected static String
REQUEST_PARAM_CLEAR_CACHE
Request parameter that triggers clearing the clientlib cache.protected static String
REQUEST_PARAM_FILTER
Request parameter that sets a filter for clientlibs.protected static String
REQUEST_PARAM_IMPERSONATE
Request parameter to check permissions / view clientlibs for one user.protected static String
REQUEST_PARAM_LIB
Request parameter to restrict output to one libraryprotected static String
REQUEST_PARAM_TYPE
Request parameter that overrides the type selector, when used from the form.protected org.apache.sling.api.resource.ResourceResolverFactory
resolverFactory
protected static Pattern
SELECTOR_REGEX
Extracts 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 void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
protected void
initResolvers(ClientlibDebugConsolePlugin.Processor processor, String impersonation)
protected Clientlib.Type
requestedClientlibType(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:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
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)
-
-