Peter Smythe (
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b3b4ba74e83c12dd31159d6
) *created* an issue
GeoServer (
https://osgeo-org.atlassian.net/browse/GEOS?atlOrigin=eyJpIjoiN2YwYzJiNmM3M2M1NDE5ZjlhN2NmZGJkNjRhOTQ4YTMiLCJwIjoiaiJ9
) / Bug (
https://osgeo-org.atlassian.net/browse/GEOS-10749?atlOrigin=eyJpIjoiN2YwYzJiNmM3M2M1NDE5ZjlhN2NmZGJkNjRhOTQ4YTMiLCJwIjoiaiJ9
) GEOS-10749 (
https://osgeo-org.atlassian.net/browse/GEOS-10749?atlOrigin=eyJpIjoiN2YwYzJiNmM3M2M1NDE5ZjlhN2NmZGJkNjRhOTQ4YTMiLCJwIjoiaiJ9
) Multiple viewparams not working: &viewparams=p1:5;p2:6;p3:7 (
https://osgeo-org.atlassian.net/browse/GEOS-10749?atlOrigin=eyJpIjoiN2YwYzJiNmM3M2M1NDE5ZjlhN2NmZGJkNjRhOTQ4YTMiLCJwIjoiaiJ9
)
Issue Type: Bug Affects Versions: 2.21.1 Assignee: Unassigned Created:
15/Nov/22 8:47 AM Priority: Medium Reporter: Peter Smythe (
https://osgeo-org.atlassian.net/secure/ViewProfile.jspa?accountId=5b3b4ba74e83c12dd31159d6
)
I am following the documentation at
https://docs.geoserver.org/latest/en/user/data/database/sqlview.html#using-a-parametric-sql-view
(
https://fdfdfha.r.af.d.sendibt2.com/tr/cl/ZuSfQbPvAxtm7fihalOB7fHBZCg_68NVZijYR5OIEv7mU8Z07ZrQLe8mp0QKUgzRt2QVqHsGsqvew8SqrXrBwrA0Fkc8-FsUzThTdUE1G2thv_QvCuNemwsWoQfdQj1AY83PS_UtaCBjlh8LyF0psjjGR4MF5hchlULF1BJl5qeRsUYXmWOjq6AmUdetYIuA9KTcsWAQQvKWbux6gIv2J_6S-lo-lg2-3D-H8wCl1Dt8wN3pAFlIswQ1bVaEI0SOWgEEx-kQ31veNIy0huIsbjtEpqm24x4TYi9GecJpqqXW3ViAnPrRuAGVGQXT-nMLdCARnGvP-mjg8_mohZZJ
) which is essentially:
>
>
>
> Using a parametric SQL View ¶ (
> https://fdfdfha.r.af.d.sendibt2.com/tr/cl/4ZVgc5U2H57vrHvDQCrl8tbCuEQvKao3v0XZM9qRHtxqW2bIo2TaxtNiJTUXQQa83D33vpizRjY7Y_GeMbEYLxDE1QJhjpf3ppjyc5f22CX0eIiUjjwAS2_4-DdaU4UyvkJFBgI0P3Z8amd5RQqFPqAzxvMeAaSFLSYxqNigIYbqa59zB7JGvB3ew-hMASjyTbxqT2X0CI1QY-pO9-4fVEQD3BkM9rd2vuU1Q0gN4LwGxFTQuJ3IXQJwBQrxIcxlpUtd2ct9Q2dWQTlGEbTzs5RTUyF2JagMv6_KHLJHJYpkIHTG2T9RuakXz0rXyT3uT8TP1ZfOah0St_o34P5-
> )
>
>
>
> The SQL view parameters are specified by adding the viewparams parameter to
> the WMS GetMap or the WFS GetFeature request. The viewparams argument is a
> list of key:value pairs, separated by semicolons:
>
>
>
> viewparams=p1:v1;p2:v2;...
>
>
>
> If the values contain semicolons or commas these must be escaped with a
> backslash (e.g. \, and \; ).
>
>
I have discovered that the second and third viewparams (p2, p3 above) do not
get set to the values provided in the WFS request and default to their default
values.
How to reproduce:
Add store > Geopackage ( which allows a SQL view ) > test-viewparams as the
store name and geopackage name
You will be taken to Add new layer > Configure new SQL view > add a view name
and this SQL:
SELECT %p1% as a,
%p2% as b,
%p3% as c
Click Guess parameters from SQL > enter default values 1, 2, 3 respectively.
Save, Save.
Now hit
http://localhost:8080/geoserver/wfs?version=1.0.0&request=GetFeature&typeName=cite:test-viewparams&outputFormat=application/json&
(
https://fdfdfha.r.af.d.sendibt2.com/tr/cl/cgi7GwVQIQiW_k1ljTRgpP0XE8ADzPZIoVCffkuNewf-8wSdy81wSochnmub358o7KiVPd9-kJf7EvkaCbZZw_8fo6WNz_N1_xchy72aqQTUFRTFQ0c8d_kmvycPeW0GIKiQJUxGT52tgNEbTKddhJM6RzZBb79LngJJPLIywjGtTQG4FWsE4cEI7cZq8NoXfceYGWfRD7CDMlNuZrkM-SZB1DIIxYJJMQG6KyV7ot31pV1Mg7X2uUF2PkBhziy3G1fPfiFH9kAM8w1fB5Qxnjm6NuxdvdEPHSG3J7TQZ_lKTxzWhf3VWqyEBx8VgBp2x7aJj73HodM7mgEcxBxNo4Hch3r4xLLV1UBh-ZNZ0UARqgGang9aUljH4aecreNMwsgoH0OTVIuMBcoC-x0T-E2Do5tIcH4zIqAKZFUGANyUzxrHQyI
) viewparams=p1:5;p2:6;p3:7
This should set:
* p1 to 5 (not the default 1)
* p2 to 6 (not the default 2)
* p3 to 7 (not the default 3)
However, only p1 is set and p2 and p3 are set to their default values:
>
>
>
> {
> "type": "FeatureCollection",
> "features": [{
> "type": "Feature",
> "id": "test-viewparams.fid-42816c8f_1842d011d2b_-7ff3",
> "geometry": null,
> "properties":
>
> Unknown macro: { "a"}
>
>
> }
> ],
> "totalFeatures": 1,
> "numberMatched": 1,
> "numberReturned": 1,
> "timeStamp": "2022-11-10T09:29:59.900Z",
> "crs": null
> }
>
>
Further, in the GeoServer application logs, I see that the semicolon separator
has been replaced by an ampersand separator by the time of “Checking match of
request” in the Filter Chains:
15 041 07:41:49 DEBUG [geoserver.security] - Checking match of request : 'Path:
/wfs, QueryString:
version=1.0.0&request=GetFeature&typeName=cite:test-viewparams&outputFormat=application/json&viewparams=p1:5*&
*p2:6* & *p3:7'; against '/web/* *'
And a bit further on only the first viewparams is displayed - the others have
already been dropped:
15 041 07:41:49 INFO [geoserver.wfs] -
Request: getFeature
service = WFS
version = 1.0.0
baseUrl = http://localhost:8080/geoserver/ (
http://sandboxogc.afrigis.co.za/geoserver/ )
query [0] :
typeName [0] =
{[http://www.opengeospatial.net/cite}
test-viewparams|http://www.opengeospatial.net/cite%7Dtest-viewparams]
outputFormat = application/json
resultType = results
viewParams [0] = { *P1=5* }
(
https://osgeo-org.atlassian.net/browse/GEOS-10749#add-comment?atlOrigin=eyJpIjoiN2YwYzJiNmM3M2M1NDE5ZjlhN2NmZGJkNjRhOTQ4YTMiLCJwIjoiaiJ9
) Add Comment (
https://osgeo-org.atlassian.net/browse/GEOS-10749#add-comment?atlOrigin=eyJpIjoiN2YwYzJiNmM3M2M1NDE5ZjlhN2NmZGJkNjRhOTQ4YTMiLCJwIjoiaiJ9
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210-
sha1:28a3636 )
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel