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