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


Java Field.ENTRY_CLASS_NAME属性代码示例

本文整理汇总了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();
	}
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:20,代码来源:QueryFilterBuilderImpl.java

示例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);
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:34,代码来源:QueryFilterBuilderImpl.java

示例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();
	}
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:38,代码来源:QueryFilterBuilderImpl.java


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