Search in sources :

Example 11 with ActionableDynamicQuery

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();
}
Also used : AlbumExportActionableDynamicQuery(org.liferay.jukebox.service.persistence.AlbumExportActionableDynamicQuery) ArtistExportActionableDynamicQuery(org.liferay.jukebox.service.persistence.ArtistExportActionableDynamicQuery) AlbumExportActionableDynamicQuery(org.liferay.jukebox.service.persistence.AlbumExportActionableDynamicQuery) ArtistExportActionableDynamicQuery(org.liferay.jukebox.service.persistence.ArtistExportActionableDynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)

Example 12 with ActionableDynamicQuery

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();
}
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)

Example 13 with ActionableDynamicQuery

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());
}
Also used : Foo(com.liferay.blade.samples.servicebuilder.model.Foo) IntegerWrapper(com.liferay.portal.kernel.util.IntegerWrapper) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery) Test(org.junit.Test)

Example 14 with ActionableDynamicQuery

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);
}
Also used : ArrayList(java.util.ArrayList) Document(com.liferay.portal.kernel.search.Document) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)

Example 15 with ActionableDynamicQuery

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);
}
Also used : SongActionableDynamicQuery(org.liferay.jukebox.service.persistence.SongActionableDynamicQuery) Song(org.liferay.jukebox.model.Song) DynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery) SongActionableDynamicQuery(org.liferay.jukebox.service.persistence.SongActionableDynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery) ArrayList(java.util.ArrayList) Document(com.liferay.portal.kernel.search.Document) SongActionableDynamicQuery(org.liferay.jukebox.service.persistence.SongActionableDynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)

Aggregations

ActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)21 DefaultActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery)6 IndexableActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery)6 DynamicQuery (com.liferay.portal.kernel.dao.orm.DynamicQuery)4 Document (com.liferay.portal.kernel.search.Document)4 IntegerWrapper (com.liferay.portal.kernel.util.IntegerWrapper)4 Test (org.junit.Test)4 KBArticleExportActionableDynamicQuery (com.liferay.knowledgebase.service.persistence.KBArticleExportActionableDynamicQuery)3 KBCommentExportActionableDynamicQuery (com.liferay.knowledgebase.service.persistence.KBCommentExportActionableDynamicQuery)3 KBTemplateExportActionableDynamicQuery (com.liferay.knowledgebase.service.persistence.KBTemplateExportActionableDynamicQuery)3 Element (com.liferay.portal.kernel.xml.Element)3 ArrayList (java.util.ArrayList)3 GadgetExportActionableDynamicQuery (com.liferay.opensocial.service.persistence.GadgetExportActionableDynamicQuery)2 AlbumExportActionableDynamicQuery (org.liferay.jukebox.service.persistence.AlbumExportActionableDynamicQuery)2 ArtistExportActionableDynamicQuery (org.liferay.jukebox.service.persistence.ArtistExportActionableDynamicQuery)2 Foo (com.liferay.blade.samples.servicebuilder.model.Foo)1 KBArticle (com.liferay.knowledgebase.model.KBArticle)1 KBArticleActionableDynamicQuery (com.liferay.knowledgebase.service.persistence.KBArticleActionableDynamicQuery)1 KBArticleVersionComparator (com.liferay.knowledgebase.util.comparator.KBArticleVersionComparator)1 ExportActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery)1