Package org.alfresco.opencmis.search
Class CmisFunctionEvaluationContext
- java.lang.Object
-
- org.alfresco.opencmis.search.CmisFunctionEvaluationContext
-
- All Implemented Interfaces:
FunctionEvaluationContext
public class CmisFunctionEvaluationContext extends java.lang.Object implements FunctionEvaluationContext
- Author:
- andyh
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[]
ALFRESCO_SCOPES
static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[]
STRICT_SCOPES
-
Constructor Summary
Constructors Constructor Description CmisFunctionEvaluationContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <Q,S,E extends java.lang.Throwable>
QbuildLuceneEquality(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
<Q,S,E extends java.lang.Throwable>
QbuildLuceneExists(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.lang.Boolean not)
Note: null and not null are not required to support functions from the spec<Q,S,E extends java.lang.Throwable>
QbuildLuceneGreaterThan(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
<Q,S,E extends java.lang.Throwable>
QbuildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
<Q,S,E extends java.lang.Throwable>
QbuildLuceneIn(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.util.Collection<java.io.Serializable> values, java.lang.Boolean not, PredicateMode mode)
Note: In is not required to support functions from the spec<Q,S,E extends java.lang.Throwable>
QbuildLuceneInequality(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
<Q,S,E extends java.lang.Throwable>
QbuildLuceneLessThan(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
<Q,S,E extends java.lang.Throwable>
QbuildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction)
<Q,S,E extends java.lang.Throwable>
QbuildLuceneLike(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, java.lang.Boolean not)
Note: Like is not required to support functions from the specvoid
checkFieldApplies(Selector selector, java.lang.String propertyName)
java.lang.String
getAlfrescoPropertyName(java.lang.String propertyName)
java.lang.String
getAlfrescoTypeName(java.lang.String typeName)
java.lang.String
getLuceneFieldName(java.lang.String propertyName)
LuceneFunction
getLuceneFunction(FunctionArgument functionArgument)
<Q,S,E extends java.lang.Throwable>
java.lang.StringgetLuceneSortField(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName)
java.util.Map<java.lang.String,NodeRef>
getNodeRefs()
NodeService
getNodeService()
java.io.Serializable
getProperty(NodeRef nodeRef, java.lang.String propertyName)
Get a propertyjava.lang.Float
getScore()
java.util.Map<java.lang.String,java.lang.Float>
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<NodeRef,CMISNodeInfo> nodeInfos)
void
setNodeRefs(java.util.Map<java.lang.String,NodeRef> nodeRefs)
void
setNodeService(NodeService nodeService)
void
setScore(java.lang.Float score)
void
setScores(java.util.Map<java.lang.String,java.lang.Float> scores)
void
setValidScopes(org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] validScopes)
-
-
-
Method Detail
-
setNodeRefs
public void setNodeRefs(java.util.Map<java.lang.String,NodeRef> nodeRefs)
- Parameters:
nodeRefs
- the nodeRefs to set
-
setScores
public void setScores(java.util.Map<java.lang.String,java.lang.Float> scores)
- Parameters:
scores
- the scores to set
-
setNodeInfos
public void setNodeInfos(java.util.Map<NodeRef,CMISNodeInfo> 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<java.lang.String,NodeRef> getNodeRefs()
- Specified by:
getNodeRefs
in interfaceFunctionEvaluationContext
- Returns:
- the matching nodes by selector (at navigation time)
-
getNodeService
public NodeService getNodeService()
- Specified by:
getNodeService
in interfaceFunctionEvaluationContext
- 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 interfaceFunctionEvaluationContext
- Parameters:
nodeRef
- NodeRefpropertyName
- String- Returns:
- the property (at navigation time)
-
getScores
public java.util.Map<java.lang.String,java.lang.Float> getScores()
- Specified by:
getScores
in interfaceFunctionEvaluationContext
- Returns:
- the scores by selector (at navigation time)
-
getScore
public java.lang.Float getScore()
- Specified by:
getScore
in interfaceFunctionEvaluationContext
- Returns:
- the score
-
setScore
public void setScore(java.lang.Float score)
- Parameters:
score
- the score to set
-
buildLuceneEquality
public <Q,S,E extends java.lang.Throwable> Q buildLuceneEquality(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends java.lang.Throwable
- Specified by:
buildLuceneEquality
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneExists
public <Q,S,E extends java.lang.Throwable> Q buildLuceneExists(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.lang.Boolean not) throws E extends java.lang.Throwable
Description copied from interface:FunctionEvaluationContext
Note: null and not null are not required to support functions from the spec- Specified by:
buildLuceneExists
in interfaceFunctionEvaluationContext
propertyName
- Stringnot
- Boolean- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneGreaterThan
public <Q,S,E extends java.lang.Throwable> Q buildLuceneGreaterThan(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends java.lang.Throwable
- Specified by:
buildLuceneGreaterThan
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneGreaterThanOrEquals
public <Q,S,E extends java.lang.Throwable> Q buildLuceneGreaterThanOrEquals(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends java.lang.Throwable
- Specified by:
buildLuceneGreaterThanOrEquals
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneIn
public <Q,S,E extends java.lang.Throwable> Q buildLuceneIn(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.util.Collection<java.io.Serializable> values, java.lang.Boolean not, PredicateMode mode) throws E extends java.lang.Throwable
Description copied from interface:FunctionEvaluationContext
Note: In is not required to support functions from the spec- Specified by:
buildLuceneIn
in interfaceFunctionEvaluationContext
propertyName
- Stringnot
- Booleanmode
- PredicateMode- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneInequality
public <Q,S,E extends java.lang.Throwable> Q buildLuceneInequality(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends java.lang.Throwable
- Specified by:
buildLuceneInequality
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneLessThan
public <Q,S,E extends java.lang.Throwable> Q buildLuceneLessThan(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends java.lang.Throwable
- Specified by:
buildLuceneLessThan
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneLessThanOrEquals
public <Q,S,E extends java.lang.Throwable> Q buildLuceneLessThanOrEquals(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends java.lang.Throwable
- Specified by:
buildLuceneLessThanOrEquals
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablemode
- PredicateModeluceneFunction
- LuceneFunction- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
buildLuceneLike
public <Q,S,E extends java.lang.Throwable> Q buildLuceneLike(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName, java.io.Serializable value, java.lang.Boolean not) throws E extends java.lang.Throwable
Description copied from interface:FunctionEvaluationContext
Note: Like is not required to support functions from the spec- Specified by:
buildLuceneLike
in interfaceFunctionEvaluationContext
propertyName
- Stringvalue
- Serializablenot
- Boolean- Returns:
- the query
- Throws:
E
E extends java.lang.Throwable
-
getLuceneSortField
public <Q,S,E extends java.lang.Throwable> java.lang.String getLuceneSortField(LuceneQueryParserAdaptor<Q,S,E> lqpa, java.lang.String propertyName) throws E extends java.lang.Throwable
- Specified by:
getLuceneSortField
in interfaceFunctionEvaluationContext
propertyName
- String- Returns:
- the field used for sorting the given property
- Throws:
E
E extends java.lang.Throwable
-
isObjectId
public boolean isObjectId(java.lang.String propertyName)
- Specified by:
isObjectId
in interfaceFunctionEvaluationContext
- Parameters:
propertyName
- String- Returns:
- - is this an object id
-
isOrderable
public boolean isOrderable(java.lang.String fieldName)
- Specified by:
isOrderable
in interfaceFunctionEvaluationContext
- Parameters:
fieldName
- String- Returns:
- Is this property orderable
-
isQueryable
public boolean isQueryable(java.lang.String fieldName)
- Specified by:
isQueryable
in interfaceFunctionEvaluationContext
- Parameters:
fieldName
- String- Returns:
- is this property queryable
-
getLuceneFieldName
public java.lang.String getLuceneFieldName(java.lang.String propertyName)
- Specified by:
getLuceneFieldName
in interfaceFunctionEvaluationContext
- Parameters:
propertyName
- String- Returns:
- the lucene field name for the property
-
getLuceneFunction
public LuceneFunction getLuceneFunction(FunctionArgument functionArgument)
- Specified by:
getLuceneFunction
in interfaceFunctionEvaluationContext
- Parameters:
functionArgument
- FunctionArgument- Returns:
- the lucene function appropriate to a function argument
-
checkFieldApplies
public void checkFieldApplies(Selector selector, java.lang.String propertyName)
- Specified by:
checkFieldApplies
in interfaceFunctionEvaluationContext
- Parameters:
selector
- SelectorpropertyName
- String
-
isMultiValued
public boolean isMultiValued(java.lang.String propertyName)
Description copied from interface:FunctionEvaluationContext
Is this a multi-valued property?- Specified by:
isMultiValued
in interfaceFunctionEvaluationContext
- Parameters:
propertyName
- String- Returns:
- boolean
-
getAlfrescoPropertyName
public java.lang.String getAlfrescoPropertyName(java.lang.String propertyName)
- Specified by:
getAlfrescoPropertyName
in interfaceFunctionEvaluationContext
-
getAlfrescoTypeName
public java.lang.String getAlfrescoTypeName(java.lang.String typeName)
- Specified by:
getAlfrescoTypeName
in interfaceFunctionEvaluationContext
- Parameters:
typeName
- String- Returns:
- String
-
-