Concessione : Fixed abstract management
This commit is contained in:
parent
577ee3d831
commit
cdb6d783d3
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
|
<gitBaseUrl>https://code-repo.d4science.org/gCubeSystem</gitBaseUrl>
|
||||||
<sis.version>1.0</sis.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -54,16 +53,10 @@
|
||||||
<version>[1.0.0,2.0.0)</version>
|
<version>[1.0.0,2.0.0)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- TEST -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.application.cms</groupId>
|
|
||||||
<artifactId>cms-test-commons</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Client for legacy -->
|
<!-- Client for legacy -->
|
||||||
<!-- jackson java time -->
|
<!-- jackson java time -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
@ -75,6 +68,13 @@
|
||||||
<artifactId>jersey-media-json-jackson</artifactId>
|
<artifactId>jersey-media-json-jackson</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- TEST -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>cms-test-commons</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.qos.logback</groupId>
|
<groupId>ch.qos.logback</groupId>
|
||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package org.gcube.application.geoportal.client.legacy;
|
package org.gcube.application.geoportal.client.legacy;
|
||||||
|
|
||||||
import org.gcube.application.geoportal.common.model.legacy.Concessione;
|
import org.gcube.application.geoportal.common.model.legacy.*;
|
||||||
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
|
|
||||||
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.gcube.application.geoportal.common.rest.MongoConcessioni;
|
import org.gcube.application.geoportal.common.rest.MongoConcessioni;
|
||||||
import org.gcube.application.geoportal.common.rest.TempFile;
|
import org.gcube.application.geoportal.common.rest.TempFile;
|
||||||
|
|
||||||
|
@ -15,14 +11,14 @@ public interface ConcessioniManagerI extends MongoConcessioni{
|
||||||
public Concessione addPiantaFineScavo(LayerConcessione toAdd,TempFile...files)throws Exception;
|
public Concessione addPiantaFineScavo(LayerConcessione toAdd,TempFile...files)throws Exception;
|
||||||
public Concessione setPosizionamento(LayerConcessione toSet,TempFile...files)throws Exception;
|
public Concessione setPosizionamento(LayerConcessione toSet,TempFile...files)throws Exception;
|
||||||
public Concessione setRelazioneScavo(RelazioneScavo toSet,TempFile...files)throws Exception;
|
public Concessione setRelazioneScavo(RelazioneScavo toSet,TempFile...files)throws Exception;
|
||||||
|
public Concessione setAbstractRelazioneScavo(AbstractRelazione toSet, TempFile...files)throws Exception;
|
||||||
|
|
||||||
|
|
||||||
public Concessione addImmagineRappresentativa(UploadedImage toAdd,InputStreamDescriptor f) throws Exception;
|
public Concessione addImmagineRappresentativa(UploadedImage toAdd,InputStreamDescriptor f) throws Exception;
|
||||||
public Concessione addPiantaFineScavo(LayerConcessione toAdd,InputStreamDescriptor...files)throws Exception;
|
public Concessione addPiantaFineScavo(LayerConcessione toAdd,InputStreamDescriptor...files)throws Exception;
|
||||||
public Concessione setPosizionamento(LayerConcessione toSet,InputStreamDescriptor...files)throws Exception;
|
public Concessione setPosizionamento(LayerConcessione toSet,InputStreamDescriptor...files)throws Exception;
|
||||||
public Concessione setRelazioneScavo(RelazioneScavo toSet,InputStreamDescriptor f)throws Exception;
|
public Concessione setRelazioneScavo(RelazioneScavo toSet,InputStreamDescriptor f)throws Exception;
|
||||||
|
public Concessione setAbstractRelazioneScavo(AbstractRelazione toSet,InputStreamDescriptor f)throws Exception;
|
||||||
|
|
||||||
public Concessione publish() throws Exception;
|
public Concessione publish() throws Exception;
|
||||||
public void delete() throws Exception;
|
public void delete() throws Exception;
|
||||||
|
|
|
@ -5,13 +5,9 @@ import java.util.ArrayList;
|
||||||
import javax.ws.rs.client.WebTarget;
|
import javax.ws.rs.client.WebTarget;
|
||||||
|
|
||||||
import org.gcube.application.geoportal.client.DefaultMongoConcessioni;
|
import org.gcube.application.geoportal.client.DefaultMongoConcessioni;
|
||||||
|
import org.gcube.application.geoportal.common.model.legacy.*;
|
||||||
import org.gcube.application.geoportal.common.utils.FileSets;
|
import org.gcube.application.geoportal.common.utils.FileSets;
|
||||||
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.Concessione.Paths;
|
||||||
import org.gcube.application.geoportal.common.model.legacy.InputStreamDescriptor;
|
|
||||||
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.gcube.application.geoportal.common.rest.TempFile;
|
import org.gcube.application.geoportal.common.rest.TempFile;
|
||||||
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
import org.gcube.application.geoportal.common.utils.StorageUtils;
|
||||||
import org.gcube.common.clients.delegates.ProxyDelegate;
|
import org.gcube.common.clients.delegates.ProxyDelegate;
|
||||||
|
@ -107,6 +103,16 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
||||||
return currentC;
|
return currentC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Concessione setAbstractRelazioneScavo(AbstractRelazione toSet, TempFile... files) throws Exception {
|
||||||
|
if(currentC==null) throw new Exception("Invalid operation : current Concessione is null.");
|
||||||
|
currentC.setAbstractRelazione(toSet);
|
||||||
|
currentC=replace(currentC);
|
||||||
|
|
||||||
|
currentC=super.registerFileSet(currentC.getMongo_id(),
|
||||||
|
FileSets.build(Paths.ABSTRACT_RELAZIONE,files).getTheRequest());
|
||||||
|
return currentC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -129,4 +135,8 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
||||||
return setRelazioneScavo(toSet,FileSets.asTemp(storage,f));
|
return setRelazioneScavo(toSet,FileSets.asTemp(storage,f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Concessione setAbstractRelazioneScavo(AbstractRelazione toSet, InputStreamDescriptor f) throws Exception {
|
||||||
|
return setAbstractRelazioneScavo(toSet,FileSets.asTemp(storage,f));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,10 @@ public class StatefulClientTests extends BasicVreTests{
|
||||||
toRegister.setNome("Mock module");
|
toRegister.setNome("Mock module");
|
||||||
manager.createNew(toRegister);
|
manager.createNew(toRegister);
|
||||||
|
|
||||||
UploadedImage toRegisterImg= TestModel.prepareConcessione().getImmaginiRappresentative().get(0);
|
Concessione source=TestModel.prepareConcessione();
|
||||||
|
|
||||||
|
|
||||||
|
UploadedImage toRegisterImg= source.getImmaginiRappresentative().get(0);
|
||||||
|
|
||||||
// TEMP Files are hosted in INFRASTRUCTURE's VOLATILE AREA
|
// TEMP Files are hosted in INFRASTRUCTURE's VOLATILE AREA
|
||||||
TempFile toUpload=storage.putOntoStorage(
|
TempFile toUpload=storage.putOntoStorage(
|
||||||
|
@ -52,16 +55,23 @@ public class StatefulClientTests extends BasicVreTests{
|
||||||
|
|
||||||
|
|
||||||
//Relazione
|
//Relazione
|
||||||
manager.setRelazioneScavo(TestModel.prepareConcessione().getRelazioneScavo(),
|
manager.setRelazioneScavo(source.getRelazioneScavo(),
|
||||||
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"relazione.pdf"), "relazione_it.pdf"),
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"relazione.pdf"), "relazione_it.pdf"),
|
||||||
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"relazione.pdf"), "relazione_en.pdf"));
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"relazione.pdf"), "relazione_en.pdf"));
|
||||||
|
|
||||||
|
//Abstract
|
||||||
|
manager.setAbstractRelazioneScavo(
|
||||||
|
source.getAbstractRelazione(),
|
||||||
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"relazione.pdf"), "abstract_relazione_it.pdf"),
|
||||||
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"relazione.pdf"), "abstract_relazione_en.pdf"));
|
||||||
|
|
||||||
|
|
||||||
// Posizionamento scavo
|
// Posizionamento scavo
|
||||||
manager.setPosizionamento(TestModel.prepareConcessione().getPosizionamentoScavo(),
|
manager.setPosizionamento(source.getPosizionamentoScavo(),
|
||||||
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"pos.shp"), "pos.shp"));
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"pos.shp"), "pos.shp"));
|
||||||
|
|
||||||
// Piante
|
// Piante
|
||||||
manager.addPiantaFineScavo(TestModel.prepareConcessione().getPianteFineScavo().get(0),
|
manager.addPiantaFineScavo(source.getPianteFineScavo().get(0),
|
||||||
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"pianta.shp"), "pianta.shp"),
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"pianta.shp"), "pianta.shp"),
|
||||||
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"pianta.shx"), "pianta.shx"));
|
storage.putOntoStorage(new File(TestModel.getBaseFolder(),"pianta.shx"), "pianta.shx"));
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,9 @@ public class StatelessClientTests extends BasicVreTests{
|
||||||
|
|
||||||
String mongoId=c.getMongo_id();
|
String mongoId=c.getMongo_id();
|
||||||
|
|
||||||
|
client.registerFileSet(mongoId,
|
||||||
|
FileSets.prepareRequest(storage,Paths.RELAZIONE,new File(TestModel.getBaseFolder(),"relazione.pdf")));
|
||||||
|
|
||||||
client.registerFileSet(mongoId,
|
client.registerFileSet(mongoId,
|
||||||
FileSets.prepareRequest(storage,Paths.RELAZIONE,new File(TestModel.getBaseFolder(),"relazione.pdf")));
|
FileSets.prepareRequest(storage,Paths.RELAZIONE,new File(TestModel.getBaseFolder(),"relazione.pdf")));
|
||||||
|
|
||||||
|
|
9
pom.xml
9
pom.xml
|
@ -33,9 +33,10 @@
|
||||||
<module>geoportal-client</module>
|
<module>geoportal-client</module>
|
||||||
<module>geoportal-common</module>
|
<module>geoportal-common</module>
|
||||||
<module>cms-test-commons</module>
|
<module>cms-test-commons</module>
|
||||||
|
<module>use-cases</module>
|
||||||
|
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,7 +71,11 @@
|
||||||
<artifactId>cms-test-commons</artifactId>
|
<artifactId>cms-test-commons</artifactId>
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.application.cms</groupId>
|
||||||
|
<artifactId>use-cases</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
|
|
Loading…
Reference in New Issue