Currently, I am working on a mailing list browser based on Sling and just thought, I should post the code before it gets complicated (i.e. before error handling and UI chrome get into the way).

The content is spidered form a couple of public mailing lists and stored (almost) in the format described in this post. There is an attachment to this post with test content in XML (system view format) that you can import. Import it into /mailinglists_tmp (if you use some other path you need to adapt the link to get started below).

The Sling application is written in esp and allows users to browse lists, mails and search over all mails. All scripts are attached as well. Store the scripts in the /apps folder. Please see here and here for a description on web dav, Sling scripts and so on. Also, Betrand Delacretaz' 15 minutes guide to Sling is well worth reading if you are new to Sling.

After installation you can get started by pointing the browser at (yourserver)/mailinglists_tmp.html. This should show the list of available mailing lists.

Some things are to be noted in the code:

  • The <%=...%> syntax for outputting a value cannot be used inside of markup attributes. In there one must use expression language syntax ${...}

  • The current node that is being worked on is always available as "currentNode" (this was "resource.node" before).

  • Through currentNode you have access to further repository functionality, like the QueryManager: var queryManager = currentNode.getSession().getWorkspace().getQueryManager();

  • Node properties can be access in JavaScript-style, like node["propertyname"]

You need to have a quite recent Sling build, at least from yesterday, actually, to get this code running. Since it is only a few lines, I suspect it should be easy to understand. If not, just leave a comment or drop me an email.


Related Posts


Files

2 files attached

  1. apps.zip

  2. sysview.zip



Comments

No comment, yet

Add a comment

Name

URL

  • Print version

    Printer-friendly version
  • PlanetDay

    The latest posts on PlanetDay

  • Links on Daigg