Concessioni Interface

1.0.1
Fabio Sinibaldi 3 years ago
parent 2662a25f30
commit 773e4cf339

1
.gitignore vendored

@ -1 +1,2 @@
/target/
/.classpath

@ -1 +1,2 @@
/org.eclipse.m2e.core.prefs
/org.eclipse.core.resources.prefs

@ -80,7 +80,6 @@
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<scope>test</scope>
</dependency>
<!-- jackson java time -->
@ -88,7 +87,6 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.8.8</version>
<scope>test</scope>
</dependency>

@ -4,6 +4,9 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
import org.gcube.application.geoportal.common.utils.CollectionsUtils;
@ -36,7 +39,10 @@ public abstract class AssociatedContent {
@XmlElements({
@XmlElement(type=GeoServerContent.class),
@XmlElement(type=WorkspaceContent.class),
})
private List<PersistedContent> actualContent=new ArrayList<>();

@ -5,6 +5,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import org.gcube.application.geoportal.common.model.legacy.report.Check;
import org.gcube.application.geoportal.common.model.legacy.report.ConstraintCheck;
import org.gcube.application.geoportal.common.model.legacy.report.ValidationReport;
@ -18,7 +20,7 @@ import lombok.ToString;
@Getter
@Setter
@ToString(callSuper=true)
@XmlRootElement
public class Concessione extends Record{

@ -1,5 +1,9 @@
package org.gcube.application.geoportal.common.model.legacy;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@ -7,25 +11,22 @@ import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
@Type(value = GeoServerContent.class),
@Type(value = WorkspaceContent.class),
})
public abstract class PersistedContent {
//Generic Info
private long id;
private AssociatedContent associated;
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("PersistedContent [id=");
builder.append(id);
if(associated==null) {
builder.append(", associated=");
builder.append(associated);
}else {
builder.append(", OWNER-associated-id=");
builder.append(associated.getId());
}
builder.append("]");
return builder.toString();
}

@ -14,6 +14,7 @@ import lombok.ToString;
@Setter
@ToString
@EqualsAndHashCode
public abstract class Record {

@ -3,7 +3,8 @@ package org.gcube.application.geoportal.common.rest;
public interface ConcessioniI {
public String create(String toCreate);
public String readById(String readById);
public String create(String toCreate) throws Exception;
public String readById(String id) throws Exception;
public String getAll() throws Exception;
public String update(String id,String updated) throws Exception;
}

@ -2,6 +2,9 @@ package org.gcube.application.geoportal.common.rest;
public class InterfaceConstants {
public static final String NAMESPACE="http://gcube-system.org/namespaces/data/sdi-service";
public static final String APPLICATION_BASE_PATH="geoportal-service";
public static final String APPLICATION_PATH="/srv/";
public static final String SERVICE_CLASS="Application";
public static final String SERVICE_NAME="GeoPortal";

@ -19,6 +19,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
public class SerializationTest {
@ -30,6 +31,7 @@ public class SerializationTest {
mapper.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, false);
mapper.setSerializationInclusion(Include.NON_NULL);
// mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
mapper.registerModule(new JavaTimeModule());
}

@ -1,200 +1 @@
{
"id": 1,
"recordType": "CONCESSIONE",
"version": "1.0.0",
"licenzaID": "CC-BY",
"policy": "OPEN",
"nome": "Italia, forse",
"folderId": "2f1bcd4b-fc3d-48c5-aa3b-064c68ba94c9",
"lastUpdateTime": [
2020,
11,
17,
12,
19,
58,
418000000
],
"lastUpdateUser": "NO NAME",
"creationTime": [
2020,
11,
17,
12,
19,
58,
418000000
],
"creationUser": "NO NAME",
"introduzione": "This is my 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": [],
"dataInizioProgetto": [
2020,
11,
17,
12,
19,
40,
741000000
],
"dataFineProgetto": [
2020,
11,
17,
12,
19,
40,
752000000
],
"titolareLicenza": "Qualcun altro",
"titolareCopyright": "Chiedilo in giro",
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"centroidLat": 43.0,
"centroidLong": 9.0,
"relazioneScavo": {
"id": 11,
"policy": "OPEN",
"licenseID": "CC-BY",
"titolo": "Italia, forse relazione di scavo",
"creationTime": [
2020,
11,
17,
12,
19,
58,
418000000
],
"record": null,
"actualContent": [
{
"id": 16,
"associated": null,
"mimetype": "application/pdf",
"storageID": "78ec815e-cc0e-4a61-8248-8eebe8c7c6be",
"link": "https://data.dev.d4science.org/shub/E_K0lSY05ja0s2N2hkVkxzWTVRSGN0MWZ4UFFOQnFTZHgraytOK05lcHZ2d002aGQ1Z2grZkE5d1ZmTUc5V3diLw=="
}
],
"abstractSection": "simple abstract section",
"responsabili": [
"Some one",
"Some, oneelse"
],
"soggetto": [
"Research Excavation",
"Archeology"
]
},
"immaginiRappresentative": [],
"posizionamentoScavo": {
"id": 10,
"policy": "OPEN",
"licenseID": "CC-BY",
"titolo": "Italia, forse posizionamento scavo",
"creationTime": [
2020,
11,
17,
12,
19,
58,
418000000
],
"record": null,
"actualContent": [
{
"id": 11,
"associated": null,
"mimetype": "application/x-dbf",
"storageID": "6c6ab4c4-5691-4652-9010-485ec8f1fc3d",
"link": "https://data.dev.d4science.org/shub/E_OThaZC9lRkk5cVprcjBwZlBFS1NyZEtvcjNTekFJYjVoZUdXalQweGI2emJzZ3cxNTFoUUJNbUs1YXRKLzA0bg=="
},
{
"id": 12,
"associated": null,
"mimetype": "text/plain",
"storageID": "10b8fbce-89a1-4a76-9e91-17c08c45c8ca",
"link": "https://data.dev.d4science.org/shub/E_eEo2NEV5WHl6RDhVSUMvWm1NTndwOW5FTjZaSkdPVjR0MFBiclNWWTBCbUJXUjA1ZmNVbU00N3FXeU5JQVdnLw=="
},
{
"id": 13,
"associated": null,
"mimetype": "text/plain",
"storageID": "435380a5-812d-4bef-b0f1-f0e89cd93730",
"link": "https://data.dev.d4science.org/shub/E_YTMyTDU5cVBxSWRkZEFuYi9hTVQ2ZUxtbnNyYU9KcUNydFl6dk5jbkhYWHk2ODAwUDZuemE5M2xVT2RPZDA5MA=="
},
{
"id": 14,
"associated": null,
"mimetype": "application/x-shapefile",
"storageID": "04a284fe-c6f2-4dd6-8c9c-06cc1ebbefb8",
"link": "https://data.dev.d4science.org/shub/E_UXRlN0F0OUdWazdCNElORExJUlppL0JEMjdkcHIvNWNDNGdtejNBQkxQTFlySERlWnQySUVDSkVTWHJHblRtdg=="
},
{
"id": 15,
"associated": null,
"mimetype": "application/x-shapefile",
"storageID": "285882cd-7922-4755-b7f2-95fe72960425",
"link": "https://data.dev.d4science.org/shub/E_aFlKbkhhREE3VlQ3TzZRMzlNK2YrODYxamFsclRmOWZKL1FYS1BzbjIvYWNBMjNnK2pyQzZTZUVKODUrRjBlTQ=="
}
],
"layerUUID": null,
"layerID": null,
"layerName": null,
"wmsLink": null,
"abstractSection": "Posizionamento topografico georeferenziato dellarea interessata dalle indagini",
"topicCategory": "Society",
"subTopic": "Archeology",
"bbox": {
"maxLat": 90.0,
"maxLong": 180.0,
"minLat": -90.0,
"minLong": -180.0
},
"paroleChiaveLibere": [
"Robba",
"Stuff"
],
"paroleChiaveICCD": [
"vattelapesca",
"somthing something"
],
"valutazioneQualita": "Secondo me si",
"metodoRaccoltaDati": "Fattobbene",
"scalaAcquisizione": "1:10000",
"authors": [
"Some one",
"Some, oneelse"
],
"responsabile": "Someone"
},
"pianteFineScavo": [],
"genericContent": []
}
{"id":4,"recordType":"CONCESSIONE","version":"1.0.0","licenzaID":"CC-BY","policy":"OPEN","nome":"Italia, forse","folderId":"e064c8ec-8b83-419e-ad67-ecd40bd17c76","lastUpdateTime":[2020,11,18,12,14,17,267000000],"lastUpdateUser":"NO NAME","creationTime":[2020,11,18,12,14,17,267000000],"creationUser":"NO NAME","introduzione":"This is my 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":[],"dataInizioProgetto":[2020,11,18,12,14,16,33000000],"dataFineProgetto":[2020,11,18,12,14,16,33000000],"titolareLicenza":"Qualcun altro","titolareCopyright":"Chiedilo in giro","paroleChiaveLibere":["Robba","Stuff"],"paroleChiaveICCD":["vattelapesca","somthing something"],"centroidLat":43.0,"centroidLong":9.0,"relazioneScavo":{"id":44,"policy":"OPEN","licenseID":"CC-BY","titolo":"Italia, forse relazione di scavo","creationTime":[2020,11,18,12,14,17,267000000],"record":null,"actualContent":[{"type":"WorkspaceContent","id":64,"associated":null,"mimetype":"application/pdf","storageID":"e82ddd36-de4a-42da-801a-40f3bf1dea43","link":"https://data.dev.d4science.org/shub/E_Slg1TzAvb1hRbnd5MUt3aWc2Tzl5Sjh5ZFZwN0E4VmJ4MHNKc3REL1BtM2NQT2pEai9mTThNeHU1QVVKWWFiaQ=="}],"abstractSection":"simple abstract section","responsabili":["Some one","Some, oneelse"],"soggetto":["Research Excavation","Archeology"]},"immaginiRappresentative":[],"posizionamentoScavo":{"id":43,"policy":"OPEN","licenseID":"CC-BY","titolo":"Italia, forse posizionamento scavo","creationTime":[2020,11,18,12,14,17,267000000],"record":null,"actualContent":[{"type":"WorkspaceContent","id":62,"associated":null,"mimetype":"application/x-shapefile","storageID":"0a191728-a55a-4cfc-a06b-74a2c7ab06cb","link":"https://data.dev.d4science.org/shub/E_WUo4K2diTjYxK00vcE1tb3NXM3JrdVlBWnZ3eHhZQjdxdTRoYWNYZG4zSXRON3BtRDh1M3duaTBrZ3JmaVBROQ=="},{"type":"WorkspaceContent","id":59,"associated":null,"mimetype":"application/x-dbf","storageID":"9ddec900-6133-4312-ae1c-6e5a246d656c","link":"https://data.dev.d4science.org/shub/E_bGFLdy9VVmtGc2pyeW9BOTZwY0dPOFp1ZmowY25Nd1JFY1ZmdUdNOHBuZnZTWlNVNThFeWVhTzVBc1BqZTl5SQ=="},{"type":"WorkspaceContent","id":60,"associated":null,"mimetype":"text/plain","storageID":"bf0973f9-e963-494a-9884-45cf40860323","link":"https://data.dev.d4science.org/shub/E_QU5MU3pnZUhZaWpsai9jeXY0azdJT3J3Z3N6bVQwZTBZKytsTGpWVmVZTThsOXN6dEREL2xOeko2UEFLSmtWWA=="},{"type":"WorkspaceContent","id":61,"associated":null,"mimetype":"text/plain","storageID":"161f01b6-4c5d-44c2-9f4b-f86b983870d9","link":"https://data.dev.d4science.org/shub/E_Q0dwUlhOTCtQRlAvZ29lZFZVbzNFcXNHMm1iL3B4SDdEMGVnVi9oVkxHMEp6dEZBTWthemhuZW1BQ0hIVnpocg=="},{"type":"WorkspaceContent","id":63,"associated":null,"mimetype":"application/x-shapefile","storageID":"738a4505-499c-4447-b2dc-be591dd36bfb","link":"https://data.dev.d4science.org/shub/E_dEVOdk5UaHJDVmJvUm0zMmU4MUR2Vmc3OXpxVkFUMWh1dTZUSFMxbExOYmhxdmUzMnMwNTE4bTZaZS9Vekk0TQ=="}],"layerUUID":null,"layerID":null,"layerName":null,"wmsLink":null,"abstractSection":"Posizionamento topografico georeferenziato dellarea interessata dalle indagini","topicCategory":"Society","subTopic":"Archeology","bbox":{"maxLat":90.0,"maxLong":180.0,"minLat":-90.0,"minLong":-180.0},"paroleChiaveLibere":["Robba","Stuff"],"paroleChiaveICCD":["vattelapesca","somthing something"],"valutazioneQualita":"Secondo me si","metodoRaccoltaDati":"Fattobbene","scalaAcquisizione":"1:10000","authors":["Some one","Some, oneelse"],"responsabile":"Someone"},"pianteFineScavo":[],"genericContent":[]}