The AMSeT Project Blog

Friday Sep 25, 2009

Bean Soup and Spring Bananas

I've been driving a NetBeans Hacker automatic for too long now to go back to a manual shift. At the click of a mouse I can write 20 getters and setters at a time. And these little getters and setters let me use yet more tools to pull apps together. Spring is one such. Alfresco's AMP extension modules require Spring to wire into the main application.

Databinding in the view layer in SpringMVC requires that Java objects have the Bean getter/setter structure. There is a nested class structure running down the SWORD "common core" spine ServiceDocument.Service.Workspace.Collection... Spring can see Java fields OK until it burrows down to Workspaces and Collections where it goes bananas (eh?) when the Bean structure is broken. For example, the Workspaces getter returns an Iterator and the setter uses a List.

This means that Spring and other tools can't be used directly to bind to display fields in the view layer. This might be something to consider if SWORD is to be developed further.

There's always another way. One obvious solution is to write <%...%> Java code in the jaspers and talk to the objects directly. But, old-fashioned as I am, I'm not that old-fashioned. Another way would be to write a tag library, but in a stocking-filler workpackage, I thought better of that. What I have done is create mini AmsetWorkspace and AmsetCollection objects in which The Canonical Bean is restored. I should get away with that.

Tuesday Sep 15, 2009

Alfresco SWORD

As we approach the last few furlongs of AMSeT, the SWORD workpackage has been unsheathed from its scabbard.

There is a server and client component to the task. An implementation of the Java SWORD server will be added to the Alfresco Web application and a Building Block extension to the Blackboard VLE will be created that will house a SWORD client. It will then be possible to publish Blackboard documents to a SWORD-fronted repository.

The recommended method for adding functionality to Alfresco is to create an Alfresco Module Package (AMP). This is installed into the Alfresco WAR file using the Module Management Tool (MMT). The structure and contents of an AMP will be described in a future post. The SWORD server will hand the deposit process to a class that will use the Alfresco Foundation API to publish the incoming document.

There is no concept of a collection in Alfresco and so an addition to its default content model will have to be made to add a collection aspect to a folder node.

The original SWORD SourceForge repository includes a Web application client. Our Building Block expert will visit shortly to advise on the conversion. The webapp has been built as a NetBeans project and deposited in SourceForge at https://amset.svn.sourceforge.net/svnroot/amset/sword/webapp-client. (IE doesn't like the markup, fine with Firefox, Chrome and Safari.)

Calendar

Search

Navigation