Sonntag, 24. Mai 2009

Sling/Groovy Development with OSGI

After having evaded this whole OSGI/Maven topic, I think it is time that I delve into the whole issue. Lars Trieloff and other helpful people alredy gave me a hint about when to change from webdav/scripting mode to OSGI/Maven bundles.

After several hours and reading several blogs and webpages, I came up with the following pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi=""

<name>Apache Incubating Repository</name>
<name>Apache Incubating Plugin Repository</name>

There are several things to point out:
  1. I am by no means a OSGI/Maven expert, so consider this to be a first draft
  2. the commented out scr plugin is used for declarative OSGI services, details here.
  3. the groovy version used for compilation (1.6.3) and within OSGI (1.6.0) are different. This might lead to problem. Best thing to do would be to reinstall groovy-all.jar into the OSGI environment
  4. the "Sling-Inital-Content" tag is a convenience used to supply initial content to sling
  5. the <mountByFS>true</mountByFS> tag should theoretically allow to have all changes done within the filesystem be propagated to sling. Doesn't work atm, although, unsure why

Mittwoch, 20. Mai 2009

So where in REST is the MVC?

Still trying to get my head around REST. Looking at sling, I do see two different approaches:
  • view/model combined: a resource is represented by a markup (html), which contains both view and model information. The controller (browser) is responsible for the correct representation and the hypermedia functionality (hyperlinks, forms), which allows navigation and manipulation of the represented data
  • model exclusively: the resource is represented by a data structure (json), which is both rendered to the controllers (browser) taste as view
Now, from a design point of view, the second one seems cleaner, and very compatible with the MVC pattern. But the first approach is the one the web is build upon, soooo there has to be something about it ...

The idea spinning around in my head is to implement the first approach with Griffon and Sling: Sling will deliver SwingBuilder fragments which then will be interpreted by Griffon. Stay tuned...

Dienstag, 12. Mai 2009

Apache's mime-type list

Just stumbled on this while reading the sling mailing list:

Apache's web server default mime-type list, together with associated extensions: might come handy, includes the relevant RFCs in the comment