OGC LINKS as Map

This commit is contained in:
Fabio Sinibaldi 2022-09-27 15:53:52 +02:00
parent ac80cbbd7c
commit a5702a44fa
3 changed files with 11 additions and 2 deletions

View File

@ -7,6 +7,7 @@ import org.bson.Document;
import org.gcube.application.geoportal.common.model.document.filesets.Materialization; import org.gcube.application.geoportal.common.model.document.filesets.Materialization;
import java.util.List; import java.util.List;
import java.util.Map;
public class GCubeSDILayer extends Materialization { public class GCubeSDILayer extends Materialization {
@ -130,7 +131,7 @@ public class GCubeSDILayer extends Materialization {
} }
@JsonIgnore @JsonIgnore
public List getOGCLinks(){return this.get(OGC_LINKS, List.class);} public Map getOGCLinks(){return this.get(OGC_LINKS, Map.class);}
@JsonIgnore @JsonIgnore
public Object getBBox(){return this.get(B_BOX);} public Object getBBox(){return this.get(B_BOX);}
@JsonIgnore @JsonIgnore

View File

@ -46,7 +46,11 @@ public class GCubeSDILayerBuilder {
theObject.put(GCubeSDILayer.B_BOX,bbox); theObject.put(GCubeSDILayer.B_BOX,bbox);
prepareOGCLinks(); prepareOGCLinks();
theObject.put(GCubeSDILayer.OGC_LINKS,ogcLinks.values()); final Document finalLinkDocument = new Document();
ogcLinks.forEach( (type,document) -> {
finalLinkDocument.putAll(document);
});
theObject.put(GCubeSDILayer.OGC_LINKS,finalLinkDocument);
return theObject; return theObject;
} }

View File

@ -93,6 +93,10 @@ public class IndexerTest extends BasicPluginTest {
assertEquals(GeoServerPlatform.GS_PLATFORM,platformDoc.get(Materialization.TYPE)); assertEquals(GeoServerPlatform.GS_PLATFORM,platformDoc.get(Materialization.TYPE));
} }
System.out.println("OGC_LINKS : ");
layer.getOGCLinks().forEach((k,v) ->{
System.out.println(k + "\t:\t"+v);
});
} }