本文整理汇总了Java中org.alfresco.repo.search.impl.querymodel.Order类的典型用法代码示例。如果您正苦于以下问题:Java Order类的具体用法?Java Order怎么用?Java Order使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Order类属于org.alfresco.repo.search.impl.querymodel包,在下文中一共展示了Order类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testOrderableProperty
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
private void testOrderableProperty(String propertyQueryName)
{
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " ASC", 13, false, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, false, Order.DESCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
}
示例2: testOrderablePropertyFail
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
private void testOrderablePropertyFail(String propertyQueryName)
{
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " ASC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.DESCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
testOrderBy("SELECT " + propertyQueryName + " FROM test:extendedContent ORDER BY " + propertyQueryName + " DESC", 13, true, Order.ASCENDING, CMISQueryMode.CMS_STRICT,
propertyQueryName);
}
示例3: buildSortDefinitions
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的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;
}
示例4: DBOrdering
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
/**
* @param column Column
* @param order Order
*/
public DBOrdering(Column column, Order order)
{
super(column, order);
}
示例5: createOrdering
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
@Override
public Ordering createOrdering(Column column, Order order)
{
return new DBOrdering(column, order);
}
示例6: BaseOrdering
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public BaseOrdering(Column column, Order order)
{
this.column = column;
this.order = order;
}
示例7: getOrder
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public Order getOrder()
{
return order;
}
示例8: LuceneOrdering
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
/**
* @param column Column
* @param order Order
*/
public LuceneOrdering(Column column, Order order)
{
super(column, order);
// TODO Auto-generated constructor stub
}
示例9: createOrdering
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
public Ordering createOrdering(Column column, Order order)
{
return new LuceneOrdering(column, order);
}
示例10: buildSort
import org.alfresco.repo.search.impl.querymodel.Order; //导入依赖的package包/类
@Override
public Sort buildSort(List<Ordering> orderings, FunctionEvaluationContext functionContext) throws ParseException
{
int index = 0;
SortField[] fields = new SortField[orderings.size()];
for (Ordering ordering : orderings)
{
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 luceneField = functionContext.getLuceneSortField(this, propertyName);
if (luceneField != null)
{
if (LuceneUtils.fieldHasTerm(lqp.getIndexReader(), luceneField))
{
Locale locale = this.getSearchParameters().getSortLocale();
fields[index++] = new SortField(luceneField, locale, (ordering.getOrder() == Order.DESCENDING));
}
else
{
fields[index++] = new SortField(null, SortField.DOC, (ordering.getOrder() == Order.DESCENDING));
}
}
else
{
throw new IllegalStateException();
}
}
else if (ordering.getColumn().getFunction().getName().equals(Score.NAME))
{
fields[index++] = new SortField(null, SortField.SCORE, !(ordering.getOrder() == Order.DESCENDING));
}
else
{
throw new IllegalStateException();
}
}
return new Sort(fields);
}