Slide Show Widget

The Slide Show widget is a simple, unobtrusive script used to overlay images on the current page, display sets of images and create slide shows using your favorite photos. The widget is based on the Prototype JavaScript library and LightboxEx JS slideshow (http://ahavriluk.home.comcast.net/lightboxEx/doc/), and works on all modern browsers.

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>

HTML code

Include the following code where you want to invoke the Collection Manager in page:
<span  onclick="dSS.startSlideshow();" class="dekoh_ST_actionButton" id="dekoh_actionButton_slideshow" title="View Slideshow"></span>

JavaScript code

The basic syntax to initialize the Slide Show widget is
<script type="text/javascript">
//<![CDATA[
dSS =new dekohSlideShow('dSS', {dioColId:'8',ImageSize:'Medium', currentPhoto:'PHOTO_ID_FROM_WHERE_THE_SLIDESHOW_WILL_START'});
//]]>
</script>

How do I use a simple slide show widget in the photo application without implementing the DWR?

Add this code to the head section of the page:
<style type="text/css" title="currentStyle" media="screen">
    @import "<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "theme","app","css.jsp?externalApp=true")%>";
    </style>
<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/swfobject.js"></script>
<script type="text/javascript" src="/photos/widgets/<%=dekoh.photo.URLGenerator.staticContentVersion%>/lightboxEx/Sound.js"></script>
<script type="text/javascript" src="/photos/widgets/<%=dekoh.photo.URLGenerator.staticContentVersion%>/lightboxEx/lightboxEx.js"></script>

HTML Code

Include this code in the page:
<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
<a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a>
<a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a>
Add a rel="lightbox" attribute to any link tag to activate the lightbox. If you have a set of related images that you would like to group, follow step one but additionally include a group name between square brackets in the rel attribute.

You may check the document at http://ahavriluk.home.comcast.net/lightboxEx/doc/ for any further requirements.

Parameters for initializing the dekohSlideShow class in the widget

Required arameters

OptionsSinceDescriptionDefault
idV1.0The id of-

Optional parameters

OptionsSinceDescriptionDefault
dioColIdV1.0The collection Idnull
ImageSizeV1.0The image size can be set as 'MEDIUM','SMALL','THUMB'MEDIUM
currentPhotoV1.0The photo from where you want to start the slideshownull

Functions

FunctionParametersDescription
getSlideShowImgdioColId- the Collection Id, ImageSize- Image size of the photos, ClickUrl-set value as null, currentPhoto- The photo from where you want to start the slideshow-
startSlideshowStarts the slide show-
checkSlideshowLoadedChecks if the slideshow images are loaded or not. If loaded on the page it will start the slideshow.-

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

slideshow_widget.jpg Info on slideshow_widget.jpg 155670 bytes