use of com.liferay.exportimport.kernel.lar.ManifestSummary 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;
}
Aggregations