0

Jython instead of zul

asked 2010-09-03 05:12:53 +0800

volpadri gravatar image volpadri
9

Hi to you all,

I've already developped applications with Thinwire + Jython where the servlet init method instatiates a PythonInterpreter which opens the Application and manages the gui, obtaining a good inteface response and a rapid programming environment.

The question is: is it possible to implement the same in ZK not running scripts in zul and instead develop by code (like Java) the entire application ?.

And eventually where is the core servlet to start the Application process ?

Tnx a lot

Adriano

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2010-09-03 05:31:10 +0800

xmedeko gravatar image xmedeko
1031 1 16
http://xmedeko.blogspot.c...

Maybe http://code.google.com/p/zkgrails/ ZKGrails is what are you looking for? Just it uses Groovy.

link publish delete flag offensive edit

answered 2010-09-03 07:55:08 +0800

volpadri gravatar image volpadri
9

Yes, the idea seems the same, but obviously I don't want to translate the code from jython to groovy.
I can more precisely express the idea with some references to the actual code:

#### in web.xml: ####
...
<servlet-class>thinwire.render.web.WebServlet</servlet-class> <<< the servlet class
...
<init-param>
<description></description>
<param-name>mainClass</param-name>
<param-value>thinwire_jython.jython_interpreter.JythonInterpreter</param-value> <<< the mainClass istantiated by the servlet
</init-param>
...

#### in Java: ####

public class JythonInterpreter {
...
PythonInterpreter.initialize(sysProps, postProps, args);
...
interp = new PythonInterpreter(dict,sys);
...
interp.execfile(pyappdir + "\\" + pyappname + ".py"); <<< the .py interpreted

}


#### in Jython Desktop.py ####

class Desktop: <<< the GUI application
def __init__(self):
self.frame = fr.DesktopFrame(self,'Jython Desktop')
self.frame.initBackground()
self.createView()
self.createMenu()
self.createStatusBar()
...


where the key point is where instantiate the PythonInterpreter in the servlet

Adriano

link publish delete flag offensive edit

answered 2010-09-04 03:31:16 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

Hi Adriano,

maybe you can start from a so called "Richlet":

http://books.zkoss.org/wiki/ZK_Developer's_Guide/Migrate/Integrate_Other_UI_frameworks/SWING/Richlets

Just a note: I'm programming ZK with Java and use JRebel to reload my changes without app-server restarts and so on. Very productive, because you have all the benefits of Java (type-safety, IDE-support, application performance) with turnaroud-times like scripting languages. If you're interested, you can read something more here:

http://jease.org/coffeeklatsch/jrebel

Just replace PHP with Python...;-)

Cheers, Maik

link publish delete flag offensive edit

answered 2010-09-04 05:04:02 +0800

volpadri gravatar image volpadri
9

Richlets seem to be exactly the solution...

Tnx a lot Maik.

Adriano

link publish delete flag offensive edit

answered 2011-11-19 12:36:30 +0800

Bobzk gravatar image Bobzk
444 1 8

You might also want to look at my ZK with Python/Jython smalltalks - http://books.zkoss.org/wiki/Small_Talks/2010/May/Python_With_ZK_Part2

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-09-03 05:12:53 +0800

Seen: 441 times

Last updated: Nov 19 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More