phil wilson :: a geek commodity

10:15 AM

permanent link to post  

Tuesday, December 09, 2003

JAlbum is what I used to make my online gallery of the photos I took when in Rome, and it uses JSP-based skins to generate the index and individual pages. This means, of course, that with a simple RDF-skin you can provide an XML description of your gallery. Below is the skin I used to generate mine (I’ve not finished writing all the comments yet!) - for it to work well it requires you to do two things: 1) add a comment (which will get stored in the JPEG header) to each image in the "edit" tab as shown in this screenshot (click to enlarge)

2) add some custom variables as shown below with these names in the "advanced" tab (click to enlarge)

Do a publish and voila! Not only will you have an online gallery, but an RSS 1.0 file describing it, and each photo in it! All that’s missing is somewhere to stick FOAF codepiction data, and whilst JAlbum is closed source, it has a documented API so it should be easy enough to knock up a simple GUI along the lines of KimDaBa which lets you add people, locations and keywords to images (KimDaBa looks like an excellent app in its own right, btw, and definitely one to check out if you’re in Linux!)

<?xml version="1.0" encoding="iso-8859-1"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:dc="http://purl.org/dc/elements/1.1/" 
            xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="$location">
<title>$title</title>
<link>$location</link>
<description>$description</description>
<dc:creator>$creator</dc:creator>

<items>
  <rdf:Seq>
    <ja:rowiterator>
      <ja:coliterator>
        <rdf:li rdf:resource="$location$fileName" />
      </ja:coliterator>
    </ja:rowiterator>
  </rdf:Seq>
</items>

</channel>

<ja:rowiterator>
  <ja:coliterator>
    <item rdf:about="$location$fileName">
      <title>$label</title>
      <ja:if exists="comment">
        <description>$comment</description>
      </ja:if>
      <link>$location$fileName</link>
    </item>
  </ja:coliterator>
</ja:rowiterator>

</rdf:RDF>

Link to the index.rdf file now fixed!

Modification to template to only display <description> element when there's content to display