Sunday, 20 September 2009

Shuffl: basic workspace persistence using AtomPub works

I've now got Shuffl persistence working against eXist. The UI is a bit clunky (well, a lot clunky really), and the error handling is poor, but it does seem to work. I must properly document how to set it up.

Roughly:

  1. install eXist
  2. configure eXist/Jetty to serve static files from some location. (See: http://shuffl-announce.blogspot.com/2009/08/exist-and-jetty-configuration.html)
  3. copy the shuffl files to that static location (I just link to my Eclipse workspace, so short-circuit this bit)
  4. start eXist
  5. Run the demo application from file shuffl-demo.xhtml (e.g. browse to http://localhost:8080/exist/shuffl/static/demo/shuffl-demo.xhtml).
  6. Use the shuffl menu (click on the logo) "Save as new workspace...", and change the URI in the dialog to something like "http://localhost:8080/exist/atom/edit/shuffl-test/" and click OK. Note the location at the bottom of the window changes to something like "http://localhost:8080/exist/atom/edit/shuffl-test/shuffl-test.json" - any filename in the URI entered is not used.
  7. Make changes to the UI and use the menu option "Save workspace"

Later, to restore the saved data, start shuffl then use menu option "Open workspace...", and change the Atom feed path to the value used previously.

Not yet implemented:

  • saving card size
  • delete cards
  • just about anything else you want to do

It's a small WIN, but I do count this as a WIN. It was a bit of a struggle getting to this point.

Wednesday, 16 September 2009

Sprint 4 plan

The plan for sprint 4 has been prepared.
This will be a 3 week / 12 day sprint.
Focus for this sprint will be (a) to complete the workspace persistence via AtomPub, and (b) to start looking at card collections and structures to support the visualization use case raised in discussion with Chris Holland. I'll probably focus on that to the exclusion of planned basic user authentication during this sprint, since the user emphasis here is on visualization rather than sharing/publication.
I have also configured this announcement blog so that postings are sent automatically the the project discussion group. (It came up in discussion with Ross Gardler that there is a tension here between JISC reporting requirements that require a syndication feed of tagged project announcements, and common open source practice of using a mailing list for project announcements and discussions. I think this approach, if it works as hoped, nicely meets these requirements, and provides a place to view announcements that us uncluttered by chit-chat.)

Initial SWOT analysis posted

An initial SWOT analysis for the Shuffl project has been posted here.
It is far from complete, and I intend to use this as a place to collect additional notes as I go along.

Tuesday, 15 September 2009

Sprint 3 review

Sprint 3 is finished, and progress notes can be viewed here.

The main points to note are that I've had to re-assess my plan for implementing workspace persistence, and have backed up to implement a new layer of test cases. Progress has been made, but workspace saving/persistence is still not yet complete.

The other main feature of the sprint has been lots of meetings: the JISCRI meeting, the London linked web data, and a VoCamp in Bristol. All of these have contributed, in various ways, to my thoughts for taking Shuffl to users, and have provided opportunities to discuss ideas and use-cases.

I've tagged this progress note as a FAIL as the project is slipping compared with plan: AtomPub has proved rather more of a handful to master than expected. Progress is being made, but more slowly than hoped. I'm hoping to be able to get back to user-visible functionality before too much longer.

Wednesday, 9 September 2009

DELETE on AtomPub media resource

I read somewhere that deleting an AtomPub media resource associated with a feed item (using HTTP DELETE) should also delete the feed item. It turns out that the eXist AtomPub implementation does not support this, claiming (erroneously) that the resource does not exist.
Examining the AtomPub spec provides little support (though on first reading I actually thought this did support what I want to do):
To delete a Member Resource, a client sends a 
DELETE request to its Member URI, as specified 
in [RFC2616].  The deletion of a Media Link
Entry SHOULD result in the deletion of the 
corresponding Media Resource.
-- RFC 5023, section 9.4
This is unfortunate for Shuffl, as I had been hoping to not get too bogged down in feed items vs resources. Now I might need to include a feed item URI along with card data if I'm to be able to delete the card data. Or maybe I'll just delete the feed and recreate it without the missing data?
More generally, I am beginning to wonder if AtomPub was the best choice for persisting Shuffl data. I estimate the complexities of dealing with AtomPub have cost me a week or so in slippage, and that I would be better off with WebDAV. I'll stick with it for now, but I'm thinking about a plug-in framework for Shuffl back-end support so I can support alternative protocols.

Wednesday, 2 September 2009

Relearning the agile lessons

My coding has been getting a bit bogged down recently, and I've finally stepped back a little to try and figure out why.
One of the lessons of agile development is that things go more smoothly if one proceeds by small steps. I realize I've been trying to implement too much at once, and as a result the code has been getting away from me.
So how did this come about? In-browser unit testing can take quite a bit of organization to put in place, and I've been so flushed by the ease of throwing stuff together with jQuery that I've neglected to create sufficient unit tests, and instead relying upon manual operation testing of the user interface. For the highly-visible user interface functions, and proceeding in small steps, I was getting away with this. But my current task is to save a shuffl workspace using AtomPub. The AtomPub handlers I've developed do have fairly good unit test coverage, but the additional logic needed to assemble the workspace to be saved is also rather complex, and it is here that I'm getting bogged down.
So I'm suspending that line of development, and reorganizing the existing code into modules around which I can put in place some decent unit tests. Strangely, I now feel that things are once again moving forward at a respectable pace! This is all work that needs to be done sooner or later, and sooner seems best.

jQuery with Firefox gotcha: use .html, not .xhtml

I've been tearing hair out over this error message from Firefox when trying to run my test cases from the local file system.
uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: file:///Users/graham/workspace/googlecode_shuffl/jQuery/js/jquery-1.3.2.js :: anonymous :: line 911" data: no]
Line 0
According to a random page I found on the web, it turns out to be caused by a subtle bug in Firefox and XHTML parsing. The file's DTD declaration calls for transitional, loose XHTML. The file was being served with a .xhtml extension. Changing the file extension to just .html solves the problem.