[Gvsig_english] groovy
Jorge Sanz
jsanz at prodevelop.es
Thu Aug 28 09:11:40 CEST 2008
Hi Robert,
Do you want to execute groovy compiled classes or to execute dynamic compiled scripts?
I've tested recently the dynamic execution of groovy scripts in gvSIG (sorry but I haven't any examples here at work) loading the script files. I created a new extension (like any other gvSIG plugin) with its config.xml and so on. In my extension execute method I've tried to parse a groovy script[1].
One thing you should care about is to pass the extension classloader[2] to the compiler in order to let your groovy scripts to access gvSIG classes. I've successfully accessed andami classes (like PluginServices for example) but I've experienced casting problems with other libraries like FMap (to access for example to the active view's MapControl).
Anyway (IMHO) developing extensions for gvSIG is easier in Java than in scripting languages.
Regards
[1] http://groovy.codehaus.org/api/groovy/lang/GroovyShell.html#GroovyShell(java.lang.ClassLoader)
[2] http://groovy.codehaus.org/api/groovy/lang/GroovyShell.html#evaluate(java.io.File)
--
Jorge Gaspar Sanz Salinas
Ingeniero en Geodesia y Cartografía
Prodevelop S.L. - Valencia - España
Tlf.: 96.351.06.12 - Fax: 96.351.09.68
jsanz[en]prodevelop[punto]es
http://www.prodevelop.es
De: gvsig_internacional-bounces at runas.cap.gva.es [mailto:gvsig_internacional-bounces at runas.cap.gva.es] En nombre de Robert Sanson
Enviado el: jueves, 28 de agosto de 2008 6:16
Para: Users and Developers mailing list
Asunto: Re: [Gvsig_english] groovy
Hi
How can I use groovy scripting in gvSIG?
Many thanks,
Robert Sanson
------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------
This message has been scanned for malware by SurfControl plc. www.surfcontrol.com <http://www.surfcontrol.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://runas.cap.gva.es/pipermail/gvsig_internacional/attachments/20080828/8d47ed5a/attachment.htm
More information about the Gvsig_internacional
mailing list