当前位置: 首页>>代码示例>>Java>>正文


Java FunctionEvaluationContext类代码示例

本文整理汇总了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();
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:DBFunctionalConstraint.java

示例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();
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:DBConjunction.java

示例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();
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:DBDisjunction.java

示例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();
	}
    
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:17,代码来源:LuceneSelector.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:25,代码来源:LuceneIn.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:27,代码来源:LuceneFTSRange.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:24,代码来源:LuceneFTSTerm.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:20,代码来源:LuceneLike.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:18,代码来源:LuceneExists.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:25,代码来源:LuceneFTSWildTerm.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:24,代码来源:LuceneFTSFuzzyTerm.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:27,代码来源:LuceneFTSPrefixTerm.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:17,代码来源:LuceneNotEquals.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:19,代码来源:LuceneFunctionalConstraint.java

示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:19,代码来源:Child.java


注:本文中的org.alfresco.repo.search.impl.querymodel.FunctionEvaluationContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。