This commit is contained in:
Fabio Sinibaldi 2022-02-17 11:07:03 +01:00
parent c05f8e8d76
commit 5731c855ac
3 changed files with 9 additions and 11 deletions

View File

@ -48,7 +48,7 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
PluginManagerInterface pluginManager;
// TODO DISCOVER
MaterializationPlugin plugin = new SDIMaterializerPlugin();
MaterializationPlugin plugin;
@Override
public InitializationReport initInContext() throws InitializationException {
@ -109,7 +109,7 @@ public class ConcessioniLifeCycleManager implements LifecycleManager {
matReq.setParameters(params);
MaterializationReport matRep = new SDIMaterializerPlugin().materialize(matReq);
MaterializationReport matRep = plugin.materialize(matReq);
switch(matRep.getStatus()){

View File

@ -133,11 +133,11 @@ public class SDIMaterializerPlugin implements MaterializationPlugin {
RegisteredFileSet obtained = getSDIManager().materializeLayer(fs,requestArguments);
log.debug("Obtained {} ",obtained);
documentNavigator.setElement("$..[?(@.uuid == "+fs.getUUID()+")]",obtained);
documentNavigator.setElement("$..[?(@.uuid == '"+fs.getUUID()+"')]",obtained);
}
}
profiledDocument.setTheDocument(Document.parse(documentNavigator.getValueCTX().json()));
profiledDocument.setTheDocument(Document.parse(documentNavigator.getValueCTX().jsonString()));
report.setResultDocument(profiledDocument);
report.setStatus(Report.Status.OK);
}catch (SDIInteractionException e){

View File

@ -8,6 +8,7 @@ import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.bson.Document;
import org.gcube.application.cms.concessioni.sdi.faults.SDIInteractionException;
import org.gcube.application.cms.plugins.requests.BaseExecutionRequest;
import org.gcube.application.cms.serialization.Serialization;
import org.gcube.application.geoportal.common.model.document.filesets.GCubeSDILayer;
@ -92,9 +93,9 @@ public class SDIManager {
log.debug("Materializing FS {} on {} ", fileSet, geoserverHostName);
// validate parameters
String workspace = getMandatory("workspace", params);
String documentID = getMandatory("documentID", params);
String basePersistencePAth = getMandatory("basePersistencePath", params);
String workspace = BaseExecutionRequest.getMandatory("workspace", params);
String documentID = BaseExecutionRequest.getMandatory("documentID", params);
String basePersistencePAth = BaseExecutionRequest.getMandatory("basePersistencePath", params);
// check if empty
@ -276,9 +277,6 @@ public class SDIManager {
}
private static final String getMandatory(String param,Document params) throws SDIInteractionException {
if(!params.containsKey(param)) throw new SDIInteractionException("Missing mandatory parameter "+param);
return params.getString(param);
}
}