Availability
The Galleryr plugin can be downloaded from the blojsom plugins download page
.
Overview
Galleryr Plugin retrieves information of photos/photosets stored in Flickr
. You can create a gallery of Flickr photos in your Blojsom blog, check out Melbourne photoblog
for an example.
Galleryr Plugin uses Flickrj API
, maintained by Anthony Eden
.
Changelog
v0.1 (11-08-2005): Initial release. Requires Blojsom 2.17 or later, and Flickrj 1.0a8 .
Build
Galleryr Plugin uses Ant
to build the source.
ant jar-pkg
Installation
Place flickrapi-version.jar and galleryrplugin-version.jar in your /WEB-INF/lib directory.
In your global /WEB-INF/plugin.properties file, add the following line:
galleryr=com.mbledug.blojsom.plugin.galleryr.GalleryrPlugin
You may then add "galleryr" to one of the flavor-based plugin chains. These plugin chains can be found in the individual blog's plugin.properties file. You can put this plugin anywhere in the chain, but it is advisable to put it somewhere near the end.
html.blojsom-plugin-chain=..., ..., ..., galleryr, ...
Add the Galleryr plugin configuration file as an initialization parameter for BlojsomServlet in /WEB-INF/web.xml.
<init-param>
<param-name>plugin-galleryr</param-name>
<param-value>galleryr.properties</param-value>
</init-param>
Place galleryr.properties file in the respective /WEB-INF/blog-id directory. The comments in the .properties file are self explanatory.
You can override the sizes in each blog entry by adding meta-galleryr-size-thumbnail and meta-galleryr-size-original meta data in the blog entry. For example:
meta-galleryr-size-thumbnail=Thumbnail
meta-galleryr-size-original=Medium
Usage
To add photos from Flickr, add either or both of the following meta data to the blog entry.
meta-galleryr-photos-id=31672038,31672718,31673083,31673749,31674479
meta-galleryr-photosets-id=31672038,31672718
The values are comma separated, you can put 1 or more, as many as you want.
Please note that the ID is not the title of the photo or the photoset. If you're not sure how to find out the ID, have a look at How to find out Flickr Photo ID and How to find out Flickr Photoset ID below.


You can then display the photo information in your template file (e.g. asual-entry.vm)
#if ( $entry.getMetaData().get("blojsom-plugin-galleryr") )
#set ( $photos = $entry.getMetaData().get("blojsom-plugin-galleryr") )
#foreach( $photo in $photos )
<a href="$photo.getOriginalSource()">
<img src="$photo.getThumbnailSource()" height="$photo.getThumbnailHeight()" width="$photo.getThumbnailWidth()" alt="$!photo.getDescription()"/>
</a>
#end
#end
$photo will give you GalleryrPhoto object which provides getId(), getDescription(), getThumbnailSource(), getThumbnailWidth(), getThumbnailHeight(), getOriginalSource(), getOriginalWidth(), getOriginalHeight().
GalleryrPhoto object also provides getFlickrPhoto() method which returns com.aetrion.flickr.photos.Photo object.
It's up to you how you want to display the photo using the provided information. At the demo site below, I use Javascript to toggle the image source value when the image is clicked.
Demo
A demo is available at Melbourne Photoblog
.