use of com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery in project liferay-ide by liferay.
the class AdminIndexer method reindexKBArticles.
protected void reindexKBArticles(long companyId) throws Exception {
ActionableDynamicQuery actionableDynamicQuery = new KBArticleActionableDynamicQuery() {
@Override
protected void addCriteria(DynamicQuery dynamicQuery) {
Property property = PropertyFactoryUtil.forName("status");
dynamicQuery.add(property.eq(WorkflowConstants.STATUS_APPROVED));
}
@Override
protected void performAction(Object object) throws PortalException {
KBArticle kbArticle = (KBArticle) object;
Document document = getDocument(kbArticle);
addDocument(document);
}
};
actionableDynamicQuery.setCompanyId(companyId);
actionableDynamicQuery.setSearchEngineId(getSearchEngineId());
actionableDynamicQuery.performActions();
}
Aggregations