diff --git a/.classpath b/.classpath
index eb4a3d2..b1b720d 100644
--- a/.classpath
+++ b/.classpath
@@ -1,12 +1,12 @@
-
+
-
+
@@ -28,10 +28,10 @@
-
+
-
+
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index 443e085..b257af7 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -1,6 +1,6 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
diff --git a/distro/changelog.xml b/distro/changelog.xml
index 816faa6..dce7d3d 100644
--- a/distro/changelog.xml
+++ b/distro/changelog.xml
@@ -1,4 +1,9 @@
+
+ Added location and zoom support [ticket #11708]
+ Added coordinates EPSG:4326 and EPSG:3857 support [ticket #11710]
+
Updated to support get operator by id with refresh
diff --git a/pom.xml b/pom.xml
index 0265010..ba74b9a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
org.gcube.data.analysis
data-miner-manager-cl
- 1.6.0-SNAPSHOT
+ 1.7.0-SNAPSHOT
data-miner-manager-cl
DataMiner Manager Client Library
@@ -39,17 +39,16 @@
distro
config
+
+ 1.7
+ 1.8
-
- 1.7
-
-
2.6.1
3.3.2
-
+
${env.KEYS}
@@ -177,7 +176,7 @@
1.7.5
test
-
+
junit
junit
@@ -245,7 +244,7 @@
-
+
@@ -269,16 +268,16 @@
-->
-
+
maven-compiler-plugin
3.1
-
- ${javaVersion}
+
+ ${maven.compiler.target}
-
+
org.apache.maven.plugins
diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java
index 20f1f55..49a54d2 100644
--- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java
+++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/server/dmservice/wps/WPS2DM.java
@@ -20,6 +20,7 @@ import net.opengis.wps.x100.SupportedComplexDataType;
import org.gcube.data.analysis.dataminermanagercl.shared.exception.ServiceException;
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnListParameter;
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.ColumnParameter;
+import org.gcube.data.analysis.dataminermanagercl.shared.parameters.Coordinates;
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.DateParameter;
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.EnumParameter;
import org.gcube.data.analysis.dataminermanagercl.shared.parameters.FileParameter;
@@ -200,43 +201,45 @@ public class WPS2DM {
private static Parameter retrieveWKTParameter(String id, String title, String defaultValue) {
+ WKTGeometryType wktGeometryType = WKTGeometryType.Polygon;
+
if (title.contains("[WKT_POINT]")) {
title = title.replace("[WKT_POINT]", "");
- return new WKTParameter(id, title, WKTGeometryType.Point, defaultValue);
+ wktGeometryType = WKTGeometryType.Point;
} else {
if (title.contains("[WKT_LINESTRING]")) {
title = title.replace("[WKT_LINESTRING]", "");
- return new WKTParameter(id, title, WKTGeometryType.LineString, defaultValue);
+ wktGeometryType = WKTGeometryType.LineString;
} else {
if (title.contains("[WKT_POLYGON]")) {
title = title.replace("[WKT_POLYGON]", "");
- return new WKTParameter(id, title, WKTGeometryType.Polygon, defaultValue);
+ wktGeometryType = WKTGeometryType.Polygon;
} else {
if (title.contains("[WKT_CIRCLE]")) {
title = title.replace("[WKT_CIRCLE]", "");
- return new WKTParameter(id, title, WKTGeometryType.Circle, defaultValue);
+ wktGeometryType = WKTGeometryType.Circle;
} else {
if (title.contains("[WKT_TRIANGLE]")) {
title = title.replace("[WKT_TRIANGLE]", "");
- return new WKTParameter(id, title, WKTGeometryType.Triangle, defaultValue);
+ wktGeometryType = WKTGeometryType.Triangle;
} else {
if (title.contains("[WKT_SQUARE]")) {
title = title.replace("[WKT_SQUARE]", "");
- return new WKTParameter(id, title, WKTGeometryType.Square, defaultValue);
+ wktGeometryType = WKTGeometryType.Square;
} else {
if (title.contains("[WKT_PENTAGON]")) {
title = title.replace("[WKT_PENTAGON]", "");
- return new WKTParameter(id, title, WKTGeometryType.Pentagon, defaultValue);
+ wktGeometryType = WKTGeometryType.Pentagon;
} else {
if (title.contains("[WKT_HEXAGON]")) {
title = title.replace("[WKT_HEXAGON]", "");
- return new WKTParameter(id, title, WKTGeometryType.Hexagon, defaultValue);
+ wktGeometryType = WKTGeometryType.Hexagon;
} else {
if (title.contains("[WKT_BOX]")) {
title = title.replace("[WKT_BOX]", "");
- return new WKTParameter(id, title, WKTGeometryType.Box, defaultValue);
+ wktGeometryType = WKTGeometryType.Box;
} else {
- return new WKTParameter(id, title, WKTGeometryType.Polygon, defaultValue);
+ wktGeometryType = WKTGeometryType.Polygon;
}
}
}
@@ -246,8 +249,53 @@ public class WPS2DM {
}
}
}
+
+
+ Coordinates coordinates = retrieveCoordinates(title);
+ String wktDescription= cleanWKTDescription(title);
+ WKTParameter wktParameter = new WKTParameter(id, wktDescription, wktGeometryType, coordinates, defaultValue);
+ logger.debug("Retrieved WKTParameter: " + wktParameter);
+ return wktParameter;
+
}
+
+ private static Coordinates retrieveCoordinates(String title) {
+ logger.debug("Retrieve Coordinates");
+ Coordinates coordinates = null;
+ if (title != null && !title.isEmpty() && title.contains("[COORDS_")) {
+ Pattern pattern = Pattern.compile("\\[COORDS_(.*?)_(.*?)_(.*?)_(.*?)\\]");
+ Matcher matcher = pattern.matcher(title);
+ if (matcher.find()) {
+ logger.debug("Coords Match found");
+ coordinates = new Coordinates(matcher.group(1), matcher.group(2), matcher.group(3), matcher.group(4));
+ }
+ }
+ logger.debug("Retrieved Coordinates: " + coordinates);
+ return coordinates;
+ }
+
+ private static String cleanWKTDescription(String title) {
+ if (title != null && !title.isEmpty()) {
+ int indexStart = title.indexOf("[COORDS_");
+ if (indexStart > -1 && indexStart < title.length()) {
+ String subTitle = title.substring(indexStart);
+ logger.debug("Title without the initial part: " + subTitle);
+ int indexEnd = subTitle.indexOf("]");
+ if (indexEnd > -1 && indexEnd < subTitle.length()) {
+ StringBuilder titleCleaned = new StringBuilder();
+ titleCleaned.append(title.substring(0, indexStart));
+ if (indexEnd + 1 < subTitle.length()) {
+ titleCleaned.append(subTitle.substring(indexEnd + 1));
+ }
+ title = new String(titleCleaned.toString());
+ }
+ }
+ }
+ logger.debug("Cleaned Description: " + title);
+ return title;
+ }
+
/**
*
* @param maxMegaBytes
diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Coordinates.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Coordinates.java
new file mode 100644
index 0000000..434b593
--- /dev/null
+++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/Coordinates.java
@@ -0,0 +1,67 @@
+package org.gcube.data.analysis.dataminermanagercl.shared.parameters;
+
+import java.io.Serializable;
+
+/**
+ *
+ * @author Giancarlo Panichi
+ *
+ *
+ */
+public class Coordinates implements Serializable {
+ private static final long serialVersionUID = -1387634056697911513L;
+ private String projection;
+ private String x;
+ private String y;
+ private String zoom;
+
+ public Coordinates() {
+ super();
+ }
+
+ public Coordinates(String projection, String x, String y, String zoom) {
+ super();
+ this.projection = projection;
+ this.x = x;
+ this.y = y;
+ this.zoom = zoom;
+ }
+
+ public String getProjection() {
+ return projection;
+ }
+
+ public void setProjection(String projection) {
+ this.projection = projection;
+ }
+
+ public String getX() {
+ return x;
+ }
+
+ public void setX(String x) {
+ this.x = x;
+ }
+
+ public String getY() {
+ return y;
+ }
+
+ public void setY(String y) {
+ this.y = y;
+ }
+
+ public String getZoom() {
+ return zoom;
+ }
+
+ public void setZoom(String zoom) {
+ this.zoom = zoom;
+ }
+
+ @Override
+ public String toString() {
+ return "Coordinates [projection=" + projection + ", x=" + x + ", y=" + y + ", zoom=" + zoom + "]";
+ }
+
+}
diff --git a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java
index f59d539..8c5414e 100644
--- a/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java
+++ b/src/main/java/org/gcube/data/analysis/dataminermanagercl/shared/parameters/WKTParameter.java
@@ -13,6 +13,7 @@ public class WKTParameter extends Parameter {
private static final long serialVersionUID = 1673874854501249519L;
private WKTGeometryType wktGeometryType;
+ private Coordinates coordinates;
private String defaultValue;
/**
@@ -38,6 +39,28 @@ public class WKTParameter extends Parameter {
super(name, ParameterType.WKT, description);
this.wktGeometryType = wktGeometryType;
this.defaultValue = defaultValue;
+ this.coordinates = null;
+ }
+
+ /**
+ *
+ * @param name
+ * Name
+ * @param description
+ * Description
+ * @param wktGeometryType
+ * WKT geometry type
+ * @param coordinates
+ * Coordinates
+ * @param defaultValue
+ * Default Value
+ */
+ public WKTParameter(String name, String description, WKTGeometryType wktGeometryType, Coordinates coordinates,
+ String defaultValue) {
+ super(name, ParameterType.WKT, description);
+ this.wktGeometryType = wktGeometryType;
+ this.defaultValue = defaultValue;
+ this.coordinates = coordinates;
}
/**
@@ -72,10 +95,19 @@ public class WKTParameter extends Parameter {
this.wktGeometryType = wktGeometryType;
}
+ public Coordinates getCoordinates() {
+ return coordinates;
+ }
+
+ public void setCoordinates(Coordinates coordinates) {
+ this.coordinates = coordinates;
+ }
+
@Override
public String toString() {
- return "WKTParameter [wktGeometryType=" + wktGeometryType + ", defaultValue=" + defaultValue + ", value="
- + value + ", name=" + name + ", description=" + description + ", typology=" + typology + "]";
+ return "WKTParameter [wktGeometryType=" + wktGeometryType + ", coordinates=" + coordinates + ", defaultValue="
+ + defaultValue + ", name=" + name + ", description=" + description + ", typology=" + typology
+ + ", value=" + value + "]";
}
}