Commit e0ad30ae authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade nuevos campos a model + tests

parent 24dae97e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -24,12 +24,14 @@ import org.springframework.stereotype.Component;

import es.redmic.atlaslib.dto.layer.ActivityDTO;
import es.redmic.atlaslib.dto.layer.ContactDTO;
import es.redmic.atlaslib.dto.layer.DimensionDTO;
import es.redmic.atlaslib.dto.layer.LatLonBoundingBoxDTO;
import es.redmic.atlaslib.dto.layer.LayerDTO;
import es.redmic.atlaslib.dto.layer.ProtocolDTO;
import es.redmic.atlaslib.dto.layer.StyleLayerDTO;
import es.redmic.atlaslib.dto.themeinspire.ThemeInspireDTO;
import es.redmic.atlasview.model.layer.Contact;
import es.redmic.atlasview.model.layer.Dimension;
import es.redmic.atlasview.model.layer.LatLonBoundingBox;
import es.redmic.atlasview.model.layer.Layer;
import es.redmic.atlasview.model.layer.Protocol;
@@ -69,6 +71,13 @@ public class LayerESMapper extends CustomMapper<Layer, LayerDTO> {
			b.setProtocols(mapperFacade.mapAsList(a.getProtocols(), ProtocolDTO.class));
		}

		if (a.getTimeDimension() != null) {
			b.setTimeDimension(mapperFacade.map(a.getTimeDimension(), DimensionDTO.class));
		}

		if (a.getElevationDimension() != null) {
			b.setElevationDimension(mapperFacade.map(a.getElevationDimension(), DimensionDTO.class));
		}
		super.mapAtoB(a, b, context);
	}

@@ -99,6 +108,14 @@ public class LayerESMapper extends CustomMapper<Layer, LayerDTO> {
			a.setProtocols(mapperFacade.mapAsList(b.getProtocols(), Protocol.class));
		}

		if (b.getTimeDimension() != null) {
			a.setTimeDimension(mapperFacade.map(b.getTimeDimension(), Dimension.class));
		}

		if (b.getElevationDimension() != null) {
			a.setElevationDimension(mapperFacade.map(b.getElevationDimension(), Dimension.class));
		}

		super.mapBtoA(b, a, context);
	}
}
+36 −1
Original line number Diff line number Diff line
@@ -41,8 +41,11 @@ public class Layer extends LayerModelCompact {
	private String image;
	private LatLonBoundingBox latLonBoundsImage;
	private List<Protocol> protocols;

	private Polygon geometry;
	private String legend;
	private Boolean opaque = false;
	private Dimension timeDimension;
	private Dimension elevationDimension;

	public Layer() {
	}
@@ -103,6 +106,38 @@ public class Layer extends LayerModelCompact {
		this.geometry = geometry;
	}

	public String getLegend() {
		return legend;
	}

	public void setLegend(String legend) {
		this.legend = legend;
	}

	public Boolean getOpaque() {
		return opaque;
	}

	public void setOpaque(Boolean opaque) {
		this.opaque = opaque;
	}

	public Dimension getTimeDimension() {
		return timeDimension;
	}

	public void setTimeDimension(Dimension timeDimension) {
		this.timeDimension = timeDimension;
	}

	public Dimension getElevationDimension() {
		return elevationDimension;
	}

	public void setElevationDimension(Dimension elevationDimension) {
		this.elevationDimension = elevationDimension;
	}

	public List<ActivityCompact> getActivities() {
		return activities;
	}
+12 −0
Original line number Diff line number Diff line
@@ -87,6 +87,18 @@
			]
		]
	},
	"legend": "https://redmic.local/ww",
	"opaque": false,
	"timeDimension": {
		"name": "time",
		"units": "ISO8601",
		"defaultValue": "P30M/PRESENT"
	},
	"elevationDimension": {
		"name": "elevation",
		"units": "ISO8601",
		"defaultValue": "z1"
	},
	"parent": {
		"id": "category-333",
		"name": "Especies"
+12 −0
Original line number Diff line number Diff line
@@ -101,6 +101,18 @@
					]
				]
			},
			"legend": "https://redmic.local/ww",
			"opaque": false,
			"timeDimension": {
				"name": "time",
				"units": "ISO8601",
				"defaultValue": "P30M/PRESENT"
			},
			"elevationDimension": {
				"name": "elevation",
				"units": "ISO8601",
				"defaultValue": "z1"
			},
			"parent": null,
			"updated": "2017-05-23T12:35:12.052+00:00",
			"inserted": "2017-05-23T12:35:12.052+00:00"
+12 −0
Original line number Diff line number Diff line
@@ -87,6 +87,18 @@
			]
		]
	},
	"legend": "https://redmic.local/ww",
	"opaque": false,
	"timeDimension": {
		"name": "time",
		"units": "ISO8601",
		"defaultValue": "P30M/PRESENT"
	},
	"elevationDimension": {
		"name": "elevation",
		"units": "ISO8601",
		"defaultValue": "z1"
	},
	"updated": "2017-05-23T12:35:12.052+00:00",
	"inserted": "2017-05-23T12:35:12.052+00:00"
}
 No newline at end of file
Loading