From a2989fc07fa6add00c945982adf5fba40e05ce66 Mon Sep 17 00:00:00 2001 From: Lyn Elisa Goltz Date: Wed, 20 Dec 2023 06:26:23 +0100 Subject: [PATCH 1/3] X-2307 - overwrite srsName in StoredQuery template with default srs --- .../deegree/services/wfs/query/QueryAnalyzer.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/query/QueryAnalyzer.java b/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/query/QueryAnalyzer.java index 9a68f9eeab..ba25fd45f8 100644 --- a/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/query/QueryAnalyzer.java +++ b/deegree-services/deegree-services-wfs/src/main/java/org/deegree/services/wfs/query/QueryAnalyzer.java @@ -42,7 +42,6 @@ import java.io.IOException; import java.io.StringReader; -import java.math.BigInteger; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; @@ -260,10 +259,11 @@ private List> convertTemp try { String templ = IOUtils.toString(u.openStream()); for (Entry e : query.getParams().entrySet()) { - String val = e.getValue().getText(); - Pattern p = Pattern.compile("[$][{]" + e.getKey() + "[}]", Pattern.CASE_INSENSITIVE); - templ = p.matcher(templ).replaceAll(val); + String key = e.getKey(); + templ = replaceParam(key, e.getValue().getText(), templ); } + String defaultSrsName = controller.getDefaultQueryCrs().getAlias(); + templ = replaceParam("srsName", defaultSrsName, templ); LOG.debug("Stored query template after replacement: {}", templ); @@ -287,6 +287,11 @@ private List> convertTemp } } + private static String replaceParam(String key, String val, String templ) { + Pattern p = Pattern.compile("[$][{]" + key + "[}]", Pattern.CASE_INSENSITIVE); + return p.matcher(templ).replaceAll(val); + } + private List> convertStoredQueries( List wfsQueries) throws OWSException { List> adHocQueries = new ArrayList>(); From dec704071f94849f8ef33c2ba70c88279b22d574 Mon Sep 17 00:00:00 2001 From: Lyn Elisa Goltz Date: Wed, 20 Dec 2023 06:43:07 +0100 Subject: [PATCH 2/3] X-2307 - documentation of srsName in stored queries --- .../src/main/asciidoc/webservices.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc index e3efdeb724..0348695bea 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc +++ b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc @@ -764,7 +764,7 @@ StoredQueryDefinition file. Here's an example: - + @@ -798,6 +798,8 @@ Query-Elements should be used. An exception is thrown as DescribeStoredQueries response, if the configured feature type is not served by the WFS. +The optional attribute _srsName="${srsName}"_ can be set to support the parameter _srsName_ in the GetFeature request to determine the CRS of the returned geometries. If the paramater is missing in the request the default CRS of the WFS is assumed. + To enable support for the Manage Stored Queries conformance class for WFS 2.0.0 it is required to create a directory storedqueries/managed in your workspace. The stored queries created with _CreateStoredQuery_ requests are stored in this directory. They are loaded during startup of deegree automatically. It is not recommend to put the StoredQueries configured in the WFS configuration with the StoredQuery element into this folder. If the directory is missing the _CreateStoredQuery_ request returns an exception. TIP: deegree WFS supports the execution of stored queries using From 5fa5ddf52e5c14f58dd18de888ce25f3c5f944d2 Mon Sep 17 00:00:00 2001 From: dstenger Date: Thu, 11 Jan 2024 13:57:17 +0100 Subject: [PATCH 3/3] XPLANBOX-2307 - Update description of srsName --- .../src/main/asciidoc/webservices.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc index 0348695bea..694397c627 100644 --- a/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc +++ b/deegree-services/deegree-webservices-handbook/src/main/asciidoc/webservices.adoc @@ -798,7 +798,7 @@ Query-Elements should be used. An exception is thrown as DescribeStoredQueries response, if the configured feature type is not served by the WFS. -The optional attribute _srsName="${srsName}"_ can be set to support the parameter _srsName_ in the GetFeature request to determine the CRS of the returned geometries. If the paramater is missing in the request the default CRS of the WFS is assumed. +The optional attribute _srsName="${srsName}"_ can be set to support the parameter _srsName_ in the GetFeature request to determine the CRS of the returned geometries. If the paramater is missing in the request, the default CRS of the WFS is returned. To enable support for the Manage Stored Queries conformance class for WFS 2.0.0 it is required to create a directory storedqueries/managed in your workspace. The stored queries created with _CreateStoredQuery_ requests are stored in this directory. They are loaded during startup of deegree automatically. It is not recommend to put the StoredQueries configured in the WFS configuration with the StoredQuery element into this folder. If the directory is missing the _CreateStoredQuery_ request returns an exception.