2017-12-15 00:01:26 +01:00
|
|
|
package eu.eudat.controllers;
|
2017-10-04 11:48:21 +02:00
|
|
|
|
2017-11-03 18:55:04 +01:00
|
|
|
import java.util.Date;
|
2017-10-04 11:48:21 +02:00
|
|
|
import java.util.List;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2017-12-15 00:01:26 +01:00
|
|
|
import eu.eudat.entities.DMP;
|
|
|
|
import eu.eudat.entities.Dataset;
|
|
|
|
import eu.eudat.entities.DatasetProfile;
|
|
|
|
import eu.eudat.entities.UserInfo;
|
2017-12-15 13:25:21 +01:00
|
|
|
import eu.eudat.managers.DatasetManager;
|
|
|
|
import eu.eudat.models.dataset.DatasetTableRequest;
|
|
|
|
import eu.eudat.models.helpers.DataTableData;
|
2017-12-17 22:34:24 +01:00
|
|
|
import eu.eudat.models.helpers.responses.*;
|
2017-12-19 17:22:30 +01:00
|
|
|
import eu.eudat.models.listingmodels.DatasetListingModel;
|
2018-01-08 12:44:48 +01:00
|
|
|
import eu.eudat.models.security.Principal;
|
2018-01-04 10:32:39 +01:00
|
|
|
import eu.eudat.services.ApiContext;
|
2017-10-04 11:48:21 +02:00
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
2017-12-15 00:01:26 +01:00
|
|
|
import eu.eudat.dao.entities.DMPDao;
|
|
|
|
import eu.eudat.dao.entities.DMPProfileDao;
|
|
|
|
import eu.eudat.dao.entities.DataRepositoryDao;
|
|
|
|
import eu.eudat.dao.entities.DatasetDao;
|
|
|
|
import eu.eudat.dao.entities.DatasetProfileDao;
|
|
|
|
import eu.eudat.dao.entities.DatasetProfileRulesetDao;
|
|
|
|
import eu.eudat.dao.entities.DatasetProfileViewstyleDao;
|
|
|
|
import eu.eudat.dao.entities.OrganisationDao;
|
|
|
|
import eu.eudat.dao.entities.ProjectDao;
|
|
|
|
import eu.eudat.dao.entities.RegistryDao;
|
|
|
|
import eu.eudat.dao.entities.ResearcherDao;
|
|
|
|
import eu.eudat.dao.entities.ServiceDao;
|
|
|
|
import eu.eudat.dao.entities.UserInfoDao;
|
|
|
|
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
|
|
|
import eu.eudat.models.criteria.RegistryCriteria;
|
|
|
|
import eu.eudat.models.criteria.ServiceCriteria;
|
2017-10-04 11:48:21 +02:00
|
|
|
|
2017-12-22 14:42:47 +01:00
|
|
|
import javax.transaction.Transactional;
|
|
|
|
|
2017-10-04 11:48:21 +02:00
|
|
|
|
|
|
|
@RestController
|
|
|
|
@CrossOrigin
|
2018-01-12 09:05:44 +01:00
|
|
|
public class Datasets extends BaseController {
|
2017-12-15 13:25:21 +01:00
|
|
|
|
2018-01-12 09:05:44 +01:00
|
|
|
@Autowired
|
|
|
|
public Datasets(ApiContext apiContext) {
|
|
|
|
super(apiContext);
|
|
|
|
}
|
2017-12-15 13:25:21 +01:00
|
|
|
|
2018-01-12 09:05:44 +01:00
|
|
|
@RequestMapping(method = RequestMethod.POST, value = {"/datasets/getPaged"}, consumes = "application/json", produces = "application/json")
|
|
|
|
public @ResponseBody
|
|
|
|
ResponseItem<DataTableData<DatasetListingModel>> getPaged(@RequestBody DatasetTableRequest datasetTableRequest, Principal principal) {
|
|
|
|
try {
|
|
|
|
DataTableData<DatasetListingModel> dataTable = new DatasetManager().getPaged(this.getApiContext(), datasetTableRequest, principal);
|
|
|
|
return new ResponseItem<DataTableData<DatasetListingModel>>().status(HttpStatus.OK).payload(dataTable);
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
return new ResponseItem<DataTableData<DatasetListingModel>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
|
|
|
|
}
|
|
|
|
}
|
2017-12-15 13:25:21 +01:00
|
|
|
|
2017-10-04 11:48:21 +02:00
|
|
|
}
|
|
|
|
|