Opened 5 years ago
Closed 5 years ago
#2126 closed enhancement (invalid)
make WCS/WMS client more configurable
Reported by: | Peter Baumann | Owned by: | Bang Pham Huu |
---|---|---|---|
Priority: | major | Milestone: | 11.0 |
Component: | petascope | Version: | 9.8 |
Keywords: | Cc: | Dimitar Misev, Vlad Merticariu | |
Complexity: | Medium |
Description
when deployed some client behavior is site dependent. It should be possible to easily configure parameters like service endpoint, WMS and WCS WorldWind starting position, and likely more.
2 options I see:
- have a specific JS source file with constant definitions available for admin editing. This file would get loaded as any JS file.
- Pro: powerful, con: easy to mess up if used wrongly.
- add config file parameters. Pro:
- Pro: somewhat cleaner approach. Con: more effort for parsing, config file error handling, etc.
Opinions?
Attachments (1)
Change History (8)
comment:1 by , 5 years ago
Milestone: | 10.0 → 11.0 |
---|
comment:2 by , 5 years ago
by , 5 years ago
Attachment: | wcs-client.properties added |
---|
comment:3 by , 5 years ago
I don't like (strongly object) the idea from Vlad because it is too verbose, one should use JSON-like configuration and can be consumed from WSClient directly as Javascript code.
{ "wcps-queries: [ { "name": "query1", "description": "test", "query": `very long query1`, }, { "name": "query2", "description": "test", "query": `very long query2`, } ] }
comment:4 by , 5 years ago
Having settings files as code is bad practice. We would need to call eval() in the client to evaluate the code, and even then we don't know what the code does (how do you know how the admin called the variable containing the queries, so you can access it? conventions on variable names? what if there's a clash?)
Besides that, we add a requirement on the administrator to know javascript.
comment:5 by , 5 years ago
P.S. Please write the queries in the attached wcs-client.properties in the JS syntax that you proposed, then compare verbosity of the 2 files.
comment:6 by , 5 years ago
My small changes for a slightly simplified syntax:
#Comments start with #, like in all properties files #Dummy property setting the default zoom in wwd wwd.default-zoom-level = 100 query = perform ndvi image>>for $c in (Sentinel) return encode( ($c.0 - $c.1) / ($c.0 + $c.1) "jpeg") === query = subset 2D coverage image>>for $c in (Sentinel) return encode($c[Lat(0:10), Long(0:10)], "jpeg") ===
- configurations are
key = value
- if key is
query
, then the value is the query description- the query itself starts on the next line until a line that starts with
===
is reached
- the query itself starts on the next line until a line that starts with
comment:7 by , 5 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
A file called wcs-client.properties should be added to etc/ and served by petascope.
Initially, the file would only contain example queries to be shown in the Examples dropdown in the ProcessCoverages tab, later we can add other properties as well (e.g. which tabs to show / hide, wwd position etc).
I propose the following format for the file:
Example wcs-client.properties attached.