imageGallery

Overview

a simple image gallery which allows multiple upload of images (via swfuplader resource), editing images (via imageUtil reource), add a descreption (key) to image, reorder the images, delete image.

Name:
image
Namespace:
http://www.litwan.com/yanel/resource/1.0
Universal Name:
<{http://www.litwan.com/yanel/resource/1.0}imageGallery/>
Description:
simple image gallery
Java Class:
com.litwan.yanel.impl.resources.imagegallery.ImageGalleryResource

Resource Configuration

yanel-path
Path to the image source. (allows yanelrepo: and yanelresource:). if set yanel-path-matcher and yanel-path-template are ignored
xml-filename
the filename of the xml which holds the infos about the order and image keys. optional. default = gallery.xml
images-base-path
path to the directory of images. optional, default to the parent directory.

Request Paramter

resource.imagegallery.usecase

possible usecases: add-key, create-image, create-gallery, new-gallery, textedit, move, swap, down, up, delete, create-image, create-gallery

rc-tmplate-path
a path to an rc template which will be used if you upload an new image.

Basic Example:

To use the image resource type first you need to register the resource type as usual. add following line with the correct path to your (local.)resource-types.xml

<resource-type src="/home/simon/src/3k3-yanel-contrib/resource-types/imageGallery/" compile="true"/>

after this you need to add a matcher to the map.rc-map file e.g.

    <matcher pattern="/galleries/*/**.html" rcpath="/rc/galleries.html.yanel-rc"/>

then you need to create an galleries.html.yanel-rc file with following content.

<?xml version="1.0"?>

<yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
  <yanel:rti name="imageGallery" namespace="http://www.litwan.com/yanel/resource/1.0"/>

  <yanel:property name="mime-type" value="application/xhtml+xml"/>
  <yanel:property name="gallery-base-node" value="/galleries/"/>
  
  <yanel:custom-config>
    <views>
      <view id="default" type="jelly">
        <template>rthtdocs:/jelly/gallery.jelly</template>
        <xslt>rthtdocs:/xslt/gallery.xsl</xslt>
        <xslt>/xslt/gallery.xsl</xslt>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="create-gallery" type="jelly">
        <template>rthtdocs:/jelly/create-gallery.jelly</template>
        <xslt>rthtdocs:/xslt/create-gallery.xsl</xslt>
        <xslt>/xslt/global.xsl</xslt>
      </view>
    </views>
  </yanel:custom-config>  
</yanel:resource-config>

IMPORTANT

if you use this resource-type in a headless environement set Djava.awt.headless=true

Demo

http://demo.yanel-contribution.3k3.org/galleries/test/1.html

Source

browse svn repo: http://trac.yanel-contribution.3k3.org/browser/resource-types/imageGallery
checkout source:

svn co https://svn.3k3.org/repos/public/yanel/resource-types/imageGallery

License

apache license 2.0