[Gvsig_english] groovy

Robert Sanson SansonR at asurequality.com
Thu Aug 28 22:35:33 CEST 2008


Hi Jorge
 
I am new to gvSIG, and am wanting to work out the best way to write
extensions for gvSIG. For instance, I want to be able to select an
attribute value from a layer in the view based on a click location, and
use that to execute a SQL statement against a database. I have been
looking at options such as Jython and Groovy. Perhaps it is better to
stick to Java? Has the developer's manual been translated to English
yet? I tried to follow the link to the News item on the gvSIG web site,
but did not find the manual:
 
https://gvsig.org/web/docdev/manual-for-developers-gvSIG 
 
Many thanks,
 
Robert Sanson

>>> "Jorge Sanz" <jsanz at prodevelop.es> 28/08/2008 7:11 p.m. >>>

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/ )



Click here (
https://www.mailcontrol.com/sr/UyMWDvXzbPjTndxI!oX7Ul4TPWxlZJ1aSJQ+lK9syuf!21ILXzPEZyCBT5!TwAWH2ZTBXr+ASFpGp10b+rkp2Q==
) to report this email as spam.
------------------------------------------------------------------
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.
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://runas.cap.gva.es/pipermail/gvsig_internacional/attachments/20080829/7e3526ab/attachment.htm


More information about the Gvsig_internacional mailing list