added common module

This commit is contained in:
enricoottonello 2019-04-03 10:53:54 +02:00
parent 1a1ec7da8e
commit b316467608
13 changed files with 49 additions and 42 deletions

View File

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>eu.dnetlib</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-mdstore-manager-app</artifactId> <artifactId>dhp-mdstore-manager-app</artifactId>
<version>1.1.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>
@ -55,6 +55,13 @@
<artifactId>commons-io</artifactId> <artifactId>commons-io</artifactId>
<version>2.6</version> <version>2.6</version>
</dependency> </dependency>
<!-- Common -->
<dependency>
<groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp-common</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!-- Swagger --> <!-- Swagger -->
<dependency> <dependency>

View File

@ -17,12 +17,12 @@ import org.springframework.web.bind.annotation.RestController;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import eu.dnetlib.data.mdstore.manager.common.model.MDStore;
import eu.dnetlib.data.mdstore.manager.common.model.MDStoreCurrentVersion;
import eu.dnetlib.data.mdstore.manager.common.model.MDStoreVersion;
import eu.dnetlib.data.mdstore.manager.common.model.MDStoreWithInfo;
import eu.dnetlib.data.mdstore.manager.exceptions.MDStoreManagerException; import eu.dnetlib.data.mdstore.manager.exceptions.MDStoreManagerException;
import eu.dnetlib.data.mdstore.manager.exceptions.NoContentException; import eu.dnetlib.data.mdstore.manager.exceptions.NoContentException;
import eu.dnetlib.data.mdstore.manager.model.MDStore;
import eu.dnetlib.data.mdstore.manager.model.MDStoreCurrentVersion;
import eu.dnetlib.data.mdstore.manager.model.MDStoreVersion;
import eu.dnetlib.data.mdstore.manager.model.MDStoreWithInfo;
import eu.dnetlib.data.mdstore.manager.repository.MDStoreCurrentVersionRepository; import eu.dnetlib.data.mdstore.manager.repository.MDStoreCurrentVersionRepository;
import eu.dnetlib.data.mdstore.manager.repository.MDStoreRepository; import eu.dnetlib.data.mdstore.manager.repository.MDStoreRepository;
import eu.dnetlib.data.mdstore.manager.repository.MDStoreVersionRepository; import eu.dnetlib.data.mdstore.manager.repository.MDStoreVersionRepository;
@ -72,7 +72,7 @@ public class MDStoreController {
} }
@ApiOperation(value = "Create a new mdstore") @ApiOperation(value = "Create a new mdstore")
@RequestMapping(value = "/new/{format}/{layout}/{interpretation}", method = RequestMethod.PUT) @RequestMapping(value = "/new/{format}/{layout}/{interpretation}", method = RequestMethod.GET)
public MDStoreWithInfo createMDStore( public MDStoreWithInfo createMDStore(
@ApiParam("mdstore format") @PathVariable final String format, @ApiParam("mdstore format") @PathVariable final String format,
@ApiParam("mdstore layout") @PathVariable final String layout, @ApiParam("mdstore layout") @PathVariable final String layout,

View File

@ -3,7 +3,7 @@ package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import eu.dnetlib.data.mdstore.manager.model.MDStoreCurrentVersion; import eu.dnetlib.data.mdstore.manager.common.model.MDStoreCurrentVersion;
@Repository @Repository
public interface MDStoreCurrentVersionRepository extends JpaRepository<MDStoreCurrentVersion, String> { public interface MDStoreCurrentVersionRepository extends JpaRepository<MDStoreCurrentVersion, String> {

View File

@ -3,7 +3,7 @@ package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import eu.dnetlib.data.mdstore.manager.model.MDStore; import eu.dnetlib.data.mdstore.manager.common.model.MDStore;
@Repository @Repository
public interface MDStoreRepository extends JpaRepository<MDStore, String> { public interface MDStoreRepository extends JpaRepository<MDStore, String> {

View File

@ -3,7 +3,7 @@ package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import eu.dnetlib.data.mdstore.manager.model.MDStoreVersion; import eu.dnetlib.data.mdstore.manager.common.model.MDStoreVersion;
@Repository @Repository
public interface MDStoreVersionRepository extends JpaRepository<MDStoreVersion, String> { public interface MDStoreVersionRepository extends JpaRepository<MDStoreVersion, String> {

View File

@ -2,7 +2,7 @@ package eu.dnetlib.data.mdstore.manager.repository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import eu.dnetlib.data.mdstore.manager.model.MDStoreWithInfo; import eu.dnetlib.data.mdstore.manager.common.model.MDStoreWithInfo;
@Repository @Repository
public interface MDStoreWithInfoRepository extends ReadOnlyRepository<MDStoreWithInfo, String> { public interface MDStoreWithInfoRepository extends ReadOnlyRepository<MDStoreWithInfo, String> {

View File

@ -21,7 +21,7 @@ app.controller('mdstoreManagerController', function($scope, $http) {
if (dsName || dsId || apiId) { if (dsName || dsId || apiId) {
url += '?dsName=' + encodeURIComponent(dsName) + '&dsId=' + encodeURIComponent(dsId) + '&apiId=' + encodeURIComponent(apiId); url += '?dsName=' + encodeURIComponent(dsName) + '&dsId=' + encodeURIComponent(dsId) + '&apiId=' + encodeURIComponent(apiId);
} }
$http.put(url).success(function(data) { $http.get(url).success(function(data) {
$scope.reload(); $scope.reload();
}).error(function() { }).error(function() {
alert("error"); alert("error");

View File

@ -1,33 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>eu.dnetlib.dhp</groupId> <groupId>eu.dnetlib.dhp</groupId>
<artifactId>dhp</artifactId> <artifactId>dhp</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</parent> </parent>
<artifactId>dhp-common</artifactId> <artifactId>dhp-common</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.apache.commons</groupId> <groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId> <artifactId>commons-lang3</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
</dependency> </dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencies>
</project> </project>

View File

@ -1,4 +1,4 @@
package eu.dnetlib.data.mdstore.manager.model; package eu.dnetlib.data.mdstore.manager.common.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.UUID; import java.util.UUID;

View File

@ -1,4 +1,4 @@
package eu.dnetlib.data.mdstore.manager.model; package eu.dnetlib.data.mdstore.manager.common.model;
import java.io.Serializable; import java.io.Serializable;

View File

@ -1,4 +1,4 @@
package eu.dnetlib.data.mdstore.manager.model; package eu.dnetlib.data.mdstore.manager.common.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;

View File

@ -1,4 +1,4 @@
package eu.dnetlib.data.mdstore.manager.model; package eu.dnetlib.data.mdstore.manager.common.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;

View File

@ -1,4 +1,4 @@
#Created by Apache Maven 3.5.2 #Created by Apache Maven 3.6.0
version=1.0.0 version=1.0.0
groupId=eu.dnetlib groupId=eu.dnetlib
artifactId=dhp-collector-worker artifactId=dhp-collector-worker