use of com.liferay.portal.kernel.util.OrderByComparator in project liferay-ide by liferay.
the class KBArticleLocalServiceImpl method fetchLatestKBArticleByUrlTitle.
@Override
public KBArticle fetchLatestKBArticleByUrlTitle(long groupId, long kbFolderId, String urlTitle, int status) throws SystemException {
urlTitle = StringUtil.replaceFirst(urlTitle, StringPool.SLASH, StringPool.BLANK);
List<KBArticle> kbArticles = null;
OrderByComparator orderByComparator = new KBArticleVersionComparator();
if (status == WorkflowConstants.STATUS_ANY) {
kbArticles = kbArticlePersistence.findByG_KBFI_UT(groupId, kbFolderId, urlTitle, 0, 1, orderByComparator);
} else {
kbArticles = kbArticlePersistence.findByG_KBFI_UT_ST(groupId, kbFolderId, urlTitle, status, 0, 1, orderByComparator);
}
if (kbArticles.isEmpty()) {
return null;
}
return kbArticles.get(0);
}
Aggregations