use of com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery in project liferay-ide by liferay.
the class JukeboxPortletDataHandler method doPrepareManifestSummary.
@Override
protected void doPrepareManifestSummary(PortletDataContext portletDataContext, PortletPreferences portletPreferences) throws Exception {
ActionableDynamicQuery albumActionableDynamicQuery = new AlbumExportActionableDynamicQuery(portletDataContext);
albumActionableDynamicQuery.performCount();
ActionableDynamicQuery artistActionableDynamicQuery = new ArtistExportActionableDynamicQuery(portletDataContext);
artistActionableDynamicQuery.performCount();
}
use of com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery 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();
}
use of com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery in project liferay-blade-samples by liferay.
the class FooPersistenceTest method testActionableDynamicQuery.
@Test
public void testActionableDynamicQuery() throws Exception {
final IntegerWrapper count = new IntegerWrapper();
ActionableDynamicQuery actionableDynamicQuery = FooLocalServiceUtil.getActionableDynamicQuery();
actionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Foo>() {
@Override
public void performAction(Foo foo) {
Assert.assertNotNull(foo);
count.increment();
}
});
actionableDynamicQuery.performActions();
Assert.assertEquals(count.getValue(), _persistence.countAll());
}
use of com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery in project liferay-ide by liferay.
the class AlbumIndexer method reindexEntries.
protected void reindexEntries(long companyId) throws PortalException {
final Collection<Document> documents = new ArrayList<Document>();
ActionableDynamicQuery actionableDynamicQuery = AlbumLocalServiceUtil.getActionableDynamicQuery();
actionableDynamicQuery.setCompanyId(companyId);
actionableDynamicQuery.performActions();
SearchEngineUtil.updateDocuments(getSearchEngineId(), companyId, documents);
}
use of com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery in project liferay-ide by liferay.
the class SongIndexer method reindexEntries.
protected void reindexEntries(long companyId) throws PortalException, SystemException {
final Collection<Document> documents = new ArrayList<Document>();
ActionableDynamicQuery actionableDynamicQuery = new SongActionableDynamicQuery() {
@Override
protected void addCriteria(DynamicQuery dynamicQuery) {
}
@Override
protected void performAction(Object object) throws PortalException {
Song song = (Song) object;
Document document = getDocument(song);
documents.add(document);
}
};
actionableDynamicQuery.setCompanyId(companyId);
actionableDynamicQuery.performActions();
SearchEngineUtil.updateDocuments(getSearchEngineId(), companyId, documents);
}
Aggregations