Test Module

This commit is contained in:
Fabio Sinibaldi 2021-09-20 18:11:51 +02:00
parent a7de8e61c3
commit 5c0682eff7
78 changed files with 417 additions and 2038 deletions

75
cms-test-commons/pom.xml Normal file
View File

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.application.cms</groupId>
<artifactId>cms-test-commons</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>CMS Test Commons</name>
<parent>
<groupId>org.gcube.application.cms</groupId>
<artifactId>gcube-cms-suite</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<properties>
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
<sis.version>1.0</sis.version>
</properties>
<scm>
<connection>scm:git:${gitBaseUrl}/${project.artifactId}.git</connection>
<developerConnection>scm:git:${gitBaseUrl}/${project.artifactId}.git</developerConnection>
<url>${gitBaseUrl}/${project.artifactId}.git</url>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>2.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-smartgears-bom</artifactId>
<version>2.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-common</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
</dependencies>
</project>

View File

@ -1,24 +1,20 @@
package org.gcube.application.geoportal.service;
import org.bson.types.ObjectId;
import org.gcube.application.geoportal.common.model.legacy.*;
package org.gcube.application.cms.tests.model;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import org.bson.types.ObjectId;
import org.gcube.application.geoportal.common.model.legacy.*;
public class TestModel {
public static Concessione prepareEmptyConcessione() {
Concessione concessione=new Concessione();
// Generic fields
// Concessione fields
concessione.setNome("MONGO Italia, forse, ma su ");
concessione.setIntroduzione("This is my MONGO project");
concessione.setDescrizioneContenuto("It contains this and that");
@ -48,9 +44,9 @@ public class TestModel {
concessione.setParoleChiaveICCD(Arrays.asList(new String[] {"vattelapesca","somthing something"}));
concessione.setCentroidLat(43.0); //N-S
concessione.setCentroidLong(9.0); //E-W
// concessione.setCentroidLat(43.0); //N-S
// concessione.setCentroidLong(9.0); //E-W
//
return concessione;
}
@ -66,6 +62,8 @@ public class TestModel {
public static final String rnd() {
return new ObjectId().toHexString();
}
public static Concessione prepareConcessione() {
return prepareConcessione(4,2);
}
@ -77,14 +75,18 @@ public class TestModel {
// Attachments
// Relazione scavo
RelazioneScavo relScavo=new RelazioneScavo();
relScavo.setAbstractIta("simple abstract section");
relScavo.setResponsabili(concessione.getAuthors());
concessione.setRelazioneScavo(relScavo);
//Abstract
AbstractRelazione abstractRelazione=new AbstractRelazione();
abstractRelazione.setAbstractIta("Il mio abstract");
abstractRelazione.setAbstractEng("My abstract");
concessione.setAbstractRelazione(abstractRelazione);
//Immagini rappresentative
ArrayList<UploadedImage> imgs=new ArrayList<>();
for(int i=0;i<imgsCount;i++) {

View File

@ -0,0 +1,33 @@
package org.gcube.application.cms.tests.model;
import lombok.extern.slf4j.Slf4j;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
import java.util.Properties;
@Slf4j
public class TokenSetter {
private static Properties props=new Properties();
static{
try {
props.load(TokenSetter.class.getResourceAsStream("/tokens.properties"));
} catch (Exception e) {
throw new RuntimeException("YOU NEED TO SET TOKEN FILE IN CONFIGURATION");
}
}
public static void set(String scope){
try{
if(!props.containsKey(scope)) throw new RuntimeException("No token found for scope : "+scope);
SecurityTokenProvider.instance.set(props.getProperty(scope));
}catch(Throwable e){
log.warn("Unable to set token for scope "+scope,e);
}
ScopeProvider.instance.set(scope);
}
}

View File

@ -0,0 +1,201 @@
{
"_id": {
"$oid": "613f1cee02ad3d6128abd3d7"
},
"mongo_id": "613f1cee02ad3d6128abd3d7",
"id": 0,
"recordType": "CONCESSIONE",
"version": "1.0.0",
"licenzaID": "CC-BY",
"policy": "OPEN",
"nome": "Mock module",
"folderId": "4dd93a95-811f-47d6-9983-e39cf5de2525",
"lastUpdateTime": "2021-09-13T11:42:06.003",
"lastUpdateUser": null,
"creationTime": "2021-09-13T11:42:06.003",
"creationUser": null,
"report": {
"objectName": "Publish report",
"errorMessages": [],
"warningMessages": [],
"children": [],
"status": "PASSED"
},
"introduzione": "This is my MONGO project",
"descrizioneContenuto": "It contains this and that",
"authors": ["Some one", "Some, oneelse"],
"contributore": "Contrib 1",
"titolari": ["Some one", "Some, oneelse"],
"responsabile": "Someone",
"editore": "Editore",
"fontiFinanziamento": ["Big pharma", "Pentagon"],
"soggetto": ["Research Excavation", "Archeology"],
"risorseCorrelate": null,
"dataInizioProgetto": "2021-09-13T11:42:05.48",
"dataFineProgetto": "2021-09-13T11:42:05.482",
"titolareLicenza": ["Qualcun altro"],
"titolareCopyright": ["Chiedilo in giro"],
"paroleChiaveLibere": ["Robba", "Stuff"],
"paroleChiaveICCD": ["vattelapesca", "somthing something"],
"centroidLat": 40.63000418577982,
"centroidLong": 8.621048885423953,
"relazioneScavo": {
"mongo_id": "613f1d1502ad3d6128abd3de",
"id": 0,
"policy": "OPEN",
"licenseID": "CC-BY",
"titolo": "Mock module relazione di scavo",
"creationTime": "2021-09-13T11:42:06.003",
"actualContent": [{
"type": "WorkspaceContent",
"id": 0,
"mimetype": "application/pdf",
"storageID": "b36cb9de-e209-470b-a4fd-b5585813b35a",
"link": "https://data.dev.d4science.org/shub/E_Q3BiNUhsaGU4N2VlTzY4ei9YQ3V4S1pOZXFla0k2djVrbDcvV25DMTVkQ1ZWeDNGejBTcTBRY1RnT0NLTTNicw=="
}, {
"type": "WorkspaceContent",
"id": 0,
"mimetype": "application/pdf",
"storageID": "19ba1bc8-91ae-46a7-8777-68e1331acda7",
"link": "https://data.dev.d4science.org/shub/E_SENCdzhwTnVxUkpsR1E4RUhzYkw0RzlJem9KSlNZc1VpK1VMWFhYK3NYRFNCZU1LOUJ5YkxTNXFnR2tNNEZmOQ=="
}],
"abstractIta": "semplice sezione abstract",
"abstractEng": "simple abstract section",
"responsabili": ["Some one", "Some, oneelse"],
"soggetto": ["Research Excavation", "Archeology"]
},
"immaginiRappresentative": [{
"mongo_id": "613f1cfd02ad3d6128abd3d9",
"id": 0,
"policy": "OPEN",
"licenseID": "CC-BY-4.0",
"titolo": "My image number 0",
"creationTime": "2021-09-13T11:42:06.142",
"actualContent": [{
"type": "WorkspaceContent",
"id": 0,
"mimetype": "image/png",
"storageID": "6133717f-c527-4c09-9e76-f579ecaa35e9",
"link": "https://data.dev.d4science.org/shub/E_SmtLbC8wTUNLOSsvWkVDQ0Jua3EwSDZXdExTNjJKYVZySFlPSzZ0OGt2UzEydzI5Ymgva3ljNDBwVDExL09KcQ=="
}],
"didascalia": "You can see my image number 0",
"format": "TIFF",
"responsabili": ["Some one", "Some, oneelse"],
"soggetto": ["Research Excavation", "Archeology"]
}, {
"mongo_id": "613f1d0402ad3d6128abd3db",
"id": 0,
"policy": "OPEN",
"licenseID": "CC-BY-4.0",
"titolo": "My image number 0",
"creationTime": "2021-09-13T11:42:06.142",
"actualContent": [{
"type": "WorkspaceContent",
"id": 0,
"mimetype": "image/png",
"storageID": "aee78fe0-1661-4090-8310-cc5809530988",
"link": "https://data.dev.d4science.org/shub/E_b2RXUFBsdTFDdjJ5L1BzUE5xOSt1QktRL1hBMXR0SDNSY09GdXJ5cjB3d0pvTTdXNjRpSURzV0lkVHQwUFh1Rw=="
}],
"didascalia": "You can see my image number 0",
"format": "TIFF",
"responsabili": ["Some one", "Some, oneelse"],
"soggetto": ["Research Excavation", "Archeology"]
}],
"posizionamentoScavo": {
"mongo_id": "613f1d2002ad3d6128abd3e0",
"id": 0,
"policy": "OPEN",
"licenseID": "CC-BY-4.0",
"titolo": "Mock module posizionamento scavo",
"creationTime": "2021-09-13T11:42:06.003",
"actualContent": [{
"type": "WorkspaceContent",
"id": 0,
"mimetype": "application/x-shapefile",
"storageID": "d1fc3b37-bd48-4e73-8160-e32e86801a3a",
"link": "https://data.dev.d4science.org/shub/E_TEI1dVV6dlVYOEhiR2pmc0FobE5yUnJEdG5sWUV3MElTNXlNWHE3RHVsMmJsQVNwcnBFaUJFaDd1aU4xamEyRw=="
}, {
"type": "GeoServerContent",
"id": 0,
"geoserverHostName": "geoserver1.dev.d4science.org",
"geoserverPath": "/srv/geoserver_data/GNA/613f1cee02ad3d6128abd3d7/613f1d2002ad3d6128abd3e0/pos",
"fileNames": ["pos.shp"],
"workspace": "gna_conc_613f1cee02ad3d6128abd3d7",
"store": "pos_store",
"featureType": "pos"
}],
"layerUUID": null,
"layerID": null,
"layerName": "pos",
"wmsLink": "https://geoserver1.dev.d4science.org/geoserver/gna_conc_613f1cee02ad3d6128abd3d7/wms?service=WMS&version=1.1.0&request=GetMap&layers=gna_conc_613f1cee02ad3d6128abd3d7:pos&styles=&bbox=8.620919,40.629750,8.621179,40.630258&srs=EPSG:4326&format=application/openlayers&width=400&height=400",
"workspace": "gna_conc_613f1cee02ad3d6128abd3d7",
"abstractSection": "Posizionamento topografico georeferenziato dellarea interessata dalle indagini",
"topicCategory": "Society",
"subTopic": "Archeology",
"bbox": {
"maxLat": 40.630257904721645,
"maxLong": 8.621178639172953,
"minLat": 40.62975046683799,
"minLong": 8.62091913167495
},
"paroleChiaveLibere": ["Robba", "Stuff"],
"paroleChiaveICCD": ["vattelapesca", "somthing something"],
"valutazioneQualita": "Secondo me si",
"metodoRaccoltaDati": "Fattobbene",
"scalaAcquisizione": "1:10000",
"authors": ["Some one", "Some, oneelse"],
"responsabile": "Someone"
},
"pianteFineScavo": [{
"mongo_id": "613f1d3302ad3d6128abd3e3",
"id": 0,
"policy": "RESTRICTED",
"licenseID": "CC-BY-4.0",
"titolo": "Mock module pianta fine scavo",
"creationTime": "2021-09-13T11:42:06.003",
"actualContent": [{
"type": "WorkspaceContent",
"id": 0,
"mimetype": "application/x-shapefile",
"storageID": "42518460-60f8-4b1b-a374-f720cec4b795",
"link": "https://data.dev.d4science.org/shub/E_TWxtcHNqN2E1OVNqa2lSa2svN3dJWE9TQlM2dmtoR3NvR2YweHQ4eFBYNUQ4MTdxVnl6SWg2aWl3SXZld21rZg=="
}, {
"type": "WorkspaceContent",
"id": 0,
"mimetype": "application/x-shapefile",
"storageID": "73f44642-ff9f-43b7-a754-5df735ef510f",
"link": "https://data.dev.d4science.org/shub/E_U01hZXRCV3lRVUR0ZmZFUGtnZTJnbm14L240RzJieEJqaWtLYUJmcnVwelNoOWxycXpnbmo0QmRnQU5XMEZBWg=="
}, {
"type": "GeoServerContent",
"id": 0,
"geoserverHostName": "geoserver1.dev.d4science.org",
"geoserverPath": "/srv/geoserver_data/GNA/613f1cee02ad3d6128abd3d7/613f1d3302ad3d6128abd3e3/pianta",
"fileNames": ["pianta.shp", "pianta.shx"],
"workspace": "gna_conc_613f1cee02ad3d6128abd3d7",
"store": "pianta_store",
"featureType": "pianta"
}],
"layerUUID": null,
"layerID": null,
"layerName": "pianta",
"wmsLink": "https://geoserver1.dev.d4science.org/geoserver/gna_conc_613f1cee02ad3d6128abd3d7/wms?service=WMS&version=1.1.0&request=GetMap&layers=gna_conc_613f1cee02ad3d6128abd3d7:pianta&styles=&bbox=647502.891667,4470387.347517,647527.486073,4470417.525434&srs=EPSG:4326&format=application/openlayers&width=400&height=400",
"workspace": "gna_conc_613f1cee02ad3d6128abd3d7",
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"topicCategory": "Society",
"subTopic": "Archeology",
"bbox": {
"maxLat": 4470417.525433567,
"maxLong": 647527.4860734959,
"minLat": 4470387.347516773,
"minLong": 647502.8916670183
},
"paroleChiaveLibere": ["Robba", "Stuff"],
"paroleChiaveICCD": ["vattelapesca", "somthing something"],
"valutazioneQualita": "Secondo me si",
"metodoRaccoltaDati": "Fattobbene",
"scalaAcquisizione": "1:10000",
"authors": ["Some one", "Some, oneelse"],
"responsabile": "Someone"
}],
"genericContent": []
}

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -1,14 +1,14 @@
package org.gcube.application.geoportal.common.model;
package org.gcube.application.cms.commons.model.concessioni;
import static org.junit.Assert.assertEquals;
import java.util.UUID;
import org.gcube.application.cms.tests.model.TestModel;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
import org.junit.Assert;
import org.junit.Test;
@ -17,32 +17,32 @@ public class PathsTest {
@Test
public void embeddedPaths() {
Concessione c=TestModel.prepareConcessione();
Concessione c= TestModel.prepareConcessione();
c=TestModel.setIds(c);
LayerConcessione p=(LayerConcessione) c.getContentByPath(Paths.POSIZIONAMENTO);
assertEquals(c.getPosizionamentoScavo(), p);
Assert.assertEquals(c.getPosizionamentoScavo(), p);
RelazioneScavo rel=(RelazioneScavo) c.getContentByPath(Paths.RELAZIONE);
assertEquals(c.getRelazioneScavo(), rel);
Assert.assertEquals(c.getRelazioneScavo(), rel);
for(int i=0;i<c.getPianteFineScavo().size();i++) {
LayerConcessione l=(LayerConcessione) c.getContentByPath(Paths.piantaByIndex(i));
assertEquals(c.getPianteFineScavo().get(i),l);
Assert.assertEquals(c.getPianteFineScavo().get(i),l);
}
for(int i=0;i<c.getImmaginiRappresentative().size();i++) {
UploadedImage l=(UploadedImage) c.getContentByPath(Paths.imgByIndex(i));
assertEquals(c.getImmaginiRappresentative().get(i),l);
Assert.assertEquals(c.getImmaginiRappresentative().get(i),l);
}
for(int i=0;i<c.getPianteFineScavo().size();i++) {
LayerConcessione layer=c.getPianteFineScavo().get(i);
LayerConcessione l=(LayerConcessione) c.getContentByPath(Paths.piantaById(layer.getMongo_id()));
assertEquals(layer,l);
Assert.assertEquals(layer,l);
}
@ -50,7 +50,7 @@ public class PathsTest {
for(int i=0;i<c.getImmaginiRappresentative().size();i++) {
UploadedImage layer=c.getImmaginiRappresentative().get(i);
UploadedImage l=(UploadedImage) c.getContentByPath(Paths.imgById(layer.getMongo_id()));
assertEquals(layer,l);
Assert.assertEquals(layer,l);
}

View File

@ -1,7 +1,8 @@
package org.gcube.application.geoportal.common.model;
package org.gcube.application.cms.commons.model.concessioni;
import java.io.IOException;
import org.gcube.application.cms.tests.model.TestModel;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.profile.Profile;
import org.gcube.application.geoportal.common.utils.Files;
@ -34,7 +35,7 @@ public class SerializationTest {
public void readProfile() throws JsonProcessingException, IOException {
Profile concessione=mapper.readerFor(Profile.class).readValue(
Files.getFileFromResources("ProfileConcessioni.json"));
Files.getFileFromResources("concessioni/ProfileConcessioni.json"));
System.out.println("Profile is "+mapper.writeValueAsString(concessione));
Assert.assertTrue(concessione.getFields().size()>0);
@ -44,14 +45,14 @@ public class SerializationTest {
@Test
public void readConcessione() throws JsonProcessingException, IOException {
Concessione concessione=mapper.readerFor(Concessione.class).readValue(
Files.getFileFromResources("Concessione.json"));
Files.getFileFromResources("concessioni/Concessione.json"));
System.out.println("Concessione is "+concessione.toString());
}
@Test
public void generic() throws JsonProcessingException, IOException {
Concessione conc=TestModel.prepareConcessione();
Concessione conc= TestModel.prepareConcessione();
conc.validate();
full(conc);
}

View File

@ -18,54 +18,25 @@
<properties>
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
<sis.version>1.0</sis.version>
</properties>
<scm>
<connection>scm:git:${gitBaseUrl}/${project.artifactId}.git</connection>
<developerConnection>scm:git:${gitBaseUrl}/${project.artifactId}.git</developerConnection>
<url>${gitBaseUrl}/${project.artifactId}.git</url>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>2.0.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-smartgears-bom</artifactId>
<version>2.1.0</version>
<type>pom</type>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
</dependency>
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-common</artifactId>
<version>[1.0.0,2.0.0)</version>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-fw-clients</artifactId>
@ -77,8 +48,6 @@
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-jaxrs-client</artifactId>
@ -87,18 +56,11 @@
<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<groupId>org.gcube.application.cms</groupId>
<artifactId>cms-test-commons</artifactId>
<scope>test</scope>
<version>4.11</version>
</dependency>
<!-- Storage HUB -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- Client for legacy -->
<!-- jackson java time -->
@ -134,6 +96,7 @@
</dependency>
</dependencies>
</project>

View File

@ -1,6 +1,6 @@
package org.gcube.application.geoportal;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.common.rest.TempFile;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.common.utils.StorageUtils;

View File

@ -1,5 +1,6 @@
package org.gcube.application.geoportal.clients;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.junit.BeforeClass;
public class BasicVreTests {

View File

@ -6,9 +6,9 @@ import static org.junit.Assert.*;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import org.gcube.application.cms.tests.model.TestModel;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.TestModel;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
@ -34,7 +34,7 @@ public class StatefulClientTests extends BasicVreTests{
toRegister.setNome("Mock module");
manager.createNew(toRegister);
UploadedImage toRegisterImg=TestModel.prepareConcessione().getImmaginiRappresentative().get(0);
UploadedImage toRegisterImg= TestModel.prepareConcessione().getImmaginiRappresentative().get(0);
// TEMP Files are hosted in INFRASTRUCTURE's VOLATILE AREA
TempFile toUpload=storage.putOntoStorage(new FileInputStream(Files.getFileFromResources("concessioni/immagine.png")), "immagine.png");

View File

@ -1,7 +1,6 @@
package org.gcube.application.geoportal.clients;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
import static org.junit.Assert.*;
import java.io.File;
@ -11,10 +10,8 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicLong;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.cms.tests.model.TestModel;
import org.gcube.application.geoportal.client.utils.Queries;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.TestModel;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport.ValidationStatus;

View File

@ -1,35 +0,0 @@
package org.gcube.application.geoportal.clients;
import java.util.Properties;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
public class TokenSetter {
private static Properties props=new Properties();
static{
try {
props.load(TokenSetter.class.getResourceAsStream("/tokens.properties"));
} catch (Exception e) {
throw new RuntimeException("YOU NEED TO SET TOKEN FILE IN CONFIGURATION");
}
}
public static void set(String scope){
try{
if(!props.containsKey(scope)) throw new RuntimeException("No token found for scope : "+scope);
SecurityTokenProvider.instance.set(props.getProperty(scope));
}catch(Exception e){
e.printStackTrace(System.err);
throw e;
}
ScopeProvider.instance.set(scope);
}
}

View File

@ -1,33 +0,0 @@
package org.gcube.application.geoportal.common.model;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicLong;
public class Serializations {
@Test
public void readOne(){}
@Test
public void readMulti() throws IOException {
Iterator it=Serialization.readCollection(
new FileInputStream(new File("src/test/resources/concessioni/ConcessioniList.json")),
Concessione.class);
AtomicLong l=new AtomicLong(0);
it.forEachRemaining(element->{l.incrementAndGet();});
Assert.assertTrue(l.get()==4);
}
}

View File

@ -1,130 +0,0 @@
package org.gcube.application.geoportal.common.model;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.UUID;
import org.bson.types.ObjectId;
import org.gcube.application.geoportal.common.model.legacy.AccessPolicy;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
import org.gcube.application.geoportal.common.model.legacy.RelazioneScavo;
import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
public class TestModel {
public static Concessione prepareEmptyConcessione() {
Concessione concessione=new Concessione();
// Generic fields
// Concessione fields
concessione.setNome("MONGO Italia, forse, ma su ");
concessione.setIntroduzione("This is my MONGO project");
concessione.setDescrizioneContenuto("It contains this and that");
concessione.setAuthors(Arrays.asList(new String[] {"Some one","Some, oneelse"}));
concessione.setContributore("Contrib 1");
concessione.setTitolari(Arrays.asList(new String[] {"Some one","Some, oneelse"}));
concessione.setResponsabile("Someone");
concessione.setEditore("Editore");
concessione.setFontiFinanziamento(Arrays.asList(new String[] {"Big pharma","Pentagon"}));
concessione.setSoggetto(Arrays.asList(new String[] {"Research Excavation","Archeology"}));
concessione.setDataInizioProgetto(LocalDateTime.now());
concessione.setDataFineProgetto(LocalDateTime.now());
concessione.setLicenzaID("CC-BY");
concessione.setTitolareLicenza(Arrays.asList(new String[] {"Qualcun altro"}));
concessione.setTitolareCopyright(Arrays.asList(new String[] {"Chiedilo in giro"}));
concessione.setParoleChiaveLibere(Arrays.asList(new String[] {"Robba","Stuff"}));
concessione.setParoleChiaveICCD(Arrays.asList(new String[] {"vattelapesca","somthing something"}));
// concessione.setCentroidLat(43.0); //N-S
// concessione.setCentroidLong(9.0); //E-W
//
return concessione;
}
public static final Concessione setIds(Concessione c) {
// c.setMongo_id(rnd());
c.getRelazioneScavo().setMongo_id(rnd());
c.getPosizionamentoScavo().setMongo_id(rnd());
c.getPianteFineScavo().forEach((LayerConcessione l)->{l.setMongo_id(rnd());});
c.getImmaginiRappresentative().forEach((UploadedImage i)->{i.setMongo_id(rnd());});
return c;
}
public static final String rnd() {
return new ObjectId().toHexString();
}
public static Concessione prepareConcessione() {
return prepareConcessione(4,2);
}
public static Concessione prepareConcessione(int pianteCount ,int imgsCount) {
Concessione concessione=prepareEmptyConcessione();
// Attachments
// Relazione scavo
RelazioneScavo relScavo=new RelazioneScavo();
relScavo.setAbstractEng("simple abstract section");
relScavo.setAbstractIta("semplice sezione abstract");
relScavo.setResponsabili(concessione.getAuthors());
concessione.setRelazioneScavo(relScavo);
//Immagini rappresentative
ArrayList<UploadedImage> imgs=new ArrayList<>();
for(int i=0;i<imgsCount;i++) {
UploadedImage img=new UploadedImage();
img.setTitolo("My image number "+i);
img.setDidascalia("You can see my image number "+i);
img.setFormat("TIFF");
img.setCreationTime(LocalDateTime.now());
img.setResponsabili(concessione.getAuthors());
imgs.add(img);
}
concessione.setImmaginiRappresentative(imgs);
//Posizionamento
LayerConcessione posizionamento=new LayerConcessione();
posizionamento.setValutazioneQualita("Secondo me si");
posizionamento.setMetodoRaccoltaDati("Fattobbene");
posizionamento.setScalaAcquisizione("1:10000");
posizionamento.setAuthors(concessione.getAuthors());
concessione.setPosizionamentoScavo(posizionamento);
// Piante fine scavo
ArrayList<LayerConcessione> piante=new ArrayList<LayerConcessione>();
for(int i=0;i<pianteCount;i++) {
LayerConcessione pianta=new LayerConcessione();
pianta.setValutazioneQualita("Secondo me si");
pianta.setMetodoRaccoltaDati("Fattobbene");
pianta.setScalaAcquisizione("1:10000");
pianta.setAuthors(concessione.getAuthors());
pianta.setPolicy(AccessPolicy.RESTRICTED);
piante.add(pianta);
}
concessione.setPianteFineScavo(piante);
return concessione;
}
}

View File

@ -1,7 +1,8 @@
package org.gcube.application.geoportal.usecases;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import java.util.ArrayList;

View File

@ -1,17 +1,16 @@
package org.gcube.application.geoportal.usecases;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.utils.FileSets;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.geoportal.common.model.legacy.AssociatedContent;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni;

View File

@ -1,9 +1,10 @@
package org.gcube.application.geoportal.usecases;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.rest.TempFile;

View File

@ -2,9 +2,10 @@ package org.gcube.application.geoportal.usecases;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.legacy.ConcessioniManager;
import org.gcube.application.geoportal.client.utils.Serialization;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.geoportal.common.model.legacy.*;
import org.gcube.common.storagehub.client.dsl.FileContainer;
import org.gcube.common.storagehub.client.dsl.StorageHubClient;

View File

@ -1,7 +1,8 @@
package org.gcube.application.geoportal.usecases;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import java.util.ArrayList;

View File

@ -1,7 +1,8 @@
package org.gcube.application.geoportal.usecases;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.geoportal.clients.TokenSetter;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;

View File

@ -2,28 +2,19 @@ package org.gcube.application.geoportal.usecases.mocks;
import com.opencsv.CSVReader;
import lombok.extern.slf4j.Slf4j;
import org.gcube.application.geoportal.client.legacy.ConcessioniManagerI;
import org.gcube.application.cms.tests.model.TestModel;
import org.gcube.application.cms.tests.model.TokenSetter;
import org.gcube.application.geoportal.client.utils.FileSets;
import org.gcube.application.geoportal.clients.StatelessClientTests;
import org.gcube.application.geoportal.clients.TokenSetter;
import org.gcube.application.geoportal.common.model.TestModel;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
import org.gcube.application.geoportal.common.model.legacy.UploadedImage;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest;
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportal.common.rest.TempFile;
import org.gcube.application.geoportal.common.utils.Files;
import org.gcube.application.geoportal.common.utils.StorageUtils;
import org.gcube.contentmanagement.blobstorage.service.IClient;
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.mongoConcessioni;
import static org.gcube.application.geoportal.client.GeoportalAbstractPlugin.statefulMongoConcessioni;
import static org.junit.Assert.assertTrue;
@Slf4j
@ -139,7 +130,7 @@ public class MockFromFolder {
private static Concessione createMock(String baseName,Map<String,List<File>> piante, List<File> pos,
MongoConcessioni client, StorageUtils storage) throws Exception {
Concessione c=TestModel.prepareConcessione(piante.size(), 2);
Concessione c= TestModel.prepareConcessione(piante.size(), 2);
c.setNome("Mock for "+baseName);
c= client.createNew(c);
String mongoId=c.getMongo_id();

View File

@ -1,747 +0,0 @@
{
"authors": [
"Some one",
"Some, oneelse"
],
"centroidLat": 43.0,
"centroidLong": 9.0,
"contributore": "Contrib 1",
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"creationUser": "NO NAME",
"dataFineProgetto": [
2020,
11,
26,
13,
14,
17,
6000000
],
"dataInizioProgetto": [
2020,
11,
26,
13,
14,
16,
994000000
],
"descrizioneContenuto": "It contains this and that",
"editore": "Editore",
"folderId": "5f14252f-55df-4c9a-94d9-9ad190efbe6a",
"fontiFinanziamento": [
"Big pharma",
"Pentagon"
],
"genericContent": [],
"id": 8,
"immaginiRappresentative": [
{
"actualContent": [
{
"associated": null,
"id": 187,
"link": "https://data.dev.d4science.org/shub/E_VGFQSExUR1BmdzVHNjI5ZjFJeXE1TUFpWEkxUGllelIyWVZndndKZ3pBaGNPWlNGczdFaUNtMHVZaEd0dXc2Rw==",
"mimetype": "image/png",
"storageID": "6765deab-b157-494f-83e2-299032e1904c",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 0",
"format": "TIFF",
"id": 67,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 0",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 188,
"link": "https://data.dev.d4science.org/shub/E_NDVyQnBiMFJ1VDliYS83eEJvYS9vb1JrZ2tQN2orY3ZXNUJia25McFFtNlMrSS91NHNBN3pPVUNzTGN2aE9JOQ==",
"mimetype": "image/png",
"storageID": "4b4fb9f9-b96d-485d-80c9-713fad8a5c9b",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 1",
"format": "TIFF",
"id": 68,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 1",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 189,
"link": "https://data.dev.d4science.org/shub/E_YWw0TXVKa29KZFJOeDMwVlRDc29xMW0zSExYdGRJdmxZWEtJSGRVZ3ZBRVEwTnc1cEdMNG1iVVRBN2JDVG9WYQ==",
"mimetype": "image/png",
"storageID": "2690d6bc-2833-4797-81bb-1c1865f34f34",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 2",
"format": "TIFF",
"id": 69,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 2",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 190,
"link": "https://data.dev.d4science.org/shub/E_TU9ha0lGMTRhTDl6S2IzWDNmUWROVXZjZzJiSmNrS1BjZ3gycUJvVEI2b0ZDaGxuK1dUWmlsNW1DZE1ESUJPbA==",
"mimetype": "image/png",
"storageID": "244b0fe0-8f53-469a-9c5e-ac63e37d4622",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 3",
"format": "TIFF",
"id": 70,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 3",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 191,
"link": "https://data.dev.d4science.org/shub/E_NXZYZnV3RlFTYzRWOTBOMWt0cmFtVUtTU20xWTBQb3daRVV6RU8zTDc5RU9USnZVL3Y1VmpRNHNaajMyelVTMQ==",
"mimetype": "image/png",
"storageID": "6fab2082-08af-4899-9730-462b011b517d",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 4",
"format": "TIFF",
"id": 71,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 4",
"type": "UploadedImage"
}
],
"introduzione": "This is my project",
"lastUpdateTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"lastUpdateUser": "NO NAME",
"licenzaID": "CC-BY",
"nome": "Italia, forse",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"pianteFineScavo": [
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 196,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 193,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 195,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 194,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 192,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 72,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 198,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 197,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 200,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 199,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 201,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 73,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 202,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 204,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 205,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 203,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 206,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 74,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 209,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 211,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 207,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 208,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 210,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 75,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
}
],
"policy": "OPEN",
"posizionamentoScavo": {
"abstractSection": "Posizionamento topografico georeferenziato dellarea interessata dalle indagini",
"actualContent": [
{
"associated": null,
"id": 214,
"link": "https://data.dev.d4science.org/shub/E_UjJoQkw2a0VlR3djQnVYMlNaME40VkdLL3pxV21DNmRrWXVZUlFhMk53aXJORVJmM29pcHpPdVc4aHZLUTRwcg==",
"mimetype": "text/plain",
"storageID": "fac45dad-4840-4fda-b613-0bfd831d8720",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 213,
"link": "https://data.dev.d4science.org/shub/E_T0lsR09LbVdqMExWT1ZwZWpZSW4zUXBqZlV2bCt6d3hMbnc5UDBvRW45eENONzB4cXNtZ216cXZFNWVzdjU0eg==",
"mimetype": "text/plain",
"storageID": "d599e90f-26e0-4b27-b85e-bedd286ff2d7",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 215,
"link": "https://data.dev.d4science.org/shub/E_U2NhMXUvMzRycE9YYkRmbHphdC82QlJJN2FEeVd0Y1FEQmxwSjNmcWRTUDZoZHhVQ1VPdjRMVVdOVDcxNTh5Yw==",
"mimetype": "application/x-shapefile",
"storageID": "f1080875-7f01-4658-9758-9388262ad12c",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 216,
"link": "https://data.dev.d4science.org/shub/E_RlBWRW5lUG9nbncxSC9ZQlRURmFSeTQ3Q0ZqdDhOK2luV01uWjUxMTZ4OHREa29US2t3K21RblpjaXFMTWtSSA==",
"mimetype": "application/x-shapefile",
"storageID": "6b7eeb40-0cd1-4fe5-97b5-b7091e6b7531",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 212,
"link": "https://data.dev.d4science.org/shub/E_aHQxcDhoRGN0QXdXZTkwUmtKRlJsUFVqWjM4STY3U0JkVGU1L3l1a2t5WkhFWlc4blpoa0QxaDVRaHZCOXR2Nw==",
"mimetype": "application/x-dbf",
"storageID": "9af11436-2241-4a03-a95b-96849272bc25",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 76,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "OPEN",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse posizionamento scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
"recordType": "CONCESSIONE",
"relazioneScavo": {
"abstractSection": "simple abstract section",
"actualContent": [
{
"associated": null,
"id": 217,
"link": "https://data.dev.d4science.org/shub/E_a0JGWWNsY0tFc29CVC8xUW1ROUJhMnVaaWwxNk5TTk5TRlgvQW1tbkpLdDBuNFU3Rkg2VmlFVW53TEUzaEM4aA==",
"mimetype": "application/pdf",
"storageID": "e0cd721a-89e4-437d-9fba-2bfc197cb4c1",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 77,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "Italia, forse relazione di scavo",
"type": "RelazioneScavo"
},
"responsabile": "Someone",
"risorseCorrelate": [],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolareCopyright": "Chiedilo in giro",
"titolareLicenza": "Qualcun altro",
"titolari": [
"Some one",
"Some, oneelse"
],
"version": "1.0.0"
}

View File

@ -45,7 +45,6 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
</dependency>

View File

@ -13,4 +13,5 @@ public class AbstractRelazione extends AssociatedContent{
private String abstractEng;
}

View File

@ -74,11 +74,7 @@ public abstract class AssociatedContent {
if (getClass() != obj.getClass())
return false;
AssociatedContent other = (AssociatedContent) obj;
// if (actualContent == null) {
// if (other.actualContent != null)
// return false;
// } else if (!actualContent.equals(other.actualContent))
// return false;
if(!CollectionsUtils.equalsCollections(actualContent, other.actualContent)) return false;
if (creationTime == null) {

View File

@ -71,7 +71,7 @@ public class Concessione extends Record{
private Double centroidLong;
private RelazioneScavo relazioneScavo;
private AssociatedContent abstractRelazione;
private AbstractRelazione abstractRelazione;
private List<UploadedImage> immaginiRappresentative=new ArrayList<UploadedImage>();

View File

@ -1,130 +0,0 @@
package org.gcube.application.geoportal.common.model;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.UUID;
import org.gcube.application.geoportal.common.model.legacy.*;
public class TestModel {
private static final String rnd() {
return UUID.randomUUID().toString().replace("-", "_");
}
public static final Concessione setIds(Concessione c) {
c.setMongo_id(rnd());
c.getRelazioneScavo().setMongo_id(rnd());
c.getPosizionamentoScavo().setMongo_id(rnd());
c.getPianteFineScavo().forEach((LayerConcessione l)->{l.setMongo_id(rnd());});
c.getImmaginiRappresentative().forEach((UploadedImage i)->{i.setMongo_id(rnd());});
return c;
}
public static Concessione prepareEmptyConcessione() {
Concessione concessione=new Concessione();
// Generic fields
// Concessione fields
concessione.setNome("MONGO Italia, forse, ma su ");
concessione.setIntroduzione("This is my MONGO project");
concessione.setDescrizioneContenuto("It contains this and that");
concessione.setAuthors(Arrays.asList(new String[] {"Some one","Some, oneelse"}));
concessione.setContributore("Contrib 1");
concessione.setTitolari(Arrays.asList(new String[] {"Some one","Some, oneelse"}));
concessione.setResponsabile("Someone");
concessione.setEditore("Editore");
concessione.setFontiFinanziamento(Arrays.asList(new String[] {"Big pharma","Pentagon"}));
concessione.setSoggetto(Arrays.asList(new String[] {"Research Excavation","Archeology"}));
concessione.setDataInizioProgetto(LocalDateTime.now());
concessione.setDataFineProgetto(LocalDateTime.now());
concessione.setLicenzaID("CC-BY");
concessione.setTitolareLicenza(Arrays.asList(new String[] {"Qualcun altro"}));
concessione.setTitolareCopyright(Arrays.asList(new String[] {"Chiedilo in giro"}));
concessione.setParoleChiaveLibere(Arrays.asList(new String[] {"Robba","Stuff"}));
concessione.setParoleChiaveICCD(Arrays.asList(new String[] {"vattelapesca","somthing something"}));
concessione.setCentroidLat(43.0); //N-S
concessione.setCentroidLong(9.0); //E-W
return concessione;
}
public static Concessione prepareConcessione() {
Concessione concessione=prepareEmptyConcessione();
// Attachments
// Relazione scavo
RelazioneScavo relScavo=new RelazioneScavo();
relScavo.setResponsabili(concessione.getAuthors());
// Abstract
AbstractRelazione abstractRel=new AbstractRelazione();
abstractRel.setAbstractEng("This is the abstract");
abstractRel.setAbstractIta("Abstract ita");
concessione.setAbstractRelazione(abstractRel);
concessione.setRelazioneScavo(relScavo);
//Immagini rappresentative
ArrayList<UploadedImage> imgs=new ArrayList<>();
for(int i=0;i<5;i++) {
UploadedImage img=new UploadedImage();
img.setTitolo("My image number "+i);
img.setDidascalia("You can see my image number "+i);
img.setFormat("TIFF");
img.setCreationTime(LocalDateTime.now());
img.setResponsabili(concessione.getAuthors());
imgs.add(img);
}
concessione.setImmaginiRappresentative(imgs);
//Posizionamento
LayerConcessione posizionamento=new LayerConcessione();
posizionamento.setValutazioneQualita("Secondo me si");
posizionamento.setMetodoRaccoltaDati("Fattobbene");
posizionamento.setScalaAcquisizione("1:10000");
posizionamento.setAuthors(concessione.getAuthors());
concessione.setPosizionamentoScavo(posizionamento);
// Piante fine scavo
ArrayList<LayerConcessione> piante=new ArrayList<LayerConcessione>();
for(int i=0;i<4;i++) {
LayerConcessione pianta=new LayerConcessione();
pianta.setValutazioneQualita("Secondo me si");
pianta.setMetodoRaccoltaDati("Fattobbene");
pianta.setScalaAcquisizione("1:10000");
pianta.setAuthors(concessione.getAuthors());
pianta.setPolicy(AccessPolicy.RESTRICTED);
piante.add(pianta);
}
concessione.setPianteFineScavo(piante);
return concessione;
}
}

View File

@ -1,747 +0,0 @@
{
"authors": [
"Some one",
"Some, oneelse"
],
"centroidLat": 43.0,
"centroidLong": 9.0,
"contributore": "Contrib 1",
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"creationUser": "NO NAME",
"dataFineProgetto": [
2020,
11,
26,
13,
14,
17,
6000000
],
"dataInizioProgetto": [
2020,
11,
26,
13,
14,
16,
994000000
],
"descrizioneContenuto": "It contains this and that",
"editore": "Editore",
"folderId": "5f14252f-55df-4c9a-94d9-9ad190efbe6a",
"fontiFinanziamento": [
"Big pharma",
"Pentagon"
],
"genericContent": [],
"id": 8,
"immaginiRappresentative": [
{
"actualContent": [
{
"associated": null,
"id": 187,
"link": "https://data.dev.d4science.org/shub/E_VGFQSExUR1BmdzVHNjI5ZjFJeXE1TUFpWEkxUGllelIyWVZndndKZ3pBaGNPWlNGczdFaUNtMHVZaEd0dXc2Rw==",
"mimetype": "image/png",
"storageID": "6765deab-b157-494f-83e2-299032e1904c",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 0",
"format": "TIFF",
"id": 67,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 0",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 188,
"link": "https://data.dev.d4science.org/shub/E_NDVyQnBiMFJ1VDliYS83eEJvYS9vb1JrZ2tQN2orY3ZXNUJia25McFFtNlMrSS91NHNBN3pPVUNzTGN2aE9JOQ==",
"mimetype": "image/png",
"storageID": "4b4fb9f9-b96d-485d-80c9-713fad8a5c9b",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 1",
"format": "TIFF",
"id": 68,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 1",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 189,
"link": "https://data.dev.d4science.org/shub/E_YWw0TXVKa29KZFJOeDMwVlRDc29xMW0zSExYdGRJdmxZWEtJSGRVZ3ZBRVEwTnc1cEdMNG1iVVRBN2JDVG9WYQ==",
"mimetype": "image/png",
"storageID": "2690d6bc-2833-4797-81bb-1c1865f34f34",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 2",
"format": "TIFF",
"id": 69,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 2",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 190,
"link": "https://data.dev.d4science.org/shub/E_TU9ha0lGMTRhTDl6S2IzWDNmUWROVXZjZzJiSmNrS1BjZ3gycUJvVEI2b0ZDaGxuK1dUWmlsNW1DZE1ESUJPbA==",
"mimetype": "image/png",
"storageID": "244b0fe0-8f53-469a-9c5e-ac63e37d4622",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 3",
"format": "TIFF",
"id": 70,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 3",
"type": "UploadedImage"
},
{
"actualContent": [
{
"associated": null,
"id": 191,
"link": "https://data.dev.d4science.org/shub/E_NXZYZnV3RlFTYzRWOTBOMWt0cmFtVUtTU20xWTBQb3daRVV6RU8zTDc5RU9USnZVL3Y1VmpRNHNaajMyelVTMQ==",
"mimetype": "image/png",
"storageID": "6fab2082-08af-4899-9730-462b011b517d",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
35,
177000000
],
"didascalia": "You can see my image number 4",
"format": "TIFF",
"id": 71,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "My image number 4",
"type": "UploadedImage"
}
],
"introduzione": "This is my project",
"lastUpdateTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"lastUpdateUser": "NO NAME",
"licenzaID": "CC-BY",
"nome": "Italia, forse",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"pianteFineScavo": [
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 196,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 193,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 195,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 194,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 192,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 72,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 198,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 197,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 200,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 199,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 201,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 73,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 202,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 204,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 205,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 203,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 206,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 74,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
{
"abstractSection": "Planimetria georeferenziata dell'area indagata al termine delle attività",
"actualContent": [
{
"associated": null,
"id": 209,
"link": "https://data.dev.d4science.org/shub/E_RFZ0V2NUaDB5bCt4bGo5MnByZXZoRW5rWnRSWXFoRzdnQmxqTHlYSlhCeTU5RHZ3S2Ywa0ZDUCtUOCtZK3VkdQ==",
"mimetype": "text/plain",
"storageID": "f0f1fff4-6ee4-47c5-92be-2fd2c1ab5687",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 211,
"link": "https://data.dev.d4science.org/shub/E_aTZqVlNzRlRVSUFVZXhBNVp2bDdYMDlRTnNwVlRGRXNqMlI3MkxTdXlrWVFJeDF0L3pLemtaTDBwWFA3TVJKUw==",
"mimetype": "application/x-shapefile",
"storageID": "debd7027-56fe-4cff-ae87-b0df94421035",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 207,
"link": "https://data.dev.d4science.org/shub/E_cFZ6MFgvR1gzWmx0d2hvRmVnVTBQTEszdG1seEN3d2tBcHNsYkFXVlhKRUtucHZKb24xakEwa1IwQWJCTjc3cA==",
"mimetype": "application/x-dbf",
"storageID": "2c542d5a-ca89-42bb-87c9-1bceb8f0f03b",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 208,
"link": "https://data.dev.d4science.org/shub/E_UWpOTUYvRTRvV2hCYS8wQ3BaSG5GdG00MXdyeVg2M3dnZk5ZSEd3a0RxdWs0YUJTalFMK1JJQ2x5dFlySTZ4Lw==",
"mimetype": "text/plain",
"storageID": "d44b073f-6828-4dfd-a1fc-1d5eed93abc5",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 210,
"link": "https://data.dev.d4science.org/shub/E_SXUrWi9OZW9MMXpTSzdraGhveXNpaVo3b0Fid1loc1BEdnlqVmdGaWd1U2czb1YxdDhPeHNBWmovV21xRmxXVw==",
"mimetype": "application/x-shapefile",
"storageID": "4e184a77-915b-4ebd-bcb8-08ac8138069b",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 75,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "RESTRICTED",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse pianta fine scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
}
],
"policy": "OPEN",
"posizionamentoScavo": {
"abstractSection": "Posizionamento topografico georeferenziato dellarea interessata dalle indagini",
"actualContent": [
{
"associated": null,
"id": 214,
"link": "https://data.dev.d4science.org/shub/E_UjJoQkw2a0VlR3djQnVYMlNaME40VkdLL3pxV21DNmRrWXVZUlFhMk53aXJORVJmM29pcHpPdVc4aHZLUTRwcg==",
"mimetype": "text/plain",
"storageID": "fac45dad-4840-4fda-b613-0bfd831d8720",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 213,
"link": "https://data.dev.d4science.org/shub/E_T0lsR09LbVdqMExWT1ZwZWpZSW4zUXBqZlV2bCt6d3hMbnc5UDBvRW45eENONzB4cXNtZ216cXZFNWVzdjU0eg==",
"mimetype": "text/plain",
"storageID": "d599e90f-26e0-4b27-b85e-bedd286ff2d7",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 215,
"link": "https://data.dev.d4science.org/shub/E_U2NhMXUvMzRycE9YYkRmbHphdC82QlJJN2FEeVd0Y1FEQmxwSjNmcWRTUDZoZHhVQ1VPdjRMVVdOVDcxNTh5Yw==",
"mimetype": "application/x-shapefile",
"storageID": "f1080875-7f01-4658-9758-9388262ad12c",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 216,
"link": "https://data.dev.d4science.org/shub/E_RlBWRW5lUG9nbncxSC9ZQlRURmFSeTQ3Q0ZqdDhOK2luV01uWjUxMTZ4OHREa29US2t3K21RblpjaXFMTWtSSA==",
"mimetype": "application/x-shapefile",
"storageID": "6b7eeb40-0cd1-4fe5-97b5-b7091e6b7531",
"type": "WorkspaceContent"
},
{
"associated": null,
"id": 212,
"link": "https://data.dev.d4science.org/shub/E_aHQxcDhoRGN0QXdXZTkwUmtKRlJsUFVqWjM4STY3U0JkVGU1L3l1a2t5WkhFWlc4blpoa0QxaDVRaHZCOXR2Nw==",
"mimetype": "application/x-dbf",
"storageID": "9af11436-2241-4a03-a95b-96849272bc25",
"type": "WorkspaceContent"
}
],
"authors": [
"Some one",
"Some, oneelse"
],
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 76,
"layerID": null,
"layerName": null,
"layerUUID": null,
"licenseID": "CC-BY",
"metodoRaccoltaDati": "Fattobbene",
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"policy": "OPEN",
"record": null,
"responsabile": "Someone",
"scalaAcquisizione": "1:10000",
"subTopic": "Archeology",
"titolo": "Italia, forse posizionamento scavo",
"topicCategory": "Society",
"type": "LayerConcessione",
"valutazioneQualita": "Secondo me si",
"wmsLink": null
},
"recordType": "CONCESSIONE",
"relazioneScavo": {
"abstractSection": "simple abstract section",
"actualContent": [
{
"associated": null,
"id": 217,
"link": "https://data.dev.d4science.org/shub/E_a0JGWWNsY0tFc29CVC8xUW1ROUJhMnVaaWwxNk5TTk5TRlgvQW1tbkpLdDBuNFU3Rkg2VmlFVW53TEUzaEM4aA==",
"mimetype": "application/pdf",
"storageID": "e0cd721a-89e4-437d-9fba-2bfc197cb4c1",
"type": "WorkspaceContent"
}
],
"creationTime": [
2020,
11,
26,
13,
14,
37,
342000000
],
"id": 77,
"licenseID": "CC-BY",
"policy": "OPEN",
"record": null,
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolo": "Italia, forse relazione di scavo",
"type": "RelazioneScavo"
},
"responsabile": "Someone",
"risorseCorrelate": [],
"soggetto": [
"Research Excavation",
"Archeology"
],
"titolareCopyright": ["Chiedilo in giro"],
"titolareLicenza": ["Qualcun altro"],
"titolari": [
"Some one",
"Some, oneelse"
],
"version": "1.0.0"
}

View File

@ -212,6 +212,11 @@
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.gcube.application.cms</groupId>
<artifactId>cms-test-commons</artifactId>
<scope>test</scope>
</dependency>
<!-- <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId>
<version>10.8.3.0</version> <scope>test</scope> </dependency> -->

View File

@ -1,5 +1,6 @@
package org.gcube.application.geoportal.service;
import org.gcube.application.cms.tests.model.TestModel;
import org.gcube.application.geoportal.common.model.legacy.Concessione;
import org.gcube.application.geoportal.common.model.legacy.Concessione.Paths;
import org.gcube.application.geoportal.common.model.legacy.LayerConcessione;
@ -77,7 +78,7 @@ public class ConcessioniOverMongoTest extends BasicServiceTestUnit{
}
private static Concessione get(WebTarget target) throws Exception {
return register(target,TestModel.prepareConcessione());
return register(target, TestModel.prepareConcessione());
}
private static Concessione getById(WebTarget target ,String id) throws Exception {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -1,3 +0,0 @@
{
"id" : {$gt : 0}
}

View File

@ -1,3 +0,0 @@
{
"creationUser" : {$ne : "fabio.sinibaldi"}
}

View File

@ -1,3 +0,0 @@
{
"report.status": {$eq : "PASSED"}
}

View File

@ -1,10 +0,0 @@
{
"paging" : {
"offset" : 0,
"limit" : 1
},
"ordering" : {
"direction" : "ASCENDING",
"fields" : ["creationTime","nome"]
}
}

View File

@ -1,18 +0,0 @@
{
"paging" : {
"offset" : 0,
"limit" : 1
},
"ordering" : {
"direction" : "DESCENDING",
"fields" : ["creationTime","nome"]
},
"filter" : {
"creationUser" : {$eq : "fabio.sinibaldi"}
},
"projection" : {
"nome" : 1
}
}

View File

@ -1,11 +0,0 @@
{
"paging" : {
"offset" : 0,
"limit" : 1
},
"ordering" : {
"direction" : "DESCENDING",
"fields" : ["creationTime","nome"]
}
}

View File

@ -1,10 +0,0 @@
{
"ordering" : {
"direction" : "DESCENDING",
"fields" : ["nome"]
},
"filter" : {"report.status" : {"$eq" : "WARNING"}},
"projection" : {"report.warningMessages" : 1}
}

View File

@ -1 +0,0 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

View File

@ -1 +0,0 @@
GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]

57
pom.xml
View File

@ -32,6 +32,7 @@
<module>geoportal-service</module>
<module>geoportal-client</module>
<module>geoportal-common</module>
<module>cms-test-commons</module>
</modules>
@ -49,41 +50,39 @@
</dependency>
<!-- modules -->
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-service</artifactId>
<version>[1.0.6-SNAPSHOT,2.0.0)</version>
</dependency>
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-client</artifactId>
<version>[1.0.5-SNAPSHOT,2.0.0)</version>
</dependency>
<dependency>
<groupId>org.gcube.application</groupId>
<artifactId>geoportal-common</artifactId>
<version>[1.0.7-SNAPSHOT,2.0.0)</version>
</dependency>
<dependency>
<groupId>org.gcube.application.cms</groupId>
<artifactId>cms-test-commons</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.14.8</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- TEST -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<description>gCube CMS Suite is a set of components designed to manage complex space-temporal Documents defined by metadata Profiles.</description>