Hi,
I’ve been working on the process selection and I believe it’s ready for commit.
It’s a relatively large patch (97KB) with new API, even if it’s destined for trunk
only right now I believe it would have been good to get some feedback before
moving on.
If you just cannot resist and have a look at the diffs here you go, more description follows:
https://github.com/aaime/geoserver/compare/73f804450c859b2ab1e946baea22fd5153007c65…aaime:wps-filter
So the whole work is based on a very simple interface, here:
https://github.com/aaime/geoserver/blob/wps-filter/src/extension/wps/wps-core/src/main/java/org/geoserver/wps/process/ProcessFilter.java
It is simpler and more generic than the one I presented before, and allows also
to wrap process factories, which means one can not only control which processes are around, but
also lie about process metadata, or add controls for inputs and outputs (in their java object form,
more on this later).
If one really just wants to hide certain processes there is a convenience base class available:
https://github.com/aaime/geoserver/blob/wps-filter/src/extension/wps/wps-core/src/main/java/org/geoserver/wps/process/ProcessSelector.java
The ProcessFilter is pluggable, just register it in the app context (there are tests for this)
and the GeoServerProcessors, which replaces Processors in GeoServer WPS, will use it:
https://github.com/aaime/geoserver/blob/wps-filter/src/extension/wps/wps-core/src/main/java/org/geoserver/wps/process/GeoServerProcessors.java
Configuration wise, the WPSInfo has been extended to have an idea of a “process group”
(which is a factory, but I did not want to put the term “factory” in the GUI and REST user eyes):
https://github.com/aaime/geoserver/blob/wps-filter/src/extension/wps/wps-core/src/main/java/org/geoserver/wps/WPSInfo.java
The process group is really just a reference to a factory, a flag that enables/disables it, and a list
of disabled processes:
https://github.com/aaime/geoserver/blob/wps-filter/src/extension/wps/wps-core/src/main/java/org/geoserver/wps/ProcessGroupInfo.java
The approach of blacklisting processes (as opposed to white list them) has been chosen to allow
upgrading servers to keep on working, as well as give people adding processes via scripting
the ability to use the process right away without having to also enable it.
A authorization subsytem can decide to implement the ProcessFilter interface with a whitelist
approach if it wants to.
Here is some screenshots from the GUI. The main entry point in the WPS admin page:
and the page that opens to cherry-pick processes from a certain group:
One notice about the GUI, I had to deep clone the ProcessGroupInfo used in the GUI because
they don’t get wrapped with a proxy, so modifying them was altering the server state even
if you did not push the save button in the WPS admin page.
As far as I can see ModificationProxy simply clones collections, that takes care of adding/removing
items, but not modifying them.
I see there are lists that do wrap their contents too, used for the methods that return lists of info objects
from the catalog, but they are not used inside ModificationProxy “get” property paths.
So far the cloning works good, but it made me wrestle with the code quite a bit before discovering
where the issue was (I was blaming Wicket, for once it wasn’t it :-p )
Cheers
Andrea
–
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it