Forum OpenACS Development: Re: Photo-Album Includelet for Xowiki

Collapse
Posted by Richard Hamilton on
Gustaf,

No I was not aware of this, and now that I have had a look at it I am very excited by the possibilities. Thank you.

I have created an experimental page with a single image on it, but have run into a problem:

Error in includelet 'yui-carousel':
::xotcl::__#0G: unable to dispatch method 'pretty_link'
while executing
"$entry pretty_link -download true"
(procedure "render" line 57)
invoked from within
"next"
(procedure "render" line 5)
::xotcl::__#0E ::xowiki::includelet::decoration=portlet->render
invoked from within
"$includelet render"

The url for the page is:
http://dev.oakmasters.com:8000/xowiki/available_includelets

Is this caused by something I have omitted to do?

I have studied your code and am beginning to 'get it', but I am not yet familiar enough with xotcl to know the kind of problems that create method dispatch issues. Is this a problem with the image object or a more fundamental issue? I have found the method in the links-procs.tcl and I am not really sure where to start troubleshooting to work out why this method fails on the image object.

I should mention that before I added an image object to the page, the empty YUI carousel rendered just fine. As soon as I added a child object of type image (as per the includelet code), the pretty_link method choked.

Also, I am concerned that with a very large number of images on many pages, the files may become difficult to manage since there are no folders in an xowiki admin page. I can add categories to organise the photos for display controlled by a menu, but I am concerned about the admin situation.

In the past I have used photo-album to organise images hierarchically in the admin pages and public viewing, and to use the images arbitrarily in other pages by hyperlinking them within the html. Of course this simply causes the browser to grab the image as a seperate request, whereas the yui-carousel includelet is doing all the work on the server. Is there a way to emulate the hierarchical organisation of the photo-album package in xowiki?

If not, could the yui-carousel be populated from the photo-album? Is it be feasible to enable photo-album content items (images) to be allocated to xowiki page objects as additional child objects, without disrupting their existing object relationships within the photo-album application?

Alternatively, is a lightweight {{adp /photo-album/includelet_viewer.adp {album nnnn} }} a realistic possibility for me as a means of ducking the object-tcl challenge for the time being?

Regards and many thanks
Richard

Collapse
Posted by Gustaf Neumann on
it was simply a bug introduced in june; just add the one line, that i fixed yesterday (see http://fisheye.openacs.org/changelog/OpenACS/?cs=MAIN%3Agustafn%3A20101031172542)

What amounts of photos you want to handle (and how many folders, how many photos per folder, are subfolders wanted/needed/not necessary)?

In principle, one could subclass yui-carousel to get photos from different sources (such as the photo-album), finally it needs just the image urls (and maybe titles etc.) but selecting the right album might not be end-user friendly (if you just new a few albums, this might be fine). Another issue are the navigation structures, which are handled by yui-carousel (and similar js widgets) by themselves.

About including: one can certainly include every adp/tcl pair in an xowiki page. Problems might arise be from the navigation structures inside the adp, here it depends often how flexible the adp can be configured. I am not aware with the details of the photo-album, the 122 files in photo-album/www are too much for me to check now.

Collapse
Posted by Richard Hamilton on
Gustaf,

Thank you, I'll do a cvs update from HEAD to grab the change.

We need around 11 folders with the capability to have up to around 60 images in each folder.

Subfolders are not essential but may be useful later to group images by project within category.

On the subject of sourcing the images from photo-album, I can see what you mean about the navigation issue. The includelet would need to know a lot about the structures within photo-album. Alternatively, photo-album could be coded to export or maintain some kind of trivial structure map for the includelet to refer to. Either way this could be ugly if not done carefully.

As far as the {{adp ..... }} is concerned, I was considering adding specific adp/tcl pairs for image display only, so I would maintain control of the nav links. However I have no sense of how big a job this might be.

I think the simplest option is undoubtedly as you have suggested. How could I improve the organisation of this many files?

Regards
Richard

Collapse
Posted by Richard Hamilton on
Gustaf,

I have now had a chance to play with the {{yui-carousel}} and I can see what a lovely, clean and elegant solution this makes for simple slideshows.

I originally thought that the carousel picked up images that were children of the xowiki::page but I now see that it makes a slideshow of all images in the xowiki instance. I can see therefore that if you want multiple galleries, you would simply create an xowiki instance for each gallery to organise your images.

I have never tried, so I don't know, but I assume that a single ACS Category tree can be mapped to more than one xowiki instance so that any navigation system could be preserved between instances?

Nevertheless, I the functionality I'd like more closely resembles the YUI demo with the AJAX updated strip of thumbnails with larger image below.

http://developer.yahoo.com/yui/examples/carousel/csl_dynload2.html

I think I will work on integrating this with OpenACS photo-album package so that the thumbnail and intermediate image sized image pages are effectively combined through AJAX. I think that the viewer you have put in the yui-carousel will make a lovely solution for the photo-album full-sized slideshow, perhaps with deferred image loading to smooth things along, so I will add that as well.

What I'd love to do after that is to work on a way of enabling this to be included in an xowiki page using an includelet.

If I code so that the navigation is handled through AJAX calls after the page is loaded, then the navigation issue would be eased. I would however probably need to be able to pass a value through to my includelet that had been passed url-encoded to the xowiki page. Can this be done?

In the case of ADP (notionally using @notation@):

{{adp photo-album {album @album_id@} }}

In the case of xowiki includelet:

{{photo-album -album @album_id@ -mode @mode@ }}

Links created by the includelet could be of the form:

/xowikiinstance/xowikipage?album_id=7364&photo_id=6253

Is this feasible or totally nuts!? 😊

Regards
Richard

Collapse
Posted by Dave Bauer on
NOTE:
THe current content repository image type has built in thumbnail and other size handlers similar (but simpler) than photo album.

This works for any image that is stored in the CR with image or image subtype content type.

If you address the image with the image.vuh handler ie: mysite.com/image/${image_id}/${size_name} and the size_name is configured (there is a procedure for this) it will generate the size and link it to the original image on the fly.

Collapse
Posted by Richard Hamilton on
Thank very much. What is that used for currently?

From what I can see, the {{yui-carousel}} includelet passes the full-sized image and the Javascript arranges the resize in the browser. I guess I would have to do the same if I create a new album view page that includes the YUI2 carousel?

Do you think the photo-album application should be updated to use this CR functionality rather than its own?

I cannot find a YUI3 carousel. Do you know if there is one?

Regards
Richard