Right, I thought I remembered a process that could do something like that. I
agree it would be nice to share the code. What would be nicer perhaps is to
have a general pattern to go about doing so. For instance there is lots of
code duplication between the ui and restconfig when it comes to interacting
with the catalog. If we could factor that out it would be nice.

I guess we could use a utility clase... but i sort of detest utility classes
as you may know :). But I guess it work work. Something I keep thinking
about is having a package of command classes, each that performs a specific
task. For instance this one would be one that takes a source file , or
source datastore instance and goes about importing it / creating the
underlying type, etc...

Thoughts? Sorry sort of a tangent.

On Fri, Nov 12, 2010 at 12:36 PM, Andrea Aime
<[email protected]>wrote:

> On Fri, Nov 12, 2010 at 8:25 PM, Justin Deoliveira <[email protected]>
> wrote:
> > Hi all,
> > Recently I have been working on some improvements to restconfig that I
> would
> > like to run by everyone. The changes have to do with the operations that
> > allow the uploading of a shapefile.
> > Currently you only really have one option. You upload a shapefile (or
> > reference it externally) and a datastore (and feature type) gets created
> for
> > that shapefile. Cool, but I think it would be cool to have some
> flexibility
> > here. Mainly to be able to specify a different datastore than shapefile.
> For
> > instance maybe you want that shapefile to be stored in an existing
>  postgis
> > database. Or maybe you want a different type of datastore to be
> > automatically created (thinking H2 here mostly).
> > So currently the api looks mostly like this:
> >   PUT [zipped shapefile] /rest/workspaces/<ws>/datastores/<ds>/file.shp
> > Well nothing really has to change. If you want to use an existing data
> store
> > you just put to that datastore. For instance:
> >   PUT [zipped shapefile] /rest/workspaces/<ws>/datastores/foo_pg/file.shp
> > Would under the covers take the shapefile and create a feature type /
> table
> > for it (via DataStore.createSchema()). Then copy the contents of the
> > shapefile into that new type.
> > I was also thinking of doing things like this:
> >   PUT [zipped shapefile]
> > /rest/workspaces/<ws>/datastores/foo_h2/file.shp?target=h2
> > In this case the datastore does not exist, but the user specified the
> type
> > of datastore they want to create via the "target" parameter. In this an
> H2
> > database and datastore would be created automatically, and the new type
> > added to it. Now obviously this could not be supported for all types of
> > datastores. For instance we can't really magically create a new postgis
> > datastore. But for many like h2, and other file based datastores it
> should
> > be possible.
> > So... what do you all think? The existing behaviour would be completely
> > maintained. These would really just be additions.
>
> Works for me. You may want to have a look in the WPS process that does
> the same thing:
>
> http://svn.codehaus.org/geoserver/trunk/src/community/wps/src/main/java/org/geoserver/wps/gs/ImportProcess.java
>
> I guess some of the code can be shared
>
> Cheers
> Andrea
>
> -----------------------------------------------------
> Ing. Andrea Aime
> Senior Software Engineer
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584962313
> fax:     +39 0584962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -----------------------------------------------------
>



-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to