Class AlfrescoFunctionEvaluationContext
- java.lang.Object
-
- org.alfresco.repo.search.impl.parsers.AlfrescoFunctionEvaluationContext
-
- All Implemented Interfaces:
FunctionEvaluationContext
public class AlfrescoFunctionEvaluationContext extends java.lang.Object implements FunctionEvaluationContext
Alfrecso function evaluation context for evaluating FTS expressions against lucene.- Author:
- andyh
-
-
Constructor Summary
Constructors Constructor Description AlfrescoFunctionEvaluationContext(NamespacePrefixResolver namespacePrefixResolver, DictionaryService dictionaryService, java.lang.String defaultNamespace)
-
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 specvoidcheckFieldApplies(Selector selector, java.lang.String propertyName)java.lang.StringgetAlfrescoPropertyName(java.lang.String propertyName)java.lang.StringgetAlfrescoTypeName(java.lang.String typeName)java.lang.StringgetLuceneFieldName(java.lang.String propertyName)LuceneFunctiongetLuceneFunction(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()NodeServicegetNodeService()java.io.SerializablegetProperty(NodeRef nodeRef, java.lang.String propertyName)Get a propertyjava.lang.FloatgetScore()java.util.Map<java.lang.String,java.lang.Float>getScores()booleanisMultiValued(java.lang.String propertyName)Is this a multi-valued property?booleanisObjectId(java.lang.String propertyName)booleanisOrderable(java.lang.String fieldName)booleanisQueryable(java.lang.String fieldName)QNamestripSuffixes(QName qname)
-
-
-
Constructor Detail
-
AlfrescoFunctionEvaluationContext
public AlfrescoFunctionEvaluationContext(NamespacePrefixResolver namespacePrefixResolver, DictionaryService dictionaryService, java.lang.String defaultNamespace)
- Parameters:
namespacePrefixResolver- NamespacePrefixResolverdictionaryService- DictionaryServicedefaultNamespace- String
-
-
Method Detail
-
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:
buildLuceneEqualityin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE 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: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 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:
buildLuceneGreaterThanin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE 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:
buildLuceneGreaterThanOrEqualsin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE 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:FunctionEvaluationContextNote: In is not required to support functions from the spec- Specified by:
buildLuceneInin interfaceFunctionEvaluationContextpropertyName- Stringnot- Booleanmode- PredicateMode- Returns:
- the query
- Throws:
EE 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:
buildLuceneInequalityin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE 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:
buildLuceneLessThanin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE 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:
buildLuceneLessThanOrEqualsin interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablemode- PredicateModeluceneFunction- LuceneFunction- Returns:
- the query
- Throws:
EE 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:FunctionEvaluationContextNote: Like is not required to support functions from the spec- Specified by:
buildLuceneLikein interfaceFunctionEvaluationContextpropertyName- Stringvalue- Serializablenot- Boolean- Returns:
- the query
- Throws:
EE 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:
getLuceneSortFieldin interfaceFunctionEvaluationContextpropertyName- String- Returns:
- the field used for sorting the given property
- Throws:
EE extends java.lang.Throwable
-
getNodeRefs
public java.util.Map<java.lang.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 java.io.Serializable getProperty(NodeRef nodeRef, java.lang.String propertyName)
Description copied from interface:FunctionEvaluationContextGet a property- Specified by:
getPropertyin interfaceFunctionEvaluationContext- Parameters:
nodeRef- NodeRefpropertyName- String- Returns:
- the property (at navigation time)
-
getScore
public java.lang.Float getScore()
- Specified by:
getScorein interfaceFunctionEvaluationContext- Returns:
- the score (at navigation time)
-
getScores
public java.util.Map<java.lang.String,java.lang.Float> getScores()
- Specified by:
getScoresin interfaceFunctionEvaluationContext- Returns:
- the scores by selector (at navigation time)
-
isObjectId
public boolean isObjectId(java.lang.String propertyName)
- Specified by:
isObjectIdin interfaceFunctionEvaluationContext- Parameters:
propertyName- String- Returns:
- - is this an object id
-
isOrderable
public boolean isOrderable(java.lang.String fieldName)
- Specified by:
isOrderablein interfaceFunctionEvaluationContext- Parameters:
fieldName- String- Returns:
- Is this property orderable
-
isQueryable
public boolean isQueryable(java.lang.String fieldName)
- Specified by:
isQueryablein interfaceFunctionEvaluationContext- Parameters:
fieldName- String- Returns:
- is this property queryable
-
getLuceneFieldName
public java.lang.String getLuceneFieldName(java.lang.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, java.lang.String propertyName)
- Specified by:
checkFieldAppliesin interfaceFunctionEvaluationContext- Parameters:
selector- SelectorpropertyName- String
-
isMultiValued
public boolean isMultiValued(java.lang.String propertyName)
Description copied from interface:FunctionEvaluationContextIs this a multi-valued property?- Specified by:
isMultiValuedin interfaceFunctionEvaluationContext- Parameters:
propertyName- String- Returns:
- boolean
-
getAlfrescoPropertyName
public java.lang.String getAlfrescoPropertyName(java.lang.String propertyName)
- Specified by:
getAlfrescoPropertyNamein interfaceFunctionEvaluationContext
-
getAlfrescoTypeName
public java.lang.String getAlfrescoTypeName(java.lang.String typeName)
- Specified by:
getAlfrescoTypeNamein interfaceFunctionEvaluationContext- Parameters:
typeName- String- Returns:
- String
-
-