It could be interesting to combine an 'offline catalog' based 
configuration library with a Python client for the REST API.  Throw in a 
little dynamic dispatch to use the REST API if GeoServer's running and 
the offline catalog otherwise, and you can run your configuration 
scripts without worrying about shutting down GeoServer beforehand.

I happen to already be working on a python client library for the REST 
API, currently hosted at http://bitbucket.org/dwins/gsconfigpy/ .  It is 
far from complete, but I'd like to make sure that we are at least 
providing the same API in both access modes.

--
David Winslow
OpenGeo - http://opengeo.org/

On 02/17/2010 09:13 AM, Justin Deoliveira wrote:
> Hi Ariel,
>
> Wow, awesome work. Good to see you are excited about the new module.
>
> As for your question about running GeoServer "offline" it is "sort" of
> possible. In the Geoserver test setup we mock up a data directory and
> create a spring context manually.
>
> I imagine you could use a similar approach in your plugin. Probably the
> most logical way to go at this point. You could possibly just call the
> existing MockData setup methods directly.
>
> Keep up the enthusiasm!
>
> -Justin
>
> On 2/16/10 11:11 PM, Ariel Nunez wrote:
>    
>> First of all, awesome work Justin!
>>
>> I took the python module for a test drive today, and after getting it
>> to build and pass the tests in eclipse, I wanted to play with it on a
>> real python shell.
>>
>> Here is the journey's log:
>>
>> Destination
>> ========
>>
>> What I want to do is create a geoserver-admin.py command similar to
>> django-admin.py to be able to quickly call actions script or shells.
>>
>> geoserver-admin.py createuser bob
>>
>> geoserver-admin.py addshapefile myshapefile.shp --workspace sf
>>
>> geoserver-admin.py runscript mystuff.py
>>
>> geoserver-admin.py shell
>>      
>>>>> from geoserver import catalog
>>>>> if "sf" in catalog.stores:
>>>>>       print catalog.stores.get("sf").size
>>>>>            
>> Roadblocks
>> =========
>>
>> Before going for a standalon script, I decided to create a maven
>> plugin to get access to the shell.
>>
>> Started by modifying a module called maven-jython-plugin, renamed it
>> to maven-geoscript-plugin and did something like this:
>>
>> public class JythonShellMojo extends AbstractMojo
>> {
>>       public void execute() throws MojoExecutionException, 
>> MojoFailureException
>>       {
>>           Python python = new Python(new GeoServerResourceLoader(new
>> File( System.getenv("GEOSERVER_DATA_DIR"))));
>>           String path =  python.getLibRoot().getCanonicalPath();
>>           Py.getSystemState().path.insert(0, new PyString( path ));
>>           jython.main(new String[]{});
>>       }
>> }
>>
>> Then enabled the plugin in the python community module and ran:
>>
>> mvn geoscript:shell
>>
>> but got the following error:
>>
>> SEVERE: Extension lokup occured, but ApplicationContext is unset [1]
>>
>> So my question is: "is it possible to get Geoserver up with just
>> GEOSERVER_DATA_DIR and GEOSERVER_HOME set, without using jetty or
>> tomcat?" I have the feeling that code similar to the one used in the
>> Test Suite could be used to enable this, but would like to hear
>> thoughts on it.
>>
>> Conclusion
>> ========
>>
>> In any case, the new Python community module made my day, and I'm
>> looking forward to help bringing it to extension status.
>>
>> Ariel.
>>
>> [1] http://img.skitch.com/20100217-e98c6yj4f9j6eswykg7k33jpjg.png
>>
>> --
>> Ariel Núñez // GeoSolutions S.A.S
>>
>> ------------------------------------------------------------------------------
>> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
>> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
>> http://p.sf.net/sfu/solaris-dev2dev
>> _______________________________________________
>> Geoserver-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>      
>
>    


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to