Package com.composum.sling.nodes.servlet
Class NodeServlet.AbstractQueryOperation
- java.lang.Object
-
- com.composum.sling.nodes.servlet.NodeServlet.AbstractQueryOperation
-
- All Implemented Interfaces:
ServletOperation
- Direct Known Subclasses:
NodeServlet.ExportQueryOperation,NodeServlet.HtmlQueryOperation,NodeServlet.JsonQueryOperation
- Enclosing class:
- NodeServlet
protected abstract class NodeServlet.AbstractQueryOperation extends Object implements ServletOperation
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractQueryOperation()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanaccept(ResourceFilter filter, org.apache.sling.api.resource.Resource resource)voiddoIt(@NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull org.apache.sling.api.SlingHttpServletResponse response, ResourceHandle resource)protected @Nullable LonggetQueryLimit()StringgetSimpleQuery(String path, String text)protected voidwriteError(org.apache.sling.api.SlingHttpServletResponse response, String queryString, Exception ex)protected abstract voidwriteQueryResult(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, String queryString, javax.jcr.query.QueryResult result, ResourceFilter filter, org.apache.sling.api.resource.ResourceResolver resolver)Writes the query result in the format appropriate to the output.
-
-
-
Method Detail
-
doIt
public void doIt(@NotNull @NotNull org.apache.sling.api.SlingHttpServletRequest request, @NotNull @NotNull org.apache.sling.api.SlingHttpServletResponse response, ResourceHandle resource) throws javax.servlet.ServletException, IOException- Specified by:
doItin interfaceServletOperation- Throws:
javax.servlet.ServletExceptionIOException
-
accept
protected boolean accept(ResourceFilter filter, org.apache.sling.api.resource.Resource resource)
-
getQueryLimit
@Nullable protected @Nullable Long getQueryLimit()
-
writeQueryResult
protected abstract void writeQueryResult(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, String queryString, javax.jcr.query.QueryResult result, ResourceFilter filter, org.apache.sling.api.resource.ResourceResolver resolver) throws javax.jcr.RepositoryException, javax.servlet.ServletException, IOExceptionWrites the query result in the format appropriate to the output. Caution: think of escaping appropriately (XSS etc.).- Throws:
javax.jcr.RepositoryExceptionjavax.servlet.ServletExceptionIOException
-
writeError
protected void writeError(org.apache.sling.api.SlingHttpServletResponse response, String queryString, Exception ex) throws IOException- Throws:
IOException
-
-