Monday, January 12, 2009

Let's see about this GWT in Sakai stuff

Now that I have the SOPI Swing app talking nicely to Sakai I need to build a Sakai tool for setting some site properties and monitoring student progress.

Being more of a on the server and in the plumbing type of guy I don't have tons of experience with modern front end technologies.

This give me a chance to investigate GWT in Sakai.

I'm starting off with that interesting post from Luis of last year ( http://www.nabble.com/Re:-GWT-Sakai-Development-p16124688.html ) and starting from there. I need a hello-world for Sakai / GWT / Eclipse and I have concluded that the OpenSyllabus folks are too busy to finish up the one they started in the Sakai Confluence area. The Davis folks are apparently plunging along but no cycles have been spared for more than a few tasty public postings.

off I go!

1) get gwt - http://code.google.com/webtoolkit/download.html I expand this and drop in in my development area. I kick the mail sample. it just works. love this just workingness. but heck the app engines just about just worked too.

2) Oh I better get Luis' IPBUserManager dealy. Use the Nabble link above. I expand this and put it into my Sakai Eclipse workspace, and then import it into Eclipse. Of course it's a bit confused.

2.1) As Luis described in his email the include-sakai directory is empty in his package. He did us all a favor by not populating it and attaching such a giant wad to his email. A WHAT_WAS_HERE.txt file explains the deal. As I'm developing against Sakai 2.4.x I'll have to wing it on the various M2 versions. So I get busy updating the include-sakai directory based on the shopping list. I do this by ransacking my local maven repo and populating the IPBUserManager's include-sakai directory.

2.2) don't forget to update Luis' (it's easier to type Luis than IPBUserManager) build.xml. You'll need to update locations to reflect where you've dumped the GWT and to update the platform info to reflect your development platform. For example Luis is using Linux, so his gwt.dev.jar is gwt-dev-linux, right? swap it for whatever platform specific value you need.

2.2.1) the Ant I'm dorking around with on this G5 isn't wired up to use the tomcat administration bits, so I comment those out.

2.3) compile the bits, package as a .war, and drop into my dev instance of Sakai. Let's see what we get. I fire up the VPN, restart the sakai, and wait...a while. This isn't the fastest way to work with sakai - a VPN'ed database out through DSL. snore. Then I make a mistake of clicking on a course site which must be an old load testing site - it has scads of users and so it starts off doing scads of LDAP and Kerberos lookups! oops. I pick another site, go to Site Info -> Tools and find the IBP User Manager tool. nicely.

2.3.1) Ok I have it now in a page in a course Site. I get a big exception when I go to actually use it. the exception is from the portal, and it's throwing a NPE. OK I probably missed a step or a dependancy.

org.sakaiproject.portal.api.PortalHandlerException: java.lang.NullPointerException
at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:718)
caused by: java.lang.NullPointerException
at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:441)
at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1099)
at org.sakaiproject.portal.charon.handlers.ToolHandler.doTool(ToolHandler.java:163)
at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:86)

The portal isn't having much fun getting the tool placement together.

I wonder if this only works with Spring 2.0? Because I also see that org/springframework/web/HttpRequestHandler is missing. I don't think that was part of spring 1.2.8, which is the Spring in this Sakai.

That's got to be it; I bet this example works in Sakai 2.5 or a Sakai 2.4.x which has been mutated to use Spring 2.0.x.

Time for lunch and then I'll be back at this! I'll just dork up the dispatching.


3) Luis mentions a plugin from Cypal. I think Thomas has mentioned it as well. While I know this won't help with my Placement problem I go off and get that: http://code.google.com/p/cypal-studio/downloads/list with documentation: http://www.cypal.in/studiodocs

3 comments:

Steve Swinsburg said...

Sounds good Casey, when you get it up and in a state to share, commit it somewhere in contrib so we can play with a quickstart!

Steve Swinsburg said...

Hi Casey,

You should also take a look at Wicket if you are interested in using some AJAXy goodness but without writing it all by hand. It has loads of built in Java methods that attach rich AJAX functions, so you don't need to write a line of Javascript - but can easily make a call to a jQuery method if you want to add more.

I've been using Wicket heaps inside Sakai, they play really well together.

cheers.

caseyd said...

Hi Steve,

Yes I'm looking for someway around writing and maintaining sophisticated client side javascript.

Wicket may well be a good approach, and I did have it on my list of things to investigate.

My plan is to follow through with GWT and see if I can get into some more fluid Sakai development cycle. I'll be using their RPC stuff to stitch together existing Sakai webservices; I'm expecting to be able to live mostly in Eclipse and the google dev tools and not have to repackage and deploy to Sakai as much as we have to now.