Search in sources :

Example 1 with KBArticleActionableDynamicQuery

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();
}
Also used : KBArticle(com.liferay.knowledgebase.model.KBArticle) KBArticleActionableDynamicQuery(com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery) DynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery) KBArticleActionableDynamicQuery(com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery) Document(com.liferay.portal.kernel.search.Document) Property(com.liferay.portal.kernel.dao.orm.Property) KBArticleActionableDynamicQuery(com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)

Aggregations

KBArticle (com.liferay.knowledgebase.model.KBArticle)1 KBArticleActionableDynamicQuery (com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery)1 ActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)1 DynamicQuery (com.liferay.portal.kernel.dao.orm.DynamicQuery)1 Property (com.liferay.portal.kernel.dao.orm.Property)1 Document (com.liferay.portal.kernel.search.Document)1