Package org.alfresco.opencmis.search
Class CmisFunctionEvaluationContext
- java.lang.Object
-
- org.alfresco.opencmis.search.CmisFunctionEvaluationContext
-
- All Implemented Interfaces:
FunctionEvaluationContext
public class CmisFunctionEvaluationContext extends Object implements FunctionEvaluationContext
- Author:
- andyh
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.chemistry.opencmis.commons.enums.BaseTypeId[]ALFRESCO_SCOPESstatic 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 Throwable>
QbuildLuceneEquality(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)<Q,S,E extends Throwable>
QbuildLuceneExists(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Boolean not)Note: null and not null are not required to support functions from the spec<Q,S,E extends Throwable>
QbuildLuceneGreaterThan(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)<Q,S,E extends Throwable>
QbuildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)<Q,S,E extends Throwable>
QbuildLuceneIn(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode)Note: In is not required to support functions from the spec<Q,S,E extends Throwable>
QbuildLuceneInequality(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)<Q,S,E extends Throwable>
QbuildLuceneLessThan(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)<Q,S,E extends Throwable>
QbuildLuceneLessThanOrEquals(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction)<Q,S,E extends Throwable>
QbuildLuceneLike(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, Boolean not)Note: Like is not required to support functions from the specvoidcheckFieldApplies(Selector selector, String propertyName)StringgetAlfrescoPropertyName(String propertyName)StringgetAlfrescoTypeName(String typeName)StringgetLuceneFieldName(String propertyName)LuceneFunctiongetLuceneFunction(FunctionArgument functionArgument)<Q,S,E extends Throwable>
StringgetLuceneSortField(QueryParserAdaptor<Q,S,E> lqpa, String propertyName)Map<String,NodeRef>getNodeRefs()NodeServicegetNodeService()SerializablegetProperty(NodeRef nodeRef, String propertyName)Get a propertyFloatgetScore()Map<String,Float>getScores()booleanisMultiValued(String propertyName)Is this a multi-valued property?booleanisObjectId(String propertyName)booleanisOrderable(String fieldName)booleanisQueryable(String fieldName)voidsetCmisDictionaryService(CMISDictionaryService cmisDictionaryService)voidsetNodeInfos(Map<NodeRef,CMISNodeInfo> nodeInfos)voidsetNodeRefs(Map<String,NodeRef> nodeRefs)voidsetNodeService(NodeService nodeService)voidsetScore(Float score)voidsetScores(Map<String,Float> scores)voidsetValidScopes(org.apache.chemistry.opencmis.commons.enums.BaseTypeId[] validScopes)
-
-
-
Method Detail
-
setNodeRefs
public void setNodeRefs(Map<String,NodeRef> nodeRefs)
- Parameters:
nodeRefs- the nodeRefs to set
-
setNodeInfos
public void setNodeInfos(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 Map<String,NodeRef> getNodeRefs()
- Specified by:
getNodeRefsin interfaceFunctionEvaluationContext- Returns:
- the matching nodes by selector (at navigation time)
-
getNodeService
public NodeService getNodeService()
- Specified by:
getNodeServicein interfaceFunctionEvaluationContext- Returns:
- the node service
-
getProperty
public Serializable getProperty(NodeRef nodeRef, String propertyName)
Description copied from interface:FunctionEvaluationContextGet a property- Specified by:
getPropertyin interfaceFunctionEvaluationContext- Parameters:
nodeRef- NodeRefpropertyName- String- Returns:
- the property (at navigation time)
-
getScores
public Map<String,Float> getScores()
- Specified by:
getScoresin interfaceFunctionEvaluationContext- Returns:
- the scores by selector (at navigation time)
-
getScore
public Float getScore()
- Specified by:
getScorein interfaceFunctionEvaluationContext- Returns:
- the score
-
setScore
public void setScore(Float score)
- Parameters:
score- the score to set
-
buildLuceneEquality
public <Q,S,E extends Throwable> Q buildLuceneEquality(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends Throwable
- Specified by:
buildLuceneEqualityin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneExists
public <Q,S,E extends Throwable> Q buildLuceneExists(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Boolean not) throws E extends Throwable
Description copied from interface:FunctionEvaluationContextNote: null and not null are not required to support functions from the spec- Specified by:
buildLuceneExistsin interfaceFunctionEvaluationContextpropertyName- Stringnot- Boolean- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneGreaterThan
public <Q,S,E extends Throwable> Q buildLuceneGreaterThan(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends Throwable
- Specified by:
buildLuceneGreaterThanin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneGreaterThanOrEquals
public <Q,S,E extends Throwable> Q buildLuceneGreaterThanOrEquals(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends Throwable
- Specified by:
buildLuceneGreaterThanOrEqualsin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneIn
public <Q,S,E extends Throwable> Q buildLuceneIn(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Collection<Serializable> values, Boolean not, PredicateMode mode) throws E extends Throwable
Description copied from interface:FunctionEvaluationContextNote: In is not required to support functions from the spec- Specified by:
buildLuceneInin interfaceFunctionEvaluationContextpropertyName- Stringnot- Booleanmode- PredicateMode- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneInequality
public <Q,S,E extends Throwable> Q buildLuceneInequality(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends Throwable
- Specified by:
buildLuceneInequalityin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneLessThan
public <Q,S,E extends Throwable> Q buildLuceneLessThan(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends Throwable
- Specified by:
buildLuceneLessThanin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneLessThanOrEquals
public <Q,S,E extends Throwable> Q buildLuceneLessThanOrEquals(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, PredicateMode mode, LuceneFunction luceneFunction) throws E extends Throwable
- Specified by:
buildLuceneLessThanOrEqualsin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE extends Throwable
-
buildLuceneLike
public <Q,S,E extends Throwable> Q buildLuceneLike(QueryParserAdaptor<Q,S,E> lqpa, String propertyName, Serializable value, Boolean not) throws E extends Throwable
Description copied from interface:FunctionEvaluationContextNote: Like is not required to support functions from the spec- Specified by:
buildLuceneLikein interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablenot- Boolean- Returns:
- the query
- Throws:
EE extends Throwable
-
getLuceneSortField
public <Q,S,E extends Throwable> String getLuceneSortField(QueryParserAdaptor<Q,S,E> lqpa, String propertyName) throws E extends Throwable
- Specified by:
getLuceneSortFieldin interfaceFunctionEvaluationContextpropertyName- String- Returns:
- the field used for sorting the given property
- Throws:
EE extends Throwable
-
isObjectId
public boolean isObjectId(String propertyName)
- Specified by:
isObjectIdin interfaceFunctionEvaluationContext- Parameters:
propertyName- String- Returns:
- - is this an object id
-
isOrderable
public boolean isOrderable(String fieldName)
- Specified by:
isOrderablein interfaceFunctionEvaluationContext- Parameters:
fieldName- String- Returns:
- Is this property orderable
-
isQueryable
public boolean isQueryable(String fieldName)
- Specified by:
isQueryablein interfaceFunctionEvaluationContext- Parameters:
fieldName- String- Returns:
- is this property queryable
-
getLuceneFieldName
public String getLuceneFieldName(String propertyName)
- Specified by:
getLuceneFieldNamein interfaceFunctionEvaluationContext- Parameters:
propertyName- String- Returns:
- the lucene field name for the property
-
getLuceneFunction
public LuceneFunction getLuceneFunction(FunctionArgument functionArgument)
- Specified by:
getLuceneFunctionin interfaceFunctionEvaluationContext- Parameters:
functionArgument- FunctionArgument- Returns:
- the lucene function appropriate to a function argument
-
checkFieldApplies
public void checkFieldApplies(Selector selector, String propertyName)
- Specified by:
checkFieldAppliesin interfaceFunctionEvaluationContext- Parameters:
selector- SelectorpropertyName- String
-
isMultiValued
public boolean isMultiValued(String propertyName)
Description copied from interface:FunctionEvaluationContextIs this a multi-valued property?- Specified by:
isMultiValuedin interfaceFunctionEvaluationContext- Parameters:
propertyName- String- Returns:
- boolean
-
getAlfrescoPropertyName
public String getAlfrescoPropertyName(String propertyName)
- Specified by:
getAlfrescoPropertyNamein interfaceFunctionEvaluationContext
-
getAlfrescoTypeName
public String getAlfrescoTypeName(String typeName)
- Specified by:
getAlfrescoTypeNamein interfaceFunctionEvaluationContext- Parameters:
typeName- String- Returns:
- String
-
-