Search in sources :

Example 1 with ExportActionableDynamicQuery

use of com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery in project liferay-blade-samples by liferay.

the class FooLocalServiceBaseImpl method getExportActionableDynamicQuery.

@Override
public ExportActionableDynamicQuery getExportActionableDynamicQuery(final PortletDataContext portletDataContext) {
    final ExportActionableDynamicQuery exportActionableDynamicQuery = new ExportActionableDynamicQuery() {

        @Override
        public long performCount() throws PortalException {
            ManifestSummary manifestSummary = portletDataContext.getManifestSummary();
            StagedModelType stagedModelType = getStagedModelType();
            long modelAdditionCount = super.performCount();
            manifestSummary.addModelAdditionCount(stagedModelType, modelAdditionCount);
            long modelDeletionCount = ExportImportHelperUtil.getModelDeletionCount(portletDataContext, stagedModelType);
            manifestSummary.addModelDeletionCount(stagedModelType, modelDeletionCount);
            return modelAdditionCount;
        }
    };
    initActionableDynamicQuery(exportActionableDynamicQuery);
    exportActionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() {

        @Override
        public void addCriteria(DynamicQuery dynamicQuery) {
            portletDataContext.addDateRangeCriteria(dynamicQuery, "modifiedDate");
        }
    });
    exportActionableDynamicQuery.setCompanyId(portletDataContext.getCompanyId());
    exportActionableDynamicQuery.setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<Foo>() {

        @Override
        public void performAction(Foo foo) throws PortalException {
            StagedModelDataHandlerUtil.exportStagedModel(portletDataContext, foo);
        }
    });
    exportActionableDynamicQuery.setStagedModelType(new StagedModelType(PortalUtil.getClassNameId(Foo.class.getName())));
    return exportActionableDynamicQuery;
}
Also used : ExportActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery) DefaultActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery) ExportActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery) DynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery) IndexableActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery) ManifestSummary(com.liferay.exportimport.kernel.lar.ManifestSummary) Foo(com.liferay.blade.samples.servicebuilder.model.Foo) StagedModelType(com.liferay.exportimport.kernel.lar.StagedModelType) PortalException(com.liferay.portal.kernel.exception.PortalException) DefaultActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery) ExportActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery) IndexableActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery) ActionableDynamicQuery(com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)

Aggregations

Foo (com.liferay.blade.samples.servicebuilder.model.Foo)1 ManifestSummary (com.liferay.exportimport.kernel.lar.ManifestSummary)1 StagedModelType (com.liferay.exportimport.kernel.lar.StagedModelType)1 ActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)1 DefaultActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery)1 DynamicQuery (com.liferay.portal.kernel.dao.orm.DynamicQuery)1 ExportActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery)1 IndexableActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery)1 PortalException (com.liferay.portal.kernel.exception.PortalException)1