Field naming
This commit is contained in:
parent
b675a0b208
commit
221fb36c78
|
@ -0,0 +1,6 @@
|
|||
package org.gcube.application.cms.plugins;
|
||||
|
||||
public abstract class AbstractLifeCycleManager {
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.application.geoportal.common.model.document;
|
||||
package org.gcube.application.cms.plugins.model;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
|
|||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.gcube.application.geoportal.common.model.document.ComparableVersion;
|
||||
|
||||
@Data
|
||||
@RequiredArgsConstructor
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.gcube.application.cms.plugins.reports;
|
|||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bson.Document;
|
||||
import org.gcube.application.cms.plugins.faults.PluginExecutionException;
|
||||
|
@ -12,29 +14,42 @@ import org.gcube.application.geoportal.common.model.document.lifecycle.Lifecycle
|
|||
|
||||
|
||||
@Data
|
||||
|
||||
@Slf4j
|
||||
public class DocumentHandlingReport<T extends BaseExecutionRequest> extends Report{
|
||||
|
||||
@NonNull
|
||||
T theRequest;
|
||||
Document resultingDocument;
|
||||
LifecycleInformation toSetLifecycleInformation;
|
||||
|
||||
|
||||
public DocumentHandlingReport(@NonNull T theRequest) {
|
||||
this.theRequest = theRequest;
|
||||
toSetLifecycleInformation=theRequest.getDocument().getLifecycleInformation().cleanState();
|
||||
resultingDocument = theRequest.getDocument().getTheDocument();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() throws PluginExecutionException {
|
||||
super.validate();
|
||||
if (resultingDocument==null) {
|
||||
log.warn("NULL resulting document in report {} ", this);
|
||||
throw new PluginExecutionException("Invalid report : Resulting document cannot be null");
|
||||
}
|
||||
if(toSetLifecycleInformation == null) {
|
||||
log.warn("NULL lifecycleinformation in report {} ",this);
|
||||
throw new PluginExecutionException("Invalid report : Lifecycle information cannot be null");
|
||||
}
|
||||
}
|
||||
|
||||
public ProfiledDocument prepareResult() throws JsonProcessingException, PluginExecutionException {
|
||||
log.trace("Preparing document ID {} from report ... ",theRequest.getDocument().get_id());
|
||||
log.trace("Preparing document ID {} from report ... ",theRequest.getDocument().getId());
|
||||
this.validate();
|
||||
|
||||
ProfiledDocument toReturn = theRequest.getDocument();
|
||||
if(resultingDocument !=null ) {
|
||||
log.trace("Updating Document ");
|
||||
toReturn.setTheDocument(resultingDocument);
|
||||
}
|
||||
if(toSetLifecycleInformation != null){
|
||||
log.trace("Merging lifecycleInformation");
|
||||
// Document original = Serialization.asDocument(toReturn.getLifecycleInformation());
|
||||
// Document toSet = Serialization.asDocument(toSetLifecycleInformation);
|
||||
// toSet.putAll(original);
|
||||
// toReturn.setLifecycleInformation(Serialization.convert(toSet,LifecycleInformation.class));
|
||||
toReturn.setLifecycleInformation(toSetLifecycleInformation);
|
||||
}
|
||||
toReturn.setTheDocument(resultingDocument);
|
||||
toReturn.setLifecycleInformation(toSetLifecycleInformation);
|
||||
|
||||
// Force Report status into info
|
||||
log.trace("Report status is {} ",getStatus());
|
||||
|
|
|
@ -9,6 +9,12 @@ import org.gcube.application.geoportal.common.model.document.lifecycle.Lifecycle
|
|||
@Data
|
||||
public class EventExecutionReport extends DocumentHandlingReport<EventExecutionRequest>{
|
||||
|
||||
public EventExecutionReport(EventExecutionRequest req){
|
||||
super(req);
|
||||
this.setToSetLifecycleInformation(theRequest.getDocument().getLifecycleInformation().cleanState());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setToSetLifecycleInformation(LifecycleInformation toSetLifecycleInformation) {
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package org.gcube.application.cms.plugins.reports;
|
||||
|
||||
import lombok.NonNull;
|
||||
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||
|
||||
public class IndexDocumentReport extends DocumentHandlingReport<IndexDocumentRequest> {
|
||||
public IndexDocumentReport(@NonNull IndexDocumentRequest theRequest) {
|
||||
super(theRequest);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package org.gcube.application.cms.plugins.reports;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import org.gcube.application.cms.plugins.requests.MaterializationRequest;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
|
||||
@Data
|
||||
|
||||
public class MaterializationReport extends DocumentHandlingReport<MaterializationRequest>{
|
||||
|
||||
|
||||
|
||||
public MaterializationReport(@NonNull MaterializationRequest theRequest) {
|
||||
super(theRequest);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.application.cms.plugins.reports;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.*;
|
||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
|
@ -8,9 +8,15 @@ import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class StepExecutionReport extends DocumentHandlingReport<StepExecutionRequest>{
|
||||
|
||||
public StepExecutionReport(@NonNull StepExecutionRequest theRequest) {
|
||||
super(theRequest);
|
||||
}
|
||||
|
||||
List<EventExecutionRequest> toTriggerEvents;
|
||||
|
||||
List<StepExecutionRequest> cascadeSteps;
|
||||
|
|
|
@ -10,7 +10,7 @@ import com.vdurmont.semver4j.Semver;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bson.Document;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.gcube.application.geoportal.common.model.document.ComparableVersion;
|
||||
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||
|
||||
|
@ -87,8 +87,8 @@ public class Serialization {
|
|||
|
||||
public static final Document asDocumentWithId(ProfiledDocument doc) throws JsonProcessingException {
|
||||
Document toReturn =Document.parse(mapper.writeValueAsString(doc));
|
||||
if(doc.get_id()!=null)
|
||||
toReturn.put(ProfiledDocument.ID,new ObjectId(doc.get_id()));
|
||||
if(doc.getId()!=null)
|
||||
toReturn.put(ProfiledDocument.ID,new ObjectId(doc.getId()));
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.util.HashMap;
|
|||
public class TestProfiles {
|
||||
|
||||
|
||||
public static File BASE_FOLDER =new File("../test-data/profiledDocuments");
|
||||
public static File BASE_FOLDER =new File("../test-data/profiledDocuments/profiles");
|
||||
public static final HashMap<String, Profile> profiles =new HashMap<>();
|
||||
|
||||
static{
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
|||
import org.gcube.application.cms.plugins.MaterializationPlugin;
|
||||
import org.gcube.application.cms.plugins.PluginManagerInterface;
|
||||
import org.gcube.application.cms.plugins.faults.EventException;
|
||||
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
||||
import org.gcube.application.cms.plugins.reports.*;
|
||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||
|
@ -51,10 +52,7 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
|
|||
@Setter
|
||||
PluginManagerInterface pluginManager;
|
||||
|
||||
// TODO DISCOVER
|
||||
MaterializationPlugin plugin;
|
||||
|
||||
IndexerPluginInterface indexerPlugin;
|
||||
|
||||
@Override
|
||||
public InitializationReport initInContext() throws InitializationException {
|
||||
|
@ -74,8 +72,7 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
|
|||
InitializationReport report = new InitializationReport();
|
||||
try{
|
||||
report.setStatus(Report.Status.OK);
|
||||
plugin= (MaterializationPlugin) pluginManager.getById("SDI-Default-Materializer");
|
||||
indexerPlugin = (IndexerPluginInterface) pluginManager.getById("SDI-Indexer-Plugin");
|
||||
|
||||
} catch (Throwable e) {
|
||||
log.error("Unable to initialize plugins ",e);
|
||||
report.setStatus(Report.Status.WARNING);
|
||||
|
@ -92,15 +89,21 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
|
|||
@Override
|
||||
public StepExecutionReport performStep(StepExecutionRequest request) throws StepException {
|
||||
log.info("Serving Request {}",request);
|
||||
StepExecutionReport report=new StepExecutionReport();
|
||||
report.setTheRequest(request);
|
||||
StepExecutionReport report=new StepExecutionReport(request);
|
||||
report.setStatus(Report.Status.OK);
|
||||
report.setToSetLifecycleInformation(new LifecycleInformation());
|
||||
|
||||
LifecycleInformation info=report.getToSetLifecycleInformation();
|
||||
info.setLastOperationStatus(LifecycleInformation.Status.OK);
|
||||
info.setLastInvokedStep(request.getStep());
|
||||
try {
|
||||
|
||||
MaterializationPlugin plugin;
|
||||
|
||||
IndexerPluginInterface indexerPlugin;
|
||||
|
||||
plugin= (MaterializationPlugin) pluginManager.getById("SDI-Default-Materializer");
|
||||
indexerPlugin = (IndexerPluginInterface) pluginManager.getById("SDI-Indexer-Plugin");
|
||||
|
||||
switch (request.getStep()) {
|
||||
case "SUBMIT-FOR-REVIEW" :{
|
||||
|
||||
|
@ -209,14 +212,7 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
|
|||
@Override
|
||||
public EventExecutionReport onEvent(EventExecutionRequest request) throws EventException {
|
||||
log.info("Executing Event {}",request);
|
||||
EventExecutionReport report=new EventExecutionReport();
|
||||
report.setTheRequest(request);
|
||||
if(report.getToSetLifecycleInformation()==null){
|
||||
LifecycleInformation lc=new LifecycleInformation();
|
||||
report.setStatus(Report.Status.OK);
|
||||
report.setToSetLifecycleInformation(lc);
|
||||
}
|
||||
|
||||
EventExecutionReport report=new EventExecutionReport(request);
|
||||
|
||||
TriggeredEvents info=new TriggeredEvents();
|
||||
info.setEvent(request.getEvent());
|
||||
|
|
|
@ -3,43 +3,24 @@ package org.gcube.application.cms.sdi.plugins;
|
|||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bson.Document;
|
||||
import org.gcube.application.cms.caches.AbstractScopedMap;
|
||||
import org.gcube.application.cms.implementations.ISInterface;
|
||||
import org.gcube.application.cms.implementations.ImplementationProvider;
|
||||
import org.gcube.application.cms.plugins.AbstractPlugin;
|
||||
import org.gcube.application.cms.plugins.IndexerPluginInterface;
|
||||
import org.gcube.application.cms.plugins.InitializablePlugin;
|
||||
import org.gcube.application.cms.plugins.faults.InitializationException;
|
||||
import org.gcube.application.cms.plugins.faults.ShutDownException;
|
||||
import org.gcube.application.cms.plugins.model.PluginDescriptor;
|
||||
import org.gcube.application.cms.plugins.reports.IndexDocumentReport;
|
||||
import org.gcube.application.cms.plugins.reports.InitializationReport;
|
||||
import org.gcube.application.cms.plugins.reports.MaterializationReport;
|
||||
import org.gcube.application.cms.plugins.reports.Report;
|
||||
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.IndexDocumentRequest;
|
||||
import org.gcube.application.cms.sdi.engine.PostgisIndexer;
|
||||
import org.gcube.application.cms.sdi.engine.PostgisTable;
|
||||
import org.gcube.application.cms.sdi.engine.SDIManager;
|
||||
import org.gcube.application.cms.sdi.engine.SDIManagerWrapper;
|
||||
import org.gcube.application.cms.sdi.faults.SDIInteractionException;
|
||||
import org.gcube.application.cms.serialization.Serialization;
|
||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||
import org.gcube.application.geoportal.common.model.document.ComparableVersion;
|
||||
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.document.filesets.GCubeSDILayer;
|
||||
import org.gcube.application.geoportal.common.model.profile.HandlerDeclaration;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
import org.gcube.application.geoportal.common.model.rest.DatabaseConnection;
|
||||
import org.gcube.application.geoportal.common.utils.ContextUtils;
|
||||
|
||||
import javax.swing.border.AbstractBorder;
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPluginInterface {
|
||||
|
@ -94,7 +75,7 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
|
|||
Document requestArguments=request.getCallParameters();
|
||||
Document profileConfiguration =getConfigurationFromProfile(profile).getConfiguration();
|
||||
|
||||
IndexDocumentReport report= new IndexDocumentReport();
|
||||
IndexDocumentReport report= new IndexDocumentReport(request);
|
||||
|
||||
log.debug("Profile Configuration is {} ",profileConfiguration);
|
||||
|
||||
|
@ -134,7 +115,7 @@ public class SDIIndexerPlugin extends SDIAbstractPlugin implements IndexerPlugin
|
|||
|
||||
Document doc = requestArguments;
|
||||
// DEFAULT VALUES
|
||||
doc.put("projectid",profiledDocument.get_id());
|
||||
doc.put("projectid",profiledDocument.getId());
|
||||
|
||||
// ********************** EVALAUTE POSITION
|
||||
log.debug("indexing Profile {} : Evaluating Centroid... ",profile.getId());
|
||||
|
|
|
@ -5,7 +5,6 @@ import lombok.Synchronized;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.bson.Document;
|
||||
import org.gcube.application.cms.plugins.AbstractPlugin;
|
||||
import org.gcube.application.cms.sdi.engine.SDIManager;
|
||||
import org.gcube.application.cms.sdi.engine.SDIManagerWrapper;
|
||||
import org.gcube.application.cms.sdi.faults.SDIInteractionException;
|
||||
import org.gcube.application.cms.plugins.MaterializationPlugin;
|
||||
|
@ -19,11 +18,10 @@ import org.gcube.application.cms.plugins.reports.Report;
|
|||
import org.gcube.application.cms.plugins.requests.MaterializationRequest;
|
||||
import org.gcube.application.cms.serialization.Serialization;
|
||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||
import org.gcube.application.geoportal.common.model.document.ComparableVersion;
|
||||
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFileSet;
|
||||
import org.gcube.application.geoportal.common.model.profile.Field;
|
||||
import org.gcube.application.geoportal.common.model.profile.HandlerDeclaration;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
import org.gcube.application.geoportal.common.utils.ContextUtils;
|
||||
|
||||
|
@ -96,7 +94,7 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
|
|||
Document requestArguments=request.getCallParameters();
|
||||
Document profileConfiguration =getConfigurationFromProfile(profile).getConfiguration();
|
||||
|
||||
MaterializationReport report= new MaterializationReport();
|
||||
MaterializationReport report= new MaterializationReport(request);
|
||||
|
||||
log.debug("Profile Configuration is {} ",profileConfiguration);
|
||||
try{
|
||||
|
@ -122,13 +120,13 @@ public class SDIMaterializerPlugin extends AbstractPlugin implements Materializa
|
|||
RegisteredFileSet fs = Serialization.convert(fsObject,RegisteredFileSet.class);
|
||||
log.debug("Found {} ",fs);
|
||||
requestArguments.putIfAbsent("basePersistencePath",profile.getId());
|
||||
requestArguments.putIfAbsent("documentID",profiledDocument.get_id());
|
||||
requestArguments.putIfAbsent("documentID",profiledDocument.getId());
|
||||
if(requestArguments.containsKey("titleField"))
|
||||
requestArguments.putIfAbsent("layerTitle",fs.getString(requestArguments.getString("titleField")));
|
||||
else requestArguments.putIfAbsent("layerTitle",fs.getUUID());
|
||||
|
||||
//Add FS uuid at ws_baseName
|
||||
requestArguments.put("workspace",request.getMandatory("workspace")+"_"+ profiledDocument.get_id());
|
||||
requestArguments.put("workspace",request.getMandatory("workspace")+"_"+ profiledDocument.getId());
|
||||
|
||||
// Actually materializing
|
||||
RegisteredFileSet obtained = getSDIManager().materializeLayer(fs,requestArguments);
|
||||
|
|
|
@ -51,7 +51,7 @@ public class DefaultProfiledDocumentsClient<T extends ProfiledDocument> implemen
|
|||
post(Entity.entity(toCreate, MediaType.APPLICATION_JSON)),getManagedClass());
|
||||
};
|
||||
T toReturn = delegate.make(call);
|
||||
log.info("Registered {} profiled {} ",toReturn.get_id(),profileID);
|
||||
log.info("Registered {} profiled {} ",toReturn.getId(),profileID);
|
||||
return toReturn;
|
||||
}catch(RemoteException e){
|
||||
log.error("Unexpected error ",e);
|
||||
|
|
|
@ -68,7 +68,7 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
|||
|
||||
current =super.registerFileSet(current.getMongo_id(),
|
||||
Serialization.convert(
|
||||
FileSets.build(Paths.imgByIndex(current.getImmaginiRappresentative().size()-1),f).getTheRequest(),
|
||||
FileSets.build(Paths.imgByIndex(current.getImmaginiRappresentative().size()-1),null,null,f).getTheRequest(),
|
||||
AddSectionToConcessioneRequest.class));
|
||||
return current;
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
|||
|
||||
current =super.registerFileSet(current.getMongo_id(),
|
||||
Serialization.convert(
|
||||
FileSets.build(Paths.piantaByIndex(current.getPianteFineScavo().size()-1),files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
FileSets.build(Paths.piantaByIndex(current.getPianteFineScavo().size()-1),null,null,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
return current;
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
|||
|
||||
|
||||
current =super.registerFileSet(current.getMongo_id(),
|
||||
Serialization.convert(FileSets.build(Paths.POSIZIONAMENTO,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
Serialization.convert(FileSets.build(Paths.POSIZIONAMENTO,null,null,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
return current;
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
|||
|
||||
|
||||
current =super.registerFileSet(current.getMongo_id(),
|
||||
Serialization.convert(FileSets.build(Paths.RELAZIONE,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
Serialization.convert(FileSets.build(Paths.RELAZIONE,null,null,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
return current;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ public class StatefulMongoConcessioni extends DefaultMongoConcessioni implements
|
|||
current =replace(current);
|
||||
|
||||
current =super.registerFileSet(current.getMongo_id(),
|
||||
Serialization.convert(FileSets.build(Paths.ABSTRACT_RELAZIONE,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
Serialization.convert(FileSets.build(Paths.ABSTRACT_RELAZIONE,null,null,files).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
return current;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,6 @@ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|||
import com.vdurmont.semver4j.Semver;
|
||||
import org.bson.Document;
|
||||
import org.bson.types.ObjectId;
|
||||
import org.gcube.application.geoportal.common.model.document.ComparableVersion;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.rest.QueryRequest;
|
||||
|
||||
public class Serialization {
|
||||
|
||||
|
|
|
@ -46,12 +46,12 @@ public class ProfiledDocumentsTest<M extends ProfiledDocument,C extends Profiled
|
|||
ProfiledDocumentsI<M> client = (ProfiledDocumentsI<M>) getClient();
|
||||
AtomicLong counter=new AtomicLong(0);
|
||||
client.query(new QueryRequest()).forEachRemaining( m -> {
|
||||
System.out.print(counter.incrementAndGet()+ ", ID : "+m.get_id());
|
||||
System.out.print(counter.incrementAndGet()+ ", ID : "+m.getId());
|
||||
try {
|
||||
M proj=client.getById(m.get_id());
|
||||
M proj=client.getById(m.getId());
|
||||
System.out.println("... OK.. STATUS : "+proj.getLifecycleInformation());
|
||||
} catch (RemoteException e) {
|
||||
System.err.println(" Error with "+m.get_id());
|
||||
System.err.println(" Error with "+m.getId());
|
||||
System.err.println(e);
|
||||
System.out.println("... ERRR !!!!");
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ public class StatelessClientTests extends BasicVreTests {
|
|||
AddSectionToConcessioneRequest request=
|
||||
Serialization.convert(
|
||||
// FileSets.prepareRequest(new StorageUtils(),Paths.RELAZIONE,new File(TestConcessioniModel.getBaseFolder(),"relazione.pdf"));
|
||||
FileSets.build(Paths.ABSTRACT_RELAZIONE).add(
|
||||
FileSets.build(Paths.ABSTRACT_RELAZIONE,null,null).add(
|
||||
new StorageUtils().putOntoStorage(new File(TestConcessioniModel.getBaseFolder(),"relazione.pdf"),"San Mauro_drone totale.JPG"))
|
||||
.getTheRequest(),AddSectionToConcessioneRequest.class);
|
||||
|
||||
|
@ -193,21 +193,21 @@ public class StatelessClientTests extends BasicVreTests {
|
|||
assertEquals(AccessPolicy.EMBARGOED,c.getRelazioneScavo().getPolicy());
|
||||
|
||||
c=client.registerFileSet(mongoId,
|
||||
Serialization.convert(FileSets.prepareRequest(storage,Paths.RELAZIONE,
|
||||
Serialization.convert(FileSets.prepareRequest(storage,Paths.RELAZIONE,null,null,
|
||||
new File(TestConcessioniModel.getBaseFolder(),"relazione.pdf")), AddSectionToConcessioneRequest.class));
|
||||
|
||||
assertEquals(AccessPolicy.EMBARGOED,c.getRelazioneScavo().getPolicy());
|
||||
|
||||
c=client.registerFileSet(mongoId,
|
||||
Serialization.convert(
|
||||
FileSets.prepareRequest(storage,Paths.ABSTRACT_RELAZIONE,new File(TestConcessioniModel.getBaseFolder(),"relazione.pdf")),AddSectionToConcessioneRequest.class));
|
||||
FileSets.prepareRequest(storage,Paths.ABSTRACT_RELAZIONE,null, null, new File(TestConcessioniModel.getBaseFolder(),"relazione.pdf")),AddSectionToConcessioneRequest.class));
|
||||
|
||||
assertEquals(AccessPolicy.EMBARGOED,c.getRelazioneScavo().getPolicy());
|
||||
|
||||
for(int i=0;i<numImgs;i++)
|
||||
c=client.registerFileSet(mongoId,
|
||||
Serialization.convert(
|
||||
FileSets.build(Paths.imgByIndex(i)).
|
||||
FileSets.build(Paths.imgByIndex(i),null,null).
|
||||
add(storage.putOntoStorage(new File(TestConcessioniModel.getBaseFolder(),"immagine"+(i+1)+".png"),
|
||||
i+"San Mauro_drone totale.JPG")).getTheRequest(),AddSectionToConcessioneRequest.class));
|
||||
|
||||
|
@ -215,14 +215,14 @@ public class StatelessClientTests extends BasicVreTests {
|
|||
|
||||
c=client.registerFileSet(mongoId,
|
||||
Serialization.convert(
|
||||
FileSets.prepareRequest(storage,Paths.POSIZIONAMENTO,new File(TestConcessioniModel.getBaseFolder(),
|
||||
FileSets.prepareRequest(storage,Paths.POSIZIONAMENTO,null,null,new File(TestConcessioniModel.getBaseFolder(),
|
||||
"pos.shp")),AddSectionToConcessioneRequest.class));
|
||||
|
||||
assertEquals(AccessPolicy.EMBARGOED,c.getRelazioneScavo().getPolicy());
|
||||
|
||||
c=client.registerFileSet(mongoId,
|
||||
Serialization.convert(
|
||||
FileSets.prepareRequest(storage,Paths.piantaByIndex(0),
|
||||
FileSets.prepareRequest(storage,Paths.piantaByIndex(0),null,null,
|
||||
new File(TestConcessioniModel.getBaseFolder(),"pianta.shp")),AddSectionToConcessioneRequest.class));
|
||||
|
||||
assertEquals(AccessPolicy.EMBARGOED,c.getRelazioneScavo().getPolicy());
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package org.gcube.application.geoportal.clients.serialization;
|
||||
|
||||
import ch.qos.logback.core.net.SyslogOutputStream;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import junit.framework.Assert;
|
||||
import org.gcube.application.cms.tests.TestProfiles;
|
||||
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||
import org.gcube.application.geoportal.common.model.JSONPathWrapper;
|
||||
import org.gcube.application.geoportal.common.model.document.ProfiledDocument;
|
||||
import org.gcube.application.geoportal.common.model.profile.Field;
|
||||
import org.gcube.application.geoportal.common.model.profile.HandlerDeclaration;
|
||||
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||||
import org.gcube.application.geoportal.common.utils.Files;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
import static junit.framework.TestCase.assertTrue;
|
||||
|
||||
public class Profiles {
|
||||
|
||||
private static Profile readProfile(String file) throws IOException {
|
||||
return Serialization.read(getJSON(file), Profile.class);
|
||||
}
|
||||
|
||||
private static String getJSON(String file) throws IOException {
|
||||
return Files.readFileAsString(
|
||||
new File(TestProfiles.BASE_FOLDER,file).getAbsolutePath(), Charset.defaultCharset());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void read () throws IOException {
|
||||
for (Map.Entry<String, Profile> entry : TestProfiles.profiles.entrySet()) {
|
||||
String s = entry.getKey();
|
||||
Profile profile = entry.getValue();
|
||||
System.out.println("Checking " + s);
|
||||
|
||||
validate(profile);
|
||||
System.out.println(profile);
|
||||
Profile converted = Serialization.convert(profile, Profile.class);
|
||||
assertEquals(profile, converted);
|
||||
JSONPathWrapper wrapper = new JSONPathWrapper(Serialization.asDocument(profile).toJson());
|
||||
List<List> foundObjects = wrapper.getByPath("$." + Profile.HANDLERS, List.class);
|
||||
|
||||
foundObjects.get(0).forEach(o -> {
|
||||
HandlerDeclaration h = Serialization.convert(o, HandlerDeclaration.class);
|
||||
System.out.println(h);
|
||||
validate(h);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void validate(Profile profile){
|
||||
assertTrue(profile.getId()!=null);
|
||||
if(profile.getHandlers()!=null)
|
||||
profile.getHandlers().forEach(handlerDeclaration -> validate(handlerDeclaration));
|
||||
if(profile.getSchema()!=null)
|
||||
validate(profile.getSchema());
|
||||
|
||||
}
|
||||
private void validate(HandlerDeclaration handler){
|
||||
assertTrue(handler.getId()!=null);
|
||||
}
|
||||
|
||||
private void validate(Field f){
|
||||
//assertTrue(f.getType()!=null);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.mongodb.client.model.geojson.GeoJsonObjectType;
|
||||
import com.vdurmont.semver4j.Semver;
|
||||
import lombok.*;
|
||||
|
@ -28,26 +29,34 @@ public class ProfiledDocument {
|
|||
|
||||
// CORE METADATA
|
||||
|
||||
private String _id;
|
||||
@JsonProperty(ID)
|
||||
private String id;
|
||||
@JsonProperty(VERSION)
|
||||
private Semver version;
|
||||
|
||||
// Publication Info
|
||||
@JsonProperty(INFO)
|
||||
private PublicationInfo info;
|
||||
|
||||
// Profile reference
|
||||
@JsonProperty(PROFILE_ID)
|
||||
private String profileID;
|
||||
@JsonProperty(PROFILE_VERSION)
|
||||
private Semver profileVersion;
|
||||
|
||||
@JsonProperty(LIFECYCLE_INFORMATION)
|
||||
private LifecycleInformation lifecycleInformation;
|
||||
|
||||
@JsonProperty(RELATIONSHIPS)
|
||||
private Relationship[] relationships;
|
||||
|
||||
// Expected GEOJSON
|
||||
@JsonProperty(SPATIAL_REFERENCE)
|
||||
private Document spatialReference;
|
||||
|
||||
@JsonProperty(TEMPORAL_REFERENCE)
|
||||
private TemporalReference temporalReference;
|
||||
|
||||
@JsonProperty(THE_DOCUMENT)
|
||||
private Document theDocument;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@NoArgsConstructor
|
||||
|
@ -12,7 +13,9 @@ public class Relationship {
|
|||
public static final String RELATIONSHIP_NAME="_relationshipName";
|
||||
public static final String TARGET_ID="_targetID";
|
||||
|
||||
@JsonProperty(RELATIONSHIP_NAME)
|
||||
private String relationshipName;
|
||||
@JsonProperty(TARGET_ID)
|
||||
private String targetID;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document.access;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@NoArgsConstructor
|
||||
|
@ -12,7 +13,9 @@ public class Access {
|
|||
public static final String POLICY="_policy";
|
||||
public static final String LICENSE="_license";
|
||||
|
||||
@JsonProperty(POLICY)
|
||||
private AccessPolicy policy;
|
||||
@JsonProperty(LICENSE)
|
||||
private String license;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document.accounting;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
@ -15,7 +16,10 @@ public class AccountingInfo {
|
|||
public static final String CONTEXT="_context";
|
||||
public static final String INSTANT="_instant";
|
||||
|
||||
@JsonProperty(USER)
|
||||
private User user;
|
||||
@JsonProperty(CONTEXT)
|
||||
private Context context;
|
||||
@JsonProperty(INSTANT)
|
||||
private LocalDateTime instant;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document.accounting;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@NoArgsConstructor
|
||||
|
@ -11,7 +12,8 @@ public class Context {
|
|||
public static final String ID="_id";
|
||||
public static final String NAME = "_name";
|
||||
|
||||
|
||||
@JsonProperty(ID)
|
||||
private String id;
|
||||
@JsonProperty(NAME)
|
||||
private String name;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document.accounting;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||
|
||||
|
@ -14,8 +15,11 @@ public class PublicationInfo {
|
|||
public static final String LAST_EDIT_INFO="_lastEditInfo";
|
||||
public static final String ACCESS = "_access";
|
||||
|
||||
@JsonProperty(CREATION_INFO)
|
||||
private AccountingInfo creationInfo;
|
||||
@JsonProperty(LAST_EDIT_INFO)
|
||||
private AccountingInfo lastEditInfo;
|
||||
@JsonProperty(ACCESS)
|
||||
private Access access;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document.accounting;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@NoArgsConstructor
|
||||
|
@ -11,7 +12,7 @@ public class User {
|
|||
|
||||
public static final String USERNAME="_username";
|
||||
|
||||
|
||||
@JsonProperty(USERNAME)
|
||||
private String username;
|
||||
|
||||
}
|
||||
|
|
|
@ -14,12 +14,22 @@ public class GCubeSDILayer extends Materialization{
|
|||
|
||||
public static final BBOX WORLD=new BBOX(180d,90d,-180d,-90d);
|
||||
|
||||
public static final String MAX_X="maxX";
|
||||
public static final String MAX_Y="maxY";
|
||||
public static final String MIN_X="minX";
|
||||
public static final String MIN_Y="minY";
|
||||
public static final BBOX WORLD_3D=new BBOX(180d,90d,-180d,-90d);
|
||||
|
||||
public BBOX(Double maxX,Double maxY,Double minX,Double minY){
|
||||
public static final String MAX_X="_maxX";
|
||||
public static final String MAX_Y="_maxY";
|
||||
public static final String MAX_Z="_maxZ";
|
||||
public static final String MIN_X="_minX";
|
||||
public static final String MIN_Y="_minY";
|
||||
public static final String MIN_Z="_minZ";
|
||||
|
||||
|
||||
public BBOX(Double maxX,Double minX,Double maxY,Double minY,Double maxZ,Double minZ){
|
||||
this(maxX,minX,maxY,minY);
|
||||
setMaxZ(maxZ);
|
||||
setMinZ(minZ);
|
||||
}
|
||||
public BBOX(Double maxX,Double minX,Double maxY,Double minY){
|
||||
setMaxX(maxX);
|
||||
setMinX(minX);
|
||||
setMaxY(maxY);
|
||||
|
@ -28,12 +38,16 @@ public class GCubeSDILayer extends Materialization{
|
|||
|
||||
public void setMaxX(Double d){this.put(MAX_X,d);}
|
||||
public void setMaxY(Double d){this.put(MAX_Y,d);}
|
||||
public void setMaxZ(Double d){this.put(MAX_Z,d);}
|
||||
public void setMinX(Double d){this.put(MIN_X,d);}
|
||||
public void setMinY(Double d){this.put(MIN_Y,d);}
|
||||
public void setMinZ(Double d){this.put(MIN_Z,d);}
|
||||
public Double getMinY(){return (Double) this.getOrDefault(MIN_Y,-90d);}
|
||||
public Double getMaxY(){return (Double) this.getOrDefault(MAX_Y,90d);}
|
||||
public Double getMinX(){return (Double) this.getOrDefault(MIN_X,-180d);}
|
||||
public Double getMaxX(){return (Double) this.getOrDefault(MAX_X,180d);}
|
||||
public Double getMinZ(){return (Double) this.getOrDefault(MIN_Z,null);}
|
||||
public Double getMaxZ(){return (Double) this.getOrDefault(MAX_Z,null);}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,17 +1,22 @@
|
|||
package org.gcube.application.geoportal.common.model.document.filesets;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@Data
|
||||
public class RegisteredFile {
|
||||
|
||||
public static String MIMETYPE="_mimetype";
|
||||
public static String STORAGE_ID="_storageID";
|
||||
public static String LINK="_link";
|
||||
public static String NAME="_name";
|
||||
public static final String MIMETYPE="_mimetype";
|
||||
public static final String STORAGE_ID="_storageID";
|
||||
public static final String LINK="_link";
|
||||
public static final String NAME="_name";
|
||||
|
||||
@JsonProperty(MIMETYPE)
|
||||
private String mimetype;
|
||||
@JsonProperty(STORAGE_ID)
|
||||
private String storageID;
|
||||
@JsonProperty(LINK)
|
||||
private String link;
|
||||
@JsonProperty(NAME)
|
||||
private String name;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.document.lifecycle;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -8,10 +9,11 @@ import java.util.List;
|
|||
@Data
|
||||
public class LifecycleInformation {
|
||||
|
||||
//COMMON PHASES
|
||||
public static final String DRAFT_PHASE="DRAFT";
|
||||
|
||||
public static final String PUBLISHED_PHASE="PUBLISHED";
|
||||
|
||||
|
||||
public static final String PHASE="_phase";
|
||||
public static final String LAST_INVOKED_STEP="_lastInvokedStep";
|
||||
public static final String LAST_OPERATION_STATUS="_lastOperationStatus";
|
||||
|
@ -23,11 +25,17 @@ public class LifecycleInformation {
|
|||
OK,ERROR,WARNING
|
||||
}
|
||||
|
||||
@JsonProperty(PHASE)
|
||||
private String phase;
|
||||
@JsonProperty(LAST_INVOKED_STEP)
|
||||
private String lastInvokedStep;
|
||||
@JsonProperty(LAST_OPERATION_STATUS)
|
||||
private Status lastOperationStatus;
|
||||
@JsonProperty(ERROR_MESSAGES)
|
||||
private List<String> errorMessages;
|
||||
@JsonProperty(WARNING_MESSAGES)
|
||||
private List<String> warningMessages;
|
||||
@JsonProperty(TRIGGERED_EVENTS)
|
||||
private List<TriggeredEvents> triggeredEvents;
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.application.geoportal.common.model.profile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
import org.bson.Document;
|
||||
|
||||
|
@ -12,9 +13,9 @@ import java.util.List;
|
|||
@ToString
|
||||
public class DataAccessPolicy {
|
||||
|
||||
public static final String POLICY = "policy";
|
||||
public static final String ROLES = "roles";
|
||||
public static final String ENFORCER = "enforcer";
|
||||
public static final String POLICY = "_policy";
|
||||
public static final String ROLES = "_roles";
|
||||
public static final String ENFORCER = "_enforcer";
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
@ -22,14 +23,16 @@ public class DataAccessPolicy {
|
|||
@Setter
|
||||
@ToString
|
||||
public static class Policy {
|
||||
public static final String WRITE="write";
|
||||
public static final String READ="read";
|
||||
public static final String WRITE="_write";
|
||||
public static final String READ="_read";
|
||||
|
||||
public static enum Type{
|
||||
OWN,NONE,ANY
|
||||
}
|
||||
|
||||
@JsonProperty(WRITE)
|
||||
private Type write;
|
||||
@JsonProperty(READ)
|
||||
private Type read;
|
||||
}
|
||||
|
||||
|
@ -40,12 +43,16 @@ public class DataAccessPolicy {
|
|||
@Setter
|
||||
@ToString
|
||||
public static class PolicyEnforcer {
|
||||
public static final String FILTER="filter";
|
||||
public static final String FILTER="_filter";
|
||||
@JsonProperty(FILTER)
|
||||
private Document filter;
|
||||
}
|
||||
|
||||
|
||||
@JsonProperty(POLICY)
|
||||
private Policy policy;
|
||||
@JsonProperty(ROLES)
|
||||
private List<String> roles;
|
||||
@JsonProperty(ENFORCER)
|
||||
private PolicyEnforcer enforcer;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
package org.gcube.application.geoportal.common.model.profile;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import org.bson.Document;
|
||||
|
||||
@Data
|
||||
public class HandlerDeclaration {
|
||||
|
||||
@JsonProperty("_id")
|
||||
private String id;
|
||||
@JsonProperty("_type")
|
||||
private String type;
|
||||
@JsonProperty("_configuration")
|
||||
private Document configuration;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Map;
|
|||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.vdurmont.semver4j.Semver;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -17,18 +18,37 @@ import org.gcube.application.geoportal.common.model.document.accounting.Accounti
|
|||
@XmlRootElement
|
||||
public class Profile{
|
||||
|
||||
public static final String ID="_id";
|
||||
public static final String VERSION="_version";
|
||||
public static final String NAME="_name";
|
||||
public static final String DESCRIPTION="_description";
|
||||
public static final String CREATION_INFO="_creationInfo";
|
||||
public static final String SCHEMA="_schema";
|
||||
public static final String HANDLERS="_handlers";
|
||||
public static final String DATA_ACCESS_POLICIES="_dataAccessPolicies";
|
||||
|
||||
|
||||
|
||||
@JsonProperty(ID)
|
||||
private String id;
|
||||
@JsonProperty(VERSION)
|
||||
private Semver version;
|
||||
|
||||
@JsonProperty(NAME)
|
||||
private String name;
|
||||
@JsonProperty(DESCRIPTION)
|
||||
private String description;
|
||||
@JsonProperty(CREATION_INFO)
|
||||
private AccountingInfo creationInfo;
|
||||
|
||||
@JsonProperty(SCHEMA)
|
||||
private Field schema;
|
||||
|
||||
@JsonProperty(HANDLERS)
|
||||
private List<HandlerDeclaration> handlers;
|
||||
|
||||
|
||||
@JsonProperty(DATA_ACCESS_POLICIES)
|
||||
private List<DataAccessPolicy> dataAccessPolicies;
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.application.cms.plugins.reports.StepExecutionReport;
|
|||
import org.gcube.application.cms.plugins.reports.InitializationReport;
|
||||
import org.gcube.application.cms.plugins.requests.EventExecutionRequest;
|
||||
import org.gcube.application.cms.plugins.requests.StepExecutionRequest;
|
||||
import org.gcube.application.geoportal.common.model.document.ComparableVersion;
|
||||
import org.gcube.application.cms.plugins.model.ComparableVersion;
|
||||
import org.gcube.application.geoportal.common.model.rest.Configuration;
|
||||
import org.gcube.application.geoportal.common.model.rest.ConfigurationException;
|
||||
|
||||
|
|
|
@ -327,8 +327,8 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
|||
if(!(toDelete == null)&&!(toDelete.isEmpty()))
|
||||
deleteFileSetRoutine(toDelete,false,ws);
|
||||
|
||||
RegisteredFileSet fs = prepareRegisteredFileSet(doc.getInfo(),doc.get_id(),profile.getId(), request.getAttributes(),files,storage,ws);
|
||||
log.debug("Registered Fileset for [ID {} profile {}] is {} ",fs,doc.get_id(),doc.getProfileID());
|
||||
RegisteredFileSet fs = prepareRegisteredFileSet(doc.getInfo(),doc.getId(),profile.getId(), request.getAttributes(),files,storage,ws);
|
||||
log.debug("Registered Fileset for [ID {} profile {}] is {} ",fs,doc.getId(),doc.getProfileID());
|
||||
docWrapper.putElement(parentMatchingPath,request.getFieldName(),fs);
|
||||
break;}
|
||||
case MERGE_EXISTING: {
|
||||
|
@ -338,15 +338,15 @@ public class ProfiledMongoManager extends MongoManager implements MongoManagerI<
|
|||
// MERGE ATTRIBUTES AND PUT
|
||||
Document toUseAttributes=request.getAttributes();
|
||||
if(original!=null) toUseAttributes.putAll(original);
|
||||
RegisteredFileSet fs = prepareRegisteredFileSet(doc.getInfo(),doc.get_id(),profile.getId(), toUseAttributes,files,storage,ws);
|
||||
log.debug("Registered Fileset for [ID {} profile {}] is {} ",fs,doc.get_id(),doc.getProfileID());
|
||||
RegisteredFileSet fs = prepareRegisteredFileSet(doc.getInfo(),doc.getId(),profile.getId(), toUseAttributes,files,storage,ws);
|
||||
log.debug("Registered Fileset for [ID {} profile {}] is {} ",fs,doc.getId(),doc.getProfileID());
|
||||
docWrapper.putElement(parentMatchingPath,request.getFieldName(),fs);
|
||||
break;}
|
||||
case APPEND: {
|
||||
if(!fieldDefinition.isCollection())
|
||||
throw new WebApplicationException("Cannot add to single field "+request.getFieldDefinitionPath()+".",Response.Status.BAD_REQUEST);
|
||||
RegisteredFileSet fs = prepareRegisteredFileSet(doc.getInfo(),doc.get_id(),profile.getId(), request.getAttributes(),files,storage,ws);
|
||||
log.debug("Registered Fileset for [ID {} profile {}] is {} ",fs,doc.get_id(),doc.getProfileID());
|
||||
RegisteredFileSet fs = prepareRegisteredFileSet(doc.getInfo(),doc.getId(),profile.getId(), request.getAttributes(),files,storage,ws);
|
||||
log.debug("Registered Fileset for [ID {} profile {}] is {} ",fs,doc.getId(),doc.getProfileID());
|
||||
|
||||
docWrapper.addElementToArray(String.format("%1ds['%2$s']",parentMatchingPath,request.getFieldName()),fs);
|
||||
break;}
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.reflections.Reflections;
|
|||
import org.reflections.util.ConfigurationBuilder;
|
||||
import org.reflections.util.FilterBuilder;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -42,14 +43,14 @@ public class PluginManager extends AbstractScopedMap<PluginManager.PluginMap> im
|
|||
.filterInputsBy(new FilterBuilder().includePackage("org.gcube.application.cms")));
|
||||
|
||||
reflections.getSubTypesOf(Plugin.class).iterator().forEachRemaining(pluginClass->{
|
||||
if(!pluginClass.isInterface()){
|
||||
if(!pluginClass.isInterface() && !Modifier.isAbstract(pluginClass.getModifiers())){
|
||||
try {
|
||||
Plugin plugin = pluginClass.newInstance();
|
||||
log.debug("Loading {} descriptiorn : ", plugin, plugin.getDescriptor());
|
||||
implementations.put(plugin.getDescriptor().getId(), plugin);
|
||||
Plugin plugin = pluginClass.newInstance();
|
||||
log.debug("Loading {} description : {}", plugin, plugin.getDescriptor());
|
||||
implementations.put(plugin.getDescriptor().getId(), plugin);
|
||||
|
||||
if(plugin instanceof LifecycleManager)
|
||||
((LifecycleManager)plugin).setPluginManager(this);
|
||||
if(plugin instanceof LifecycleManager)
|
||||
((LifecycleManager)plugin).setPluginManager(this);
|
||||
}catch (Throwable t){
|
||||
log.warn("Unable to instantiate Plugin "+pluginClass,t);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ProfiledDocuments {
|
|||
protected ProfiledDocument run() throws Exception, WebApplicationException {
|
||||
log.info("Creating new ProfiledDocument ({})",manager.getProfile().getId());
|
||||
ProfiledDocument toReturn= manager.registerNew(d);
|
||||
log.info("Created new ProfiledDocument ({}, ID {})",manager.getProfile().getId(),toReturn.get_id());
|
||||
log.info("Created new ProfiledDocument ({}, ID {})",manager.getProfile().getId(),toReturn.getId());
|
||||
return toReturn;
|
||||
}
|
||||
}.execute().getResult();
|
||||
|
|
|
@ -1,30 +1,30 @@
|
|||
{
|
||||
"id" : "profiledConcessioni",
|
||||
"version" : "1.0.0",
|
||||
"name" : "Concessione",
|
||||
"_id" : "profiledConcessioni",
|
||||
"_version" : "1.0.0",
|
||||
"_name" : "Concessione",
|
||||
|
||||
"schema" : {
|
||||
"_schema" : {
|
||||
"relazioneScavo" : { "_max" : 1, "_min" : 1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
},
|
||||
"imgs" : {
|
||||
"_max" : -1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
},
|
||||
"posizionamentoScavo" : { "_max" : 1, "_min" : 1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
},
|
||||
"pianteFineScavo" : { "_max" : -1, "_min" : 1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
|
@ -32,25 +32,25 @@
|
|||
},
|
||||
|
||||
|
||||
"description" : "Embedded profile for concessioni [mibac] management",
|
||||
"creationInfo": {
|
||||
"user" : {
|
||||
"username": "fabio.sinibaldi"
|
||||
"_description" : "Embedded profile for concessioni [mibac] management",
|
||||
"_creationInfo": {
|
||||
"_user" : {
|
||||
"_username": "fabio.sinibaldi"
|
||||
}
|
||||
},
|
||||
"data_access_policy" : [
|
||||
{"policy" : {"read" : "own", "write" : "own"}, "roles":[]},
|
||||
{"policy" : {"read" : "any", "write" : "none"}, "roles":["Guest"],
|
||||
"enforcer": {"filter" : {"lifecycleInformation.phase" : {"$eq" : "Published"}}}},
|
||||
{"policy" : {"read" : "any", "write" : "none"}, "roles":["Admin"]},
|
||||
{"policy" : {"read" : "any", "write" : "any"}, "roles":["Data-Manager"]}
|
||||
"_data_access_policy" : [
|
||||
{"_policy" : {"_read" : "own", "_write" : "own"}, "_roles":[]},
|
||||
{"_policy" : {"_read" : "any", "_write" : "none"}, "_roles":["Guest"],
|
||||
"_enforcer": {"_filter" : {"_lifecycleInformation._phase" : {"$eq" : "Published"}}}},
|
||||
{"_policy" : {"_read" : "any", "_write" : "none"}, "_roles":["Admin"]},
|
||||
{"_policy" : {"_read" : "any", "_write" : "any"}, "_roles":["Data-Manager"]}
|
||||
],
|
||||
|
||||
"handlers" : [
|
||||
"_handlers" : [
|
||||
{
|
||||
"id" : "GNA-CONCESSIONI-LC",
|
||||
"type" : "LifecycleManagement",
|
||||
"configuration" : {
|
||||
"_id" : "GNA-CONCESSIONI-LC",
|
||||
"_type" : "LifecycleManagement",
|
||||
"_configuration" : {
|
||||
"step_access" : [
|
||||
{"STEP" : "PUBLISH", "roles" :[ "DataManager"]}
|
||||
]
|
||||
|
@ -58,9 +58,9 @@
|
|||
},
|
||||
|
||||
{
|
||||
"id" : "SDI-Default-Materializer",
|
||||
"type" : "Materializer",
|
||||
"configuration" : {
|
||||
"_id" : "SDI-Default-Materializer",
|
||||
"_type" : "Materializer",
|
||||
"_configuration" : {
|
||||
"registeredFileSetPaths" : [
|
||||
{"schemaField" : "pianteFineScavo","documentPath" : "pianteFineScavo[*].fileset"},
|
||||
{"schemaField" : "posizionamentoScavo","documentPath" : "posizionamentoScavo.fileset"}
|
||||
|
@ -71,10 +71,10 @@
|
|||
|
||||
|
||||
{
|
||||
"id" : "org.gcube....geoportal-data-entry-portlet",
|
||||
"type" : "DATA_ENTRY_GUI",
|
||||
"case" : "",
|
||||
"configuration" : {
|
||||
"_id" : "org.gcube....geoportal-data-entry-portlet",
|
||||
"_type" : "DATA_ENTRY_GUI",
|
||||
"_case" : "",
|
||||
"_configuration" : {
|
||||
"gcubeProfiles" : [
|
||||
{
|
||||
"gcubeCategory" : "",
|
||||
|
@ -96,10 +96,10 @@
|
|||
},
|
||||
|
||||
{
|
||||
"id" : "org.gcube....geoportal-data-list",
|
||||
"type" : "DATA_LIST_GUI",
|
||||
"case" : "smallList",
|
||||
"configuration" : {
|
||||
"_id" : "org.gcube....geoportal-data-list",
|
||||
"_type" : "DATA_LIST_GUI",
|
||||
"_case" : "smallList",
|
||||
"_configuration" : {
|
||||
"projection" : {"nome" : 1, "lifecycleInformation.phase" : 1},
|
||||
"orderPaths":[
|
||||
{"label" : "author", "path" : "info.creationInfo.user.username"}],
|
||||
|
|
|
@ -55,7 +55,7 @@ public abstract class AbstractProfiledDocumentsTests extends BasicServiceTestUni
|
|||
baseTarget().request(MediaType.APPLICATION_JSON).get(List.class).forEach(d ->{
|
||||
|
||||
try {
|
||||
check(baseTarget().path((Serialization.convert(d,ProfiledDocument.class)).get_id())
|
||||
check(baseTarget().path((Serialization.convert(d,ProfiledDocument.class)).getId())
|
||||
.request(MediaType.APPLICATION_JSON).get(),ProfiledDocument.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
|
@ -93,7 +93,7 @@ public abstract class AbstractProfiledDocumentsTests extends BasicServiceTestUni
|
|||
|
||||
protected void validate (ProfiledDocument doc){
|
||||
assertTrue(doc!=null);
|
||||
assertTrue(doc.get_id()!=null);
|
||||
assertTrue(doc.getId()!=null);
|
||||
assertTrue(doc.getLifecycleInformation().getPhase()!=null);
|
||||
assertTrue(doc.getLifecycleInformation().getLastOperationStatus()!=null);
|
||||
if(doc.getLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.ERROR))
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.gcube.application.geoportal.common.model.document.filesets.GCubeSDILa
|
|||
import org.gcube.application.geoportal.common.model.document.filesets.Materialization;
|
||||
import org.gcube.application.geoportal.common.model.document.filesets.RegisteredFileSet;
|
||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||
import org.gcube.application.geoportal.common.model.profile.Field;
|
||||
import org.gcube.application.geoportal.common.model.rest.RegisterFileSetRequest;
|
||||
import org.gcube.application.geoportal.common.model.rest.StepExecutionRequest;
|
||||
import org.gcube.application.geoportal.common.rest.InterfaceConstants;
|
||||
|
@ -49,7 +50,7 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
doc.getTheDocument().put("someStrangeField","someOtherRandomValue");
|
||||
String edited=doc.getTheDocument().toJson();
|
||||
Assert.assertNotEquals(beforeJson,doc.getTheDocument().toJson());
|
||||
doc=check(baseTarget().path(doc.get_id()).request(MediaType.APPLICATION_JSON).
|
||||
doc=check(baseTarget().path(doc.getId()).request(MediaType.APPLICATION_JSON).
|
||||
put(Entity.entity(doc.getTheDocument(), MediaType.APPLICATION_JSON)),ProfiledDocument.class);
|
||||
Assert.assertEquals(edited,doc.getTheDocument().toJson());
|
||||
}
|
||||
|
@ -67,7 +68,7 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
// Try set releazione scavo
|
||||
String parentPath="relazioneScavo";
|
||||
String fieldName="fileset";
|
||||
String fieldDefinition="relazioneScavo.children[?(@.fileset)]";
|
||||
String fieldDefinition="relazioneScavo."+Field.CHILDREN+"[?(@.fileset)]";
|
||||
|
||||
String filename = "relazione.pdf";
|
||||
|
||||
|
@ -76,7 +77,7 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
// INSERT ONE, MERGE INFO (NB default values already exist)
|
||||
doc = upload(
|
||||
new StorageUtils(),
|
||||
doc.get_id(),
|
||||
doc.getId(),
|
||||
parentPath,fieldName,
|
||||
fieldDefinition,
|
||||
new Document("customField","customFieldValue"),
|
||||
|
@ -99,9 +100,9 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
// register filesets
|
||||
doc = upload(
|
||||
new StorageUtils(),
|
||||
doc.get_id(),
|
||||
doc.getId(),
|
||||
"posizionamentoScavo","fileset",
|
||||
"posizionamentoScavo.children[?(@.fileset)]",
|
||||
"posizionamentoScavo."+Field.CHILDREN+"[?(@.fileset)]",
|
||||
null,
|
||||
RegisterFileSetRequest.ClashOptions.REPLACE_EXISTING,
|
||||
"pos.shp","pos.shx");
|
||||
|
@ -111,7 +112,7 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
// invoke step SUBMIT-FOR-REVIEW
|
||||
StepExecutionRequest req=new StepExecutionRequest();
|
||||
req.setStepID("SUBMIT-FOR-REVIEW");
|
||||
doc=step(doc.get_id(),req);
|
||||
doc=step(doc.getId(),req);
|
||||
System.out.println(doc);
|
||||
if(doc.getLifecycleInformation().getErrorMessages()!=null) {
|
||||
System.out.println("ERROR MESSAGES");
|
||||
|
@ -152,7 +153,7 @@ public class DummyProfiledDocumentTest extends AbstractProfiledDocumentsTests{
|
|||
|
||||
|
||||
req.setStepID("APPROVE DRAFT");
|
||||
doc=step(doc.get_id(),req);
|
||||
doc=step(doc.getId(),req);
|
||||
if(doc.getLifecycleInformation().getErrorMessages()!=null) {
|
||||
System.out.println("ERROR MESSAGES");
|
||||
doc.getLifecycleInformation().getErrorMessages().forEach(s -> System.out.println(s));
|
||||
|
|
|
@ -34,7 +34,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
|||
// register filesets
|
||||
doc = upload(
|
||||
new StorageUtils(),
|
||||
doc.get_id(),
|
||||
doc.getId(),
|
||||
"posizionamentoScavo","fileset",
|
||||
"posizionamentoScavo.children[?(@.fileset)]",
|
||||
Document.parse("{\"titolo\" : \"mio titolo\",\"some\" : \"something\" }"),
|
||||
|
@ -46,7 +46,7 @@ public class ProfiledConcessioniTests extends AbstractProfiledDocumentsTests{
|
|||
// invoke step SUBMIT-FOR-REVIEW
|
||||
StepExecutionRequest req=new StepExecutionRequest();
|
||||
req.setStepID("SUBMIT-FOR-REVIEW");
|
||||
doc=step(doc.get_id(),req);
|
||||
doc=step(doc.getId(),req);
|
||||
System.out.println(doc);
|
||||
assertTrue(doc.getLifecycleInformation().getLastOperationStatus().equals(LifecycleInformation.Status.OK));
|
||||
}
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
{
|
||||
"_id": "620e16d82b01092047345c7f",
|
||||
"version": "1.0.1",
|
||||
"info":
|
||||
"_id": "620e66093321de48ba29cd93",
|
||||
"_version": "1.0.1",
|
||||
"_info":
|
||||
{
|
||||
"creationInfo":
|
||||
"_creationInfo":
|
||||
{
|
||||
"user":
|
||||
"_user":
|
||||
{
|
||||
"username": "FAKE"
|
||||
"_username": "FAKE"
|
||||
},
|
||||
"context":
|
||||
{
|
||||
"id": "/pred4s/preprod/preVRE",
|
||||
"name": "/preVRE"
|
||||
},
|
||||
"instant": "2022-02-17T10:35:20.109"
|
||||
"instant": "2022-02-17T16:13:13.441"
|
||||
},
|
||||
"lastEditInfo":
|
||||
{
|
||||
|
@ -27,7 +27,7 @@
|
|||
"id": "/pred4s/preprod/preVRE",
|
||||
"name": "/preVRE"
|
||||
},
|
||||
"instant": "2022-02-17T10:36:25.115"
|
||||
"instant": "2022-02-17T16:13:53.976"
|
||||
},
|
||||
"access":
|
||||
{
|
||||
|
@ -44,21 +44,7 @@
|
|||
"lastOperationStatus": "OK",
|
||||
"errorMessages": null,
|
||||
"warningMessages": null,
|
||||
"triggeredEvents":
|
||||
[
|
||||
{
|
||||
"event": null,
|
||||
"lastOperationStatus": null,
|
||||
"errorMessages": null,
|
||||
"warningMessages": null
|
||||
},
|
||||
{
|
||||
"event": null,
|
||||
"lastOperationStatus": null,
|
||||
"errorMessages": null,
|
||||
"warningMessages": null
|
||||
}
|
||||
]
|
||||
"triggeredEvents": null
|
||||
},
|
||||
"relationships": null,
|
||||
"spatialReference": null,
|
||||
|
@ -70,7 +56,7 @@
|
|||
"title": "Mio pos",
|
||||
"fileset":
|
||||
{
|
||||
"uuid": "303aa86c-e5ff-4fa9-a9ab-555b5012d87e",
|
||||
"uuid": "e38697c5-2392-4db3-a21c-572faf7e4022",
|
||||
"creationInfo":
|
||||
{
|
||||
"user":
|
||||
|
@ -82,26 +68,26 @@
|
|||
"id": "/pred4s/preprod/preVRE",
|
||||
"name": "/preVRE"
|
||||
},
|
||||
"instant": "2022-02-17T10:36:02.484"
|
||||
"instant": "2022-02-17T16:13:40.534"
|
||||
},
|
||||
"access":
|
||||
{
|
||||
"policy": "OPEN",
|
||||
"license": ""
|
||||
},
|
||||
"folderID": "fc6d6be7-4034-4f4f-bcc1-6c29e689cdb5",
|
||||
"folderID": "907f667f-6ad9-4f35-b813-3a6fedf70695",
|
||||
"payloads":
|
||||
[
|
||||
{
|
||||
"mimetype": "application/x-shapefile",
|
||||
"storageID": "edb0dde2-f724-4c51-810f-1eef2eac28b3",
|
||||
"link": "https://data-pre.d4science.org/shub/E_NmFhQlNQS2JKMXo4U2lEZnpCMGVweWJYallhMlRDalMreG1RZ2dWQzFzdkFlRW1JbkFzZnZiZmJDc3R6MWRBUw==",
|
||||
"storageID": "98eb4287-de2c-4303-83ff-23a3f9832392",
|
||||
"link": "https://data-pre.d4science.org/shub/E_NWZBVjcvOVh6WldqZEpQQUplaW9TUlZHSEJaaUJyUS80UjI4dFl0Qk1qL25UQk93V3UwckNQaTZRKzVDV2sycA==",
|
||||
"name": "pos.shp"
|
||||
},
|
||||
{
|
||||
"mimetype": "application/x-shapefile",
|
||||
"storageID": "d9599f82-e639-4ae7-8822-48e9d86c00b7",
|
||||
"link": "https://data-pre.d4science.org/shub/E_ZjFOQ3lXVlRLdzhQNUk3YmVwcUdBcVd6WWQ5dHVHSGQxMnc1NGlCRmlsVW9ZdmlYYTZCQjJ0VjRLaC9xdW40TA==",
|
||||
"storageID": "0cbbd289-41f6-42bd-b2e0-1d15ca51fd95",
|
||||
"link": "https://data-pre.d4science.org/shub/E_MW9DR1N0NzI3d1ZZQzdKNVd3RUZRQUNDM283TU5URGozWFdHK1lQNkNWMlBzVWk1QzFhRmh4TWVnWnpjcTRqTw==",
|
||||
"name": "pos.shx"
|
||||
}
|
||||
],
|
||||
|
@ -112,7 +98,7 @@
|
|||
"ogcLinks":
|
||||
[
|
||||
{
|
||||
"wms": "https://geoserver1-t.pre.d4science.org/geoserver/profiledconcessioni_pred4s_preprod_prevre/wms?service=WMS&version=1.1.0&request=GetMap&layers=profiledconcessioni_pred4s_preprod_prevre:pos_2&styles=&bbox=8.620919,40.629750,8.621179,40.630258&srs=EPSG:4326&format=application/openlayers&width=400&height=400"
|
||||
"wms": "https://geoserver1-t.pre.d4science.org/geoserver/profiledconcessioni_pred4s_preprod_prevre_620e66093321de48ba29cd93/wms?service=WMS&version=1.1.0&request=GetMap&layers=profiledconcessioni_pred4s_preprod_prevre_620e66093321de48ba29cd93:pos&styles=&bbox=8.620919,40.629750,8.621179,40.630258&srs=EPSG:4326&format=application/openlayers&width=400&height=400"
|
||||
}
|
||||
],
|
||||
"bbox":
|
||||
|
@ -126,15 +112,15 @@
|
|||
[
|
||||
{
|
||||
"_type": "Geoserver",
|
||||
"workspace": "profiledconcessioni_pred4s_preprod_prevre",
|
||||
"layerName": "pos_2",
|
||||
"persistencePath": "profiledConcessioni/620e16d82b01092047345c7f/303aa86c-e5ff-4fa9-a9ab-555b5012d87e/pos_2",
|
||||
"workspace": "profiledconcessioni_pred4s_preprod_prevre_620e66093321de48ba29cd93",
|
||||
"layerName": "pos",
|
||||
"persistencePath": "profiledConcessioni/620e66093321de48ba29cd93/e38697c5-2392-4db3-a21c-572faf7e4022/pos",
|
||||
"files":
|
||||
[
|
||||
"pos_2.shp",
|
||||
"pos_2.shx"
|
||||
"pos.shp",
|
||||
"pos.shx"
|
||||
],
|
||||
"storeName": "pos_2_store"
|
||||
"storeName": "pos_store"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
{
|
||||
"id" : "profiledConcessioni",
|
||||
"version" : "1.0.0",
|
||||
"name" : "Concessione",
|
||||
"_id" : "profiledConcessioni",
|
||||
"_version" : "1.0.0",
|
||||
"_name" : "Concessione",
|
||||
|
||||
"schema" : {
|
||||
"_schema" : {
|
||||
"relazioneScavo" : { "_max" : 1, "_min" : 1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
},
|
||||
"imgs" : {
|
||||
"_max" : -1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
},
|
||||
"posizionamentoScavo" : { "_max" : 1, "_min" : 1,
|
||||
"children" : [
|
||||
"_children" : [
|
||||
{"fileset" :{"_type" : "RegisteredFileSet"}},
|
||||
{"title" : {"_max" : 1, "_min" : 1}}
|
||||
]
|
||||
|
@ -26,25 +26,26 @@
|
|||
},
|
||||
|
||||
|
||||
"description" : "Embedded profile for concessioni [mibac] management",
|
||||
"creationInfo": {
|
||||
"user" : {
|
||||
"username": "fabio.sinibaldi"
|
||||
"_description" : "Embedded profile for concessioni [mibac] management",
|
||||
"_creationInfo": {
|
||||
"_user" : {
|
||||
"_username": "fabio.sinibaldi"
|
||||
}
|
||||
},
|
||||
"data_access_policy" : [
|
||||
{"policy" : {"read" : "own", "write" : "own"}, "roles":[]},
|
||||
{"policy" : {"read" : "any", "write" : "none"}, "roles":["Guest"],
|
||||
"enforcer": {"filter" : {"lifecycleInformation.phase" : {"$eq" : "Published"}}}},
|
||||
{"policy" : {"read" : "any", "write" : "none"}, "roles":["Admin"]},
|
||||
{"policy" : {"read" : "any", "write" : "any"}, "roles":["Data-Manager"]}
|
||||
|
||||
"_data_access_policy" : [
|
||||
{"_policy" : {"_read" : "own", "_write" : "own"}, "_roles":[]},
|
||||
{"_policy" : {"_read" : "any", "_write" : "none"}, "_roles":["Guest"],
|
||||
"_enforcer": {"_filter" : {"lifecycleInformation.phase" : {"$eq" : "Published"}}}},
|
||||
{"_policy" : {"_read" : "any", "_write" : "none"}, "_roles":["Admin"]},
|
||||
{"_policy" : {"_read" : "any", "_write" : "any"}, "_roles":["Data-Manager"]}
|
||||
],
|
||||
|
||||
"handlers" : [
|
||||
"_handlers" : [
|
||||
{
|
||||
"id" : "GNA-CONCESSIONI-LC",
|
||||
"type" : "LifecycleManagement",
|
||||
"configuration" : {
|
||||
"_id" : "GNA-CONCESSIONI-LC",
|
||||
"_type" : "LifecycleManagement",
|
||||
"_configuration" : {
|
||||
"step_access" : [
|
||||
{"STEP" : "PUBLISH", "roles" :[ "DataManager"]}
|
||||
]
|
||||
|
@ -52,9 +53,9 @@
|
|||
},
|
||||
|
||||
{
|
||||
"id" : "SDI-Default-Materializer",
|
||||
"type" : "Materializer",
|
||||
"configuration" : {
|
||||
"_id" : "SDI-Default-Materializer",
|
||||
"_type" : "Materializer",
|
||||
"_configuration" : {
|
||||
"registeredFileSetPaths" : [
|
||||
{"schemaField" : "pianteFineScavo","documentPath" : "pianteFineScavo[*]"},
|
||||
{"schemaField" : "posizionamentoScavo","documentPath" : "posizionamentoScavo"}
|
||||
|
@ -63,12 +64,27 @@
|
|||
},
|
||||
|
||||
|
||||
{
|
||||
"_id" : "PostgisIndex",
|
||||
"_type" : "Indexer",
|
||||
"_configuration" : {
|
||||
"bboxEvaluation" : ["$..posizionamentoScavo.._bbox"],
|
||||
"explicitFieldMapping" : [
|
||||
{"name" : "titolo", "path" : "$.theDocument.title"}
|
||||
],
|
||||
"jslt" : {},
|
||||
"additionalLayers" : [
|
||||
{"source" : {"url" : "..."},"toSetTitle":""}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
"id" : "org.gcube....geoportal-data-entry-portlet",
|
||||
"type" : "DATA_ENTRY_GUI",
|
||||
"case" : "",
|
||||
"configuration" : {
|
||||
"_id" : "org.gcube....geoportal-data-entry-portlet",
|
||||
"_type" : "DATA_ENTRY_GUI",
|
||||
"_case" : "",
|
||||
"_configuration" : {
|
||||
"gcubeProfiles" : [
|
||||
{
|
||||
"gcubeCategory" : "",
|
||||
|
@ -90,10 +106,10 @@
|
|||
},
|
||||
|
||||
{
|
||||
"id" : "org.gcube....geoportal-data-list",
|
||||
"type" : "DATA_LIST_GUI",
|
||||
"case" : "smallList",
|
||||
"configuration" : {
|
||||
"_id" : "org.gcube....geoportal-data-list",
|
||||
"_type" : "DATA_LIST_GUI",
|
||||
"_case" : "smallList",
|
||||
"_configuration" : {
|
||||
"projection" : {"nome" : 1, "lifecycleInformation.phase" : 1},
|
||||
"orderPaths":[
|
||||
{"label" : "author", "path" : "info.creationInfo.user.username"}],
|
Loading…
Reference in New Issue