Merge branch 'ui-refactoring' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into ui-refactoring
This commit is contained in:
commit
86ae8e5eda
|
@ -25,7 +25,7 @@ import java.util.UUID;
|
|||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
@RequestMapping(value = {"/api/externaldatasets/"})
|
||||
@RequestMapping(value = {"/api"})
|
||||
public class ExternalDatasets extends BaseController {
|
||||
|
||||
private ExternalDatasetManager externalDatasetManager;
|
||||
|
@ -36,8 +36,31 @@ public class ExternalDatasets extends BaseController {
|
|||
this.externalDatasetManager = externalDatasetManager;
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getPaged"}, consumes = "application/json", produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<DataTableData<ExternalDatasetListingModel>>> getPaged(@RequestBody ExternalDatasetTableRequest datasetTableRequest, Principal principal) throws Exception {
|
||||
DataTableData<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getPaged(this.getApiContext(), datasetTableRequest);
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataTableData<ExternalDatasetListingModel>>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable));
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = {"/external/datasets"}, produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<List<ExternalDatasetListingModel>>> getWithExternal(
|
||||
@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type, Principal principal
|
||||
) throws NoURLFound, InstantiationException, HugeResultSet, IllegalAccessException {
|
||||
List<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getWithExternal(this.getApiContext(), query, this.getApiContext().getOperationsContext().getRemoteFetcher());
|
||||
return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<List<ExternalDatasetListingModel>>().payload(dataTable).status(ApiMessageCode.NO_MESSAGE));
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getSingle/{id}"}, consumes = "application/json", produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseItem<ExternalDatasetListingModel> getWithExternal(@PathVariable UUID id, Principal principal) throws NoURLFound, InstantiationException, HugeResultSet, IllegalAccessException {
|
||||
ExternalDatasetListingModel externalDatasetModel = new ExternalDatasetManager().getSingle(this.getApiContext().getOperationsContext().getDatabaseRepository().getExternalDatasetDao(), id);
|
||||
return new ResponseItem<ExternalDatasetListingModel>().payload(externalDatasetModel).status(ApiMessageCode.NO_MESSAGE);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@RequestMapping(method = RequestMethod.POST, consumes = "application/json", produces = "application/json")
|
||||
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets"}, consumes = "application/json", produces = "application/json")
|
||||
public @ResponseBody
|
||||
ResponseEntity<ResponseItem<ExternalDataset>> create(@RequestBody eu.eudat.models.data.externaldataset.ExternalDatasetModel externalDatasetModel, Principal principal) throws Exception {
|
||||
ExternalDataset externalDataset = this.externalDatasetManager.create(this.getApiContext(), externalDatasetModel);
|
||||
|
|
Loading…
Reference in New Issue