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 java.util.List;
import java.util.Map;
public class GCubeSDILayer extends Materialization {
@ -130,7 +131,7 @@ public class GCubeSDILayer extends Materialization {
}
@JsonIgnore
public List getOGCLinks(){return this.get(OGC_LINKS, List.class);}
public Map getOGCLinks(){return this.get(OGC_LINKS, Map.class);}
@JsonIgnore
public Object getBBox(){return this.get(B_BOX);}
@JsonIgnore

View File

@ -46,7 +46,11 @@ public class GCubeSDILayerBuilder {
theObject.put(GCubeSDILayer.B_BOX,bbox);
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;
}

View File

@ -93,6 +93,10 @@ public class IndexerTest extends BasicPluginTest {
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);
});
}