Photo Strip Widget

Reference Guide

The Photo Strip widget displays thumbnail versions of your digital photos in a scrollable horizontal or vertical strip that looks like a strip of film. This widget is based on the Prototype JavaScript library.

Features

  • Photostrips can be placed in horizontal or vertical direction
  • Slide Navigation for up and down/ left to right movement

How to use

Add this code to the head section of the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style type="text/css" title="currentStyle" media="screen">
 @import '<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "theme","app","css.jsp?externalApp=true")%>';
 @import '/photos/themes/<%=dekoh.photo.URLGenerator.staticContentVersion%>/pebbles/css.jsp';
</style>
<script src='/dekohportal/dwr/engine.js'></script>
<script src='/dekohportal/dwr/util.js'></script>
<script type="text/javascript" src="<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>">
</script>
<script type="text/javascript" src="/photos/widgets/<%=dekoh.photo.URLGenerator.staticContentVersion%>/lightboxEx/slideShow.js">
</script>
<script type="text/javascript" src="/photos/widgets/<%=dekoh.photo.URLGenerator.staticContentVersion%>/photoStrip/photoStrip.js">
</script>

HTML Code

Include the following code where you want to invoke the Photo Strip Widget in page:
<div id="photoStrip" style="width:140px;"></div>

JavaScript code

The basic syntax to initialize the Dialog widget is

<script type="text/javascript">
          //<![CDATA[
                   new PhotoStrip('photoStripVt',{dioId:'COLLECTION_DIO_ID',accessPath:'ACCESSPATH_TO_COLLECTION',photoStripImageCount:3, orientation:'vertical',ImageWidth:'100',ImageHeight:'100',ImageSize:'SQUARE_THUMB', linkUrl:'showphoto', targetDiv:'photoStrip'});
//]]>
</script>

Parameters for initializing the widget

Required parameters

OptionsSinceDescriptionDefault
IdV1.0Photostrip id-

Optional Parameters

OptionsSinceDescriptionDefault
dioIdV 1.0The collection Id is set here-
accessPathV 1.0The accesspath of the collection-
photoStripImageCountV 1.0Number of the images to be shown in the photostrip-
orientationV 1.0The orientation can be ‘horizontal’ or ‘vertical’-
ImageWidthV 1.0The thumbnail width100
ImageHeightV 1.0The thumbnail height100
ImageSizeV 1.0The image size of the thumbnail to be loaded-
linkUrlV 1.0--
targetDivV 1.0The target element on the page where the photostrip is going to get loaded 'photoStrip'

Functions

FunctionParametersDescription
getPhotoListObj- the photoStripImageObj objectGet the photo list
generatePhotoStripBoundscurrentId- the current photo Id, count- the number of pictures to be shownGenerate the UI for the photostrip container
displayPhotoStripListtempID, Id, ImageUrl, ImageLink, createPos-Displays the photo strip photos
moveDown-Move the picture to the next available picture
moveUP-Move the picture to the previous available picture

DWR Implementation

Reference in web.xml
The DWR method mapping XML is given in web.xml

<init-param>
            <param-name>config-slideshow</param-name>
         <param-value>widgets/slideshowHTML/dwr-slideShowHTML.xml</param-value>
        </init-param>

Slideshow widget is specific to photos applications. The above mapping is given in photos application web.xml.

DWR XML

<!DOCTYPE dwr PUBLIC
    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
    <allow>
        <create creator="new" javascript="slideshow">
            <param name="class" value="dekoh.photo.widget.slideshowhtml.SlideShow"/>
            <include method="getSlideShowImages"/>
        </create>
        <convert converter="bean" match="dekoh.photo.widget.slideshowhtml.SlideShowImageObject"/>
    </allow>
</dwr>

Converters

We need to ensure that all the parameters can be converted. Many of the types provided by the JDK are enabled for you, but you need to give DWR permission to convert your own bean. Generally this means that JavaBean parameters will need a <convert ...> entry.
  • Convert-class: dekoh.photo.widget.slideshowhtml.SlideShowImageObject
  • Description: DWR transfer object holding the slide show photo object metadata.

Creators

Each class on which we execute methods, needs a <create ...> entry. There are several types of creator. The most common ones use either the 'new' keyword or the Spring framework. For more information, see the Creator documentation.
  • ClassName: dekoh.photo.widget.slideshowhtml.SlideShow
  • Description: Class to serve all list of slideshow objects for the given collection.

Methods-functionality

Method NameFunctionality
getSlideShowImagesGet the list sildeshowImageObejects for the given collection.

Availability

Dekoh Portal Ver 0.4.2 or later.

Attachments

photostrip_widget.jpg Info on photostrip_widget.jpg 624107 bytes