com.liferay.batch.engine.internal.item.BatchEngineTaskItemDelegateExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.batch.engine.service
Show all versions of com.liferay.batch.engine.service
Liferay Batch Engine Service
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.batch.engine.internal.item;
import com.liferay.batch.engine.BatchEngineTaskItemDelegate;
import com.liferay.batch.engine.BatchEngineTaskOperation;
import com.liferay.batch.engine.pagination.Page;
import com.liferay.batch.engine.pagination.Pagination;
import com.liferay.portal.kernel.model.Company;
import com.liferay.portal.kernel.model.User;
import com.liferay.portal.kernel.search.Sort;
import com.liferay.portal.kernel.search.filter.Filter;
import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.odata.entity.EntityModel;
import com.liferay.portal.odata.filter.ExpressionConvert;
import com.liferay.portal.odata.filter.FilterParser;
import com.liferay.portal.odata.filter.FilterParserProvider;
import com.liferay.portal.odata.sort.SortField;
import com.liferay.portal.odata.sort.SortParser;
import com.liferay.portal.odata.sort.SortParserProvider;
import java.io.Closeable;
import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.osgi.framework.ServiceObjects;
/**
* @author Ivica Cardic
*/
public class BatchEngineTaskItemDelegateExecutor implements Closeable {
public BatchEngineTaskItemDelegateExecutor(
Company company, ExpressionConvert expressionConvert,
FilterParserProvider filterParserProvider,
Map parameters,
ServiceObjects> serviceObjects,
SortParserProvider sortParserProvider, User user) {
_company = company;
_expressionConvert = expressionConvert;
_filterParserProvider = filterParserProvider;
_parameters = parameters;
_serviceObjects = serviceObjects;
_sortParserProvider = sortParserProvider;
_user = user;
_batchEngineTaskItemDelegate = _serviceObjects.getService();
}
@Override
public void close() {
_serviceObjects.ungetService(_batchEngineTaskItemDelegate);
}
public Page> getItems(int page, int pageSize) throws Exception {
_setContextFields(_batchEngineTaskItemDelegate);
return _batchEngineTaskItemDelegate.read(
_getFilter(), Pagination.of(page, pageSize), _getSorts(),
_getFilteredParameters(), (String)_parameters.get("search"));
}
public void saveItems(
BatchEngineTaskOperation batchEngineTaskOperation,
Collection
© 2015 - 2025 Weber Informatics LLC | Privacy Policy