Playing with Slikai (Sling/Sakai) – First Experiences

I visited Cambridge this week to see what was up with the new Sling + Sakai (Slikai) work that Ian is working on. I figured that one way or another I would find a way to hack in IMS Simple Learning Tools Interoperability into it – after all I hack LTI into pretty much anything else. One day I will write a FORTRAN version of Simple LTI :).

I figured that in two days I would be a little pressed for time. Day one started out with Ian explaining Sling for about an hour and giving me some hello world stuff. It took me a while to hack each piece together. I started this morning knowning nothing about Sling and now this evening I have my first working application in Sling/Sakai.

Sitting 3 feet away from Ian meant I was never stuck for too long – I was just slow. But by the end of the first day, I am pretty much done – the code is checked in here:

https://source.sakaiproject.org/contrib/csev/trunk/sling/

All in all I am pretty impressed with Sling. Many important decisions are already made – most of the APIs we think of as “kernel” are in place. There is lots of value to be added – mostly in terms of “helper” APIs to lock down “Sakai conventions” within Sling and keep us from hard-coding convention too widely scattered throughout the code.

There is lots to do – so much more to do – but Sling feels like a great starting point. Performance is always something to worry about – but I am confident that Ian worries about performance even more than I do – so I expect that whatever we run into is solvable.

It was great fun to see this at an early state and to talk issues over with Ian and I look forward to the progress over the next few months and hope that we see some nice shiny stuff by the conference.

The README is below if you want to replicate my experiences.

Hacking Sakai K2 Sling Adding IMS Simple LTI As a Resource Type
Here are my rough notes on playing with Sakai 3 / Sling and
getting IMS LTI to work in Sling as a resource type.
Note: I have NO Idea how long these URLs will work -- Chuck
Many thanks to Ian Boston who walked me through all of this
at Caret.
References:
http://groups.google.com/group/sakai-kernel
http://incubator.apache.org/sling/site/discover-sling-in-15-minutes.html
http://cwiki.apache.org/SLING/using-slinginclude-in-jsp.html
Check out my example code (including this README) from here:
https://source.sakaiproject.org/contrib/csev/trunk/
For the rest of this document ~/dev/csev/trunk/sling/ is where
I checked out this source.
Make some directory to run your Sakai3/Sling instance - DO NOT
use the same directory as this source.
Go to that other directory
Download the Sling+Sakai bundle from Ian:
curl -O http://www2.caret.cam.ac.uk/%7Eieb/k2binary-snapshot/sakai-k2-0.1-SNAPSHOT-binary.tar.gz
tar xfz sakai-k2-0.1-SNAPSHOT-binary.tar.gz
cd sakai-k2-0.1-SNAPSHOT-binary/
./startup.sh
Keep this terminal window - it is your console - useful for debugging.
In your browser go here:
http://localhost:8080/index.html  (main sling launch pad)
http://localhost:8080/system/console/bundles   (what stuff is installed
If it looks OK and you see "Apache Felix Web Management Console
Bundles" and a long list of "Active" things all is well.
Start a new window and come back here.  We need to poke a pom
into your repo (there may be a slicker way to do this - but
whatever...).
cd ~/dev/csev/trunk/sling/  (or wherever)
cp m2-repo-patch.tgz ~/.m2
cd ~/.m2
tar xfvz m2-repo-patch.tgz
rm m2-repo-patch.tgz
Come back here and then
cd ~/dev/csev/trunk/sling/  (or wherever)
cd imsltibundle/
mvn -Predeploy clean install
If you get this message then the tar above mis-fired:
[INFO] Failed to resolve artifact.
GroupId: org.sakaiproject.kernel
ArtifactId: base
Version: 0.1-SNAPSHOT
If it starts downloading a zillion files - it is almost
a sure sign of success.
If you get this message:
[INFO] [sling:install {execution: install-bundle}]
[INFO] Installing Bundle org.imsglobal.simplelti(/Users/csev/dev
/csev/trunk/sling/imsltibundle
/target/org.imsglobal.simplelti-0.1-SNAPSHOT.jar) to
http://localhost:8080/system/console via POST
[INFO] Bundle installed
[INFO] BUILD SUCCESSFUL
Do a small jig or pump your fist in the air.
Go back to the following URL
http://localhost:8080/system/console/bundles
Press refresh and look for IMS.  If you find and
entry titles "IMS Global Learning: SimpleLTI" and it
says "Active" - you are so in good shape.
You are now 85% complete!
Just for yucks, use Finder | Go | Connect to Server
Use http://localhost:8080/
And admin/admin as id and pw
If all goes well - you should see your repo in the finder!
You can also find your repo under
/Volumes/localhost
You can edit files wither place and look at the structures.
Look at the apps folder (it is empty) and notice there is no
courses folder - all that is about to change.
Come back here:
cd ~/dev/csev/trunk/sling/  (or wherever)
sh doit.sh
This will put a bunch of files into the repository
in clever places:
(1) Install a resource handler in apps/ims/simplelti
(2) Make a /courses and /courses/SI301 and put an LTI
placement called wiscrowd in SI301
This should finish and tell you what to do next.
Login with admin admin at
http://localhost:8080/login.htm
Navigate to
http://localhost:8080/courses/SI301/wiscrowd.html
If all goes well you will see the Wisdom of Crowds
program showing the user and course info from
Sling.
Try going to
http://localhost:8080/courses/SI301/wiscrowd.html
In another browser without logging in - you will
be a student.
You can change all kinds of values in doit.sh
and re-run to play with different LTI urls and
course titles, etc etc.
Have fun.  I did.