Package com.composum.sling.nodes.servlet
Class NodeTypesServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- org.apache.sling.api.servlets.SlingSafeMethodsServlet
-
- com.composum.sling.nodes.servlet.NodeTypesServlet
-
- All Implemented Interfaces:
RestrictedService,Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class NodeTypesServlet extends org.apache.sling.api.servlets.SlingSafeMethodsServlet implements RestrictedService
A servlet that exports the nodetypes in the format used in nodetypes.cnd. E.g.http://localhost:9090/bin/cpm/nodes/debug/nodetypes?nameregex=cpp%3A.%2A- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARAM_NODETYPEREGEXRequest parameter with a regular expression to select the nodetypes to write.static StringSERVICE_KEYstatic StringSERVLET_PATH
-
Constructor Summary
Constructors Constructor Description NodeTypesServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response)ServiceRestrictions.KeygetServiceKey()protected voidwriteNodetypes(javax.jcr.Session session, PrintWriter writer, Pattern nodetypeSelector)-
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
-
-
-
-
Field Detail
-
SERVLET_PATH
public static final String SERVLET_PATH
- See Also:
- Constant Field Values
-
SERVICE_KEY
public static final String SERVICE_KEY
- See Also:
- Constant Field Values
-
PARAM_NODETYPEREGEX
public static final String PARAM_NODETYPEREGEX
Request parameter with a regular expression to select the nodetypes to write.- See Also:
- Constant Field Values
-
-
Method Detail
-
getServiceKey
@NotNull public ServiceRestrictions.Key getServiceKey()
- Specified by:
getServiceKeyin interfaceRestrictedService
-
doGet
protected void doGet(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doGetin classorg.apache.sling.api.servlets.SlingSafeMethodsServlet- Throws:
javax.servlet.ServletExceptionIOException
-
writeNodetypes
protected void writeNodetypes(javax.jcr.Session session, PrintWriter writer, Pattern nodetypeSelector) throws javax.jcr.RepositoryException, IOException- Throws:
javax.jcr.RepositoryExceptionIOException
-
-