[Geoserver-devel] Drop down list for a WPS input parameter

Hello,

How can I build a drop-down list for an Input parameter for a WPS?

I would like to examine each workspace for a list of coverages, and then add it to a list.

I see that enum gives me a drop down list, but that is defined at compile time.

Thanks for any help!!

Alex

Hi Alexander,
do you mean, in the WPS request builder? There is no support for that as far as I know.

Also, the parameters of a process developed using annotations have to be all known at compile time,
as annotations are static. To get a list of valid value at run time, you’ll have to build the necessary
infrastructure, that’s not a quick task… some ideas:

  • The Parameter objects describing the inputs are currently generated from AnnotationDrivenProcessFactory. In theory, you could modify it to build a OPTIONS metadata entry in the parameter that lists the valid values… having to determine the value at runtime, but specify it using an annotation, maybe one could pass the name of a class that, once instantiated, can produce such list.
  • The alternative would be to produce your process using a low level ProcessFactory, which would give you more control.
  • Once you have that, modify the WPS request builder to handle the OPTIONS metadata entry and build a drop down from it.
    That said, if all you want is a list of available coverages, I believe that you just need to declare your parameter as a GridCoverage2D, and

the GUI will list the coverages available in GeoServer, when choosing the “layers” input option.

Cheers
Andrea

···

Regards, Andrea Aime

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Alexander:

WPS has a DescribeProcess data structure that is used to communicate with clients what is acceptable for parameter input.

Like Andrea I will also assume you mean WPS Process builder…

  1. For vect:Count
  2. The parameter “features” requires a SimpleFeatureCollection
  3. The WPS builder gives you a couple options: text, reference, subprocess and vector layer.
  4. Selecting “vector layer” allows you to choose one of the wfs layers from geoserver

The same approach should work for processes expecting a gridcoverage?

  1. For ras:AddCoverages
  2. coverageA and coverageB both expect a GridCoverage2D
  3. The WPS builder gives options: : text, reference, subprocess and raster layer.
  4. When I select “raster layer” I can choose one of the raster published by this geoserver

If you were making your own client, not wps builder, you would review the WCS GetCapabilities to see what coverages are available…

···


Jody Garnett