Dashboard > blojsom > ... > Available Plugins > Galleryr Plugin
  blojsom Log In   View a printable version of the current page.  
  Galleryr Plugin
Added by David Czarnecki, last edited by Cliffano Subagio on May 23, 2006  (view change) show comment
Labels: 
(None)

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.

# Your Flickr API key
# If you don't have one yet, apply here http://www.flickr.com/services/api/key.gne
apikey=[yourAPIkeyhere]

# You can set the sizes of the thumbnail image and the original image in your gallery
# Set the size from the following: Square, Thumbnail, Small, Medium, Large (often only exists on free account), Original (only  available on upgraded account)
# For more information, checkout Flickr help http://www.flickr.com/help/photos/
size-thumbnail=Square
size-original=[Large or Original - depending on your account]

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.

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators