本文整理汇总了Java中org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext类的典型用法代码示例。如果您正苦于以下问题:Java FunctionEvaluationContext类的具体用法?Java FunctionEvaluationContext怎么用?Java FunctionEvaluationContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FunctionEvaluationContext类属于org.alfresco.repo.search.impl.querymodel包,在下文中一共展示了FunctionEvaluationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prepare
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
@Override
public void prepare(NamespaceService namespaceService, DictionaryService dictionaryService, QNameDAO qnameDAO, NodeDAO nodeDAO, TenantService tenantService, Set<String> selectors, Map<String, Argument> functionArgs, FunctionEvaluationContext functionContext, boolean supportBooleanFloatAndDouble)
{
Function function = getFunction();
if(function != null)
{
if(function instanceof DBQueryBuilderComponent)
{
DBQueryBuilderComponent dbQueryBuilderComponent = (DBQueryBuilderComponent)function;
dbQueryBuilderComponent.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectors, getFunctionArguments(), functionContext, supportBooleanFloatAndDouble);
}
else
{
throw new UnsupportedOperationException();
}
}
}
示例2: prepare
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
@Override
public void prepare(NamespaceService namespaceService, DictionaryService dictionaryService, QNameDAO qnameDAO, NodeDAO nodeDAO, TenantService tenantService, Set<String> selectors,
Map<String, Argument> functionArgs, FunctionEvaluationContext functionContext, boolean supportBooleanFloatAndDouble)
{
for (Constraint constraint : getConstraints())
{
if (constraint instanceof DBQueryBuilderComponent)
{
if(constraint.getOccur() == Occur.OPTIONAL)
{
throw new QueryModelException("Disjunctions are not suported");
}
DBQueryBuilderComponent dbQueryBuilderComponent = (DBQueryBuilderComponent) constraint;
dbQueryBuilderComponent.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectors, functionArgs, functionContext, supportBooleanFloatAndDouble);
}
else
{
throw new UnsupportedOperationException();
}
}
}
示例3: prepare
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
@Override
public void prepare(NamespaceService namespaceService, DictionaryService dictionaryService, QNameDAO qnameDAO, NodeDAO nodeDAO, TenantService tenantService, Set<String> selectors,
Map<String, Argument> functionArgs, FunctionEvaluationContext functionContext, boolean supportBooleanFloatAndDouble)
{
//throw new QueryModelException("Disjunctions are not suported");
for (Constraint constraint : getConstraints())
{
if (constraint instanceof DBQueryBuilderComponent)
{
DBQueryBuilderComponent dbQueryBuilderComponent = (DBQueryBuilderComponent) constraint;
dbQueryBuilderComponent.prepare(namespaceService, dictionaryService, qnameDAO, nodeDAO, tenantService, selectors, functionArgs, functionContext, supportBooleanFloatAndDouble);
}
else
{
throw new UnsupportedOperationException();
}
}
}
示例4: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
switch(getJoinType())
{
case INNER:
case NONE:
return lqpa.getFieldQuery("CLASS", getType().toString());
case LEFT:
return lqpa.getMatchAllNodesQuery();
case RIGHT:
default:
throw new IllegalArgumentException();
}
}
示例5: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Argument inverseArgument = functionArgs.get(ARG_NOT);
Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
LiteralArgument modeArgument = (LiteralArgument) functionArgs.get(ARG_MODE);
String modeString = DefaultTypeConverter.INSTANCE.convert(String.class, modeArgument.getValue(functionContext));
PredicateMode mode = PredicateMode.valueOf(modeString);
ListArgument listArgument = (ListArgument) functionArgs.get(ARG_LIST);
Collection<Serializable> collection = (Collection<Serializable>) listArgument.getValue(functionContext);
Q query = functionContext.buildLuceneIn(lqpa, propertyArgument.getPropertyName(), collection, not, mode);
if (query == null)
{
throw new QueryModelException("No query time mapping for property " + propertyArgument.getPropertyName() + ", it should not be allowed in predicates");
}
return query;
}
示例6: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
Argument argument = functionArgs.get(ARG_FROM_INC);
Boolean fromInc = (Boolean) argument.getValue(functionContext);
argument = functionArgs.get(ARG_FROM);
String from = (String) argument.getValue(functionContext);
argument = functionArgs.get(ARG_TO);
String to = (String) argument.getValue(functionContext);
argument = functionArgs.get(ARG_TO_INC);
Boolean toInc = (Boolean) argument.getValue(functionContext);
PropertyArgument propArg = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Q query;
if (propArg != null)
{
String prop = propArg.getPropertyName();
query = lqpa.getRangeQuery(functionContext.getLuceneFieldName(prop), from, to, fromInc, toInc, AnalysisMode.DEFAULT, LuceneFunction.FIELD);
}
else
{
query = lqpa.getRangeQuery(lqpa.getField(), from, to, fromInc, toInc, AnalysisMode.DEFAULT, LuceneFunction.FIELD);
}
return query;
}
示例7: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
Argument argument = functionArgs.get(ARG_TERM);
String term = (String) argument.getValue(functionContext);
argument = functionArgs.get(ARG_TOKENISATION_MODE);
AnalysisMode mode = (AnalysisMode) argument.getValue(functionContext);
PropertyArgument propArg = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Q query;
if (propArg != null)
{
String prop = propArg.getPropertyName();
query = lqpa.getFieldQuery(functionContext.getLuceneFieldName(prop), term, mode, LuceneFunction.FIELD);
}
else
{
query = lqpa.getFieldQuery(lqpa.getField(), term, mode, LuceneFunction.FIELD);
}
return query;
}
示例8: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Argument inverseArgument = functionArgs.get(ARG_NOT);
Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
Argument expressionArgument = functionArgs.get(ARG_EXP);
Serializable expression = expressionArgument.getValue(functionContext);
Q query = functionContext.buildLuceneLike(lqpa, propertyArgument.getPropertyName(), expression, not);
if (query == null)
{
throw new QueryModelException("No query time mapping for property " + propertyArgument.getPropertyName() + ", it should not be allowed in predicates");
}
return query;
}
示例9: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Argument inverseArgument = functionArgs.get(ARG_NOT);
Boolean not = DefaultTypeConverter.INSTANCE.convert(Boolean.class, inverseArgument.getValue(functionContext));
Q query = functionContext.buildLuceneExists(lqpa, propertyArgument.getPropertyName(), not);
if (query == null)
{
throw new QueryModelException("No query time mapping for property " + propertyArgument.getPropertyName() + ", it should not be allowed in predicates");
}
return query;
}
示例10: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
Argument argument = functionArgs.get(ARG_TERM);
String term = (String) argument.getValue(functionContext);
argument = functionArgs.get(ARG_TOKENISATION_MODE);
AnalysisMode mode = (AnalysisMode) argument.getValue(functionContext);
PropertyArgument propArg = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Q query;
if (propArg != null)
{
String prop = propArg.getPropertyName();
query = lqpa.getWildcardQuery(functionContext.getLuceneFieldName(prop), term, mode);
}
else
{
query = lqpa.getWildcardQuery(lqpa.getField(), term, mode);
}
return query;
}
示例11: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
Argument argument = functionArgs.get(ARG_TERM);
String term = (String) argument.getValue(functionContext);
argument = functionArgs.get(ARG_MIN_SIMILARITY);
Float minSimilarity = (Float) argument.getValue(functionContext);
PropertyArgument propArg = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Q query;
if (propArg != null)
{
String prop = propArg.getPropertyName();
query = lqpa.getFuzzyQuery(functionContext.getLuceneFieldName(prop), term, minSimilarity);
}
else
{
query = lqpa.getFuzzyQuery(lqpa.getField(), term, minSimilarity);
}
return query;
}
示例12: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
Argument argument = functionArgs.get(ARG_TERM);
String term = (String) argument.getValue(functionContext);
// strip trailing wildcard *
term = term.substring(0, term.length()-1);
argument = functionArgs.get(ARG_TOKENISATION_MODE);
AnalysisMode mode = (AnalysisMode) argument.getValue(functionContext);
PropertyArgument propArg = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Q query;
if (propArg != null)
{
String prop = propArg.getPropertyName();
query = lqpa.getPrefixQuery(functionContext.getLuceneFieldName(prop), term, mode);
}
else
{
query = lqpa.getPrefixQuery(lqpa.getField(), term, mode);
}
return query;
}
示例13: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
throws E
{
LuceneQueryParserAdaptor<Q, S, E> lqpa = luceneContext.getLuceneQueryParserAdaptor();
setPropertyAndStaticArguments(functionArgs);
Q query = functionContext.buildLuceneInequality(lqpa, getPropertyName(), getStaticArgument().getValue(functionContext), PredicateMode.ANY, functionContext
.getLuceneFunction(getFunctionArgument()));
if (query == null)
{
throw new QueryModelException("No query time mapping for property " + getPropertyArgument().getPropertyName() + ", it should not be allowed in predicates");
}
return query;
}
示例14: addComponent
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Q addComponent(Set<String> selectors, Map<String, Argument> functionArgs, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext) throws E
{
Function function = getFunction();
if(function != null)
{
if(function instanceof LuceneQueryBuilderComponent)
{
@SuppressWarnings("unchecked")
LuceneQueryBuilderComponent<Q, S, E> luceneQueryBuilderComponent = (LuceneQueryBuilderComponent<Q, S, E>)function;
return luceneQueryBuilderComponent.addComponent(selectors, getFunctionArguments(), luceneContext, functionContext);
}
else
{
throw new UnsupportedOperationException();
}
}
return null;
}
示例15: getValue
import org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext; //导入依赖的package包/类
public Serializable getValue(Map<String, Argument> args, FunctionEvaluationContext context)
{
Argument selectorArgument = args.get(ARG_SELECTOR);
String selectorName = DefaultTypeConverter.INSTANCE.convert(String.class, selectorArgument.getValue(context));
Argument parentArgument = args.get(ARG_PARENT);
NodeRef parent = DefaultTypeConverter.INSTANCE.convert(NodeRef.class, parentArgument.getValue(context));
NodeRef child = context.getNodeRefs().get(selectorName);
for (ChildAssociationRef car : context.getNodeService().getParentAssocs(child))
{
if (car.getParentRef().equals(parent))
{
return Boolean.TRUE;
}
}
return Boolean.FALSE;
}