|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
org.apache.sling.api.servlets.SlingSafeMethodsServlet
org.apache.sling.api.servlets.SlingAllMethodsServlet
com.day.cq.commons.servlets.AbstractPredicateServlet
com.day.cq.wcm.core.contentfinder.DefaultViewHandler
public class DefaultViewHandler
Servlet that returns search results for a given gql statement.
example statement:'path:/content About'
or url params:/bin/wcm/search/gql.json?query='path:/content type:"cq:Page" About'&pathPrefix=jcr:content
| Nested Class Summary | |
|---|---|
protected class |
DefaultViewHandler.GQLViewQuery
|
class |
DefaultViewHandler.Hit
|
protected class |
DefaultViewHandler.NodeIndexerViewQuery
|
static interface |
DefaultViewHandler.ViewQuery
|
| Field Summary | |
|---|---|
static String |
COMMON_PATH_PREFIX
Common path prefix |
static String |
DEFAULT_NODE_TYPE
Default node type |
static String |
DEFAULT_START_PATH
default start path |
static String |
MIME
mimeType clause |
static String |
MIX_DAM_RESOURCE
dam:Resource mixin nodetype |
static String |
QUERY
Query clause |
protected String |
startPath
start path |
| Fields inherited from class com.day.cq.commons.servlets.AbstractPredicateServlet |
|---|
FILTER_PARAM, PATH_PARAM, PREDICATE_PARAM |
| Constructor Summary | |
|---|---|
DefaultViewHandler()
|
|
| Method Summary | |
|---|---|
protected boolean |
doAdd(Node node,
String type)
Checks if a "result entry" has to be added to the final result set |
protected void |
doGet(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
org.apache.commons.collections.Predicate predicate)
Handles the HTTP GET method |
protected boolean |
isPageContent(Node node)
|
protected List<DefaultViewHandler.Hit> |
order(Map<String,DefaultViewHandler.Hit> hits)
It may happen that files/pages have the same modification date. |
protected long |
search(Session session,
org.apache.sling.commons.json.io.JSONWriter writer,
String queryString,
List<String> searchAttr,
String commonPathPrefix,
String lastModified,
boolean returnParent,
int limit,
String type)
This method analyzes/prepares the passed gql statement and executes the search than. |
| Methods inherited from class com.day.cq.commons.servlets.AbstractPredicateServlet |
|---|
doGet, getPredicate, selectorPredicateStart |
| Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet |
|---|
doDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayService |
| Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet |
|---|
doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, init, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String QUERY
public static final String MIME
public static final String COMMON_PATH_PREFIX
public static final String DEFAULT_NODE_TYPE
public static final String MIX_DAM_RESOURCE
public static final String DEFAULT_START_PATH
protected String startPath
| Constructor Detail |
|---|
public DefaultViewHandler()
| Method Detail |
|---|
protected void doGet(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
org.apache.commons.collections.Predicate predicate)
throws javax.servlet.ServletException,
IOException
AbstractPredicateServlet
doGet in class AbstractPredicateServletrequest - The HTTP requestresponse - The HTTP responsepredicate - the predicate retrieved from the request
javax.servlet.ServletException - if a servlet error occurs
IOException - if an I/O error occurs
protected long search(Session session,
org.apache.sling.commons.json.io.JSONWriter writer,
String queryString,
List<String> searchAttr,
String commonPathPrefix,
String lastModified,
boolean returnParent,
int limit,
String type)
throws IOException,
org.apache.sling.commons.json.JSONException,
RepositoryException
session - jcr sessionwriter - writer used to output resultsqueryString - query string received from clientsearchAttr - additional search attributescommonPathPrefix - common path prefixlastModified - name of last modified propertyreturnParent - specifies if the parent node has to be returned of each hitlimit - 0 means no limittype - nodetype to filter
IOException
org.apache.sling.commons.json.JSONException
RepositoryException
protected boolean doAdd(Node node,
String type)
node - node to checktype - nodetype to match
true if the node should be added to the result set
protected List<DefaultViewHandler.Hit> order(Map<String,DefaultViewHandler.Hit> hits)
throws RepositoryException
hits - "unordered" result list
RepositoryExceptionprotected boolean isPageContent(Node node)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||