no message

This commit is contained in:
annabakouli 2018-01-17 14:03:51 +02:00
parent a6e79e3551
commit c8caa8d50a
54 changed files with 1363 additions and 429 deletions

View File

@ -5,19 +5,19 @@
<groupId>dmp-backend</groupId>
<artifactId>dmp-backend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<properties>
<project.http.version>1.19.0</project.http.version>
<project.oauth.version>1.19.0</project.oauth.version>
<!--<packaging>war</packaging>-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<properties>
<project.http.version>1.19.0</project.http.version>
<project.oauth.version>1.19.0</project.oauth.version>
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
<org.springframework.version>4.3.8.RELEASE</org.springframework.version>
<!-- <org.springframework.eu.eudat.security.version>3.2.10.RELEASE</org.springframework.eu.eudat.security.version> -->
<dmp-backend-commons.version>0.0.1-SNAPSHOT</dmp-backend-commons.version>
<org.springframework.version>4.3.8.RELEASE</org.springframework.version>
<!-- <org.springframework.eu.eudat.security.version>3.2.10.RELEASE</org.springframework.eu.eudat.security.version> -->
<org.springframework.security.version>4.2.3.RELEASE</org.springframework.security.version>
<com.sun.jersey.version>1.19.1</com.sun.jersey.version>
<org.apache.tomcat.tomcat-jdbc.version>7.0.35</org.apache.tomcat.tomcat-jdbc.version>
@ -40,24 +40,12 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
@ -199,7 +187,11 @@
<version>3.5</version>
</dependency>
<!-- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>-->
</dependencies>
<build>
@ -214,10 +206,6 @@
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>

View File

@ -1,8 +1,12 @@
package eu.eudat;
import eu.eudat.handlers.PrincipalArgumentResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import java.util.List;
@ -11,11 +15,15 @@ import java.util.List;
* Created by ikalyvas on 12/15/2017.
*/
@SpringBootApplication
public class EuDatApplication {
public class EuDatApplication extends SpringBootServletInitializer {
private static final Logger logger = LoggerFactory.getLogger(EuDatApplication.class);
/*@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
return builder.sources(EuDatApplication.class);
}*/
public static void main(String[] args) {
System.setProperty("spring.devtools.restart.enabled", "true");
SpringApplication.run(EuDatApplication.class, args);
}
}

View File

@ -3,8 +3,13 @@ package eu.eudat.configurations;
import eu.eudat.handlers.PrincipalArgumentResolver;
import eu.eudat.services.AuthenticationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.boot.web.servlet.ErrorPage;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
@ -21,4 +26,5 @@ public class WebMVCConfiguration extends WebMvcConfigurerAdapter {
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
argumentResolvers.add(new PrincipalArgumentResolver(this.authenticationService));
}
}

View File

@ -1,15 +0,0 @@
package eu.eudat.controllers;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* Created by ikalyvas on 1/12/2018.
*/
@Controller
public class AngularController {
@RequestMapping({ "/login/twitter", "/login/linkedin"})
public String index() {
return "forward:/index.html";
}
}

View File

@ -0,0 +1,25 @@
package eu.eudat.controllers;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Created by ikalyvas on 1/16/2018.
*/
@Controller
public class CustomErrorController implements ErrorController{
@RequestMapping(value = "/error")
public String error(HttpServletRequest request, HttpServletResponse response) {
return "forward:/index.html";
}
@Override
public String getErrorPath() {
return "/error";
}
}

View File

@ -18,7 +18,6 @@ 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.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

View File

@ -0,0 +1,69 @@
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.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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.UUID;
/**
* Created by ikalyvas on 1/17/2018.
*/
@RestController
@CrossOrigin
public class ExternalDatasets extends BaseController{
@Autowired
public ExternalDatasets(ApiContext apiContext) {
super(apiContext);
}
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getPaged"}, consumes = "application/json", produces = "application/json")
public @ResponseBody ResponseItem<DataTableData<ExternalDatasetListingModel>> getPaged(@RequestBody ExternalDatasetTableRequest datasetTableRequest, Principal principal) {
try {
DataTableData<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getPaged(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), datasetTableRequest);
return new ResponseItem<DataTableData<ExternalDatasetListingModel>>().status(HttpStatus.OK).payload(dataTable);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<DataTableData<ExternalDatasetListingModel>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getWithExternal"}, consumes = "application/json", produces = "application/json")
public @ResponseBody ResponseItem<List<ExternalDatasetListingModel>> getWithExternal(@RequestBody ExternalDatasetCriteria externalDatasetCriteria, Principal principal) {
try {
List<ExternalDatasetListingModel> dataTable = new ExternalDatasetManager().getWithExternal(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), externalDatasetCriteria, this.getApiContext().getRemoteFetcher());
return new ResponseItem<List<ExternalDatasetListingModel>>().payload(dataTable).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<List<ExternalDatasetListingModel>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.POST, value = {"/externaldatasets/getSingle/{id}"}, consumes = "application/json", produces = "application/json")
public @ResponseBody ResponseItem<ExternalDatasetListingModel> getWithExternal(@PathVariable UUID id, Principal principal) {
try {
ExternalDatasetListingModel externalDatasetModel = new ExternalDatasetManager().getSingle(this.getApiContext().getDatabaseRepository().getExternalDatasetDao(), id);
return new ResponseItem<ExternalDatasetListingModel>().payload(externalDatasetModel ).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<ExternalDatasetListingModel>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
}

View File

@ -21,7 +21,6 @@ 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.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
@ -59,105 +58,110 @@ import eu.eudat.proxy.fetching.RemoteFetcher;
@RestController
@CrossOrigin
public class Projects extends BaseController{
public class Projects extends BaseController {
@Autowired
public Projects(ApiContext apiContext){
super(apiContext);
}
@Autowired
public Projects(ApiContext apiContext) {
super(apiContext);
}
@RequestMapping(method = RequestMethod.POST, value = { "/projects/getPaged" }, consumes = "application/json", produces="application/json")
public @ResponseBody ResponseItem<DataTableData<eu.eudat.models.project.Project>> getPaged(@Valid @RequestBody ProjectTableRequest projectTableRequest,Principal principal) {
try {
DataTableData<eu.eudat.models.project.Project> dataTable = new ProjectManager().getPaged(this.getApiContext().getDatabaseRepository().getProjectDao(), projectTableRequest);
return new ResponseItem<DataTableData<eu.eudat.models.project.Project>>().payload(dataTable).status(HttpStatus.OK);
@RequestMapping(method = RequestMethod.POST, value = {"/projects/getPaged"}, consumes = "application/json", produces = "application/json")
public @ResponseBody
ResponseItem<DataTableData<eu.eudat.models.project.ProjectListingModel>> getPaged(@Valid @RequestBody ProjectTableRequest projectTableRequest, Principal principal) {
try {
DataTableData<eu.eudat.models.project.ProjectListingModel> dataTable = new ProjectManager().getPaged(this.getApiContext().getDatabaseRepository().getProjectDao(), projectTableRequest);
return new ResponseItem<DataTableData<eu.eudat.models.project.ProjectListingModel>>().payload(dataTable).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<DataTableData<eu.eudat.models.project.Project>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<DataTableData<eu.eudat.models.project.ProjectListingModel>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.GET, value = { "/projects/getSingle/{id}" }, produces="application/json")
public @ResponseBody ResponseItem<eu.eudat.models.project.Project> getPaged(@PathVariable String id,Principal principal) {
try {
eu.eudat.models.project.Project project = new ProjectManager().getSingle(this.getApiContext().getDatabaseRepository().getProjectDao(), id);
return new ResponseItem<eu.eudat.models.project.Project>().payload(project).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<eu.eudat.models.project.Project>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.GET, value = {"/projects/getSingle/{id}"}, produces = "application/json")
public @ResponseBody
ResponseItem<eu.eudat.models.project.Project> getSingle(@PathVariable String id, Principal principal) {
try {
eu.eudat.models.project.Project project = new ProjectManager().getSingle(this.getApiContext().getDatabaseRepository().getProjectDao(), id);
return new ResponseItem<eu.eudat.models.project.Project>().payload(project).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<eu.eudat.models.project.Project>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@Transactional
@RequestMapping(method = RequestMethod.POST, value = { "/projects/createOrUpdate" }, consumes = "application/json", produces="application/json")
public @ResponseBody ResponseItem<eu.eudat.entities.Project> addProject(@Valid @RequestBody eu.eudat.models.project.Project project, Principal principal) {
try {
ProjectManager.createOrUpdate(this.getApiContext().getDatabaseRepository().getProjectDao(),this.getApiContext().getDatabaseRepository().getUserInfoDao(),project,principal);
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.OK);
}catch (Exception ex){
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@Transactional
@RequestMapping(method = RequestMethod.POST, value = {"/projects/createOrUpdate"}, consumes = "application/json", produces = "application/json")
public @ResponseBody
ResponseItem<eu.eudat.entities.Project> addProject(@Valid @RequestBody eu.eudat.models.project.Project project, Principal principal) {
try {
ProjectManager.createOrUpdate(this.getApiContext().getDatabaseRepository().getProjectDao(), this.getApiContext().getDatabaseRepository().getUserInfoDao(), project, principal);
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.OK);
} catch (Exception ex) {
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@Transactional
@RequestMapping(method = RequestMethod.DELETE, value = { "/projects/inactivate/{id}" }, consumes = "application/json", produces="application/json")
public @ResponseBody ResponseItem<eu.eudat.entities.Project> inactivate(@PathVariable String id,Principal principal) {
try {
Project project = new ProjectManager().inactivate(this.getApiContext().getDatabaseRepository().getProjectDao(),id);
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.OK);
}catch (Exception ex){
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@Transactional
@RequestMapping(method = RequestMethod.DELETE, value = {"/projects/inactivate/{id}"}, consumes = "application/json", produces = "application/json")
public @ResponseBody
ResponseItem<eu.eudat.entities.Project> inactivate(@PathVariable String id, Principal principal) {
try {
Project project = new ProjectManager().inactivate(this.getApiContext().getDatabaseRepository().getProjectDao(), id);
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.OK);
} catch (Exception ex) {
return new ResponseItem<eu.eudat.entities.Project>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.POST, value = { "/projects/getWithExternal" }, consumes = "application/json", produces="application/json")
public @ResponseBody ResponseItem<List<eu.eudat.models.project.Project>> getWithExternal(@RequestBody ProjectCriteriaRequest projectCriteria,Principal principal) {
try {
List<eu.eudat.models.project.Project> dataTable = new ProjectManager().getCriteriaWithExternal(this.getApiContext().getDatabaseRepository().getProjectDao(), projectCriteria,this.getApiContext().getRemoteFetcher());
return new ResponseItem<List<eu.eudat.models.project.Project>>().payload(dataTable).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<List<eu.eudat.models.project.Project>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.POST, value = {"/projects/getWithExternal"}, consumes = "application/json", produces = "application/json")
public @ResponseBody
ResponseItem<List<eu.eudat.models.project.Project>> getWithExternal(@RequestBody ProjectCriteriaRequest projectCriteria, Principal principal) {
try {
List<eu.eudat.models.project.Project> dataTable = new ProjectManager().getCriteriaWithExternal(this.getApiContext().getDatabaseRepository().getProjectDao(), projectCriteria, this.getApiContext().getRemoteFetcher());
return new ResponseItem<List<eu.eudat.models.project.Project>>().payload(dataTable).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<List<eu.eudat.models.project.Project>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.POST, value = { "/projects/get" }, consumes = "application/json", produces="application/json")
public @ResponseBody ResponseItem<List<eu.eudat.models.project.Project>> get(@RequestBody ProjectCriteriaRequest projectCriteria,Principal principal) {
try {
List<eu.eudat.models.project.Project> dataTable = new ProjectManager().getCriteria(this.getApiContext().getDatabaseRepository().getProjectDao(), projectCriteria,this.getApiContext().getRemoteFetcher());
return new ResponseItem<List<eu.eudat.models.project.Project>>().payload(dataTable).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<List<eu.eudat.models.project.Project>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.POST, value = {"/projects/get"}, consumes = "application/json", produces = "application/json")
public @ResponseBody
ResponseItem<List<eu.eudat.models.project.Project>> get(@RequestBody ProjectCriteriaRequest projectCriteria, Principal principal) {
try {
List<eu.eudat.models.project.Project> dataTable = new ProjectManager().getCriteria(this.getApiContext().getDatabaseRepository().getProjectDao(), projectCriteria, this.getApiContext().getRemoteFetcher());
return new ResponseItem<List<eu.eudat.models.project.Project>>().payload(dataTable).status(HttpStatus.OK);
} catch (Exception ex) {
ex.printStackTrace();
return new ResponseItem<List<eu.eudat.models.project.Project>>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@RequestMapping(method = RequestMethod.GET, value = { "/external/projects" }, produces="application/json")
public @ResponseBody ResponseItem<ProjectsExternalSourcesModel> listExternalProjects(@RequestParam(value="query", required=false) String query ,Principal principal){
try {
List<Map<String,String>> remoteRepos = this.getApiContext().getRemoteFetcher().getProjects(query);
ProjectsExternalSourcesModel projectsExternalSourcesModel = new ProjectsExternalSourcesModel().fromExternalItem(remoteRepos);
return new ResponseItem<ProjectsExternalSourcesModel>().payload(projectsExternalSourcesModel).status(HttpStatus.OK);
}
catch(NoURLFound ex) {
return new ResponseItem<ProjectsExternalSourcesModel>().status(HttpStatus.BAD_REQUEST).message("External Url Not Found");
}
catch(HugeResultSet ex) {
return new ResponseItem<ProjectsExternalSourcesModel>().status(HttpStatus.BAD_REQUEST).message("Huge Result Set");
}catch (Exception ex){
return new ResponseItem<ProjectsExternalSourcesModel>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
@RequestMapping(method = RequestMethod.GET, value = {"/external/projects"}, produces = "application/json")
public @ResponseBody
ResponseItem<ProjectsExternalSourcesModel> listExternalProjects(@RequestParam(value = "query", required = false) String query, Principal principal) {
try {
List<Map<String, String>> remoteRepos = this.getApiContext().getRemoteFetcher().getProjects(query);
ProjectsExternalSourcesModel projectsExternalSourcesModel = new ProjectsExternalSourcesModel().fromExternalItem(remoteRepos);
return new ResponseItem<ProjectsExternalSourcesModel>().payload(projectsExternalSourcesModel).status(HttpStatus.OK);
} catch (NoURLFound ex) {
return new ResponseItem<ProjectsExternalSourcesModel>().status(HttpStatus.BAD_REQUEST).message("External Url Not Found");
} catch (HugeResultSet ex) {
return new ResponseItem<ProjectsExternalSourcesModel>().status(HttpStatus.BAD_REQUEST).message("Huge Result Set");
} catch (Exception ex) {
return new ResponseItem<ProjectsExternalSourcesModel>().status(HttpStatus.BAD_REQUEST).message(ex.getMessage());
}
}
// MANAGE PROJECT(S)
// MANAGE PROJECT(S)
// @RequestMapping(method = RequestMethod.GET, value = { "/projects" }, produces="application/json")
// public @ResponseBody ResponseEntity<List<UUID>> listProjects(){
@ -383,8 +387,5 @@ public class Projects extends BaseController{
// }
}

View File

@ -12,7 +12,6 @@ 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.security.core.context.SecurityContextHolder;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
@ -63,28 +62,6 @@ public class Users extends BaseController{
super(apiContext);
}
@RequestMapping(method = RequestMethod.GET, value = { "/user/whoami" }, produces="application/json;charset=UTF-8")
public @ResponseBody ResponseEntity<UserInfo> whoami(){
String userID = null;
try {
userID = SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString();
} catch(NullPointerException ex) {
ex.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
UserInfo userInfo = this.getApiContext().getDatabaseRepository().getUserInfoDao().find(UUID.fromString(userID));
if(userInfo==null) return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
try {
return ResponseEntity.status(HttpStatus.OK).body(userInfo);
}
catch(Exception ex) {
ex.printStackTrace();
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(null);
}
}
@ -95,5 +72,5 @@ public class Users extends BaseController{
}

View File

@ -0,0 +1,7 @@
package eu.eudat.controllers.controllerhandler;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class ExternalDatasets {
}

View File

@ -0,0 +1,23 @@
package eu.eudat.dao.entities;
import eu.eudat.entities.ExternalDataset;
import eu.eudat.entities.Invitation;
import eu.eudat.models.criteria.ExternalDatasetCriteria;
import eu.eudat.models.criteria.InvitationCriteria;
import eu.eudat.queryable.QueryableList;
import java.util.UUID;
/**
* Created by ikalyvas on 1/17/2018.
*/
public interface ExternalDatasetDao {
QueryableList<ExternalDataset> getWithCriteria(ExternalDatasetCriteria criteria);
ExternalDataset createOrUpdate(ExternalDataset item);
ExternalDataset find(UUID id);
Long count();
}

View File

@ -0,0 +1,43 @@
package eu.eudat.dao.entities;
import eu.eudat.dao.databaselayer.service.DatabaseService;
import eu.eudat.entities.ExternalDataset;
import eu.eudat.entities.Project;
import eu.eudat.models.criteria.ExternalDatasetCriteria;
import eu.eudat.queryable.QueryableList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.UUID;
/**
* Created by ikalyvas on 1/17/2018.
*/
@Component("externalDatasetDao")
public class ExternalDatasetDaoImpl implements ExternalDatasetDao {
@Autowired
DatabaseService<ExternalDataset> databaseService;
@Override
public QueryableList<ExternalDataset> getWithCriteria(ExternalDatasetCriteria criteria) {
QueryableList<ExternalDataset> query = this.databaseService.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);
}
@Override
public ExternalDataset find(UUID id) {
return this.databaseService.getQueryable(ExternalDataset.class).where((builder, root) -> builder.equal(root.get("id"),id)).toList().get(0);
}
@Override
public Long count() {
return null;
}
}

View File

@ -31,8 +31,9 @@ public class ProjectDaoImpl implements ProjectDao {
public QueryableList<Project> getWithCriteria(ProjectCriteria criteria) {
QueryableList<Project> query = databaseService.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("created"),criteria.getPeriodEnd()));
if(criteria.getPeriodStart()!=null)query.where((builder, root) -> builder.greaterThan(root.get("created"),criteria.getPeriodStart()));
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()));
query.where((builder, root) -> builder.notEqual(root.get("status"), eu.eudat.models.project.Project.Status.DELETED.getValue()));
return query;
}

View File

@ -23,7 +23,8 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
attributeNodes = {
@NamedAttributeNode("dmp"),@NamedAttributeNode("profile"),@NamedAttributeNode("creator"),
@NamedAttributeNode("services"),@NamedAttributeNode("dataRepositories"),@NamedAttributeNode("registries")})
})public class Dataset implements DataEntity<Dataset> {
})
public class Dataset implements DataEntity<Dataset> {
public static Set<String> getHints() {
return hints;
@ -91,6 +92,13 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
)
private Set<Service> services;
@OneToMany(fetch = FetchType.LAZY)
@JoinTable(name="\"DatasetExternalDataset\"",
joinColumns={@JoinColumn(name="\"Dataset\"", referencedColumnName="\"ID\"")},
inverseJoinColumns={@JoinColumn(name="\"ExternalDataset\"", referencedColumnName="\"Id\"")}
)
private Set<ExternalDataset> externalDatasets;
@Column(name = "\"Status\"", nullable = false)
private Short status;
@ -256,6 +264,13 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
this.reference = reference;
}
public Set<ExternalDataset> getExternalDatasets() {
return externalDatasets;
}
public void setExternalDatasets(Set<ExternalDataset> externalDatasets) {
this.externalDatasets = externalDatasets;
}
@Override
public void update(Dataset entity) {
@ -264,6 +279,7 @@ import com.fasterxml.jackson.annotation.ObjectIdGenerators;
this.setDescription(entity.getDescription());
this.setLabel(entity.getLabel());
this.setProperties(entity.getProperties());
this.setExternalDatasets(entity.getExternalDatasets());
}
@Override

View File

@ -0,0 +1,114 @@
package eu.eudat.entities;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;
import java.util.UUID;
/**
* Created by ikalyvas on 1/17/2018.
*/
@Entity
@Table(name="\"ExternalDataset\"")
public class ExternalDataset implements DataEntity<ExternalDataset>{
@Id
@GeneratedValue
@GenericGenerator(name = "uuid2", strategy = "uuid2")
@Column(name = "\"Id\"", updatable = false, nullable = false, columnDefinition = "BINARY(16)")
private UUID id;
@Column(name = "\"Label\"", nullable = false)
private String label;
@Column(name = "\"Abbreviation\"", nullable = false)
private String abbreviation;
@Column(name = "\"Reference\"", nullable = false)
private String reference;
@Column(name = "\"Created\"", nullable = false)
private Date created;
@Column(name = "\"Modified\"", nullable = false)
private Date modified;
@OneToMany(fetch = FetchType.LAZY)
@JoinTable(name="\"DatasetExternalDataset\"",
joinColumns={@JoinColumn(name="\"ExternalDataset\"", referencedColumnName="\"Id\"")},
inverseJoinColumns={@JoinColumn(name="\"Dataset\"", referencedColumnName="\"ID\"")}
)
private Set<Dataset> datasets;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public Set<Dataset> getDatasets() {
return datasets;
}
public void setDatasets(Set<Dataset> datasets) {
this.datasets = datasets;
}
@Override
public void update(ExternalDataset entity) {
this.label = entity.getLabel();
this.abbreviation = entity.getAbbreviation();
this.modified = new Date();
}
@Override
public Object[] getKeys() {
return new UUID[]{this.id == null ? null : this.id};
}
}

View File

@ -29,9 +29,7 @@ import com.fasterxml.jackson.databind.SerializationFeature;
@Entity
@Table(name="\"Project\"")
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
public class Project implements Serializable,DataEntity<Project> {
private static final long serialVersionUID = -767048645098311154L;
public class Project implements DataEntity<Project> {
public Project () {}

View File

@ -1,5 +1,6 @@
package eu.eudat.managers;
import java.text.ParseException;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@ -55,7 +56,7 @@ public class DataManagementPlanManager {
return datamanagementPlans;
}
public static void createOrUpdate(ApiContext apiContext, DataManagementPlan dataManagementPlan, Principal principal) {
public static void createOrUpdate(ApiContext apiContext, DataManagementPlan dataManagementPlan, Principal principal) throws Exception {
DMP newDmp = dataManagementPlan.toDataModel();
createOrganisationsIfTheyDontExist(newDmp, apiContext.getDatabaseRepository().getOrganisationDao());
createResearchersIfTheyDontExist(newDmp, apiContext.getDatabaseRepository().getResearcherDao());

View File

@ -18,6 +18,7 @@ import eu.eudat.services.ApiContext;
import eu.eudat.utilities.builders.DomainModelConverter;
import org.json.JSONObject;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -56,7 +57,7 @@ public class DatasetManager {
return dataset;
}
public static eu.eudat.entities.Dataset createOrUpdate(ApiContext apiContext, DatasetWizardModel profile) throws InstantiationException, IllegalAccessException{
public static eu.eudat.entities.Dataset createOrUpdate(ApiContext apiContext, DatasetWizardModel profile) throws Exception {
eu.eudat.entities.Dataset dataset = profile.toDataModel();
createRegistriesIfTheyDontExist(apiContext.getDatabaseRepository().getRegistryDao(),dataset);
createDataRepositoriesIfTheyDontExist(apiContext.getDatabaseRepository().getDataRepositoryDao(),dataset);

View File

@ -40,6 +40,6 @@ public class DatasetWizardManager {
return new LinkedList<>();
}
List<AssociatedProfile> profiles = dataManagementPlan.getProfiles();
return profiles.stream().filter(item->item.getLabel().contains(datasetProfileWizardAutocompleteRequest.getCriteria().getLike())).collect(Collectors.toList());
return profiles;
}
}

View File

@ -0,0 +1,59 @@
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.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;
import eu.eudat.queryable.QueryableList;
import eu.eudat.utilities.builders.DomainModelConverter;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class ExternalDatasetManager {
public DataTableData<ExternalDatasetListingModel> getPaged(ExternalDatasetDao externalDatasetDao, ExternalDatasetTableRequest externalDatasetTableRequest) throws InstantiationException, IllegalAccessException {
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);
DataTableData<ExternalDatasetListingModel> externalDatasetDataTableData = new DataTableData<>();
externalDatasetDataTableData.setData(externalDatasetListingmodels);
externalDatasetDataTableData.setTotalCount(items.count());
return externalDatasetDataTableData;
}
public List<ExternalDatasetListingModel> getWithExternal(ExternalDatasetDao externalDatasetDao , ExternalDatasetCriteria criteria, RemoteFetcher remoteFetcher) throws HugeResultSet, NoURLFound, InstantiationException, IllegalAccessException {
QueryableList<eu.eudat.entities.ExternalDataset> items = externalDatasetDao.getWithCriteria(criteria);
List<ExternalDatasetListingModel> externalDatasets = new DomainModelConverter<eu.eudat.entities.ExternalDataset, ExternalDatasetListingModel>().fromDataModel(items.toList(), ExternalDatasetListingModel.class);
List<Map<String, String>> remoteRepos = remoteFetcher.getDatasets(criteria.getLike());
ExternalDatasetModel externalSourcesItemModels = new ExternalDatasetModel().fromExternalItem(remoteRepos);
for (ExternalSourcesItemModel externalListingItem : externalSourcesItemModels) {
ExternalDatasetListingModel externalDatasetListingModel = new ExternalDatasetListingModel();
externalDatasetListingModel.setReference(externalListingItem.getRemoteId());
externalDatasetListingModel.setLabel(externalListingItem.getName());
externalDatasetListingModel.setAbbreviation(externalListingItem.getAbbreviation());
externalDatasets.add(externalDatasetListingModel);
}
return externalDatasets;
}
public ExternalDatasetListingModel getSingle(ExternalDatasetDao externalDatasetDao , UUID id) throws HugeResultSet, NoURLFound, InstantiationException, IllegalAccessException {
ExternalDataset externalDataset = externalDatasetDao.find(id);
ExternalDatasetListingModel externalDatasetModel = new ExternalDatasetListingModel();
externalDatasetModel.fromDataModel(externalDataset);
return externalDatasetModel;
}
}

View File

@ -11,6 +11,7 @@ import eu.eudat.queryable.QueryableList;
import eu.eudat.services.ApiContext;
import eu.eudat.utilities.builders.DomainModelConverter;
import java.text.ParseException;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
@ -21,7 +22,7 @@ import java.util.stream.Collectors;
*/
public class InvitationsManager {
public static void inviteUsers(ApiContext apiContext, Invitation invitation, Principal principal) {
public static void inviteUsers(ApiContext apiContext, Invitation invitation, Principal principal) throws Exception {
UserInfo principalUser = new UserInfo();
principalUser.setId(principal.getId());
List<UserInfoInvitationModel> alreadySignedInUsers = invitation.getUsers().stream().filter(item -> item.getId() != null).collect(Collectors.toList());

View File

@ -1,5 +1,6 @@
package eu.eudat.managers;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@ -13,6 +14,7 @@ import eu.eudat.models.external.ProjectsExternalSourcesModel;
import eu.eudat.models.helpers.DataTableData;
import eu.eudat.models.project.Project;
import eu.eudat.models.project.ProjectCriteriaRequest;
import eu.eudat.models.project.ProjectListingModel;
import eu.eudat.models.project.ProjectTableRequest;
import eu.eudat.models.security.Principal;
import eu.eudat.proxy.config.exceptions.HugeResultSet;
@ -23,11 +25,11 @@ import eu.eudat.utilities.builders.DomainModelConverter;
public class ProjectManager {
public DataTableData<eu.eudat.models.project.Project> getPaged(ProjectDao projectRepository, ProjectTableRequest projectTableRequest) throws IllegalAccessException, InstantiationException {
public DataTableData<eu.eudat.models.project.ProjectListingModel> getPaged(ProjectDao projectRepository, ProjectTableRequest projectTableRequest) throws IllegalAccessException, InstantiationException {
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.Project> projects = new DomainModelConverter<eu.eudat.entities.Project, Project>().fromDataModel(pagedItems.toList(), eu.eudat.models.project.Project.class);
DataTableData<eu.eudat.models.project.Project> dataTable = new DataTableData<eu.eudat.models.project.Project>();
List<eu.eudat.models.project.ProjectListingModel> projects = new DomainModelConverter<eu.eudat.entities.Project, ProjectListingModel>().fromDataModel(pagedItems.toList(), eu.eudat.models.project.ProjectListingModel.class);
DataTableData<eu.eudat.models.project.ProjectListingModel> dataTable = new DataTableData<eu.eudat.models.project.ProjectListingModel>();
dataTable.setData(projects);
dataTable.setTotalCount(items.count());
return dataTable;
@ -61,6 +63,7 @@ public class ProjectManager {
project.setStatus((short) 0);
projects.add(project);
}
return projects;
}
@ -70,7 +73,7 @@ public class ProjectManager {
return projects;
}
public static void createOrUpdate(ProjectDao projectRepository, UserInfoDao userInfoRepository, eu.eudat.models.project.Project project, Principal principal) {
public static void createOrUpdate(ProjectDao projectRepository, UserInfoDao userInfoRepository, eu.eudat.models.project.Project project, Principal principal) throws ParseException {
eu.eudat.entities.Project projectEntity = project.toDataModel();
projectEntity.setCreationUser(userInfoRepository.find(principal.getId()));
projectRepository.createOrUpdate(projectEntity);

View File

@ -4,5 +4,5 @@ import eu.eudat.entities.DataEntity;
public interface DataModel<T extends DataEntity> {
void fromDataModel(T entity) throws InstantiationException, IllegalAccessException;
T toDataModel();
T toDataModel() throws Exception;
}

View File

@ -2,9 +2,11 @@ package eu.eudat.models.criteria;
import eu.eudat.entities.DMP;
import eu.eudat.models.project.Project;
import eu.eudat.models.project.ProjectCriteriaModel;
import eu.eudat.utilities.builders.DomainModelConverter;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
@ -12,7 +14,7 @@ import java.util.stream.Collectors;
public class DataManagementPlanCriteria extends Criteria<DMP>{
private Date periodStart;
private Date periodEnd;
private List<Project> projects;
private List<ProjectCriteriaModel> projects;
public Date getPeriodStart() {
return periodStart;
}
@ -29,15 +31,20 @@ public class DataManagementPlanCriteria extends Criteria<DMP>{
this.periodEnd = periodEnd;
}
public List<Project> getProjects() {
public List<ProjectCriteriaModel> getProjects() {
return projects;
}
public void setProjects(List<Project> projects) {
public void setProjects(List<ProjectCriteriaModel> projects) {
this.projects = projects;
}
public List<eu.eudat.entities.Project> getProjectEntities(){
return new DomainModelConverter<eu.eudat.entities.Project,Project>().toDataModel(this.projects);
public List<eu.eudat.entities.Project> getProjectEntities() {
try {
return new DomainModelConverter<eu.eudat.entities.Project,ProjectCriteriaModel>().toDataModel(this.projects);
} catch (Exception e) {
e.printStackTrace();
return new LinkedList<>();
}
}
}

View File

@ -0,0 +1,9 @@
package eu.eudat.models.criteria;
import eu.eudat.entities.ExternalDataset;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class ExternalDatasetCriteria extends Criteria<ExternalDataset> {
}

View File

@ -5,6 +5,7 @@ import eu.eudat.models.datasetprofile.DatasetProfileListingModel;
import eu.eudat.models.dmp.DataManagementPlan;
import eu.eudat.utilities.builders.DomainModelConverter;
import java.text.ParseException;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@ -127,7 +128,7 @@ public class Dataset implements DataModel<eu.eudat.entities.Dataset>{
this.created = entity.getCreated();
}
public eu.eudat.entities.Dataset toDataModel(){
public eu.eudat.entities.Dataset toDataModel() throws Exception {
eu.eudat.entities.Dataset entity = new eu.eudat.entities.Dataset();
entity.setId(this.id);
entity.setLabel(this.label);

View File

@ -163,7 +163,7 @@ public class DatasetWizardModel implements DataModel<Dataset> {
}
@Override
public Dataset toDataModel() {
public Dataset toDataModel() throws Exception {
eu.eudat.entities.Dataset entity = new eu.eudat.entities.Dataset();
entity.setId(this.id);
entity.setLabel(this.label);

View File

@ -10,6 +10,7 @@ import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@ -154,7 +155,7 @@ public class DataManagementPlan implements DataModel<DMP>{
}
@Override
public DMP toDataModel() {
public DMP toDataModel() throws Exception {
DMP dataManagementPlanEntity = new DMP();
dataManagementPlanEntity.setId(this.id);
if(this.organisations!=null&&!this.organisations.isEmpty())dataManagementPlanEntity.setOrganisations(new HashSet<eu.eudat.entities.Organisation>(new DomainModelConverter<eu.eudat.entities.Organisation,Organisation>().toDataModel(this.organisations)));

View File

@ -0,0 +1,21 @@
package eu.eudat.models.external;
import java.util.List;
import java.util.Map;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class ExternalDatasetModel extends ExternalListingItem<ExternalDatasetModel> {
@Override
public ExternalDatasetModel fromExternalItem(List<Map<String, String>> values) {
for(Map<String,String> item : values){
ExternalSourcesItemModel model = new ExternalSourcesItemModel();
model.setId(item.get("pid"));
model.setUri(item.get("uri"));
model.setName(item.get("name"));
this.add(model);
}
return this;
}
}

View File

@ -0,0 +1,91 @@
package eu.eudat.models.externaldataset;
import eu.eudat.entities.ExternalDataset;
import eu.eudat.models.DataModel;
import javax.persistence.Column;
import java.util.Date;
import java.util.UUID;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class ExternalDatasetListingModel implements DataModel<ExternalDataset> {
private UUID id;
private String label;
private String abbreviation;
private String reference;
private Date created;
private Date modified;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
@Override
public void fromDataModel(ExternalDataset entity) throws InstantiationException, IllegalAccessException {
this.id = entity.getId();
this.abbreviation = entity.getAbbreviation();
this.label = entity.getLabel();
this.modified = entity.getModified();
this.created = entity.getCreated();
this.reference = entity.getReference();
}
@Override
public ExternalDataset toDataModel() throws Exception {
ExternalDataset externalDataset = new ExternalDataset();
externalDataset.setAbbreviation(this.abbreviation);
externalDataset.setCreated(this.created != null ? this.created : new Date());
externalDataset.setLabel(this.label);
externalDataset.setId(this.id);
externalDataset.setModified(this.modified);
externalDataset.setReference(this.reference);
return externalDataset;
}
}

View File

@ -0,0 +1,10 @@
package eu.eudat.models.externaldataset;
import eu.eudat.models.criteria.ExternalDatasetCriteria;
import eu.eudat.models.helpers.requests.TableRequest;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class ExternalDatasetTableRequest extends TableRequest<ExternalDatasetCriteria> {
}

View File

@ -10,202 +10,209 @@ import eu.eudat.models.DataModel;
import eu.eudat.models.dmp.DataManagementPlan;
public class Project implements DataModel<eu.eudat.entities.Project>{
public class Project implements DataModel<eu.eudat.entities.Project> {
public enum Status {
ACTIVE((short) 1), INACTIVE((short) 0),DELETED((short)99);
public enum Status {
ACTIVE((short) 1), INACTIVE((short) 0), DELETED((short) 99);
private short value;
private Status(short value) { this.value = value; }
public short getValue(){return value;}
public static Status fromInteger(int value) {
switch (value) {
case 0:
return ACTIVE;
case 1:
return INACTIVE;
case 99:
return INACTIVE;
default:
throw new RuntimeException("Unsupported Project Status");
}
}
}
private short value;
private Status(short value) {
this.value = value;
}
public short getValue() {
return value;
}
public static Status fromInteger(int value) {
switch (value) {
case 0:
return ACTIVE;
case 1:
return INACTIVE;
case 99:
return INACTIVE;
default:
throw new RuntimeException("Unsupported Project Status");
}
}
}
private UUID id;
private UUID id;
private List<DataManagementPlan> dmps;
private List<DataManagementPlan> dmps;
private String label;
private String label;
private String abbreviation;
private String abbreviation;
private String reference;
private String reference;
private String uri;
private String uri;
private String definition;
private String definition;
private Date startDate;
private Date startDate;
private Date endDate;
private Date endDate;
private Status status;
private Status status;
private UserInfo creationUser;
private UserInfo creationUser;
private Date created;
private Date created;
private Date modified;
private Date modified;
private String description;
private String description;
public UUID getId() {
return id;
}
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public void setId(UUID id) {
this.id = id;
}
public List<DataManagementPlan> getDmps() {
return dmps;
}
public List<DataManagementPlan> getDmps() {
return dmps;
}
public void setDmps(List<DataManagementPlan> dmps) {
this.dmps = dmps;
}
public void setDmps(List<DataManagementPlan> dmps) {
this.dmps = dmps;
}
public String getLabel() {
return label;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public void setLabel(String label) {
this.label = label;
}
public String getAbbreviation() {
return abbreviation;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getReference() {
return reference;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getUri() {
return uri;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getDefinition() {
return definition;
}
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
public Date getStartDate() {
return startDate;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public short getStatus() {
return status.getValue();
}
public short getStatus() {
return status.getValue();
}
public void setStatus(Short status) {
this.status = Status.fromInteger(status);
}
public void setStatus(Short status) {
this.status = Status.fromInteger(status);
}
public UserInfo getCreationUser() {
return creationUser;
}
public UserInfo getCreationUser() {
return creationUser;
}
public void setCreationUser(UserInfo creationUser) {
this.creationUser = creationUser;
}
public void setCreationUser(UserInfo creationUser) {
this.creationUser = creationUser;
}
public Date getCreated() {
return created;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
public void setCreated(Date created) {
this.created = created;
}
public Date getModified() {
return modified;
}
public Date getModified() {
return modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public void setModified(Date modified) {
this.modified = modified;
}
public String getDescription() {
return description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public void fromDataModel(eu.eudat.entities.Project entity) throws InstantiationException, IllegalAccessException {
this.id = entity.getId();
this.label = entity.getLabel();
this.abbreviation = entity.getAbbreviation();
this.reference = entity.getReference();
this.uri = entity.getUri();
this.definition = entity.getDefinition();
this.startDate = entity.getStartdate();
this.endDate = entity.getEnddate();
this.setStatus(entity.getStatus());
this.created = entity.getCreated();
this.modified = entity.getModified();
this.description = entity.getDescription();
@Override
public void fromDataModel(eu.eudat.entities.Project entity) throws InstantiationException, IllegalAccessException {
this.id = entity.getId();
this.label = entity.getLabel();
this.abbreviation = entity.getAbbreviation();
this.reference = entity.getReference();
this.uri = entity.getUri();
this.definition = entity.getDefinition();
this.startDate = entity.getStartdate();
this.endDate = entity.getEnddate();
this.setStatus(entity.getStatus());
this.created = entity.getCreated();
this.modified = entity.getModified();
this.description = entity.getDescription();
}
}
@Override
public eu.eudat.entities.Project toDataModel() {
eu.eudat.entities.Project entity = new eu.eudat.entities.Project();
entity.setId(this.id);
entity.setAbbreviation(this.abbreviation);
entity.setLabel(this.label);
entity.setReference(this.reference);
entity.setUri(this.uri);
entity.setDefinition(this.definition);
entity.setStartdate(this.startDate);
entity.setCreated(this.created == null? new Date():this.created);
entity.setEnddate(this.endDate);
entity.setStatus(this.status!=null?this.getStatus():Status.ACTIVE.getValue());
entity.setModified(new Date());
entity.setDescription(this.description);
return entity;
}
@Override
public eu.eudat.entities.Project toDataModel() {
eu.eudat.entities.Project entity = new eu.eudat.entities.Project();
entity.setId(this.id);
entity.setAbbreviation(this.abbreviation);
entity.setLabel(this.label);
entity.setReference(this.reference);
entity.setUri(this.uri);
entity.setDefinition(this.definition);
entity.setStartdate(this.startDate);
entity.setCreated(this.created == null ? new Date() : this.created);
entity.setEnddate(this.endDate);
entity.setStatus(this.status != null ? this.getStatus() : Status.ACTIVE.getValue());
entity.setModified(new Date());
entity.setDescription(this.description);
return entity;
}
}

View File

@ -0,0 +1,34 @@
package eu.eudat.models.project;
import eu.eudat.entities.*;
import eu.eudat.entities.Project;
import eu.eudat.models.DataModel;
import java.util.UUID;
/**
* Created by ikalyvas on 1/15/2018.
*/
public class ProjectCriteriaModel implements DataModel<eu.eudat.entities.Project> {
private UUID id;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
@Override
public void fromDataModel(Project entity) throws InstantiationException, IllegalAccessException {
this.id = entity.getId();
}
@Override
public Project toDataModel() {
Project project = new Project();
project.setId(this.id);
return project;
}
}

View File

@ -0,0 +1,205 @@
package eu.eudat.models.project;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import eu.eudat.entities.UserInfo;
import eu.eudat.models.DataModel;
import eu.eudat.models.dmp.DataManagementPlan;
public class ProjectListingModel implements DataModel<eu.eudat.entities.Project> {
public enum Status {
ACTIVE((short) 1), INACTIVE((short) 0), DELETED((short) 99);
private short value;
private Status(short value) {
this.value = value;
}
public short getValue() {
return value;
}
public static Status fromInteger(int value) {
switch (value) {
case 0:
return ACTIVE;
case 1:
return INACTIVE;
case 99:
return INACTIVE;
default:
throw new RuntimeException("Unsupported Project Status");
}
}
}
private UUID id;
private List<DataManagementPlan> dmps;
private String label;
private String abbreviation;
private String reference;
private String uri;
private String definition;
private String startDate;
private String endDate;
private Status status;
private UserInfo creationUser;
private String created;
private String modified;
private String description;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public List<DataManagementPlan> getDmps() {
return dmps;
}
public void setDmps(List<DataManagementPlan> dmps) {
this.dmps = dmps;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public String getUri() {
return uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
this.definition = definition;
}
public short getStatus() {
return status.getValue();
}
public void setStatus(Short status) {
this.status = Status.fromInteger(status);
}
public UserInfo getCreationUser() {
return creationUser;
}
public void setCreationUser(UserInfo creationUser) {
this.creationUser = creationUser;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getCreated() {
return created;
}
public void setCreated(String created) {
this.created = created;
}
public String getModified() {
return modified;
}
public void setModified(String modified) {
this.modified = modified;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public void fromDataModel(eu.eudat.entities.Project entity) throws InstantiationException, IllegalAccessException {
this.id = entity.getId();
this.label = entity.getLabel();
this.abbreviation = entity.getAbbreviation();
this.reference = entity.getReference();
this.uri = entity.getUri();
this.definition = entity.getDefinition();
this.startDate = entity.getStartdate().toString();
this.endDate = entity.getEnddate().toString();
this.setStatus(entity.getStatus());
this.created = entity.getCreated().toString();
this.modified = entity.getModified().toString();
this.description = entity.getDescription();
}
@Override
public eu.eudat.entities.Project toDataModel() throws Exception {
throw new Exception("Not Implemented");
}
}

View File

@ -27,17 +27,18 @@ public class ConfigLoader {
private void setExternalUrls() {
String fileUrl = this.environment.getProperty("configuration.externalUrls");
System.out.println("Loaded also config file: " + fileUrl);
InputStream is = null;
String current=null;
InputStream is = null;
try {
current = new java.io.File( "." ).getCanonicalPath();
JAXBContext jaxbContext = JAXBContext.newInstance(ExternalUrls.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
is = new URL(fileUrl).openStream();
is = new URL("file:///C:/Users/ikalyvas/Documents/Projects/OpenAIRE-EUDAT-DMP-service-pilot/dmp-backend/src/main/resources/ExternalUrls.xml").openStream();
externalUrls = (ExternalUrls) jaxbUnmarshaller.unmarshal(is);
// System.out.println(new ObjectMapper().writeValueAsString(externalUrls));
} catch (Exception ex) {
//log the error and shutdown the system (that's a critical error)
ex.printStackTrace();
System.exit(0);
System.out.println("Cannot find in folder"+current);
} finally {
try {
if (is != null) is.close();

View File

@ -6,12 +6,7 @@ import java.io.Serializable;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import eu.eudat.proxy.config.entities.OrganisationUrls;
import eu.eudat.proxy.config.entities.ProjectUrls;
import eu.eudat.proxy.config.entities.RegistryUrls;
import eu.eudat.proxy.config.entities.RepositoryUrls;
import eu.eudat.proxy.config.entities.ResearcherUrls;
import eu.eudat.proxy.config.entities.ServiceUrls;
import eu.eudat.proxy.config.entities.*;
@XmlRootElement
public class ExternalUrls implements Serializable {
@ -28,7 +23,7 @@ public class ExternalUrls implements Serializable {
ServiceUrls services;
ResearcherUrls researchers;
OrganisationUrls organisations;
DatasetUrls datasets;
public RegistryUrls getRegistries() {
@ -97,16 +92,14 @@ public class ExternalUrls implements Serializable {
this.maxresults = maxresults;
}
public DatasetUrls getDatasets() {
return datasets;
}
@XmlElement(name = "datasets")
public void setDatasets(DatasetUrls datasets) {
this.datasets = datasets;
}
}

View File

@ -0,0 +1,32 @@
package eu.eudat.proxy.config.entities;
import eu.eudat.proxy.config.FetchStrategy;
import eu.eudat.proxy.config.UrlConfig;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import java.util.List;
/**
* Created by ikalyvas on 1/17/2018.
*/
public class DatasetUrls {
List<UrlConfig> urls;
FetchStrategy fetchMode;
public List<UrlConfig> getUrls() {
return urls;
}
@XmlElementWrapper
@XmlElement(name = "urlConfig")
public void setUrls(List<UrlConfig> urls) {
this.urls = urls;
}
public FetchStrategy getFetchMode() {
return fetchMode;
}
@XmlElement(name = "fetchMode")
public void setFetchMode(FetchStrategy fetchMode) {
this.fetchMode = fetchMode;
}
}

View File

@ -79,6 +79,13 @@ public class RemoteFetcher {
return getAll(urlConfigs, fetchStrategy, query);
}
@Cacheable("datasets")
public List<Map<String, String>> getDatasets(String query) throws NoURLFound, HugeResultSet {
List<UrlConfig> urlConfigs = configLoader.getExternalUrls().getDatasets().getUrls();
FetchStrategy fetchStrategy = configLoader.getExternalUrls().getDatasets().getFetchMode();
return getAll(urlConfigs, fetchStrategy, query);
}
@ -89,9 +96,6 @@ public class RemoteFetcher {
Collections.sort(urlConfigs, (config1, config2) -> config1.getOrdinal().compareTo(config2.getOrdinal()));
//for the time being, we only get the first one. in the near future we can add more than one (parallel stream)
//urlConfigs.parallelStream().map(mapper).reduce() etc etc
return getAllResultsFromUrl(urlConfigs.get(0).getUrl(), fetchStrategy, urlConfigs.get(0).getDataPath(), urlConfigs.get(0).getPaginationPath(), query);
}

View File

@ -5,5 +5,5 @@ import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
public interface SinglePredicate<T> {
Predicate applyPredicate(CriteriaBuilder builder, Root<T> root);
Predicate applyPredicate(CriteriaBuilder builder, Root<T> root) ;
}

View File

@ -3,13 +3,12 @@ package eu.eudat.security;
import java.io.IOException;
import java.security.GeneralSecurityException;
import eu.eudat.exceptions.UnauthorisedException;
import eu.eudat.models.login.LoginInfo;
import eu.eudat.models.security.Principal;
import eu.eudat.security.validators.TokenValidatorFactory;
import eu.eudat.security.validators.TokenValidatorFactoryImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.core.AuthenticationException;
import org.springframework.stereotype.Component;
import eu.eudat.dao.entities.UserInfoDao;
@ -22,7 +21,7 @@ public class CustomAuthenticationProvider {
@Autowired private TokenValidatorFactory tokenValidatorFactory;
public Principal authenticate(LoginInfo credentials) throws AuthenticationException, GeneralSecurityException {
public Principal authenticate(LoginInfo credentials) throws GeneralSecurityException {
String token = credentials.getTicket();
try {
Principal principal = this.tokenValidatorFactory.getProvider(credentials.getProvider()).validateToken(credentials);
@ -30,10 +29,10 @@ public class CustomAuthenticationProvider {
} catch (NonValidTokenException e) {
e.printStackTrace();
System.out.println("Could not validate a user by his token! Reason: " + e.getMessage());
throw new AuthenticationServiceException("Token validation failed - Not a valid token");
throw new UnauthorisedException("Token validation failed - Not a valid token");
} catch (IOException e) {
e.printStackTrace();
throw new AuthenticationServiceException("IO Exeption");
throw new UnauthorisedException("IO Exeption");
}
}
}

View File

@ -27,4 +27,5 @@ public interface DatabaseRepository {
DMPResearcherDao getDmpResearcherDao();
CredentialDao getCredentialDao();
UserTokenDao getUserTokenDao();
ExternalDatasetDao getExternalDatasetDao();
}

View File

@ -29,6 +29,8 @@ public class DatabaseRepositoryImpl implements DatabaseRepository{
private InvitationDao invitationDao;
private CredentialDao credentialDao;
private UserTokenDao userTokenDao;
private ExternalDatasetDao externalDatasetDao;
@Autowired
private void setDataRepositoryDao(DataRepositoryDao dataRepositoryDao) {
this.dataRepositoryDao = dataRepositoryDao;
@ -208,4 +210,14 @@ public class DatabaseRepositoryImpl implements DatabaseRepository{
public void setUserTokenDao(UserTokenDao userTokenDao) {
this.userTokenDao = userTokenDao;
}
@Override
public ExternalDatasetDao getExternalDatasetDao() {
return externalDatasetDao;
}
@Autowired
public void setExternalDatasetDao(ExternalDatasetDao externalDatasetDao) {
this.externalDatasetDao = externalDatasetDao;
}
}

View File

@ -5,12 +5,14 @@ package eu.eudat.utilities.builders;
*/
import eu.eudat.entities.DataEntity;
import eu.eudat.models.DataModel;
import java.text.ParseException;
import java.util.List;
import java.util.LinkedList;
public class DomainModelConverter<T extends DataEntity,U extends DataModel<T>> {
public List<T> toDataModel(List<U> models){
public List<T> toDataModel(List<U> models) throws Exception {
List<T> entities = new LinkedList<>();
for(U model : models){
entities.add(model.toDataModel());

View File

@ -19,13 +19,13 @@ public class ProjectTableRequestValidator implements Validator {
@Override
public void validate(Object obj, Errors errors) {
ProjectTableRequest projectTableRequest = (ProjectTableRequest) obj;
if(projectTableRequest.getCriteria().getPeriodEnd()!=null&&projectTableRequest.getCriteria().getPeriodEnd()!=null&&projectTableRequest.getCriteria().getPeriodEnd().before(projectTableRequest.getCriteria().getPeriodStart())){
if (projectTableRequest.getCriteria() != null && projectTableRequest.getCriteria().getPeriodEnd() != null && projectTableRequest.getCriteria().getPeriodEnd() != null && projectTableRequest.getCriteria().getPeriodEnd().before(projectTableRequest.getCriteria().getPeriodStart())) {
errors.rejectValue("criteria.periodStart", "projectTableRequest.periodStart.overlapping");
}
if(projectTableRequest.getOffset()<0){
if (projectTableRequest.getOffset() < 0) {
errors.rejectValue("offset", "projectTableRequest.offset.negative");
}
if(projectTableRequest.getLength()<0){
if (projectTableRequest.getLength() < 0) {
errors.rejectValue("length", "projectTableRequest.length.negative");
}
}

View File

@ -101,6 +101,17 @@
</organisations>
<datasets>
<urls>
<urlConfig>
<ordinal>1</ordinal>
<url>https://eestore.paas2.uninett.no/api/datasetrepo/</url>
<datapath>$['data'][*]['attributes']['pid','name','uri','description']</datapath>
<paginationpath>$['meta']['pagination']['page','pages','count']</paginationpath>
</urlConfig>
</urls>
<fetchMode>FIRST</fetchMode> <!-- EITHER 'FIRST' OR 'ALL' -->
</datasets>

View File

@ -2,49 +2,46 @@
#eu.eudat.security.portmapping.http = 7081
#eu.eudat.security.portmapping.https = 7444
########################/Security########################################
server.port = 8080
server.port=8080
logging.file=/logs/spring-boot-logging.log
##########################Persistence##########################################
database.driver-class-name=org.postgresql.Driver
database.url = jdbc:postgresql://develdb1.madgik.di.uoa.gr:5432/dmptool
database.username = dmptool
database.password = dmpt00lu$r
database.url=jdbc:postgresql://develdb1.madgik.di.uoa.gr:5432/dmptool
database.username=dmptool
database.password=dmpt00lu$r
##########################/Persistence##########################################
###################Allowed Proxy Service Host ############################
eu.eudat.proxy.allowed.host = https://eestore.paas2.uninett.no
configuration.externalUrls = file:///C:\\Users\\ikalyvas\\Documents\\Projects\\OpenAIRE-EUDAT-DMP-service-pilot\\dmp-backend\\src\\main\\resources\\ExternalUrls.xml
eu.eudat.proxy.allowed.host=https://eestore.paas2.uninett.no
configuration.externalUrls=/classes/ExternalUrls.xml
#######################################################
spring.resources.add-mappings=true
########################/Email#############################
spring.mail.default-encoding=UTF-8
spring.mail.host=smtp.gmail.com
spring.mail.username=kalivasioan@gmail.com
spring.mail.password=A3b*1*92giannis
spring.mail.password=A3b*1*92gianniskalyvas
spring.mail.port=587
spring.mail.protocol=smtp
spring.mail.test-connection=false
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
mail.subject = Invitation to DMP Plan {dmpname}
mail.content = You have been invited to {dmpname} data management plan.Follow the link localhost:4200/invitation/{invitationID} to submit it
mail.from = citesagrdev@gmail.com
mail.subject=Invitation to DMP Plan {dmpname}
mail.content=You have been invited to {dmpname} data management plan.Follow the link http://dl043.madgik.di.uoa.gr/invitation/{invitationID} to submit it
mail.from=citesagrdev@gmail.com
########################FACEBOOK LOGIN Properties#############################
facebook.login.clientId = 110586756143149
facebook.login.clientSecret = 522a847f05c873d0222c85109e24f55a
facebook.login.namespace = eudat
facebook.login.clientId=110586756143149
facebook.login.clientSecret=522a847f05c873d0222c85109e24f55a
facebook.login.namespace=eudat
########################GOOGLE LOGIN Properties#############################
google.login.clientId = 524432312250-sc9qsmtmbvlv05r44onl6l93ia3k9deo.apps.googleusercontent.com
google.login.clientId=524432312250-sc9qsmtmbvlv05r44onl6l93ia3k9deo.apps.googleusercontent.com
########################LINKEDIN LOGIN Properties#############################HiR4hQH9HNubKC5iKQy0l4mAZ
linkedin.login.clientId = 86bl8vfk77clh9
linkedin.login.clientSecret = 2OCO9e3wKylW05Tt
linkedin.login.redirect_uri = http://localhost:4200/login/linkedin
linkedin.login.clientId=86bl8vfk77clh9
linkedin.login.clientSecret=2OCO9e3wKylW05Tt
linkedin.login.redirect_uri=http://dl043.madgik.di.uoa.gr/dmp/login/linkedin
########################LINKEDIN LOGIN Properties#############################
twitter.login.clientId = HiR4hQH9HNubKC5iKQy0l4mAZ
twitter.login.clientSecret = 9KZHgkqUO2QFnELSL14jeUvfUacWX23rqD8OW8X0xoRDXOSfKH
twitter.login.redirect_uri = http://localhost:4200/login/twitter
twitter.login.clientId=HiR4hQH9HNubKC5iKQy0l4mAZ
twitter.login.clientSecret=9KZHgkqUO2QFnELSL14jeUvfUacWX23rqD8OW8X0xoRDXOSfKH
twitter.login.redirect_uri=http://dl043.madgik.di.uoa.gr/dmp/login/twitter
########################Persistence/Hibernate/Batch##############################
#persistence.hibernate.jdbc.batch_size = 30
#persistence.hibernate.order_inserts = true
@ -52,8 +49,6 @@ twitter.login.redirect_uri = http://localhost:4200/login/twitter
#persistence.hibernate.batch_versioned_data = true
#persistence.hibernate.jdbc.batch_versioned_data = DELAYED_ACQUISITION_AND_RELEASE_AFTER_TRANSACTION
########################Persistence/Hibernate/Batch##############################
########################Persistence/Hibernate/Connection pool####################
#persistence.hibernate.connectionpool.provider_class = org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
#persistence.hibernate.connectionpool.c3p0.min_size = 5

View File

@ -1,3 +1,4 @@
import { HostConfiguration } from './app.constants';
import { LoginOptions } from './user-management/utilties/LoginOptions';
import { LoginModule } from './user-management/login.module';

View File

@ -69,7 +69,7 @@
<div layout="row" class="full-width text-right" align="end">
<button mat-raised-button color="primary" (click)="cancel()" type="button">{{'DMP-EDITOR.ACTIONS.CANCEL' | translate}}</button>
<button mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button>
<button *ngIf="!isNew" mat-raised-button color="primary" (click)="invite()" type="button">{{'DMP-EDITOR.ACTIONS.INVITE' | translate}}</button>
<button mat-raised-button color="primary" type="submit">{{'DMP-EDITOR.ACTIONS.SAVE' | translate}}</button>
<button *ngIf="!isNew" mat-raised-button color="primary" type="submit" (click)="delete()">{{'DMP-EDITOR.ACTIONS.DELETE' | translate}}</button>
</div>

View File

@ -20,11 +20,7 @@
.ng-sidebar-container {
overflow: inherit !important;
position: fixed !important;
height: 100%;
min-height: 100%;
width: 100%;
min-width: 100%;
}
/* .ng-sidebar__content {

View File

@ -0,0 +1,4 @@
import { BaseCriteriaErrorModel } from '../BaseCriteriaErrorModel';
export class ExternalDatasetCriteriaErrorModel extends BaseCriteriaErrorModel {
}

View File

@ -0,0 +1,4 @@
import { BaseCriteria } from '../BaseCriteria';
export class ExternalDatasetCriteria extends BaseCriteria{
}

View File

@ -1,11 +1,15 @@
import { BaseErrorModel } from '../error/BaseErrorModel';
import { Serializable } from "../Serializable";
import { FormGenerator } from "../interfaces/FormGenerator";
import { FormGroup, FormBuilder } from "@angular/forms";
export class ExternalDatasetModel implements Serializable<ExternalDatasetModel>, FormGenerator<FormGroup>{
export class ExternalDatasetModel implements Serializable<ExternalDatasetModel> {
public abbreviation: String;
public id: String;
public label: String;
public reference: String;
public errorModel: BaseErrorModel;
fromJSONObject(item: any): ExternalDatasetModel {
this.abbreviation = item.abbreviation;
this.id = item.id;
@ -14,4 +18,13 @@ export class ExternalDatasetModel implements Serializable<ExternalDatasetModel>
return this;
}
buildForm(): FormGroup {
return new FormBuilder().group({
id: [this.id],
abbreviation: [this.abbreviation],
label: [this.label],
reference: [this.reference]
})
}
}

View File

@ -0,0 +1,44 @@
import { ProjectCriteria } from '../../models/criteria/project/ProjectCriteria';
import { RequestItem } from '../../models/criteria/RequestItem';
import { ExternalDatasetModel } from '../../models/external-dataset/ExternalDatasetModel';
import { DataTableData } from '../../models/data-table/DataTableData';
import { ExternalDatasetCriteria } from '../../models/criteria/external-dataset/ExternalDatasetCriteria';
import { DataTableRequest } from '../../models/data-table/DataTableRequest';
import { Injectable } from '@angular/core';
import { HttpHeaders } from '@angular/common/http';
import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service';
import { HostConfiguration } from './../../app.constants';
import { Observable } from 'rxjs/Observable';
@Injectable()
export class ExternalDatasetService {
private actionUrl: string;
private headers: HttpHeaders;
constructor(private http: BaseHttpService) {
this.actionUrl = HostConfiguration.Server + 'externaldatasets/';
this.headers = new HttpHeaders();
this.headers = this.headers.set('Content-Type', 'application/json');
this.headers = this.headers.set('Accept', 'application/json');
}
getPaged(dataTableRequest: DataTableRequest<ExternalDatasetCriteria>): Observable<DataTableData<ExternalDatasetModel>> {
return this.http.post<DataTableData<ExternalDatasetModel>>(this.actionUrl + 'getPaged', dataTableRequest, { headers: this.headers });
}
/* get(requestItem: RequestItem<ProjectCriteria>): Observable<ProjectModel[]> {
return this.http.post<ProjectModel[]>(this.actionUrl + 'get', requestItem, { headers: this.headers });
}*/
getWithExternal(requestItem: RequestItem<ExternalDatasetCriteria>): Observable<ExternalDatasetModel[]> {
return this.http.post<ExternalDatasetModel[]>(this.actionUrl + 'getWithExternal', requestItem, { headers: this.headers });
}
getSingle(id: string): Observable<ExternalDatasetModel> {
return this.http.get<ExternalDatasetModel>(this.actionUrl + 'getSingle/' + id, { headers: this.headers });
}
}

View File

@ -0,0 +1,111 @@
2018-01-15 11:01:38.149 INFO 13992 --- [restartedMain] eu.eudat.EuDatApplication : Starting EuDatApplication on DEVEL-21 with PID 13992 (C:\Users\ikalyvas\Documents\Projects\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\target\classes started by ikalyvas in C:\Users\ikalyvas\Documents\Projects\OpenAIRE-EUDAT-DMP-service-pilot)
2018-01-15 11:01:38.151 INFO 13992 --- [restartedMain] eu.eudat.EuDatApplication : No active profile set, falling back to default profiles: default
2018-01-15 11:01:38.267 INFO 13992 --- [restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7b427b87: startup date [Mon Jan 15 11:01:38 EET 2018]; root of context hierarchy
2018-01-15 11:01:47.240 INFO 8908 --- [restartedMain] eu.eudat.EuDatApplication : Starting EuDatApplication on DEVEL-21 with PID 8908 (C:\Users\ikalyvas\Documents\Projects\OpenAIRE-EUDAT-DMP-service-pilot\dmp-backend\target\classes started by ikalyvas in C:\Users\ikalyvas\Documents\Projects\OpenAIRE-EUDAT-DMP-service-pilot)
2018-01-15 11:01:47.241 INFO 8908 --- [restartedMain] eu.eudat.EuDatApplication : No active profile set, falling back to default profiles: default
2018-01-15 11:01:47.462 INFO 8908 --- [restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64e61df8: startup date [Mon Jan 15 11:01:47 EET 2018]; root of context hierarchy
2018-01-15 11:01:52.388 INFO 8908 --- [restartedMain] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2018-01-15 11:01:52.603 INFO 8908 --- [restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'databaseConfiguration' of type [eu.eudat.configurations.DatabaseConfiguration$$EnhancerBySpringCGLIB$$74ee7d46] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2018-01-15 11:01:54.231 INFO 8908 --- [restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2018-01-15 11:01:54.262 INFO 8908 --- [restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-01-15 11:01:54.265 INFO 8908 --- [restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.23
2018-01-15 11:01:54.727 INFO 8908 --- [localhost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-01-15 11:01:54.727 INFO 8908 --- [localhost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 7270 ms
2018-01-15 11:01:55.184 INFO 8908 --- [localhost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Mapping servlet: 'dispatcherServlet' to [/]
2018-01-15 11:01:55.191 INFO 8908 --- [localhost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-01-15 11:01:55.192 INFO 8908 --- [localhost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-01-15 11:01:55.193 INFO 8908 --- [localhost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-01-15 11:01:55.193 INFO 8908 --- [localhost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-01-15 11:01:55.446 INFO 8908 --- [restartedMain] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: org.postgresql.Driver
2018-01-15 11:01:55.805 INFO 8908 --- [restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2018-01-15 11:01:55.855 INFO 8908 --- [restartedMain] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2018-01-15 11:01:56.119 INFO 8908 --- [restartedMain] org.hibernate.Version : HHH000412: Hibernate Core {5.2.11.Final}
2018-01-15 11:01:56.132 INFO 8908 --- [restartedMain] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2018-01-15 11:01:56.305 INFO 8908 --- [restartedMain] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2018-01-15 11:01:57.812 INFO 8908 --- [restartedMain] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL92Dialect
2018-01-15 11:01:57.842 INFO 8908 --- [restartedMain] o.h.e.j.e.i.LobCreatorBuilderImpl : HHH000422: Disabling contextual LOB creation as connection was null
2018-01-15 11:01:57.845 INFO 8908 --- [restartedMain] org.hibernate.type.BasicTypeRegistry : HHH000270: Type registration [java.util.UUID] overrides previous : org.hibernate.type.UUIDBinaryType@5ad2fb6b
2018-01-15 11:01:59.783 INFO 8908 --- [restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2018-01-15 11:02:03.615 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@64e61df8: startup date [Mon Jan 15 11:01:47 EET 2018]; root of context hierarchy
2018-01-15 11:02:03.897 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/admin/get/{id}],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Admin.get(java.lang.String)
2018-01-15 11:02:03.984 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/admin/addDmp],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Admin.addDmp(eu.eudat.models.admin.composite.DatasetProfile)
2018-01-15 11:02:04.018 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/admin/addDmp/{id}],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Admin.updateDmp(java.lang.String,eu.eudat.models.admin.composite.DatasetProfile)
2018-01-15 11:02:04.019 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/login/twitter || /login/linkedin]}" onto public java.lang.String eu.eudat.controllers.AngularController.index()
2018-01-15 11:02:04.054 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dashboard/getStatistics],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.dashboard.DashBoardStatistics> eu.eudat.controllers.DashBoardController.getStatistics(eu.eudat.models.security.Principal)
2018-01-15 11:02:04.063 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/external/datarepos],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.Map<java.lang.String, java.lang.String>>> eu.eudat.controllers.DataRepositories.listExternalDataRepositories(java.lang.String)
2018-01-15 11:02:04.071 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/search/autocomplete],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.DatasetProfileController.getDataForAutocomplete(eu.eudat.models.helpers.AutoCompleteLookupItem)
2018-01-15 11:02:04.072 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetwizard/get/{id}],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.DatasetProfileController.getSingle(java.lang.String)
2018-01-15 11:02:04.074 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetprofile/save/{id}],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.DatasetProfileController.updateDataset(java.lang.String,eu.eudat.models.properties.PropertiesModel)
2018-01-15 11:02:04.083 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmps/datasetprofiles/get],methods=[POST],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.datasetprofile.DatasetProfileAutocompleteItem>> eu.eudat.controllers.DatasetProfiles.get(eu.eudat.models.datasetprofile.DatasetProfileAutocompleteRequest)
2018-01-15 11:02:04.085 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetprofiles/getAll],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.datasetprofile.DatasetProfileListingModel>> eu.eudat.controllers.DatasetProfiles.getAll()
2018-01-15 11:02:04.091 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmps/datasetprofiles/getPaged],methods=[POST],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.helpers.DataTableData<eu.eudat.models.datasetprofile.DatasetProfileListingModel>> eu.eudat.controllers.DatasetProfiles.getPaged(eu.eudat.models.datasetprofile.DatasetProfileTableRequestItem)
2018-01-15 11:02:04.093 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasets/getPaged],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.helpers.DataTableData<eu.eudat.models.listingmodels.DatasetListingModel>> eu.eudat.controllers.Datasets.getPaged(eu.eudat.models.dataset.DatasetTableRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.155 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetwizard/getAvailableProfiles],methods=[POST],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.dmp.AssociatedProfile>> eu.eudat.controllers.DatasetWizardController.getAvailableProfiles(eu.eudat.models.datasetwizard.DatasetProfileWizardAutocompleteRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.168 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetwizard/userDmps],methods=[POST],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.datasetwizard.DataManagentPlanListingModel>> eu.eudat.controllers.DatasetWizardController.getUserDmps(eu.eudat.models.datasetwizard.DatasetWizardAutocompleteRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.169 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetwizard/getSingle/{id}],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.datasetwizard.DatasetWizardModel> eu.eudat.controllers.DatasetWizardController.getPaged(java.lang.String,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.170 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/datasetwizard/createOrUpdate],methods=[POST],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.entities.Dataset> eu.eudat.controllers.DatasetWizardController.createOrUpdate(eu.eudat.models.datasetwizard.DatasetWizardModel,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.187 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmpprofile/delete],methods=[POST],consumes=[application/json],produces=[text/plain]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.DmpProfiles.delete(eu.eudat.entities.DMPProfile)
2018-01-15 11:02:04.188 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmpprofile/getAll],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.DmpProfiles.getAllDmpProfiles()
2018-01-15 11:02:04.199 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmpprofiles/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.DMPProfile> eu.eudat.controllers.DmpProfiles.getDmpProfile(java.lang.String)
2018-01-15 11:02:04.200 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmpprofile/listAllLabelIDs],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<eu.eudat.entities.responses.IDLabelPair>> eu.eudat.controllers.DmpProfiles.listLabelIds()
2018-01-15 11:02:04.201 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmpprofile/create],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.DMPProfile> eu.eudat.controllers.DmpProfiles.setDmpProfile(eu.eudat.entities.DMPProfile)
2018-01-15 11:02:04.203 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmpprofiles],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.UUID>> eu.eudat.controllers.DmpProfiles.listDmpProfiles()
2018-01-15 11:02:04.206 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmps/getSingle/{id}],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.dmp.DataManagementPlan> eu.eudat.controllers.DMPs.getSingle(java.lang.String,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.216 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmps/get],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.dmp.DataManagementPlan>> eu.eudat.controllers.DMPs.getWithCriteria(eu.eudat.models.dmp.DataManagementPlanCriteriaRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.217 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmps/getPaged],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.helpers.DataTableData<eu.eudat.models.listingmodels.DataManagementPlanListingModel>> eu.eudat.controllers.DMPs.getPaged(eu.eudat.models.dmp.DataManagementPlanTableRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.218 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/dmps/createOrUpdate],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.entities.DMP> eu.eudat.controllers.DMPs.createOrUpdate(eu.eudat.models.dmp.DataManagementPlan,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.221 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/twitterRequestToken],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<org.springframework.social.oauth1.OAuthToken> eu.eudat.controllers.Login.twitterRequestToken()
2018-01-15 11:02:04.221 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/me],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.security.Principal> eu.eudat.controllers.Login.authMe(eu.eudat.models.security.Principal)
2018-01-15 11:02:04.222 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/externallogin],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.security.Principal> eu.eudat.controllers.Login.googleLogin(eu.eudat.models.login.LoginInfo)
2018-01-15 11:02:04.223 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/auth/logout],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.security.Principal> eu.eudat.controllers.Login.logout(eu.eudat.models.security.Principal)
2018-01-15 11:02:04.224 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/organisation/delete],methods=[POST],consumes=[application/json],produces=[text/plain]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Organisation> eu.eudat.controllers.Organisations.delete(eu.eudat.entities.Organisation)
2018-01-15 11:02:04.228 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/organisations],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.UUID>> eu.eudat.controllers.Organisations.listOrganisations()
2018-01-15 11:02:04.228 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/organisation/getAll],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Organisations.getAllOrganisations()
2018-01-15 11:02:04.229 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/external/organisations],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.external.OrganisationsExternalSourcesModel> eu.eudat.controllers.Organisations.listExternalOrganisations(java.lang.String)
2018-01-15 11:02:04.230 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/organisation/create],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Organisation> eu.eudat.controllers.Organisations.setOrganisation(eu.eudat.entities.Organisation)
2018-01-15 11:02:04.230 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/organisations/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Organisation> eu.eudat.controllers.Organisations.getOrganisations(java.lang.String)
2018-01-15 11:02:04.232 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/projects/get],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.project.Project>> eu.eudat.controllers.Projects.get(eu.eudat.models.project.ProjectCriteriaRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.233 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/external/projects],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.external.ProjectsExternalSourcesModel> eu.eudat.controllers.Projects.listExternalProjects(java.lang.String,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.234 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/projects/inactivate/{id}],methods=[DELETE],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.entities.Project> eu.eudat.controllers.Projects.inactivate(java.lang.String,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.236 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/projects/createOrUpdate],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.entities.Project> eu.eudat.controllers.Projects.addProject(eu.eudat.models.project.Project,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.236 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/projects/getSingle/{id}],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.project.Project> eu.eudat.controllers.Projects.getPaged(java.lang.String,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.237 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/projects/getPaged],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.helpers.DataTableData<eu.eudat.models.project.Project>> eu.eudat.controllers.Projects.getPaged(eu.eudat.models.project.ProjectTableRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.239 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/projects/getWithExternal],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.project.Project>> eu.eudat.controllers.Projects.getWithExternal(eu.eudat.models.project.ProjectCriteriaRequest,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.240 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/registry/delete],methods=[POST],consumes=[application/json],produces=[text/plain]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Registries.delete(eu.eudat.entities.Registry)
2018-01-15 11:02:04.242 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/registry/create],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Registry> eu.eudat.controllers.Registries.setRegistry(eu.eudat.entities.Registry)
2018-01-15 11:02:04.243 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/external/registries],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.external.RegistriesExternalSourcesModel> eu.eudat.controllers.Registries.listExternalRegistries(java.lang.String)
2018-01-15 11:02:04.244 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/registries],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.UUID>> eu.eudat.controllers.Registries.listRegistries()
2018-01-15 11:02:04.244 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/registries/listAllLabelIDs],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<eu.eudat.entities.responses.IDLabelPair>> eu.eudat.controllers.Registries.listLabelIds()
2018-01-15 11:02:04.245 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/registries/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Registry> eu.eudat.controllers.Registries.getRegistries(java.lang.String)
2018-01-15 11:02:04.246 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/registry/getAll],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Registries.getAllRegistries()
2018-01-15 11:02:04.248 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/researcher/delete],methods=[POST],consumes=[application/json],produces=[text/plain]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Researchers.delete(eu.eudat.entities.Researcher)
2018-01-15 11:02:04.249 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/researcher/getByEmail],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Researcher> eu.eudat.controllers.Researchers.getResearcherByEmail(java.lang.String)
2018-01-15 11:02:04.249 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/researcher/getAll],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.util.List<eu.eudat.entities.Researcher>> eu.eudat.controllers.Researchers.getAllResearchers()
2018-01-15 11:02:04.250 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/external/researchers],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.external.ResearchersExternalSourcesModel> eu.eudat.controllers.Researchers.listExternalResearchers(java.lang.String)
2018-01-15 11:02:04.251 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/researcher/create],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Researcher> eu.eudat.controllers.Researchers.setResearcher(eu.eudat.entities.Researcher)
2018-01-15 11:02:04.252 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/researchers/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Researcher> eu.eudat.controllers.Researchers.getResearchers(java.lang.String)
2018-01-15 11:02:04.252 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/researchers],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.UUID>> eu.eudat.controllers.Researchers.listResearchers()
2018-01-15 11:02:04.254 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/service/delete],methods=[POST],consumes=[application/json],produces=[text/plain]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Services.delete(eu.eudat.entities.Service)
2018-01-15 11:02:04.255 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/service/create],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Service> eu.eudat.controllers.Services.setService(eu.eudat.entities.Service)
2018-01-15 11:02:04.256 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/services],methods=[GET]}" onto public org.springframework.http.ResponseEntity<java.util.List<java.util.UUID>> eu.eudat.controllers.Services.listServices()
2018-01-15 11:02:04.257 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/services/{id}],methods=[GET]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.Service> eu.eudat.controllers.Services.getServices(java.lang.String)
2018-01-15 11:02:04.257 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/service/getAll],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.controllers.Services.getAllServices()
2018-01-15 11:02:04.259 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/external/services],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.external.ServiceExternalSourcesModel> eu.eudat.controllers.Services.listExternalServices(java.lang.String)
2018-01-15 11:02:04.262 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/invite/getUsers],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.List<eu.eudat.models.userinfo.UserInfoInvitationModel>> eu.eudat.controllers.UserInvitationController.getUsers(eu.eudat.models.userinfo.UserInfoRequestItem)
2018-01-15 11:02:04.263 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/invite/users],methods=[POST],consumes=[application/json],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<eu.eudat.models.invitation.Invitation> eu.eudat.controllers.UserInvitationController.users(eu.eudat.models.invitation.Invitation,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.264 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/invite/exchange/{invitationID}],methods=[GET],produces=[application/json]}" onto public eu.eudat.models.helpers.responses.ResponseItem<java.util.UUID> eu.eudat.controllers.UserInvitationController.exchange(java.util.UUID,eu.eudat.models.security.Principal)
2018-01-15 11:02:04.265 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/whoami],methods=[GET],produces=[application/json;charset=UTF-8]}" onto public org.springframework.http.ResponseEntity<eu.eudat.entities.UserInfo> eu.eudat.controllers.Users.whoami()
2018-01-15 11:02:04.266 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/eu/eudat/proxy],methods=[GET],produces=[application/json]}" onto public org.springframework.http.ResponseEntity<java.lang.Object> eu.eudat.proxy.Proxy.proxy(java.lang.String)
2018-01-15 11:02:04.270 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-01-15 11:02:04.270 INFO 8908 --- [restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-01-15 11:02:04.542 INFO 8908 --- [restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-01-15 11:02:04.542 INFO 8908 --- [restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-01-15 11:02:04.617 INFO 8908 --- [restartedMain] .m.m.a.ExceptionHandlerExceptionResolver : Detected @ExceptionHandler methods in controllerErrorHandler
2018-01-15 11:02:04.745 INFO 8908 --- [restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-01-15 11:02:04.865 INFO 8908 --- [restartedMain] oConfiguration$WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]
2018-01-15 11:02:06.710 INFO 8908 --- [restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-01-15 11:02:07.143 INFO 8908 --- [restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-01-15 11:02:07.617 INFO 8908 --- [restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2018-01-15 11:02:07.705 INFO 8908 --- [restartedMain] eu.eudat.EuDatApplication : Started EuDatApplication in 21.453 seconds (JVM running for 23.191)