info.magnolia.cms.core.search
Class QueryResultImpl

java.lang.Object
  extended by info.magnolia.cms.core.search.QueryResultImpl
All Implemented Interfaces:
QueryResult

public class QueryResultImpl
extends Object
implements QueryResult

Wrapping a JCR QueryResult. This class will filter the result according to the user's ACLs. You can use getContent(String) to retrieve nodes of a certain type. If the node's type doesn't match the nearest matching ancestors is add instead. This allows to search in paragraph content while retrieving a list of pages.

Author:
Sameer Charles, Fabrizio Giustina

Field Summary
protected  Map<String,String> dirtyHandles
           
protected  HierarchyManager hm
           
protected  long maxResultSize
           
protected  Map<String,Collection<Content>> objectStore
          caches all previously queried objects.
protected  javax.jcr.query.QueryResult result
          Unfiltered result object.
 
Constructor Summary
protected QueryResultImpl(javax.jcr.query.QueryResult result, HierarchyManager hm)
           
protected QueryResultImpl(javax.jcr.query.QueryResult result, HierarchyManager hm, long maxResultSize)
           
 
Method Summary
protected  void build(javax.jcr.Node node, String[] nodeType, Collection<Content> collection)
          Traverses the hierarchy from the current node to the root until the node's type matches.
protected  void build(String nodeType, Collection<Content> collection)
          Adds all found nodes of a certain type.
 AccessManager getAccessManager()
          Deprecated.  
 Collection<Content> getContent()
          Gets a collection of Content objects for mgnl:content NodeType.
 Collection<Content> getContent(String nodeType)
          Gets a collection of Content objects for specified NodeType.
 javax.jcr.query.QueryResult getJcrResult()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

result

protected javax.jcr.query.QueryResult result
Unfiltered result object.


objectStore

protected Map<String,Collection<Content>> objectStore
caches all previously queried objects.


hm

protected HierarchyManager hm

maxResultSize

protected final long maxResultSize

dirtyHandles

protected Map<String,String> dirtyHandles
Constructor Detail

QueryResultImpl

protected QueryResultImpl(javax.jcr.query.QueryResult result,
                          HierarchyManager hm)

QueryResultImpl

protected QueryResultImpl(javax.jcr.query.QueryResult result,
                          HierarchyManager hm,
                          long maxResultSize)
Method Detail

getAccessManager

public AccessManager getAccessManager()
Deprecated. 

Returns:

getJcrResult

public javax.jcr.query.QueryResult getJcrResult()

build

protected void build(String nodeType,
                     Collection<Content> collection)
              throws javax.jcr.RepositoryException
Adds all found nodes of a certain type. If the type doesn't match it will traverse the ancestors and add them instead.

Throws:
javax.jcr.RepositoryException

build

protected void build(javax.jcr.Node node,
                     String[] nodeType,
                     Collection<Content> collection)
              throws javax.jcr.RepositoryException
Traverses the hierarchy from the current node to the root until the node's type matches.

Throws:
javax.jcr.RepositoryException

getContent

public Collection<Content> getContent()
Description copied from interface: QueryResult
Gets a collection of Content objects for mgnl:content NodeType.

Specified by:
getContent in interface QueryResult

getContent

public Collection<Content> getContent(String nodeType)
Description copied from interface: QueryResult
Gets a collection of Content objects for specified NodeType.

Specified by:
getContent in interface QueryResult


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.