Hi,
right now all scripting processes are basically using the file extension as the
namespace for the process, the code reads:
WpsHook hook = scriptMgr.lookupWpsHook(f);
if (hook == null) {
LOGGER.fine("Skipping " + f.getName() + “, no hook found”);
} else {
//use the extension as the namespace, and the basename as the process name
names.add(new NameImpl(getExtension(f.getName()), getBaseName(f.getName())));
//TODO: support the process defining its namespace
}
All right, let’s talk about that TODO, cause I have time to work on it :-p
My guess is that we probably want to delegate the creation of the name
to the WPSHook:
names.add(hook.getName(f));
And internally the default implementation would just do what the current code does,
but allowing each scripting extension to have its own way to declare namespaces.
In terms of the python one, the natural thing to do would be, imho, to add a namespace
or prefix property inside @process:
@process(
title=‘Buffer’,
description=‘Buffers a geometry’,
prefix = ‘myPrefix’
inputs={‘geom’: (Geometry, ‘The geometry to buffer’),
‘distance’:(float,‘The buffer distance’)},
outputs={‘result’: (Geometry, ‘The buffered geometry’)}
)
and this would result in the process to be exposed as myPrefix:Buffer.
Of course, it would be the process developer responsibility to ensure
the full name is unique
Opinions?
Cheers
Andrea
–
==
Meet us at GEO Business 2014! in London! Visit http://goo.gl/fES3aK
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 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it