Merge branch 'Development' of https://gitlab.eudat.eu/dmp/OpenAIRE-EUDAT-DMP-service-pilot into Development
# Conflicts: # dmp-frontend/src/app/dataset-wizard/dataset-wizard.component.ts
This commit is contained in:
commit
9f2d490e61
|
@ -10,34 +10,17 @@ import eu.eudat.entities.DMP;
|
|||
import eu.eudat.models.dmp.DataManagementPlan;
|
||||
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
|
||||
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.helpers.responses.*;
|
||||
import eu.eudat.models.listingmodels.DataManagementPlanListingModel;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
import eu.eudat.validators.DataManagementPlanTableRequestValidator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
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.managers.DataManagementPlanManager;
|
||||
|
||||
|
||||
|
@ -102,8 +85,6 @@ public class DMPs extends BaseController {
|
|||
ex.printStackTrace();
|
||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem<DMP>().status(ApiMessageCode.DEFAULT_ERROR_MESSAGE).message(ex.getMessage()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,11 +2,7 @@ package eu.eudat.controllers;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -14,29 +10,14 @@ 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;
|
||||
|
||||
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.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -23,17 +23,10 @@ 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.RestController;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
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.managers.UserManager;
|
||||
import eu.eudat.models.helpers.AutoCompleteLookupItem;
|
||||
import eu.eudat.models.helpers.common.AutoCompleteLookupItem;
|
||||
import eu.eudat.models.properties.PropertiesModel;
|
||||
import eu.eudat.utilities.builders.XmlBuilder;
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
|
|
|
@ -1,20 +1,13 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.DatasetProfileRuleset;
|
||||
import eu.eudat.entities.DatasetProfileViewstyle;
|
||||
import eu.eudat.managers.DatasetProfileManager;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileListingModel;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileTableRequestItem;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -22,26 +15,12 @@ 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.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
|
|
|
@ -1,24 +1,17 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import eu.eudat.dao.entities.*;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.managers.DatasetManager;
|
||||
import eu.eudat.managers.DatasetWizardManager;
|
||||
import eu.eudat.managers.UserManager;
|
||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||
import eu.eudat.models.datasetwizard.DataManagentPlanListingModel;
|
||||
import eu.eudat.models.datasetwizard.DatasetProfileWizardAutocompleteRequest;
|
||||
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
||||
import eu.eudat.models.datasetwizard.DatasetWizardModel;
|
||||
import eu.eudat.models.dmp.AssociatedProfile;
|
||||
import eu.eudat.models.dmp.DataManagementPlan;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.models.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
@ -26,7 +19,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.transaction.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 12/20/2017.
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.managers.DatasetManager;
|
||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.helpers.responses.*;
|
||||
import eu.eudat.models.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.security.Principal;
|
||||
|
@ -26,7 +21,6 @@ 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;
|
||||
|
||||
|
|
|
@ -1,126 +0,0 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.entities.DMPProfile;
|
||||
import eu.eudat.services.ApiContext;
|
||||
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.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
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.entities.responses.IDLabelPair;
|
||||
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
public class DmpProfiles extends BaseController{
|
||||
|
||||
@Autowired
|
||||
public DmpProfiles(ApiContext apiContext) {
|
||||
super(apiContext);
|
||||
}
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/dmpprofiles" })
|
||||
public @ResponseBody ResponseEntity<List<UUID>> listDmpProfiles(){
|
||||
try {
|
||||
List<UUID> allIDs = this.getApiContext().getDatabaseRepository().getDMPProfileDao().listAllIDs();
|
||||
return ResponseEntity.status(HttpStatus.OK).body(allIDs);
|
||||
}
|
||||
catch(Exception ex) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/dmpprofiles/{id}" })
|
||||
public @ResponseBody ResponseEntity<DMPProfile> getDmpProfile(@PathVariable("id") String id) {
|
||||
try {
|
||||
DMPProfile dmpProfile = this.getApiContext().getDatabaseRepository().getDMPProfileDao().read(UUID.fromString(id));
|
||||
return ResponseEntity.status(HttpStatus.OK).body(dmpProfile);
|
||||
}
|
||||
catch(Exception ex) {
|
||||
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/dmpprofile/listAllLabelIDs" })
|
||||
public @ResponseBody ResponseEntity<List<IDLabelPair>> listLabelIds(){
|
||||
try {
|
||||
List<IDLabelPair> allIDs = this.getApiContext().getDatabaseRepository().getDMPProfileDao().listAllIDsLabels();
|
||||
return ResponseEntity.status(HttpStatus.OK).body(allIDs);
|
||||
}
|
||||
catch(Exception ex) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = { "/dmpprofile/getAll" }, produces="application/json")
|
||||
public @ResponseBody ResponseEntity<Object> getAllDmpProfiles(){
|
||||
try {
|
||||
List<DMPProfile> allDmpProfiles = this.getApiContext().getDatabaseRepository().getDMPProfileDao().getAll();
|
||||
return ResponseEntity.status(HttpStatus.OK).body(allDmpProfiles);
|
||||
}
|
||||
catch(Exception ex) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
@RequestMapping(method = RequestMethod.POST, value = { "/dmpprofile/create" }, consumes = "application/json", produces="application/json")
|
||||
public @ResponseBody ResponseEntity<DMPProfile> setDmpProfile(@RequestBody DMPProfile dmpprofile) {
|
||||
try {
|
||||
DMPProfile createdDMPProfile = this.getApiContext().getDatabaseRepository().getDMPProfileDao().update(dmpprofile);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body(createdDMPProfile);
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(method = RequestMethod.POST, value = { "/dmpprofile/delete" }, consumes = "application/json", produces="text/plain")
|
||||
public @ResponseBody ResponseEntity<Object> delete(@RequestBody DMPProfile dmpprofile) {
|
||||
|
||||
DMPProfile dmpp = new DMPProfile();
|
||||
dmpp.setId(dmpprofile.getId());
|
||||
try {
|
||||
this.getApiContext().getDatabaseRepository().getDMPProfileDao().delete(dmpp);
|
||||
return ResponseEntity.status(HttpStatus.CREATED).body("{\"msg\":\"Deleted DMP Profile!\"}");
|
||||
} catch (Exception e) {
|
||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("{\"msg\":\"Could not Delete DMP Profile!\"}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +1,10 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import eu.eudat.managers.DatasetManager;
|
||||
import eu.eudat.managers.ExternalDatasetManager;
|
||||
import eu.eudat.managers.ProjectManager;
|
||||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||
import eu.eudat.models.externaldataset.ExternalDatasetListingModel;
|
||||
import eu.eudat.models.externaldataset.ExternalDatasetTableRequest;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.models.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.project.Project;
|
||||
import eu.eudat.models.project.ProjectCriteriaRequest;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
|
|
@ -2,13 +2,8 @@ package eu.eudat.controllers;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.models.external.OrganisationsExternalSourcesModel;
|
||||
import eu.eudat.models.external.ProjectsExternalSourcesModel;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -16,29 +11,14 @@ 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;
|
||||
|
||||
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.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.external.OrganisationsExternalSourcesModel;
|
||||
import eu.eudat.models.external.ProjectsExternalSourcesModel;
|
||||
import eu.eudat.models.external.RegistriesExternalSourcesModel;
|
||||
import eu.eudat.models.helpers.responses.*;
|
||||
import eu.eudat.models.project.ProjectCriteriaRequest;
|
||||
import eu.eudat.models.project.ProjectListingModel;
|
||||
|
@ -20,7 +14,6 @@ import eu.eudat.models.security.Principal;
|
|||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
|
@ -32,30 +25,13 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
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.entities.DMP;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
|
||||
import eu.eudat.managers.ProjectManager;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.project.ProjectTableRequest;
|
||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -2,11 +2,8 @@ package eu.eudat.controllers;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.models.external.RegistriesExternalSourcesModel;
|
||||
import eu.eudat.models.external.ResearchersExternalSourcesModel;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -14,32 +11,14 @@ 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;
|
||||
|
||||
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.entities.responses.IDLabelPair;
|
||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -2,13 +2,8 @@ package eu.eudat.controllers;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.models.external.ResearchersExternalSourcesModel;
|
||||
import eu.eudat.models.external.ServiceExternalSourcesModel;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.services.ApiContext;
|
||||
import eu.eudat.types.ApiMessageCode;
|
||||
|
@ -16,29 +11,14 @@ 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;
|
||||
|
||||
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.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -2,11 +2,7 @@ package eu.eudat.controllers;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.entities.Service;
|
||||
import eu.eudat.models.external.ServiceExternalSourcesModel;
|
||||
import eu.eudat.models.helpers.responses.ResponseItem;
|
||||
import eu.eudat.services.ApiContext;
|
||||
|
@ -15,29 +11,14 @@ 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;
|
||||
|
||||
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.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
||||
|
||||
@RestController
|
||||
|
|
|
@ -1,57 +1,10 @@
|
|||
package eu.eudat.controllers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import eu.eudat.services.ApiContext;
|
||||
import org.apache.commons.lang3.SerializationUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
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;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
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.entities.DMP;
|
||||
import eu.eudat.entities.DMPProfile;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.DatasetProfileRuleset;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.entities.Service;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.helpers.Transformers;
|
||||
|
||||
|
||||
@RestController
|
||||
@CrossOrigin
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public interface Dao<T, PK extends Serializable> {
|
||||
public T create(T t);
|
||||
public T read(PK id);
|
||||
public T update(T t);
|
||||
public void delete(T t);
|
||||
|
||||
public List<T> getAll();
|
||||
public long count();
|
||||
|
||||
public T loadDetails(T t);
|
||||
public boolean isLoaded(T t);
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface DaoFactory
|
||||
{
|
||||
public Dao getDao(Class<?> type) throws Exception;
|
||||
public void overrideMappings(Map<String, String> mappings) throws Exception;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface DaoI<T, Id extends Serializable> {
|
||||
public void persist(T entity);
|
||||
|
||||
public void update(T entity);
|
||||
|
||||
public T findById(Id id);
|
||||
|
||||
public void delete(T entity);
|
||||
|
||||
public List<T> findAll();
|
||||
|
||||
public void deleteAll();
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.DataEntity;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 1/25/2018.
|
||||
*/
|
||||
public class DatabaseAccess<T extends DataEntity<T>> {
|
||||
private DatabaseService<T> databaseService;
|
||||
|
||||
public DatabaseService<T> getDatabaseService() {
|
||||
return databaseService;
|
||||
}
|
||||
|
||||
public void setDatabaseService(DatabaseService<T> databaseService) {
|
||||
this.databaseService = databaseService;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 1/25/2018.
|
||||
*/
|
||||
public interface DatabaseAccessLayer<T, I> {
|
||||
T createOrUpdate(T item);
|
||||
|
||||
T find(I id);
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.PersistenceUnitUtil;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
|
||||
public abstract class JpaDao<T, PK extends Serializable> implements Dao<T, PK> {
|
||||
protected Class<T> entityClass;
|
||||
|
||||
// protected static EntityManagerFactory entityManagerFactory = null;
|
||||
|
||||
@PersistenceContext
|
||||
protected EntityManager entityManager;
|
||||
|
||||
protected PersistenceUnitUtil persistenceUnitUtil;
|
||||
|
||||
// public static void setEntityManagerFactory(EntityManagerFactory factory)
|
||||
// {
|
||||
// entityManagerFactory = factory;
|
||||
// }
|
||||
|
||||
public JpaDao() {
|
||||
ParameterizedType genericSuperclass = (ParameterizedType) getClass().getGenericSuperclass();
|
||||
this.entityClass = (Class<T>) genericSuperclass.getActualTypeArguments()[0];
|
||||
// entityManager = entityManagerFactory.createEntityManager();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
private void initPersistenceUnitUtil() {
|
||||
this.persistenceUnitUtil = entityManager.getEntityManagerFactory().getPersistenceUnitUtil();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public T create(T t) {
|
||||
entityManager.persist(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
@Transactional()
|
||||
public T read(PK id) {
|
||||
return entityManager.find(entityClass, id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public T update(T t) {
|
||||
return entityManager.merge(t);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void delete(T t) {
|
||||
t = entityManager.merge(t);
|
||||
entityManager.remove(t);
|
||||
}
|
||||
|
||||
public List<T> getAll() {
|
||||
List<T> result = entityManager.createQuery("from " + entityClass.getSimpleName(), entityClass).getResultList();
|
||||
return result == null ? new ArrayList<T>() : result;
|
||||
}
|
||||
|
||||
public long count() {
|
||||
return ((Number) entityManager.createQuery("select count(e) from " + entityClass.getSimpleName() + " e").getSingleResult()).longValue();
|
||||
}
|
||||
|
||||
public boolean isLoaded(T t) {
|
||||
return persistenceUnitUtil.isLoaded(t);
|
||||
}
|
||||
|
||||
protected boolean isFieldLoaded(T t, String fieldName) {
|
||||
return persistenceUnitUtil.isLoaded(t, fieldName);
|
||||
}
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import eu.eudat.dao.entities.DMPDaoImpl;
|
||||
import eu.eudat.dao.entities.DMPProfileDaoImpl;
|
||||
import eu.eudat.dao.entities.DMPResearcherDaoImpl;
|
||||
import eu.eudat.dao.entities.DataRepositoryDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetProfileDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetProfileRulesetDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetProfileViewstyleDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetRegistryDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetServiceDaoImpl;
|
||||
import eu.eudat.dao.entities.OrganisationDaoImpl;
|
||||
import eu.eudat.dao.entities.ProjectDaoImpl;
|
||||
import eu.eudat.dao.entities.RegistryDaoImpl;
|
||||
import eu.eudat.dao.entities.ResearcherDaoImpl;
|
||||
import eu.eudat.dao.entities.ServiceDaoImpl;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.DMPProfile;
|
||||
import eu.eudat.entities.DMPResearcher;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.DatasetProfileRuleset;
|
||||
import eu.eudat.entities.DatasetProfileViewstyle;
|
||||
import eu.eudat.entities.DatasetRegistry;
|
||||
import eu.eudat.entities.DatasetService;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.entities.Service;
|
||||
|
||||
|
||||
/**
|
||||
* A DAO factory for non-managed environments
|
||||
*/
|
||||
public class JpaDaoFactory implements DaoFactory
|
||||
{
|
||||
private static String persistenceUnit = null;
|
||||
private static Map<String, String> daoImpls = null;
|
||||
|
||||
public static void setPersistenceContext(String persistenceUnit)
|
||||
{
|
||||
JpaDaoFactory.persistenceUnit = persistenceUnit;
|
||||
}
|
||||
|
||||
private static void populateMappings()
|
||||
{
|
||||
daoImpls = new HashMap<String, String>();
|
||||
daoImpls.put(Organisation.class.getName(), OrganisationDaoImpl.class.getName());
|
||||
daoImpls.put(DataRepository.class.getName(), (DataRepositoryDaoImpl.class.getName()));
|
||||
daoImpls.put(Dataset.class.getName(), (DatasetDaoImpl.class.getName()));
|
||||
daoImpls.put(DatasetProfile.class.getName(), (DatasetProfileDaoImpl.class.getName()));
|
||||
daoImpls.put(DatasetProfileRuleset.class.getName(), (DatasetProfileRulesetDaoImpl.class.getName()));
|
||||
daoImpls.put(DatasetProfileViewstyle.class.getName(), (DatasetProfileViewstyleDaoImpl.class.getName()));
|
||||
daoImpls.put(DatasetRegistry.class.getName(), (DatasetRegistryDaoImpl.class.getName()));
|
||||
daoImpls.put(DatasetService.class.getName(), (DatasetServiceDaoImpl.class.getName()));
|
||||
daoImpls.put(DMP.class.getName(), (DMPDaoImpl.class.getName()));
|
||||
daoImpls.put(DMPProfile.class.getName(), (DMPProfileDaoImpl.class.getName()));
|
||||
daoImpls.put(DMPResearcher.class.getName(), (DMPResearcherDaoImpl.class.getName()));
|
||||
daoImpls.put(Organisation.class.getName(), (OrganisationDaoImpl.class.getName()));
|
||||
daoImpls.put(Project.class.getName(), (ProjectDaoImpl.class.getName()));
|
||||
daoImpls.put(Registry.class.getName(), (RegistryDaoImpl.class.getName()));
|
||||
daoImpls.put(Researcher.class.getName(), (ResearcherDaoImpl.class.getName()));
|
||||
daoImpls.put(Service.class.getName(), (ServiceDaoImpl.class.getName()));
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Dao getDao(Class<?> type) throws Exception
|
||||
{
|
||||
if(daoImpls == null) populateMappings();
|
||||
return (Dao)Class.forName(daoImpls.get(type.getName())).newInstance();
|
||||
}
|
||||
|
||||
public void overrideMappings(Map<String, String> mappings)
|
||||
{
|
||||
populateMappings();
|
||||
daoImpls.putAll(mappings);
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
package eu.eudat.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
|
||||
import eu.eudat.dao.entities.DMPDaoImpl;
|
||||
import eu.eudat.dao.entities.DMPProfileDaoImpl;
|
||||
import eu.eudat.dao.entities.DMPResearcherDaoImpl;
|
||||
import eu.eudat.dao.entities.DataRepositoryDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetProfileDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetProfileRulesetDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetProfileViewstyleDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetRegistryDaoImpl;
|
||||
import eu.eudat.dao.entities.DatasetServiceDaoImpl;
|
||||
import eu.eudat.dao.entities.OrganisationDaoImpl;
|
||||
import eu.eudat.dao.entities.ProjectDaoImpl;
|
||||
import eu.eudat.dao.entities.RegistryDaoImpl;
|
||||
import eu.eudat.dao.entities.ResearcherDaoImpl;
|
||||
import eu.eudat.dao.entities.ServiceDaoImpl;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.DMPProfile;
|
||||
import eu.eudat.entities.DMPResearcher;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.DatasetProfileRuleset;
|
||||
import eu.eudat.entities.DatasetProfileViewstyle;
|
||||
import eu.eudat.entities.DatasetRegistry;
|
||||
import eu.eudat.entities.DatasetService;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.entities.Service;
|
||||
|
||||
|
||||
/**
|
||||
* A DAO factory for Spring managed environment
|
||||
*/
|
||||
public class SpringJpaDaoFactory implements DaoFactory
|
||||
{
|
||||
public static class SpringApplicationContext implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext CONTEXT;
|
||||
|
||||
/**
|
||||
* This method is called from within the ApplicationContext once it is
|
||||
* done starting up, it will stick a reference to itself into this bean.
|
||||
* @param context a reference to the ApplicationContext.
|
||||
*/
|
||||
public void setApplicationContext(ApplicationContext context) throws BeansException {
|
||||
CONTEXT = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is about the same as context.getBean("beanName"), except it has its
|
||||
* own static handle to the Spring context, so calling this method statically
|
||||
* will give access to the beans by name in the Spring application context.
|
||||
* As in the context.getBean("beanName") call, the caller must cast to the
|
||||
* appropriate target class. If the bean does not exist, then a Runtime error
|
||||
* will be thrown.
|
||||
* @param beanName the name of the bean to get.
|
||||
* @return an Object reference to the named bean.
|
||||
*/
|
||||
public static Object getBean(String beanName) {
|
||||
return CONTEXT.getBean(beanName);
|
||||
}
|
||||
}
|
||||
|
||||
private static String persistenceUnit = null;
|
||||
private static Map<String, String> daoImpls = null;
|
||||
|
||||
public static void setPersistenceContext(String persistenceUnit)
|
||||
{
|
||||
SpringJpaDaoFactory.persistenceUnit = persistenceUnit;
|
||||
}
|
||||
|
||||
private static String getBeanName(String className)
|
||||
{
|
||||
return Character.toLowerCase(className.charAt(0)) +
|
||||
(className.length() > 1 ? className.substring(1) : "");
|
||||
}
|
||||
private static void populateMappings()
|
||||
{
|
||||
daoImpls = new HashMap<String, String>();
|
||||
daoImpls.put(DataRepository.class.getName(), getBeanName(DataRepositoryDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(Dataset.class.getName(), getBeanName(DatasetDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DatasetProfile.class.getName(), getBeanName(DatasetProfileDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DatasetProfileRuleset.class.getName(), getBeanName(DatasetProfileRulesetDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DatasetProfileViewstyle.class.getName(), getBeanName(DatasetProfileViewstyleDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DatasetRegistry.class.getName(), getBeanName(DatasetRegistryDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DatasetService.class.getName(), getBeanName(DatasetServiceDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DMP.class.getName(), getBeanName(DMPDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DMPProfile.class.getName(), getBeanName(DMPProfileDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(DMPResearcher.class.getName(), getBeanName(DMPResearcherDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(Organisation.class.getName(), getBeanName(OrganisationDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(Project.class.getName(), getBeanName(ProjectDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(Registry.class.getName(), getBeanName(RegistryDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(Researcher.class.getName(), getBeanName(ResearcherDaoImpl.class.getSimpleName()));
|
||||
daoImpls.put(Service.class.getName(), getBeanName(ServiceDaoImpl.class.getSimpleName()));
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Dao getDao(Class<?> type) throws Exception
|
||||
{
|
||||
if(daoImpls == null) populateMappings();
|
||||
return (Dao)SpringApplicationContext.getBean(daoImpls.get(type.getName()));
|
||||
}
|
||||
|
||||
public void overrideMappings(Map<String, String> mappings)
|
||||
{
|
||||
populateMappings();
|
||||
daoImpls.putAll(mappings);
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@ import javax.persistence.criteria.CriteriaBuilder;
|
|||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by giannis on 7/16/2017.
|
||||
|
@ -43,4 +44,7 @@ public class DatabaseContext<T extends DataEntity<T>> {
|
|||
return ((Number) entityManager.createQuery("select count(e) from " + entityClass.getSimpleName() + " e").getSingleResult()).longValue();
|
||||
}
|
||||
|
||||
public void delete(T item){
|
||||
this.entityManager.remove(item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,26 +8,39 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by giannis on 7/17/2017.
|
||||
*/
|
||||
@Service("databaseService")
|
||||
public class DatabaseService<T extends DataEntity<T>> {
|
||||
@Autowired
|
||||
|
||||
private DatabaseContext<T> databaseCtx;
|
||||
|
||||
@Autowired
|
||||
public DatabaseService(DatabaseContext<T> databaseCtx) {
|
||||
this.databaseCtx = databaseCtx;
|
||||
}
|
||||
|
||||
public QueryableList<T> getQueryable(Class<T> tClass) {
|
||||
return this.databaseCtx.getQueryable(tClass);
|
||||
}
|
||||
|
||||
public QueryableList<T> getQueryable(Class<T> tClass,Set<String> hints) {
|
||||
public QueryableList<T> getQueryable(Set<String> hints,Class<T> tClass) {
|
||||
return this.databaseCtx.getQueryable(tClass).setHints(hints);
|
||||
}
|
||||
|
||||
public T createOrUpdate(T item, Class<T> tClass) {
|
||||
public T createOrUpdate(T item,Class<T> tClass) {
|
||||
return this.databaseCtx.createOrUpdate(item, tClass);
|
||||
}
|
||||
|
||||
public Long count(Class<T> tClass){return this.databaseCtx.count(tClass);}
|
||||
public Long count(Class<T> tClass){
|
||||
return this.databaseCtx.count(tClass);
|
||||
}
|
||||
|
||||
public void delete(T item){
|
||||
this.databaseCtx.delete(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,32 +1,21 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.DataManagementPlanCriteria;
|
||||
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
||||
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DMPDao {
|
||||
public interface DMPDao extends DatabaseAccessLayer<DMP, UUID> {
|
||||
|
||||
QueryableList<DMP> getWithCriteria(DataManagementPlanCriteria criteria);
|
||||
|
||||
QueryableList<DMP> getUserDmps(DatasetWizardAutocompleteRequest datasetWizardAutocompleteRequest, UserInfo userInfo);
|
||||
|
||||
DMP createOrUpdate(DMP item);
|
||||
|
||||
DMP find(UUID id);
|
||||
|
||||
Long count();
|
||||
|
||||
QueryableList<DMP> getAuthenticated(QueryableList<DMP> query,UserInfo principal);
|
||||
|
||||
|
||||
Long count();
|
||||
}
|
|
@ -1,42 +1,30 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.models.criteria.DataManagementPlanCriteria;
|
||||
import eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("dMPDao")
|
||||
public class DMPDaoImpl implements DMPDao {
|
||||
public class DMPDaoImpl extends DatabaseAccess<DMP> implements DMPDao {
|
||||
|
||||
|
||||
@Autowired
|
||||
DatabaseService<DMP> databaseService;
|
||||
public DMPDaoImpl(DatabaseService<DMP> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<DMP> getWithCriteria(DataManagementPlanCriteria criteria) {
|
||||
QueryableList<DMP> query = databaseService.getQueryable(DMP.class,DMP.getHints());
|
||||
QueryableList<DMP> query = getDatabaseService().getQueryable(DMP.getHints(),DMP.class);
|
||||
if(criteria.getLike()!=null&&!criteria.getLike().isEmpty())query.where((builder, root) -> builder.like(root.get("label"),"%"+criteria.getLike()+"%"));
|
||||
if(criteria.getPeriodEnd()!=null)query.where((builder, root) -> builder.lessThan(root.get("created"),criteria.getPeriodEnd()));
|
||||
if(criteria.getPeriodStart()!=null)query.where((builder, root) -> builder.greaterThan(root.get("created"),criteria.getPeriodStart()));
|
||||
|
@ -51,24 +39,25 @@ public class DMPDaoImpl implements DMPDao {
|
|||
|
||||
@Override
|
||||
public DMP createOrUpdate(DMP item) {
|
||||
return this.databaseService.createOrUpdate(item,DMP.class);
|
||||
return this.getDatabaseService().createOrUpdate(item,DMP.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DMP find(UUID id) {
|
||||
return databaseService.getQueryable(DMP.class).where((builder, root) -> builder.equal((root.get("id")),id)).getSingle();
|
||||
}
|
||||
|
||||
public Long count(){
|
||||
return this.databaseService.count(DMP.class);
|
||||
return getDatabaseService().getQueryable(DMP.class).where((builder, root) -> builder.equal((root.get("id")),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<DMP> getUserDmps(DatasetWizardAutocompleteRequest datasetWizardAutocompleteRequest, UserInfo userInfo) {
|
||||
QueryableList<DMP> query = databaseService.getQueryable(DMP.class).where((builder, root) -> builder.or(builder.equal(root.get("creator"),userInfo),builder.isMember(userInfo,root.get("users"))));
|
||||
QueryableList<DMP> query = getDatabaseService().getQueryable(DMP.class).where((builder, root) -> builder.or(builder.equal(root.get("creator"),userInfo),builder.isMember(userInfo,root.get("users"))));
|
||||
if(datasetWizardAutocompleteRequest.getCriteria().getLike()!=null&&!datasetWizardAutocompleteRequest.getCriteria().getLike().isEmpty()){
|
||||
query.where((builder, root) -> builder.like(root.get("label"),"%"+datasetWizardAutocompleteRequest.getCriteria().getLike()+"%"));
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return this.getDatabaseService().count(DMP.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DMPProfile;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DMPProfileDao extends Dao<DMPProfile, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DMPProfile;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("dMPProfileDao")
|
||||
public class DMPProfileDaoImpl extends JpaDao<DMPProfile, UUID> implements DMPProfileDao {
|
||||
|
||||
public DMPProfile loadDetails(DMPProfile t) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT dmpProfile.id FROM DMPProfile dmpProfile";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT dmpProfile.id, dmpProfile.label FROM DMPProfile dmpProfile";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DMPResearcher;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DMPResearcherDao extends Dao<DMPResearcher, UUID> {
|
||||
|
||||
|
||||
Researcher getResearcherByEmail(String email);
|
||||
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DMPResearcher;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("dMPResearcherDao")
|
||||
public class DMPResearcherDaoImpl extends JpaDao<DMPResearcher, UUID> implements DMPResearcherDao {
|
||||
|
||||
public DMPResearcher loadDetails(DMPResearcher t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Researcher getResearcherByEmail(String email) {
|
||||
String queryString = "FROM Researcher researcher where primaryEmail=:email";
|
||||
TypedQuery<Researcher> typedQuery = entityManager.createQuery(queryString, Researcher.class);
|
||||
typedQuery.setParameter("email", email);
|
||||
try {
|
||||
return typedQuery.getSingleResult();
|
||||
}catch(Exception ex) {
|
||||
System.out.println(ex.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,15 +1,12 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
public interface DataRepositoryDao {
|
||||
List<DataRepository> listBy(Criteria<DataRepository> criteria);
|
||||
DataRepository createOrUpdate(DataRepository item);
|
||||
public interface DataRepositoryDao extends DatabaseAccessLayer<DataRepository,UUID> {
|
||||
QueryableList<DataRepository> getWithCriteria(DataRepositoryCriteria criteria);
|
||||
}
|
|
@ -1,41 +1,39 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.models.criteria.DataRepositoryCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Component("dataRepositoryDao")
|
||||
public class DataRepositoryDaoImpl implements DataRepositoryDao{
|
||||
public class DataRepositoryDaoImpl extends DatabaseAccess<DataRepository> implements DataRepositoryDao {
|
||||
|
||||
@Autowired
|
||||
DatabaseService<DataRepository> databaseService;
|
||||
@Autowired
|
||||
public DataRepositoryDaoImpl(DatabaseService<DataRepository> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataRepository> listBy(Criteria<DataRepository> criteria) {
|
||||
QueryableList<DataRepository> query = databaseService.getQueryable(DataRepository.class);
|
||||
if(criteria.getLike()!=null)query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
||||
return query.toList();
|
||||
}
|
||||
@Override
|
||||
public QueryableList<DataRepository> getWithCriteria(DataRepositoryCriteria criteria) {
|
||||
QueryableList<DataRepository> query = this.getDatabaseService().getQueryable(DataRepository.class);
|
||||
if (criteria.getLike() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataRepository createOrUpdate(DataRepository item) {
|
||||
return databaseService.createOrUpdate(item,DataRepository.class);
|
||||
}
|
||||
@Override
|
||||
public DataRepository find(UUID id) {
|
||||
return this.getDatabaseService().getQueryable(DataRepository.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataRepository createOrUpdate(DataRepository item) {
|
||||
return getDatabaseService().createOrUpdate(item, DataRepository.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,33 +1,19 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.DatasetCriteria;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||
import eu.eudat.models.project.ProjectTableRequest;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DatasetDao {
|
||||
|
||||
public interface DatasetDao extends DatabaseAccessLayer<Dataset,UUID> {
|
||||
|
||||
QueryableList<Dataset> getWithCriteria(DatasetCriteria criteria);
|
||||
|
||||
Dataset createOrUpdate(Dataset item);
|
||||
|
||||
Dataset find(UUID id);
|
||||
|
||||
Long count();
|
||||
|
||||
QueryableList<Dataset> getAuthenticated(QueryableList<Dataset> query, UserInfo principal);
|
||||
|
||||
Long count();
|
||||
}
|
|
@ -1,63 +1,43 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.DataRepository;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.DatasetCriteria;
|
||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("datasetDao")
|
||||
public class DatasetDaoImpl implements DatasetDao {
|
||||
public class DatasetDaoImpl extends DatabaseAccess<Dataset> implements DatasetDao {
|
||||
|
||||
@Autowired
|
||||
DatabaseService<Dataset> databaseService;
|
||||
public DatasetDaoImpl(DatabaseService<Dataset> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<Dataset> getWithCriteria(DatasetCriteria criteria) {
|
||||
QueryableList<Dataset> query = databaseService.getQueryable(Dataset.class, Dataset.getHints());
|
||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty())
|
||||
query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%"));
|
||||
if (criteria.getStatus() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("status"), criteria.getStatus()));
|
||||
if (criteria.getPeriodEnd() != null)
|
||||
query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd()));
|
||||
if (criteria.getPeriodStart() != null)
|
||||
query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart()));
|
||||
if (criteria.getDmpIds() != null && !criteria.getDmpIds().isEmpty())
|
||||
query.where((builder, root) -> root.get("dmp").get("id").in(criteria.getDmpIds()));
|
||||
QueryableList<Dataset> query = getDatabaseService().getQueryable(Dataset.getHints(),Dataset.class);
|
||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%"));
|
||||
if (criteria.getStatus() != null) query.where((builder, root) -> builder.equal(root.get("status"), criteria.getStatus()));
|
||||
if (criteria.getPeriodEnd() != null) query.where((builder, root) -> builder.lessThan(root.get("created"), criteria.getPeriodEnd()));
|
||||
if (criteria.getPeriodStart() != null) query.where((builder, root) -> builder.greaterThan(root.get("created"), criteria.getPeriodStart()));
|
||||
if (criteria.getDmpIds() != null && !criteria.getDmpIds().isEmpty()) query.where((builder, root) -> root.get("dmp").get("id").in(criteria.getDmpIds()));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dataset createOrUpdate(Dataset item) {
|
||||
return databaseService.createOrUpdate(item, Dataset.class);
|
||||
return getDatabaseService().createOrUpdate(item,Dataset.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dataset find(UUID id) {
|
||||
return databaseService.getQueryable(Dataset.class).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle();
|
||||
}
|
||||
|
||||
public Long count() {
|
||||
return this.databaseService.count(Dataset.class);
|
||||
return getDatabaseService().getQueryable(Dataset.class).where((builder, root) -> builder.equal((root.get("id")), id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,4 +46,9 @@ public class DatasetDaoImpl implements DatasetDao {
|
|||
, builder.equal(root.get("isPublic"), true)));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return this.getDatabaseService().count(Dataset.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +1,16 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.DatasetCriteria;
|
||||
import eu.eudat.models.criteria.DatasetProfileCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DatasetProfileDao {
|
||||
public interface DatasetProfileDao extends DatabaseAccessLayer<DatasetProfile, UUID> {
|
||||
|
||||
QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria);
|
||||
QueryableList<DatasetProfile> getAll();
|
||||
QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria);
|
||||
|
||||
DatasetProfile createOrUpdate(DatasetProfile item);
|
||||
QueryableList<DatasetProfile> getAll();
|
||||
|
||||
DatasetProfile find(UUID id);
|
||||
|
||||
Long count();
|
||||
|
||||
|
||||
}
|
|
@ -1,54 +1,43 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.Query;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.DatasetCriteria;
|
||||
import eu.eudat.models.criteria.DatasetProfileCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("datasetProfileDao")
|
||||
public class DatasetProfileDaoImpl implements DatasetProfileDao {
|
||||
public class DatasetProfileDaoImpl extends DatabaseAccess<DatasetProfile> implements DatasetProfileDao {
|
||||
|
||||
@Autowired
|
||||
DatabaseService<DatasetProfile> databaseService;
|
||||
public DatasetProfileDaoImpl(DatabaseService<DatasetProfile> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<DatasetProfile> getWithCriteria(DatasetProfileCriteria criteria) {
|
||||
QueryableList<DatasetProfile> query = databaseService.getQueryable(DatasetProfile.class);
|
||||
QueryableList<DatasetProfile> query = getDatabaseService().getQueryable(DatasetProfile.class);
|
||||
if(criteria.getLike()!=null&&!criteria.getLike().isEmpty())query.where((builder, root) -> builder.like(root.get("label"),"%"+criteria.getLike()+"%"));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DatasetProfile createOrUpdate(DatasetProfile item) {
|
||||
return this.databaseService.createOrUpdate(item,DatasetProfile.class);
|
||||
return this.getDatabaseService().createOrUpdate(item,DatasetProfile.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasetProfile find(UUID id) {
|
||||
return databaseService.getQueryable(DatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return null;
|
||||
return getDatabaseService().getQueryable(DatasetProfile.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<DatasetProfile> getAll() {
|
||||
return databaseService.getQueryable(DatasetProfile.class);
|
||||
return getDatabaseService().getQueryable(DatasetProfile.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DatasetProfileRuleset;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DatasetProfileRulesetDao extends Dao<DatasetProfileRuleset, UUID> {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DatasetProfileRuleset;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("datasetProfileRulesetDao")
|
||||
public class DatasetProfileRulesetDaoImpl extends JpaDao<DatasetProfileRuleset, UUID> implements DatasetProfileRulesetDao {
|
||||
|
||||
public DatasetProfileRuleset loadDetails(DatasetProfileRuleset t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DatasetProfileViewstyle;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DatasetProfileViewstyleDao extends Dao<DatasetProfileViewstyle, UUID> {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DatasetProfileViewstyle;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("datasetProfileViewstyleDao")
|
||||
public class DatasetProfileViewstyleDaoImpl extends JpaDao<DatasetProfileViewstyle, UUID> implements DatasetProfileViewstyleDao {
|
||||
|
||||
public DatasetProfileViewstyle loadDetails(DatasetProfileViewstyle t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DatasetRegistry;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DatasetRegistryDao extends Dao<DatasetRegistry, UUID> {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DatasetRegistry;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("datasetRegistryDao")
|
||||
public class DatasetRegistryDaoImpl extends JpaDao<DatasetRegistry, UUID> implements DatasetRegistryDao {
|
||||
|
||||
public DatasetRegistry loadDetails(DatasetRegistry t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DatasetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface DatasetServiceDao {
|
||||
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.DatasetService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("datasetServiceDao")
|
||||
public class DatasetServiceDaoImpl extends JpaDao<DatasetService, UUID> implements DatasetServiceDao {
|
||||
|
||||
public DatasetService loadDetails(DatasetService t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.ExternalDataset;
|
||||
import eu.eudat.entities.Invitation;
|
||||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||
|
@ -11,13 +13,8 @@ import java.util.UUID;
|
|||
/**
|
||||
* Created by ikalyvas on 1/17/2018.
|
||||
*/
|
||||
public interface ExternalDatasetDao {
|
||||
public interface ExternalDatasetDao extends DatabaseAccessLayer<ExternalDataset, UUID> {
|
||||
|
||||
QueryableList<ExternalDataset> getWithCriteria(ExternalDatasetCriteria criteria);
|
||||
|
||||
ExternalDataset createOrUpdate(ExternalDataset item);
|
||||
|
||||
ExternalDataset find(UUID id);
|
||||
|
||||
Long count();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.entities.ExternalDataset;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||
|
@ -14,30 +15,27 @@ import java.util.UUID;
|
|||
* Created by ikalyvas on 1/17/2018.
|
||||
*/
|
||||
@Component("externalDatasetDao")
|
||||
public class ExternalDatasetDaoImpl implements ExternalDatasetDao {
|
||||
public class ExternalDatasetDaoImpl extends DatabaseAccess<ExternalDataset> implements ExternalDatasetDao {
|
||||
|
||||
@Autowired
|
||||
DatabaseService<ExternalDataset> databaseService;
|
||||
public ExternalDatasetDaoImpl(DatabaseService<ExternalDataset> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<ExternalDataset> getWithCriteria(ExternalDatasetCriteria criteria) {
|
||||
QueryableList<ExternalDataset> query = this.databaseService.getQueryable(ExternalDataset.class);
|
||||
QueryableList<ExternalDataset> query = this.getDatabaseService().getQueryable(ExternalDataset.class);
|
||||
if (criteria.getLike() != null && !criteria.getLike().isEmpty()) query.where((builder, root) -> builder.like(root.get("label"), "%" + criteria.getLike() + "%"));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExternalDataset createOrUpdate(ExternalDataset item) {
|
||||
return this.databaseService.createOrUpdate(item,ExternalDataset.class);
|
||||
return this.getDatabaseService().createOrUpdate(item,ExternalDataset.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExternalDataset find(UUID id) {
|
||||
return this.databaseService.getQueryable(ExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return null;
|
||||
return this.getDatabaseService().getQueryable(ExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Dataset;
|
||||
import eu.eudat.entities.ExternalDataset;
|
||||
import eu.eudat.entities.Invitation;
|
||||
import eu.eudat.models.criteria.DatasetCriteria;
|
||||
import eu.eudat.models.criteria.InvitationCriteria;
|
||||
|
@ -11,13 +13,8 @@ import java.util.UUID;
|
|||
/**
|
||||
* Created by ikalyvas on 1/4/2018.
|
||||
*/
|
||||
public interface InvitationDao {
|
||||
public interface InvitationDao extends DatabaseAccessLayer<Invitation, UUID> {
|
||||
|
||||
QueryableList<Invitation> getWithCriteria(InvitationCriteria criteria);
|
||||
|
||||
Invitation createOrUpdate(Invitation item);
|
||||
|
||||
Invitation find(UUID id);
|
||||
|
||||
Long count();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.ExternalDataset;
|
||||
import eu.eudat.entities.Invitation;
|
||||
import eu.eudat.models.criteria.InvitationCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
@ -14,10 +15,12 @@ import java.util.UUID;
|
|||
* Created by ikalyvas on 1/4/2018.
|
||||
*/
|
||||
@Service("invitationDao")
|
||||
public class InvitationDaoImpl implements InvitationDao{
|
||||
public class InvitationDaoImpl extends DatabaseAccess<Invitation> implements InvitationDao{
|
||||
|
||||
@Autowired
|
||||
DatabaseService<Invitation> databaseService;
|
||||
public InvitationDaoImpl(DatabaseService<Invitation> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<Invitation> getWithCriteria(InvitationCriteria criteria) {
|
||||
|
@ -26,16 +29,12 @@ public class InvitationDaoImpl implements InvitationDao{
|
|||
|
||||
@Override
|
||||
public Invitation createOrUpdate(Invitation item) {
|
||||
return this.databaseService.createOrUpdate(item,Invitation.class);
|
||||
return this.getDatabaseService().createOrUpdate(item,Invitation.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Invitation find(UUID id) {
|
||||
return this.databaseService.getQueryable(Invitation.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
return this.getDatabaseService().getQueryable(Invitation.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,21 +1,15 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Invitation;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
import eu.eudat.models.criteria.OrganisationCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
public interface OrganisationDao extends Dao<Organisation, UUID> {
|
||||
|
||||
public List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
List<Organisation> listBy(Criteria<Organisation> criteria);
|
||||
public interface OrganisationDao extends DatabaseAccessLayer<Organisation, UUID> {
|
||||
|
||||
QueryableList<Organisation> getWithCriteria(OrganisationCriteria criteria);
|
||||
|
||||
}
|
|
@ -1,58 +1,40 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Invitation;
|
||||
import eu.eudat.models.criteria.OrganisationCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("organisationDao")
|
||||
public class OrganisationDaoImpl extends JpaDao<Organisation, UUID> implements OrganisationDao {
|
||||
public class OrganisationDaoImpl extends DatabaseAccess<Organisation> implements OrganisationDao {
|
||||
|
||||
public Organisation loadDetails(Organisation t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
@Autowired
|
||||
public OrganisationDaoImpl(DatabaseService<Organisation> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT organisation.id FROM Organisation organisation";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT organisation.id, organisation.label FROM Organisation organisation";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
@Override
|
||||
public QueryableList<Organisation> getWithCriteria(OrganisationCriteria criteria) {
|
||||
QueryableList<Organisation> query = this.getDatabaseService().getQueryable(Organisation.class);
|
||||
if (criteria.getLike() != null)
|
||||
query.where((builder, root) -> builder.equal(root.get("reference"), criteria.getLike()));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Organisation createOrUpdate(Organisation item) {
|
||||
return this.getDatabaseService().createOrUpdate(item,Organisation.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Organisation> listBy(Criteria<Organisation> criteria) {
|
||||
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
|
||||
CriteriaQuery<Organisation> criteriaQuery = criteriaBuilder .createQuery(Organisation.class);
|
||||
Root<Organisation> root = criteriaQuery.from(Organisation.class);
|
||||
criteriaQuery.where(criteriaBuilder.equal(root.get("reference"), criteria.getLike()));
|
||||
TypedQuery<Organisation> typedQuery = entityManager.createQuery(criteriaQuery);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Organisation find(UUID id) {
|
||||
return this.getDatabaseService().getQueryable(Organisation.class).where((builder, root) -> builder.equal(root.get("id"), id)).getSingle();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,16 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.project.ProjectTableRequest;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface ProjectDao {
|
||||
public interface ProjectDao extends DatabaseAccessLayer<Project, UUID> {
|
||||
|
||||
QueryableList<Project> getWithCriteria(ProjectCriteria criteria);
|
||||
|
||||
Project createOrUpdate(Project item);
|
||||
|
||||
Project find(UUID id);
|
||||
|
||||
Long count();
|
||||
}
|
|
@ -1,35 +1,27 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.project.ProjectTableRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("projectDao")
|
||||
public class ProjectDaoImpl implements ProjectDao {
|
||||
public class ProjectDaoImpl extends DatabaseAccess<Project> implements ProjectDao {
|
||||
|
||||
@Autowired
|
||||
DatabaseService<Project> databaseService;
|
||||
public ProjectDaoImpl(DatabaseService<Project> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<Project> getWithCriteria(ProjectCriteria criteria) {
|
||||
QueryableList<Project> query = databaseService.getQueryable(Project.class);
|
||||
QueryableList<Project> query = getDatabaseService().getQueryable(Project.class);
|
||||
if(criteria.getLike()!=null&&!criteria.getLike().isEmpty())query.where((builder, root) -> builder.like(root.get("label"),"%"+criteria.getLike()+"%"));
|
||||
if(criteria.getPeriodEnd()!=null)query.where((builder, root) -> builder.lessThan(root.get("enddate"),criteria.getPeriodEnd()));
|
||||
if(criteria.getPeriodStart()!=null)query.where((builder, root) -> builder.greaterThan(root.get("startdate"),criteria.getPeriodStart()));
|
||||
|
@ -39,15 +31,16 @@ public class ProjectDaoImpl implements ProjectDao {
|
|||
|
||||
@Override
|
||||
public Project createOrUpdate(Project item) {
|
||||
return databaseService.createOrUpdate(item,Project.class);
|
||||
return getDatabaseService().createOrUpdate(item,Project.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Project find(UUID id) {
|
||||
return databaseService.getQueryable(Project.class).where((builder, root) -> builder.equal((root.get("id")),id)).getSingle();
|
||||
return getDatabaseService().getQueryable(Project.class).where((builder, root) -> builder.equal((root.get("id")),id)).getSingle();
|
||||
}
|
||||
|
||||
public Long count(){
|
||||
return this.databaseService.count(Project.class);
|
||||
@Override
|
||||
public Long count() {
|
||||
return this.getDatabaseService().count(Project.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
import eu.eudat.models.criteria.RegistryCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
public interface RegistryDao extends Dao<Registry, UUID> {
|
||||
public interface RegistryDao extends DatabaseAccessLayer<Registry, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
List<Registry> listBy(Criteria<Registry> criteria);
|
||||
QueryableList<Registry> getWithCriteria(RegistryCriteria criteria);
|
||||
|
||||
}
|
|
@ -1,59 +1,39 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.models.criteria.RegistryCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("registryDao")
|
||||
public class RegistryDaoImpl extends JpaDao<Registry, UUID> implements RegistryDao {
|
||||
public class RegistryDaoImpl extends DatabaseAccess<Registry> implements RegistryDao {
|
||||
|
||||
public Registry loadDetails(Registry t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT registry.id FROM Registry registry";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT registry.id, registry.label FROM Registry registry";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
@Autowired
|
||||
public RegistryDaoImpl(DatabaseService<Registry> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Registry> listBy(Criteria<Registry> criteria) {
|
||||
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
|
||||
CriteriaQuery<Registry> criteriaQuery = criteriaBuilder .createQuery(Registry.class);
|
||||
Root<Registry> root = criteriaQuery.from(Registry.class);
|
||||
criteriaQuery.where(criteriaBuilder.equal(root.get("reference"), criteria.getLike()));
|
||||
TypedQuery<Registry> typedQuery = entityManager.createQuery(criteriaQuery);
|
||||
return typedQuery.getResultList();
|
||||
public QueryableList<Registry> getWithCriteria(RegistryCriteria criteria) {
|
||||
QueryableList<Registry> query = this.getDatabaseService().getQueryable(Registry.class);
|
||||
if(criteria.getLike()!=null) query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Registry createOrUpdate(Registry item) {
|
||||
return this.getDatabaseService().createOrUpdate(item,Registry.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Registry find(UUID id) {
|
||||
return this.getDatabaseService().getQueryable(Registry.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,15 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Registry;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
import eu.eudat.models.criteria.ResearcherCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
public interface ResearcherDao extends Dao<Researcher, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
Researcher getResearcherByEmail(String email);
|
||||
|
||||
List<Researcher> listBy(Criteria<Researcher> criteria);
|
||||
public interface ResearcherDao extends DatabaseAccessLayer<Researcher, UUID> {
|
||||
|
||||
QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria);
|
||||
|
||||
}
|
|
@ -1,69 +1,39 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.models.criteria.ResearcherCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("researcherDao")
|
||||
public class ResearcherDaoImpl extends JpaDao<Researcher, UUID> implements ResearcherDao {
|
||||
public class ResearcherDaoImpl extends DatabaseAccess<Researcher> implements ResearcherDao {
|
||||
|
||||
public Researcher loadDetails(Researcher t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT researcher.id FROM Researcher researcher";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT researcher.id, researcher.label FROM Researcher researcher";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Researcher getResearcherByEmail(String email) {
|
||||
String queryString = "FROM Researcher researcher where researcher.primaryEmail=:email";
|
||||
TypedQuery<Researcher> typedQuery = entityManager.createQuery(queryString, Researcher.class);
|
||||
|
||||
|
||||
return null;
|
||||
@Autowired
|
||||
public ResearcherDaoImpl(DatabaseService<Researcher> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Researcher> listBy(Criteria<Researcher> criteria) {
|
||||
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
|
||||
CriteriaQuery<Researcher> criteriaQuery = criteriaBuilder .createQuery(Researcher.class);
|
||||
Root<Researcher> root = criteriaQuery.from(Researcher.class);
|
||||
criteriaQuery.where(criteriaBuilder.equal(root.get("reference"), criteria.getLike()));
|
||||
TypedQuery<Researcher> typedQuery = entityManager.createQuery(criteriaQuery);
|
||||
return typedQuery.getResultList();
|
||||
public QueryableList<Researcher> getWithCriteria(ResearcherCriteria criteria) {
|
||||
QueryableList<Researcher> query = this.getDatabaseService().getQueryable(Researcher.class);
|
||||
if(criteria.getLike()!=null) query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
||||
return query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Researcher createOrUpdate(Researcher item) {
|
||||
return this.getDatabaseService().createOrUpdate(item,Researcher.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Researcher find(UUID id) {
|
||||
return this.getDatabaseService().getQueryable(Researcher.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Researcher;
|
||||
import eu.eudat.entities.Service;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import eu.eudat.models.criteria.ServiceCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
public interface ServiceDao extends Dao<Service, UUID> {
|
||||
public interface ServiceDao extends DatabaseAccessLayer<Service, UUID> {
|
||||
|
||||
List<UUID> listAllIDs();
|
||||
|
||||
List<IDLabelPair> listAllIDsLabels();
|
||||
|
||||
List<Service> listBy(Criteria<Service> criteria);
|
||||
QueryableList<Service> getWithCriteria(ServiceCriteria criteria);
|
||||
|
||||
}
|
|
@ -1,58 +1,39 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Root;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.models.criteria.ServiceCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
import org.hibernate.query.Query;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.entities.Service;
|
||||
import eu.eudat.entities.responses.IDLabelPair;
|
||||
import eu.eudat.models.criteria.Criteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("serviceDao")
|
||||
public class ServiceDaoImpl extends JpaDao<Service, UUID> implements ServiceDao {
|
||||
public class ServiceDaoImpl extends DatabaseAccess<Service> implements ServiceDao {
|
||||
|
||||
public Service loadDetails(Service t) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UUID> listAllIDs() {
|
||||
String queryString = "SELECT service.id FROM Service service";
|
||||
TypedQuery<UUID> typedQuery = entityManager.createQuery(queryString, UUID.class);
|
||||
return typedQuery.getResultList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<IDLabelPair> listAllIDsLabels() {
|
||||
String queryString = "SELECT service.id, service.label FROM Service service";
|
||||
Query query = (Query) entityManager.createQuery(queryString);
|
||||
List<Object[]> rows = query.list();
|
||||
return rows.stream().map(row -> {
|
||||
return new IDLabelPair(row[0].toString(), row[1].toString());
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
@Autowired
|
||||
public ServiceDaoImpl(DatabaseService<Service> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Service> listBy(Criteria<Service> criteria) {
|
||||
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
|
||||
CriteriaQuery<Service> criteriaQuery = criteriaBuilder .createQuery(Service.class);
|
||||
Root<Service> root = criteriaQuery.from(Service.class);
|
||||
criteriaQuery.where(criteriaBuilder.equal(root.get("reference"), criteria.getLike()));
|
||||
TypedQuery<Service> typedQuery = entityManager.createQuery(criteriaQuery);
|
||||
return typedQuery.getResultList();
|
||||
public QueryableList<Service> getWithCriteria(ServiceCriteria criteria) {
|
||||
QueryableList<Service> query = this.getDatabaseService().getQueryable(Service.class);
|
||||
if(criteria.getLike()!=null) query.where((builder, root) -> builder.equal(root.get("reference"),criteria.getLike()));
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Service createOrUpdate(Service item) {
|
||||
return this.getDatabaseService().createOrUpdate(item,Service.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Service find(UUID id) {
|
||||
return this.getDatabaseService().getQueryable(Service.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +1,15 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.dao.DatabaseAccessLayer;
|
||||
import eu.eudat.entities.Service;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.criteria.UserInfoCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
public interface UserInfoDao {
|
||||
public interface UserInfoDao extends DatabaseAccessLayer<UserInfo, UUID> {
|
||||
|
||||
QueryableList<UserInfo> getWithCriteria(UserInfoCriteria criteria);
|
||||
|
||||
UserInfo createOrUpdate(UserInfo item);
|
||||
|
||||
UserInfo find(UUID id);
|
||||
|
||||
Long count();
|
||||
|
||||
}
|
|
@ -1,31 +1,27 @@
|
|||
package eu.eudat.dao.entities;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.Invitation;
|
||||
import eu.eudat.entities.Organisation;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.criteria.UserInfoCriteria;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("userInfoDao")
|
||||
public class UserInfoDaoImpl implements UserInfoDao {
|
||||
public class UserInfoDaoImpl extends DatabaseAccess<UserInfo> implements UserInfoDao {
|
||||
|
||||
@Autowired
|
||||
private DatabaseService<UserInfo> databaseService;
|
||||
public UserInfoDaoImpl(DatabaseService<UserInfo> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryableList<UserInfo> getWithCriteria(UserInfoCriteria criteria) {
|
||||
QueryableList<UserInfo> users = this.databaseService.getQueryable(UserInfo.class);
|
||||
QueryableList<UserInfo> users = this.getDatabaseService().getQueryable(UserInfo.class);
|
||||
if (criteria.getLike() != null)
|
||||
users.where((builder, root) -> builder.or(builder.like(root.get("name"), "%" + criteria.getLike() + "%"), builder.like(root.get("email"), "%" + criteria.getLike() + "%")));
|
||||
if(criteria.getEmail()!=null)
|
||||
|
@ -35,16 +31,12 @@ public class UserInfoDaoImpl implements UserInfoDao {
|
|||
|
||||
@Override
|
||||
public UserInfo createOrUpdate(UserInfo item) {
|
||||
return this.databaseService.createOrUpdate(item,UserInfo.class);
|
||||
return this.getDatabaseService().createOrUpdate(item,UserInfo.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserInfo find(UUID id) {
|
||||
return this.databaseService.getQueryable(UserInfo.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
return this.getDatabaseService().getQueryable(UserInfo.class).where((builder, root) -> builder.equal(root.get("id"),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long count() {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,11 +1,6 @@
|
|||
package eu.eudat.dao.entities.security;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.Credential;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.UserToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 12/15/2017.
|
||||
|
|
|
@ -1,26 +1,25 @@
|
|||
package eu.eudat.dao.entities.security;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.Credential;
|
||||
import eu.eudat.entities.Project;
|
||||
import eu.eudat.entities.UserToken;
|
||||
import eu.eudat.entities.UserInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 12/15/2017.
|
||||
*/
|
||||
@Component("credentialDao")
|
||||
public class CredentialDaoImpl implements CredentialDao {
|
||||
public class CredentialDaoImpl extends DatabaseAccess<Credential> implements CredentialDao {
|
||||
|
||||
@Autowired
|
||||
DatabaseService<Credential> databaseService;
|
||||
public CredentialDaoImpl(DatabaseService<Credential> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Credential createOrUpdate(Credential item) {
|
||||
return this.databaseService.createOrUpdate(item,Credential.class);
|
||||
return this.getDatabaseService().createOrUpdate(item,Credential.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.eudat.dao.entities.security;
|
||||
|
||||
import eu.eudat.dao.Dao;
|
||||
import eu.eudat.entities.UserToken;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -8,6 +7,11 @@ import java.util.UUID;
|
|||
/**
|
||||
* Created by ikalyvas on 12/15/2017.
|
||||
*/
|
||||
public interface UserTokenDao extends Dao<UserToken, UUID> {
|
||||
public interface UserTokenDao {
|
||||
|
||||
UserToken createOrUpdate(UserToken item);
|
||||
|
||||
UserToken find(UUID id);
|
||||
|
||||
void delete(UserToken token);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package eu.eudat.dao.entities.security;
|
||||
|
||||
import eu.eudat.dao.JpaDao;
|
||||
import eu.eudat.dao.DatabaseAccess;
|
||||
import eu.eudat.dao.databaselayer.service.DatabaseService;
|
||||
import eu.eudat.entities.UserToken;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.UUID;
|
||||
|
@ -10,9 +12,25 @@ import java.util.UUID;
|
|||
* Created by ikalyvas on 12/15/2017.
|
||||
*/
|
||||
@Component("userTokenDao")
|
||||
public class UserTokenDaoImpl extends JpaDao<UserToken, UUID> implements UserTokenDao {
|
||||
public class UserTokenDaoImpl extends DatabaseAccess<UserToken> implements UserTokenDao {
|
||||
|
||||
@Autowired
|
||||
public UserTokenDaoImpl(DatabaseService<UserToken> databaseService) {
|
||||
this.setDatabaseService(databaseService);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserToken loadDetails(UserToken userToken) {
|
||||
return null;
|
||||
public UserToken createOrUpdate(UserToken item) {
|
||||
return this.getDatabaseService().createOrUpdate(item,UserToken.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserToken find(UUID id) {
|
||||
return this.getDatabaseService().getQueryable(UserToken.class).where((builder, root) -> builder.equal(root.get("token"),id)).getSingle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(UserToken userToken) {
|
||||
this.getDatabaseService().delete(userToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ import java.util.UUID;
|
|||
* Created by ikalyvas on 12/15/2017.
|
||||
*/
|
||||
@Entity
|
||||
@Table(name="\"Credential\"")
|
||||
@Table(name = "\"Credential\"")
|
||||
public class Credential implements DataEntity<Credential> {
|
||||
|
||||
@Id
|
||||
|
@ -18,7 +18,7 @@ public class Credential implements DataEntity<Credential> {
|
|||
private UUID id;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name="\"UserId\"", nullable=false)
|
||||
@JoinColumn(name = "\"UserId\"", nullable = false)
|
||||
private UserInfo userInfo;
|
||||
|
||||
@Column(name = "\"Status\"", nullable = false)
|
||||
|
|
|
@ -34,8 +34,6 @@ public class DMP implements Serializable, DataEntity<DMP> {
|
|||
}
|
||||
|
||||
private static final Set<String> hints = new HashSet<>(Arrays.asList("dataManagementPlanListingModel", "fullyDetailed"));
|
||||
private static final long serialVersionUID = -8263056535208547615L;
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -18,15 +18,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DMPOrganisation\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DMPOrganisation implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -222030426979174777L;
|
||||
|
||||
public DMPOrganisation () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||
|
|
|
@ -23,13 +23,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DMPProfile\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DMPProfile implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3213099144442689808L;
|
||||
|
||||
public DMPProfile () {}
|
||||
|
||||
public class DMPProfile {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -19,13 +19,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DMPResearcher\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DMPResearcher implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 135449857355252959L;
|
||||
|
||||
public DMPResearcher () {}
|
||||
|
||||
public class DMPResearcher {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -7,5 +7,4 @@ public interface DataEntity<T> {
|
|||
void update(T entity);
|
||||
|
||||
Object[] getKeys();
|
||||
|
||||
}
|
||||
|
|
|
@ -24,15 +24,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DataRepository\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DataRepository implements Serializable,DataEntity<DataRepository> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 4162323701450468639L;
|
||||
|
||||
public DataRepository () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||
|
|
|
@ -29,8 +29,6 @@ public class Dataset implements DataEntity<Dataset> {
|
|||
}
|
||||
private static final Set<String> hints = new HashSet<>(Arrays.asList("datasetListingModel"));
|
||||
|
||||
private static final long serialVersionUID = 3575723814399553259L;
|
||||
|
||||
public enum Status {
|
||||
SAVED((short) 0), FINALISED((short) 1), DELETED((short) 99);
|
||||
|
||||
|
@ -55,9 +53,6 @@ public class Dataset implements DataEntity<Dataset> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Dataset () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -25,14 +25,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DatasetProfile\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DatasetProfile implements Serializable,DataEntity<DatasetProfile> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 8203086344232867334L;
|
||||
|
||||
public DatasetProfile () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -21,14 +21,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DatasetProfileRuleset\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DatasetProfileRuleset implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4249565129050898613L;
|
||||
|
||||
public DatasetProfileRuleset () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||
|
|
|
@ -21,13 +21,9 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DatasetProfileViewstyle\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DatasetProfileViewstyle implements Serializable {
|
||||
public class DatasetProfileViewstyle {
|
||||
|
||||
private static final long serialVersionUID = -3251295258160291468L;
|
||||
|
||||
public DatasetProfileViewstyle () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -19,13 +19,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DatasetRegistry\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DatasetRegistry implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5594183793725819187L;
|
||||
|
||||
public DatasetRegistry () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -19,13 +19,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"DatasetService\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class DatasetService implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1469161193939096037L;
|
||||
|
||||
public DatasetService () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -25,15 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"Organisation\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class Organisation implements Serializable,DataEntity<Organisation> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 3614146195740867782L;
|
||||
|
||||
public Organisation () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||
|
|
|
@ -28,7 +28,6 @@ import com.fasterxml.jackson.databind.SerializationFeature;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"Project\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class Project implements DataEntity<Project> {
|
||||
|
||||
public enum Status {
|
||||
|
@ -47,9 +46,9 @@ public class Project implements DataEntity<Project> {
|
|||
public static Status fromInteger(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return ACTIVE;
|
||||
case 1:
|
||||
return INACTIVE;
|
||||
case 1:
|
||||
return ACTIVE;
|
||||
case 99:
|
||||
return DELETED;
|
||||
default:
|
||||
|
@ -57,8 +56,6 @@ public class Project implements DataEntity<Project> {
|
|||
}
|
||||
}
|
||||
}
|
||||
public Project () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -25,13 +25,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"Registry\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class Registry implements Serializable,DataEntity<Registry> {
|
||||
public class Registry implements DataEntity<Registry> {
|
||||
|
||||
private static final long serialVersionUID = -277572262583178090L;
|
||||
|
||||
public Registry () {}
|
||||
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -25,14 +25,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"Researcher\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class Researcher implements Serializable,DataEntity<Researcher> {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -2513186824704729896L;
|
||||
|
||||
public Researcher () {}
|
||||
|
||||
public class Researcher implements DataEntity<Researcher> {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -25,11 +25,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"Service\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class Service implements Serializable,DataEntity<Service> {
|
||||
|
||||
private static final long serialVersionUID = 163279108676904730L;
|
||||
|
||||
public class Service implements DataEntity<Service> {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
|
|
@ -17,11 +17,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"UserDMP\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class UserDMP implements Serializable{
|
||||
public class UserDMP {
|
||||
|
||||
private static final long serialVersionUID = -4467370784003784660L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||
|
|
|
@ -17,11 +17,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
|
|||
|
||||
@Entity
|
||||
@Table(name="\"UserInfo\"")
|
||||
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
|
||||
public class UserInfo implements Serializable,DataEntity<UserInfo>{
|
||||
public class UserInfo implements DataEntity<UserInfo>{
|
||||
|
||||
private static final long serialVersionUID = 1225151430484658395L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
@GenericGenerator(name = "uuid2", strategy = "uuid2")
|
||||
|
|
|
@ -11,8 +11,6 @@ import java.util.UUID;
|
|||
@Table(name="\"UserToken\"")
|
||||
public class UserToken implements DataEntity<UserToken>{
|
||||
|
||||
private static final long serialVersionUID = 1225151430484658395L;
|
||||
|
||||
@Id
|
||||
@Column(name = "\"Token\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
|
||||
private UUID token;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package eu.eudat.managers;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -11,14 +10,13 @@ import eu.eudat.entities.Project;
|
|||
import eu.eudat.entities.UserInfo;
|
||||
import eu.eudat.exceptions.UnauthorisedException;
|
||||
import eu.eudat.models.HintedModelFactory;
|
||||
import eu.eudat.models.criteria.DataManagementPlanCriteria;
|
||||
import eu.eudat.models.criteria.OrganisationCriteria;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.criteria.ResearcherCriteria;
|
||||
import eu.eudat.models.dmp.DataManagementPlan;
|
||||
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
|
||||
import eu.eudat.models.dmp.DataManagementPlanTableRequest;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.listingmodels.DataManagementPlanListingModel;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
@ -27,7 +25,7 @@ import eu.eudat.utilities.builders.DomainModelConverter;
|
|||
|
||||
public class DataManagementPlanManager {
|
||||
|
||||
public DataTableData<DataManagementPlanListingModel> getPaged(ApiContext apiContext, DataManagementPlanTableRequest dataManagementPlanTableRequest, Principal principal) throws IllegalAccessException, InstantiationException {
|
||||
public DataTableData<DataManagementPlanListingModel> getPaged(ApiContext apiContext, DataManagementPlanTableRequest dataManagementPlanTableRequest, Principal principal) throws Exception {
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setId(principal.getId());
|
||||
QueryableList<DMP> items = apiContext.getDatabaseRepository().getDmpDao().getWithCriteria(dataManagementPlanTableRequest.getCriteria());
|
||||
|
@ -85,9 +83,9 @@ public class DataManagementPlanManager {
|
|||
for (eu.eudat.entities.Researcher researcher : newDmp.getResearchers()) {
|
||||
ResearcherCriteria criteria = new ResearcherCriteria();
|
||||
criteria.setLike(researcher.getReference());
|
||||
List<eu.eudat.entities.Researcher> entries = researcherRepository.listBy(criteria);
|
||||
List<eu.eudat.entities.Researcher> entries = researcherRepository.getWithCriteria(criteria).toList();
|
||||
if (entries != null && !entries.isEmpty()) researcher.setId(entries.get(0).getId());
|
||||
else researcher = researcherRepository.create(researcher);
|
||||
else researcher = researcherRepository.createOrUpdate(researcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,9 +95,9 @@ public class DataManagementPlanManager {
|
|||
for (eu.eudat.entities.Organisation organisation : newDmp.getOrganisations()) {
|
||||
OrganisationCriteria criteria = new OrganisationCriteria();
|
||||
criteria.setLike(organisation.getReference());
|
||||
List<eu.eudat.entities.Organisation> entries = organisationRepository.listBy(criteria);
|
||||
List<eu.eudat.entities.Organisation> entries = organisationRepository.getWithCriteria(criteria).toList();
|
||||
if (entries != null && !entries.isEmpty()) organisation.setId(entries.get(0).getId());
|
||||
else organisation = organisationRepository.create(organisation);
|
||||
else organisation = organisationRepository.createOrUpdate(organisation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,13 +7,10 @@ import eu.eudat.models.criteria.DataRepositoryCriteria;
|
|||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||
import eu.eudat.models.criteria.RegistryCriteria;
|
||||
import eu.eudat.models.criteria.ServiceCriteria;
|
||||
import eu.eudat.models.dataset.Dataset;
|
||||
import eu.eudat.models.dataset.DatasetTableRequest;
|
||||
import eu.eudat.models.datasetwizard.DatasetWizardModel;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.project.Project;
|
||||
import eu.eudat.models.project.ProjectTableRequest;
|
||||
import eu.eudat.models.properties.PropertiesModel;
|
||||
import eu.eudat.models.security.Principal;
|
||||
import eu.eudat.models.user.composite.PagedDatasetProfile;
|
||||
|
@ -22,7 +19,6 @@ import eu.eudat.services.ApiContext;
|
|||
import eu.eudat.utilities.builders.DomainModelConverter;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -33,7 +29,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public class DatasetManager {
|
||||
|
||||
public DataTableData<DatasetListingModel> getPaged(ApiContext apiContext, DatasetTableRequest datasetTableRequest, Principal principal) throws IllegalAccessException, InstantiationException {
|
||||
public DataTableData<DatasetListingModel> getPaged(ApiContext apiContext, DatasetTableRequest datasetTableRequest, Principal principal) throws Exception {
|
||||
UserInfo userInfo = new UserInfo();
|
||||
userInfo.setId(principal.getId());
|
||||
QueryableList<eu.eudat.entities.Dataset> items = apiContext.getDatabaseRepository().getDatasetDao().getWithCriteria(datasetTableRequest.getCriteria());
|
||||
|
@ -87,9 +83,9 @@ public class DatasetManager {
|
|||
for (eu.eudat.entities.Registry registry : dataset.getRegistries()) {
|
||||
RegistryCriteria criteria = new RegistryCriteria();
|
||||
criteria.setLike(registry.getReference());
|
||||
List<eu.eudat.entities.Registry> entries = registryDao.listBy(criteria);
|
||||
List<eu.eudat.entities.Registry> entries = registryDao.getWithCriteria(criteria).toList();
|
||||
if (entries != null && !entries.isEmpty()) registry.setId(entries.get(0).getId());
|
||||
else registry = registryDao.create(registry);
|
||||
else registry = registryDao.createOrUpdate(registry);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,9 +95,9 @@ public class DatasetManager {
|
|||
for (eu.eudat.entities.Service service : dataset.getServices()) {
|
||||
ServiceCriteria criteria = new ServiceCriteria();
|
||||
criteria.setLike(service.getReference());
|
||||
List<eu.eudat.entities.Service> entries = serviceDao.listBy(criteria);
|
||||
List<eu.eudat.entities.Service> entries = serviceDao.getWithCriteria(criteria).toList();
|
||||
if (entries != null && !entries.isEmpty()) service.setId(entries.get(0).getId());
|
||||
else service = serviceDao.create(service);
|
||||
else service = serviceDao.createOrUpdate(service);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -111,7 +107,7 @@ public class DatasetManager {
|
|||
for (eu.eudat.entities.DataRepository dataRepo : dataset.getDataRepositories()) {
|
||||
DataRepositoryCriteria criteria = new DataRepositoryCriteria();
|
||||
criteria.setLike(dataRepo.getReference());
|
||||
List<eu.eudat.entities.DataRepository> entries = dataRepositoryDao.listBy(criteria);
|
||||
List<eu.eudat.entities.DataRepository> entries = dataRepositoryDao.getWithCriteria(criteria).toList();
|
||||
if (entries != null && !entries.isEmpty()) dataRepo.setId(entries.get(0).getId());
|
||||
else dataRepo = dataRepositoryDao.createOrUpdate(dataRepo);
|
||||
}
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
package eu.eudat.managers;
|
||||
|
||||
import eu.eudat.dao.entities.DMPDao;
|
||||
import eu.eudat.dao.entities.DatasetDao;
|
||||
import eu.eudat.dao.entities.DatasetProfileDao;
|
||||
import eu.eudat.entities.DMP;
|
||||
import eu.eudat.entities.DatasetProfile;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileListingModel;
|
||||
import eu.eudat.models.datasetprofile.DatasetProfileTableRequestItem;
|
||||
import eu.eudat.models.dmp.DataManagementPlan;
|
||||
import eu.eudat.models.dmp.DataManagementPlanCriteriaRequest;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.listingmodels.DatasetListingModel;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
import eu.eudat.utilities.builders.DomainModelConverter;
|
||||
|
||||
|
@ -29,7 +23,7 @@ public class DatasetProfileManager {
|
|||
return datasetProfiles;
|
||||
}
|
||||
|
||||
public static DataTableData<DatasetProfileListingModel> getPaged(DatasetProfileDao datasetProfileRepository, DatasetProfileTableRequestItem datasetProfileTableRequestItem) throws IllegalAccessException, InstantiationException{
|
||||
public static DataTableData<DatasetProfileListingModel> getPaged(DatasetProfileDao datasetProfileRepository, DatasetProfileTableRequestItem datasetProfileTableRequestItem) throws Exception {
|
||||
QueryableList<DatasetProfile> items = datasetProfileRepository.getWithCriteria(datasetProfileTableRequestItem.getCriteria());
|
||||
QueryableList<DatasetProfile> pagedItems = PaginationManager.applyPaging(items,datasetProfileTableRequestItem);
|
||||
List<DatasetProfileListingModel> datasetProfiles = new DomainModelConverter<DatasetProfile, DatasetProfileListingModel>().fromDataModel( pagedItems.toList(), DatasetProfileListingModel.class);
|
||||
|
|
|
@ -3,13 +3,9 @@ package eu.eudat.managers;
|
|||
import eu.eudat.dao.entities.ExternalDatasetDao;
|
||||
import eu.eudat.entities.ExternalDataset;
|
||||
import eu.eudat.models.criteria.ExternalDatasetCriteria;
|
||||
import eu.eudat.models.external.ExternalDatasetModel;
|
||||
import eu.eudat.models.external.ExternalSourcesItemModel;
|
||||
import eu.eudat.models.external.ProjectsExternalSourcesModel;
|
||||
import eu.eudat.models.externaldataset.ExternalDatasetTableRequest;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.externaldataset.ExternalDatasetListingModel;
|
||||
import eu.eudat.models.project.Project;
|
||||
import eu.eudat.proxy.config.exceptions.HugeResultSet;
|
||||
import eu.eudat.proxy.config.exceptions.NoURLFound;
|
||||
import eu.eudat.proxy.fetching.RemoteFetcher;
|
||||
|
@ -17,7 +13,6 @@ import eu.eudat.queryable.QueryableList;
|
|||
import eu.eudat.utilities.builders.DomainModelConverter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +20,7 @@ import java.util.UUID;
|
|||
*/
|
||||
public class ExternalDatasetManager {
|
||||
|
||||
public DataTableData<ExternalDatasetListingModel> getPaged(ExternalDatasetDao externalDatasetDao, ExternalDatasetTableRequest externalDatasetTableRequest) throws InstantiationException, IllegalAccessException {
|
||||
public DataTableData<ExternalDatasetListingModel> getPaged(ExternalDatasetDao externalDatasetDao, ExternalDatasetTableRequest externalDatasetTableRequest) throws Exception {
|
||||
QueryableList<ExternalDataset> items = externalDatasetDao.getWithCriteria(externalDatasetTableRequest.getCriteria());
|
||||
QueryableList<ExternalDataset> pagedItems = PaginationManager.applyPaging(items, externalDatasetTableRequest);
|
||||
List<ExternalDatasetListingModel> externalDatasetListingmodels = new DomainModelConverter<ExternalDataset, ExternalDatasetListingModel>().fromDataModel(pagedItems.toList(), ExternalDatasetListingModel.class);
|
||||
|
|
|
@ -1,14 +1,26 @@
|
|||
package eu.eudat.managers;
|
||||
|
||||
import eu.eudat.entities.DataEntity;
|
||||
import eu.eudat.models.helpers.common.ColumnOrderings;
|
||||
import eu.eudat.models.helpers.common.Ordering;
|
||||
import eu.eudat.models.helpers.requests.TableRequest;
|
||||
import eu.eudat.queryable.QueryableList;
|
||||
|
||||
public class PaginationManager {
|
||||
|
||||
public static <T extends DataEntity<T>> QueryableList<T> applyPaging(QueryableList<T> items, TableRequest tableRequest){
|
||||
public static <T extends DataEntity<T>> QueryableList<T> applyPaging(QueryableList<T> items, TableRequest tableRequest) throws Exception {
|
||||
if(tableRequest.getOrderings()!=null) applyOrder(items,tableRequest);
|
||||
if(tableRequest.getLength()!=null)items.take(tableRequest.getLength());
|
||||
if(tableRequest.getOffset()!=null)items.skip(tableRequest.getOffset());
|
||||
return items;
|
||||
}
|
||||
|
||||
public static <T extends DataEntity<T>> void applyOrder(QueryableList<T> items, TableRequest tableRequest) throws Exception {
|
||||
ColumnOrderings columnOrderings = tableRequest.getOrderings();
|
||||
for(Ordering ordering:columnOrderings.getFieldOrderings()){
|
||||
if(ordering.getType() == Ordering.OrderByType.ASC) items.orderByAsc(root -> root.get(ordering.getFieldName()));
|
||||
if(ordering.getType() == Ordering.OrderByType.DESC) items.orderByDesc(root -> root.get(ordering.getFieldName()));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,9 @@ import java.util.UUID;
|
|||
|
||||
import eu.eudat.dao.entities.ProjectDao;
|
||||
import eu.eudat.dao.entities.UserInfoDao;
|
||||
import eu.eudat.models.criteria.ProjectCriteria;
|
||||
import eu.eudat.models.external.ExternalListingItem;
|
||||
import eu.eudat.models.external.ExternalSourcesItemModel;
|
||||
import eu.eudat.models.external.ProjectsExternalSourcesModel;
|
||||
import eu.eudat.models.helpers.DataTableData;
|
||||
import eu.eudat.models.helpers.common.DataTableData;
|
||||
import eu.eudat.models.project.Project;
|
||||
import eu.eudat.models.project.ProjectCriteriaRequest;
|
||||
import eu.eudat.models.project.ProjectListingModel;
|
||||
|
@ -25,7 +23,7 @@ import eu.eudat.utilities.builders.DomainModelConverter;
|
|||
|
||||
public class ProjectManager {
|
||||
|
||||
public DataTableData<eu.eudat.models.project.ProjectListingModel> getPaged(ProjectDao projectRepository, ProjectTableRequest projectTableRequest) throws IllegalAccessException, InstantiationException {
|
||||
public DataTableData<eu.eudat.models.project.ProjectListingModel> getPaged(ProjectDao projectRepository, ProjectTableRequest projectTableRequest) throws Exception {
|
||||
QueryableList<eu.eudat.entities.Project> items = projectRepository.getWithCriteria(projectTableRequest.getCriteria());
|
||||
QueryableList<eu.eudat.entities.Project> pagedItems = PaginationManager.applyPaging(items, projectTableRequest);
|
||||
List<eu.eudat.models.project.ProjectListingModel> projects = new DomainModelConverter<eu.eudat.entities.Project, ProjectListingModel>().fromDataModel(pagedItems.toList(), eu.eudat.models.project.ProjectListingModel.class);
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
package eu.eudat.models.helpers;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class AutoCompleteLookupItem {
|
||||
private String profileID;
|
||||
private String fieldID;
|
||||
private String searchTerm;
|
||||
public String getProfileID() {
|
||||
return profileID;
|
||||
}
|
||||
public void setProfileID(String profileID) {
|
||||
this.profileID = profileID;
|
||||
}
|
||||
public String getFieldID() {
|
||||
return fieldID;
|
||||
}
|
||||
public void setFieldID(String fieldID) {
|
||||
this.fieldID = fieldID;
|
||||
}
|
||||
|
||||
public String getSearchTerm() {
|
||||
return searchTerm;
|
||||
}
|
||||
|
||||
public void setSearchTerm(String searchTerm) {
|
||||
this.searchTerm = searchTerm;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package eu.eudat.models.helpers.common;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class AutoCompleteLookupItem {
|
||||
private String profileID;
|
||||
private String fieldID;
|
||||
private String searchTerm;
|
||||
|
||||
public String getProfileID() {
|
||||
return profileID;
|
||||
}
|
||||
|
||||
public void setProfileID(String profileID) {
|
||||
this.profileID = profileID;
|
||||
}
|
||||
|
||||
public String getFieldID() {
|
||||
return fieldID;
|
||||
}
|
||||
|
||||
public void setFieldID(String fieldID) {
|
||||
this.fieldID = fieldID;
|
||||
}
|
||||
|
||||
public String getSearchTerm() {
|
||||
return searchTerm;
|
||||
}
|
||||
|
||||
public void setSearchTerm(String searchTerm) {
|
||||
this.searchTerm = searchTerm;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package eu.eudat.models.helpers.common;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 1/25/2018.
|
||||
*/
|
||||
public class ColumnOrderings {
|
||||
|
||||
private String[] fields;
|
||||
|
||||
public String[] getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
public void setFields(String[] fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
public Ordering[] getFieldOrderings() throws Exception {
|
||||
List<Ordering> orderings = new LinkedList<>();
|
||||
for(String field : fields){
|
||||
orderings.add(this.orderingFromString(field));
|
||||
}
|
||||
return orderings.toArray(new Ordering[orderings.size()]);
|
||||
}
|
||||
|
||||
private Ordering orderingFromString(String field) throws Exception {
|
||||
if(field.startsWith("+")) return new Ordering(field.replace("+",""), Ordering.OrderByType.ASC);
|
||||
else if(field.startsWith("-")) return new Ordering(field.replace("-",""), Ordering.OrderByType.DESC);
|
||||
else throw new Exception("Unsupported Field Order Type");
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package eu.eudat.models.helpers;
|
||||
package eu.eudat.models.helpers.common;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package eu.eudat.models.helpers.common;
|
||||
|
||||
/**
|
||||
* Created by ikalyvas on 1/25/2018.
|
||||
*/
|
||||
public class Ordering {
|
||||
public enum OrderByType {
|
||||
ASC, DESC
|
||||
}
|
||||
|
||||
private String fieldName;
|
||||
private OrderByType type;
|
||||
|
||||
public Ordering(String fieldName, OrderByType type) {
|
||||
this.fieldName = fieldName;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getFieldName() {
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public OrderByType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(OrderByType type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,9 @@
|
|||
package eu.eudat.models.helpers.requests;
|
||||
|
||||
import eu.eudat.models.helpers.common.ColumnOrderings;
|
||||
|
||||
public abstract class TableRequest<T> extends RequestItem<T> {
|
||||
private ColumnOrderings orderings;
|
||||
private Integer length;
|
||||
private Integer offset;
|
||||
|
||||
|
@ -19,4 +22,12 @@ public abstract class TableRequest<T> extends RequestItem<T> {
|
|||
public void setOffset(Integer offset) {
|
||||
this.offset = offset;
|
||||
}
|
||||
|
||||
public ColumnOrderings getOrderings() {
|
||||
return orderings;
|
||||
}
|
||||
|
||||
public void setOrderings(ColumnOrderings orderings) {
|
||||
this.orderings = orderings;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,12 @@ public interface QueryableList<T extends DataEntity<T>> {
|
|||
QueryableList<T> distinct();
|
||||
|
||||
QueryableList<T> orderByAsc(OrderByPredicate<T> predicate);
|
||||
|
||||
QueryableList<T> orderByDesc(OrderByPredicate<T> predicate);
|
||||
|
||||
QueryableList<T> setHints(Set<String> hints);
|
||||
|
||||
QueryableList<T> withHint(String hint);
|
||||
|
||||
Long count();
|
||||
}
|
||||
|
|
|
@ -9,10 +9,7 @@ import eu.eudat.queryable.predicates.SinglePredicate;
|
|||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Predicate;
|
||||
import javax.persistence.criteria.Root;
|
||||
import javax.persistence.criteria.*;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -24,7 +21,8 @@ public class QueryableHibernateList<T extends DataEntity<T>> implements Queryabl
|
|||
private CriteriaQuery<T> query;
|
||||
private Class<T> tClass;
|
||||
private Root<T> root;
|
||||
private LinkedList<Predicate> predicates = new LinkedList<Predicate>();
|
||||
private List<Predicate> predicates = new LinkedList<Predicate>();
|
||||
private List<Order> orderings = new LinkedList<>();
|
||||
private Integer length;
|
||||
private Integer offset;
|
||||
private Set<String> hints;
|
||||
|
@ -94,12 +92,12 @@ public class QueryableHibernateList<T extends DataEntity<T>> implements Queryabl
|
|||
}
|
||||
|
||||
public QueryableList<T> orderByAsc(OrderByPredicate<T> predicate) {
|
||||
this.query.orderBy(this.manager.getCriteriaBuilder().desc(predicate.applyPredicate(this.root)));
|
||||
this.orderings.add(this.manager.getCriteriaBuilder().asc(predicate.applyPredicate(this.root)));
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryableList<T> orderByDesc(OrderByPredicate<T> predicate) {
|
||||
this.query.orderBy(this.manager.getCriteriaBuilder().asc(predicate.applyPredicate(this.root)));
|
||||
this.orderings.add(this.manager.getCriteriaBuilder().desc(predicate.applyPredicate(this.root)));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -107,16 +105,14 @@ public class QueryableHibernateList<T extends DataEntity<T>> implements Queryabl
|
|||
CriteriaBuilder criteriaBuilder = this.manager.getCriteriaBuilder();
|
||||
CriteriaQuery<Long> criteriaQuery = criteriaBuilder.createQuery(Long.class);
|
||||
criteriaQuery.select(criteriaBuilder.count(criteriaQuery.from(this.tClass)));
|
||||
Predicate[] array = new Predicate[this.predicates.size()];
|
||||
this.predicates.toArray(array);
|
||||
criteriaQuery.where(array);
|
||||
criteriaQuery.where(this.predicates.toArray(new Predicate[this.predicates.size()]));
|
||||
return this.manager.createQuery(criteriaQuery).getSingleResult();
|
||||
}
|
||||
|
||||
public List<T> toList() {
|
||||
Predicate[] array = new Predicate[this.predicates.size()];
|
||||
this.predicates.toArray(array);
|
||||
this.query.where(array);
|
||||
|
||||
this.query.where(this.predicates.toArray(new Predicate[this.predicates.size()]));
|
||||
if (!this.orderings.isEmpty()) this.query.orderBy(this.orderings);
|
||||
|
||||
TypedQuery<T> typedQuery = this.manager.createQuery(this.query);
|
||||
if (this.offset != null) typedQuery.setFirstResult(this.offset);
|
||||
|
|
|
@ -29,7 +29,7 @@ public class AuthenticationService {
|
|||
|
||||
public Principal Touch(UUID token)
|
||||
{
|
||||
UserToken tokenEntry = this.apiContext.getDatabaseRepository().getUserTokenDao().read(token);
|
||||
UserToken tokenEntry = this.apiContext.getDatabaseRepository().getUserTokenDao().find(token);
|
||||
if (tokenEntry == null || tokenEntry.getExpiresAt().before(new Date())) return null;
|
||||
|
||||
Principal principal = this.Touch(tokenEntry);
|
||||
|
@ -39,7 +39,7 @@ public class AuthenticationService {
|
|||
|
||||
public void Logout(UUID token)
|
||||
{
|
||||
UserToken tokenEntry = this.apiContext.getDatabaseRepository().getUserTokenDao().read(token);
|
||||
UserToken tokenEntry = this.apiContext.getDatabaseRepository().getUserTokenDao().find(token);
|
||||
this.apiContext.getDatabaseRepository().getUserTokenDao().delete(tokenEntry);
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class AuthenticationService {
|
|||
userToken.setIssuedAt(new Date());
|
||||
userToken.setToken(UUID.randomUUID());
|
||||
userToken.setExpiresAt(addADay(new Date()));
|
||||
apiContext.getDatabaseRepository().getUserTokenDao().create(userToken);
|
||||
apiContext.getDatabaseRepository().getUserTokenDao().createOrUpdate(userToken);
|
||||
return Touch(userToken.getToken());
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue