本文整理汇总了Java中com.liferay.portal.kernel.search.Field.ENTRY_CLASS_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java Field.ENTRY_CLASS_NAME属性的具体用法?Java Field.ENTRY_CLASS_NAME怎么用?Java Field.ENTRY_CLASS_NAME使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.liferay.portal.kernel.search.Field
的用法示例。
在下文中一共展示了Field.ENTRY_CLASS_NAME属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDLFileEntryClassCondition
/**
* Add DLFileEntry class condition
*
* @param query
* @param dedicatedTypeQuery
* @throws ParseException
*/
protected void addDLFileEntryClassCondition(BooleanQuery query, boolean dedicatedTypeQuery) throws ParseException {
TermQuery condition = new TermQueryImpl(Field.ENTRY_CLASS_NAME, DLFileEntry.class.getName());
query.add(condition, BooleanClauseOccur.SHOULD);
// Format and type conditions (apply only when this is a single type filtered query)
if (dedicatedTypeQuery) {
buildDocumentFormatCondition();
buildDocumentTypeCondition();
}
}
示例2: buildClassesCondition
/**
* Add classes condition.
*
* @throws ParseException
*/
protected void buildClassesCondition()
throws ParseException {
List<String> classNames = _queryParams.getClassNames();
BooleanQuery query = new BooleanQueryImpl();
// Is this a single asset type targeted query
boolean dedicatedTypeQuery = classNames.size() == 1;
for (String className : classNames) {
// Handle journal article and DLFileEntry separately.
if (className.equals(JournalArticle.class.getName())) {
addJournalArticleClassCondition(query, dedicatedTypeQuery);
}
else if (className.equals(DLFileEntry.class.getName())) {
addDLFileEntryClassCondition(query, dedicatedTypeQuery);
}
else {
TermQuery condition = new TermQueryImpl(Field.ENTRY_CLASS_NAME, className);
query.add(condition, BooleanClauseOccur.SHOULD);
}
}
addAsQueryFilter(query);
}
示例3: addJournalArticleClassCondition
/**
* Add journal article class condition.
*
* @param query
* @throws ParseException
*/
protected void addJournalArticleClassCondition(BooleanQuery query, boolean dedicatedTypeQuery) throws ParseException {
BooleanQuery journalArticleQuery = new BooleanQueryImpl();
// Classname condition.
TermQuery classNamecondition = new TermQueryImpl(Field.ENTRY_CLASS_NAME, JournalArticle.class.getName());
journalArticleQuery.add(classNamecondition, BooleanClauseOccur.MUST);
// Add display date limitation.
Date now = new Date();
journalArticleQuery.addRangeTerm(
"displayDate_sortable", Long.MIN_VALUE, now.getTime());
journalArticleQuery.addRangeTerm(
"expirationDate_sortable", now.getTime(), Long.MAX_VALUE);
// Add version limitation.
TermQuery versionQuery = new TermQueryImpl("head", Boolean.TRUE.toString());
journalArticleQuery.add(versionQuery, BooleanClauseOccur.MUST);
query.add(journalArticleQuery, BooleanClauseOccur.SHOULD);
// Structure condition (apply only when this is a single type filtered query)
if (dedicatedTypeQuery) {
buildWebContentStructureCondition();
}
}