本文整理汇总了Java中org.alfresco.repo.search.impl.querymodel.PropertyArgument类的典型用法代码示例。如果您正苦于以下问题:Java PropertyArgument类的具体用法?Java PropertyArgument怎么用?Java PropertyArgument使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyArgument类属于org.alfresco.repo.search.impl.querymodel包,在下文中一共展示了PropertyArgument类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例2: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例3: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例4: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例5: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例6: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例7: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例8: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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;
}
示例9: prepare
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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)
{
Argument argument = functionArgs.get(ARG_TERM);
String term = (String) argument.getValue(functionContext);
// strip trailing wildcard *
term = term.substring(0, term.length() - 1);
PropertyArgument propertyArgument = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
argument = functionArgs.get(ARG_TOKENISATION_MODE);
AnalysisMode mode = (AnalysisMode) argument.getValue(functionContext);
if (mode != AnalysisMode.IDENTIFIER)
{
throw new QueryModelException("Analysis mode not supported for DB " + mode);
}
PropertySupport propertySupport = new PropertySupport();
propertySupport.setValue(term + "%");
QName propertyQName = QName.createQName(DBQuery.expandQName(functionContext.getAlfrescoPropertyName(propertyArgument.getPropertyName()), namespaceService));
propertySupport.setPropertyQName(propertyQName);
propertySupport.setPropertyDataType(DBQuery.getDataTypeDefinition(dictionaryService, propertyQName));
propertySupport.setPair(qnameDAO.getQName(propertyQName));
propertySupport.setJoinCommandType(DBQuery.getJoinCommandType(propertyQName));
propertySupport.setFieldName(DBQuery.getFieldName(dictionaryService, propertyQName, supportBooleanFloatAndDouble));
propertySupport.setCommandType(DBQueryBuilderPredicatePartCommandType.LIKE);
builderSupport = propertySupport;
}
示例10: buildSortDefinitions
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的package包/类
public List<SortDefinition> buildSortDefinitions(Set<String> selectors, LuceneQueryBuilderContext<Q, S, E> luceneContext, FunctionEvaluationContext functionContext)
{
if ((getOrderings() == null) || (getOrderings().size() == 0))
{
return Collections.<SortDefinition>emptyList();
}
ArrayList<SortDefinition> definitions = new ArrayList<SortDefinition>(getOrderings().size());
for (Ordering ordering : getOrderings())
{
if (ordering.getColumn().getFunction().getName().equals(PropertyAccessor.NAME))
{
PropertyArgument property = (PropertyArgument) ordering.getColumn().getFunctionArguments().get(PropertyAccessor.ARG_PROPERTY);
if (property == null)
{
throw new IllegalStateException();
}
String propertyName = property.getPropertyName();
String fieldName = functionContext.getLuceneFieldName(propertyName);
definitions.add(new SortDefinition(SortType.FIELD, fieldName, ordering.getOrder() == Order.ASCENDING));
}
else if (ordering.getColumn().getFunction().getName().equals(Score.NAME))
{
definitions.add(new SortDefinition(SortType.SCORE, null, ordering.getOrder() == Order.ASCENDING));
}
}
return definitions;
}
示例11: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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_FIRST);
String first = (String) argument.getValue(functionContext);
argument = functionArgs.get(ARG_LAST);
String last = (String) argument.getValue(functionContext);
int slop = 100;
argument = functionArgs.get(ARG_SLOP);
if(argument != null)
{
String val = (String) argument.getValue(functionContext);
try
{
slop = Integer.parseInt(val);
}
catch(NumberFormatException nfe)
{
// ignore rubbish
}
}
PropertyArgument propArg = (PropertyArgument) functionArgs.get(ARG_PROPERTY);
Q query;
if (propArg != null)
{
String prop = propArg.getPropertyName();
query = lqpa.getSpanQuery(functionContext.getLuceneFieldName(prop), first, last, slop, true);
}
else
{
query = lqpa.getSpanQuery(lqpa.getField(), first, last, slop, true);
}
return query;
}
示例12: addComponent
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的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_PHRASE);
String term = (String) argument.getValue(functionContext);
Integer slop = Integer.valueOf(lqpa.getPhraseSlop());
argument = functionArgs.get(ARG_SLOP);
if(argument != null)
{
slop = (Integer) 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, slop, LuceneFunction.FIELD);
}
else
{
query = lqpa.getFieldQuery(lqpa.getField(), term, mode, slop, LuceneFunction.FIELD);
}
return query;
}
示例13: getValue
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的package包/类
public Serializable getValue(Map<String, Argument> args, FunctionEvaluationContext context)
{
Argument arg = args.get(ARG_PROPERTY);
if(!(arg instanceof PropertyArgument))
{
throw new QueryModelException("Function "+NAME+" requires a property argument");
}
return arg.getValue(context);
}
示例14: checkPredicateConditionsForLike
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的package包/类
private void checkPredicateConditionsForLike(Map<String, Argument> functionArguments,
FunctionEvaluationContext functionEvaluationContext, Map<String, Column> columnMap)
{
if (options.getQueryMode() == CMISQueryMode.CMS_STRICT)
{
PropertyArgument propertyArgument = (PropertyArgument) functionArguments.get(Like.ARG_PROPERTY);
boolean isMultiValued = functionEvaluationContext.isMultiValued(propertyArgument.getPropertyName());
if (isMultiValued)
{
throw new QueryModelException("Like is not supported for multi-valued properties");
}
String cmisPropertyName = propertyArgument.getPropertyName();
Column column = columnMap.get(cmisPropertyName);
if (column != null)
{
// check for function type
if (column.getFunction().getName().equals(PropertyAccessor.NAME))
{
PropertyArgument arg = (PropertyArgument) column.getFunctionArguments().get(
PropertyAccessor.ARG_PROPERTY);
cmisPropertyName = arg.getPropertyName();
} else
{
throw new CmisInvalidArgumentException("Complex column reference not supoprted in LIKE "
+ cmisPropertyName);
}
}
PropertyDefinitionWrapper propDef = cmisDictionaryService.findPropertyByQueryName(cmisPropertyName);
if (propDef.getPropertyDefinition().getPropertyType() != PropertyType.STRING)
{
throw new CmisInvalidArgumentException("LIKE is only supported against String types" + cmisPropertyName);
}
}
}
示例15: createPropertyArgument
import org.alfresco.repo.search.impl.querymodel.PropertyArgument; //导入依赖的package包/类
@Override
public PropertyArgument createPropertyArgument(String name, boolean queryable, boolean orderable, String selectorAlias, String propertyName)
{
return new DBPropertyArgument(name, queryable, orderable, selectorAlias, propertyName);
}