org.hippoecm.hst.content.beans.query
Class HstCtxWhereClauseComputerImpl

java.lang.Object
  extended by org.hippoecm.hst.content.beans.query.HstCtxWhereClauseComputerImpl
All Implemented Interfaces:
HstCtxWhereClauseComputer

public class HstCtxWhereClauseComputerImpl
extends Object
implements HstCtxWhereClauseComputer


Nested Class Summary
protected static class HstCtxWhereClauseComputerImpl.Mapper
           
 
Field Summary
static org.slf4j.Logger log
           
 
Constructor Summary
HstCtxWhereClauseComputerImpl()
           
 
Method Summary
 String getCtxWhereClause(List<javax.jcr.Node> scopes, boolean skipInvalidScopes)
          returns the context where clause as from HstCtxWhereClauseComputer.getCtxWhereClause(Node), only now combines a set of scopes.
 String getCtxWhereClause(javax.jcr.Node node)
          This method returns the context where clause (without the '[' ']' brackets ) that is appended to the 'normal' xpath where clause for searching in virtual strutures.
protected  HstCtxWhereClauseComputerImpl.Mapper getPathMapper(javax.jcr.Node scope)
           
 HstVirtualizer getVirtualizer(List<javax.jcr.Node> scopes, boolean skipInvalidScopes)
          When the search was in multiple scopes, we need to rewrite the physical hits to the context aware virtual path.
 HstVirtualizer getVirtualizer(javax.jcr.Node scope)
          Returns a virtualizer for the scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.slf4j.Logger log
Constructor Detail

HstCtxWhereClauseComputerImpl

public HstCtxWhereClauseComputerImpl()
Method Detail

getVirtualizer

public HstVirtualizer getVirtualizer(List<javax.jcr.Node> scopes,
                                     boolean skipInvalidScopes)
                              throws HstContextualizeException
When the search was in multiple scopes, we need to rewrite the physical hits to the context aware virtual path. As we have multiple scope, we try every scope, with the deepest scopes first. Therefor, a sorted treeSet is used

Specified by:
getVirtualizer in interface HstCtxWhereClauseComputer
Parameters:
scopes - all the scopes that was searched in
skipInvalidScopes - whether to skip invalid scopes. If false, a HstContextualizeException is thrown when an invalid scope is found
Returns:
A virtualizer for the scopes. If null is returned, no virtualization can be done
Throws:
HstContextualizeException

getVirtualizer

public HstVirtualizer getVirtualizer(javax.jcr.Node scope)
                              throws HstContextualizeException
Description copied from interface: HstCtxWhereClauseComputer
Returns a virtualizer for the scope. If the scope is physical, a virtualizer can be returned that just returns the physical node.

Specified by:
getVirtualizer in interface HstCtxWhereClauseComputer
Returns:
A virtualizer for the scope. If null is returned, no virtualization can be done
Throws:
HstContextualizeException

getPathMapper

protected HstCtxWhereClauseComputerImpl.Mapper getPathMapper(javax.jcr.Node scope)
                                                      throws HstContextualizeException
Throws:
HstContextualizeException

getCtxWhereClause

public String getCtxWhereClause(javax.jcr.Node node)
                         throws HstContextualizeException
Description copied from interface: HstCtxWhereClauseComputer
This method returns the context where clause (without the '[' ']' brackets ) that is appended to the 'normal' xpath where clause for searching in virtual strutures. The scope to search from, the Node must be translated into a where clause, and also all possible ancestor filters that result in the virtual structure most be accounted for in the where clause computer. When the search is done in a non virtual Node, the #getCtxWhereClause(Node, HstRequestContext) is allowed to simply return null

Specified by:
getCtxWhereClause in interface HstCtxWhereClauseComputer
Parameters:
node - the Node below which (in other words the scope) the search is done
Returns:
the string containing the xpath where clause (without the enclosing '[' and ']') or null when it cannot compute one. If there is no where clause, for example because the node is the jcr root node, just "" should be returned
Throws:
HstContextualizeException

getCtxWhereClause

public String getCtxWhereClause(List<javax.jcr.Node> scopes,
                                boolean skipInvalidScopes)
                         throws HstContextualizeException
Description copied from interface: HstCtxWhereClauseComputer
returns the context where clause as from HstCtxWhereClauseComputer.getCtxWhereClause(Node), only now combines a set of scopes.

Specified by:
getCtxWhereClause in interface HstCtxWhereClauseComputer
skipInvalidScopes - true when invalid scopes are skipped
Returns:
the string containing the xpath where clause (without the enclosing '[' and ']') representing all scopes or null when it cannot compute one. If there is no where clause, for example because the node is the jcr root node, just "" should be returned
Throws:
HstContextualizeException


Copyright © 2008-2012 Hippo. All Rights Reserved.