org.alfresco.opencmis.search
Class CmisFunctionEvaluationContext

java.lang.Object
  extended by org.alfresco.opencmis.search.CmisFunctionEvaluationContext
All Implemented Interfaces:
FunctionEvaluationContext

public class CmisFunctionEvaluationContext
extends java.lang.Object
implements FunctionEvaluationContext


Field Summary
static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] ALFRESCO_SCOPES
           
static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] STRICT_SCOPES
           
 
Constructor Summary
CmisFunctionEvaluationContext()
           
 
Method Summary
 org.apache.lucene.search.Query buildLuceneEquality(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
           
 org.apache.lucene.search.Query buildLuceneExists(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.lang.Boolean not)
          Note: null and not null are not required to support functions from the spec
 org.apache.lucene.search.Query buildLuceneGreaterThan(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
           
 org.apache.lucene.search.Query buildLuceneGreaterThanOrEquals(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
           
 org.apache.lucene.search.Query buildLuceneIn(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.util.Collection values, java.lang.Boolean not, PredicateMode mode)
          Note: In is not required to support functions from the spec
 org.apache.lucene.search.Query buildLuceneInequality(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
           
 org.apache.lucene.search.Query buildLuceneLessThan(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
           
 org.apache.lucene.search.Query buildLuceneLessThanOrEquals(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
           
 org.apache.lucene.search.Query buildLuceneLike(AbstractLuceneQueryParser lqp, java.lang.String propertyName, java.io.Serializable value, java.lang.Boolean not)
          Note: Like is not required to support functions from the spec
 void checkFieldApplies(Selector selector, java.lang.String propertyName)
           
 java.lang.String getLuceneFieldName(java.lang.String propertyName)
           
 LuceneFunction getLuceneFunction(FunctionArgument functionArgument)
           
 java.lang.String getLuceneSortField(AbstractLuceneQueryParser lqp, java.lang.String propertyName)
           
 java.util.Map getNodeRefs()
           
 NodeService getNodeService()
           
 java.io.Serializable getProperty(NodeRef nodeRef, java.lang.String propertyName)
          Get a property
 java.lang.Float getScore()
           
 java.util.Map getScores()
           
 boolean isMultiValued(java.lang.String propertyName)
          Is this a multi-valued property?
 boolean isObjectId(java.lang.String propertyName)
           
 boolean isOrderable(java.lang.String fieldName)
           
 boolean isQueryable(java.lang.String fieldName)
           
 void setCmisDictionaryService(CMISDictionaryService cmisDictionaryService)
           
 void setNodeInfos(java.util.Map nodeInfos)
           
 void setNodeRefs(java.util.Map nodeRefs)
           
 void setNodeService(NodeService nodeService)
           
 void setScore(java.lang.Float score)
           
 void setScores(java.util.Map scores)
           
 void setValidScopes(org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] validScopes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRICT_SCOPES

public static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] STRICT_SCOPES

ALFRESCO_SCOPES

public static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] ALFRESCO_SCOPES
Constructor Detail

CmisFunctionEvaluationContext

public CmisFunctionEvaluationContext()
Method Detail

setNodeRefs

public void setNodeRefs(java.util.Map nodeRefs)
Parameters:
nodeRefs - the nodeRefs to set

setScores

public void setScores(java.util.Map scores)
Parameters:
scores - the scores to set

setNodeInfos

public void setNodeInfos(java.util.Map nodeInfos)

setNodeService

public void setNodeService(NodeService nodeService)
Parameters:
nodeService - the nodeService to set

setCmisDictionaryService

public void setCmisDictionaryService(CMISDictionaryService cmisDictionaryService)
Parameters:
cmisDictionaryService - the cmisDictionaryService to set

setValidScopes

public void setValidScopes(org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] validScopes)
Parameters:
validScopes - the valid scopes to set

getNodeRefs

public java.util.Map getNodeRefs()
Specified by:
getNodeRefs in interface FunctionEvaluationContext
Returns:
the matching nodes by selector (at navigation time)

getNodeService

public NodeService getNodeService()
Specified by:
getNodeService in interface FunctionEvaluationContext
Returns:
the node service

getProperty

public java.io.Serializable getProperty(NodeRef nodeRef,
                                        java.lang.String propertyName)
Description copied from interface: FunctionEvaluationContext
Get a property

Specified by:
getProperty in interface FunctionEvaluationContext
Returns:
the property (at navigation time)

getScores

public java.util.Map getScores()
Specified by:
getScores in interface FunctionEvaluationContext
Returns:
the scores by selector (at navigation time)

getScore

public java.lang.Float getScore()
Specified by:
getScore in interface FunctionEvaluationContext
Returns:
the score

setScore

public void setScore(java.lang.Float score)
Parameters:
score - the score to set

buildLuceneEquality

public org.apache.lucene.search.Query buildLuceneEquality(AbstractLuceneQueryParser lqp,
                                                          java.lang.String propertyName,
                                                          java.io.Serializable value,
                                                          PredicateMode mode,
                                                          LuceneFunction luceneFunction)
                                                   throws org.apache.lucene.queryParser.ParseException
Specified by:
buildLuceneEquality in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneExists

public org.apache.lucene.search.Query buildLuceneExists(AbstractLuceneQueryParser lqp,
                                                        java.lang.String propertyName,
                                                        java.lang.Boolean not)
                                                 throws org.apache.lucene.queryParser.ParseException
Description copied from interface: FunctionEvaluationContext
Note: null and not null are not required to support functions from the spec

Specified by:
buildLuceneExists in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneGreaterThan

public org.apache.lucene.search.Query buildLuceneGreaterThan(AbstractLuceneQueryParser lqp,
                                                             java.lang.String propertyName,
                                                             java.io.Serializable value,
                                                             PredicateMode mode,
                                                             LuceneFunction luceneFunction)
                                                      throws org.apache.lucene.queryParser.ParseException
Specified by:
buildLuceneGreaterThan in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneGreaterThanOrEquals

public org.apache.lucene.search.Query buildLuceneGreaterThanOrEquals(AbstractLuceneQueryParser lqp,
                                                                     java.lang.String propertyName,
                                                                     java.io.Serializable value,
                                                                     PredicateMode mode,
                                                                     LuceneFunction luceneFunction)
                                                              throws org.apache.lucene.queryParser.ParseException
Specified by:
buildLuceneGreaterThanOrEquals in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneIn

public org.apache.lucene.search.Query buildLuceneIn(AbstractLuceneQueryParser lqp,
                                                    java.lang.String propertyName,
                                                    java.util.Collection values,
                                                    java.lang.Boolean not,
                                                    PredicateMode mode)
                                             throws org.apache.lucene.queryParser.ParseException
Description copied from interface: FunctionEvaluationContext
Note: In is not required to support functions from the spec

Specified by:
buildLuceneIn in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneInequality

public org.apache.lucene.search.Query buildLuceneInequality(AbstractLuceneQueryParser lqp,
                                                            java.lang.String propertyName,
                                                            java.io.Serializable value,
                                                            PredicateMode mode,
                                                            LuceneFunction luceneFunction)
                                                     throws org.apache.lucene.queryParser.ParseException
Specified by:
buildLuceneInequality in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneLessThan

public org.apache.lucene.search.Query buildLuceneLessThan(AbstractLuceneQueryParser lqp,
                                                          java.lang.String propertyName,
                                                          java.io.Serializable value,
                                                          PredicateMode mode,
                                                          LuceneFunction luceneFunction)
                                                   throws org.apache.lucene.queryParser.ParseException
Specified by:
buildLuceneLessThan in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneLessThanOrEquals

public org.apache.lucene.search.Query buildLuceneLessThanOrEquals(AbstractLuceneQueryParser lqp,
                                                                  java.lang.String propertyName,
                                                                  java.io.Serializable value,
                                                                  PredicateMode mode,
                                                                  LuceneFunction luceneFunction)
                                                           throws org.apache.lucene.queryParser.ParseException
Specified by:
buildLuceneLessThanOrEquals in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

buildLuceneLike

public org.apache.lucene.search.Query buildLuceneLike(AbstractLuceneQueryParser lqp,
                                                      java.lang.String propertyName,
                                                      java.io.Serializable value,
                                                      java.lang.Boolean not)
                                               throws org.apache.lucene.queryParser.ParseException
Description copied from interface: FunctionEvaluationContext
Note: Like is not required to support functions from the spec

Specified by:
buildLuceneLike in interface FunctionEvaluationContext
Returns:
the query
Throws:
org.apache.lucene.queryParser.ParseException

getLuceneSortField

public java.lang.String getLuceneSortField(AbstractLuceneQueryParser lqp,
                                           java.lang.String propertyName)
Specified by:
getLuceneSortField in interface FunctionEvaluationContext
Returns:
the field used for sorting the given property

isObjectId

public boolean isObjectId(java.lang.String propertyName)
Specified by:
isObjectId in interface FunctionEvaluationContext
Returns:
- is this an object id

isOrderable

public boolean isOrderable(java.lang.String fieldName)
Specified by:
isOrderable in interface FunctionEvaluationContext
Returns:
Is this property orderable

isQueryable

public boolean isQueryable(java.lang.String fieldName)
Specified by:
isQueryable in interface FunctionEvaluationContext
Returns:
is this property queryable

getLuceneFieldName

public java.lang.String getLuceneFieldName(java.lang.String propertyName)
Specified by:
getLuceneFieldName in interface FunctionEvaluationContext
Returns:
the lucene field name for the property

getLuceneFunction

public LuceneFunction getLuceneFunction(FunctionArgument functionArgument)
Specified by:
getLuceneFunction in interface FunctionEvaluationContext
Returns:
the lucene function appropriate to a function argument

checkFieldApplies

public void checkFieldApplies(Selector selector,
                              java.lang.String propertyName)
Specified by:
checkFieldApplies in interface FunctionEvaluationContext

isMultiValued

public boolean isMultiValued(java.lang.String propertyName)
Description copied from interface: FunctionEvaluationContext
Is this a multi-valued property?

Specified by:
isMultiValued in interface FunctionEvaluationContext
Returns:


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.