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

Collapse
Posted by Dave Bauer on
I would basically not use Photo album at all, unless you somehow are tied to it.

For new code I would just create a CR folder, or use a existing folder ie, from xowiki, to store the images.

Even if you wanted some sort of "album" functionality, I would recommend implementing that as a plain CR folder, or a subtype of cr_folder, or using some sort of tag or categorization scheme. This would be much easier to use and get the images back out.

I basically took the image upload handling features (except for unzipping) from photo album and added them to the CR, so yes you could adapt photoalbum, and simplify it.

Collapse
Posted by Richard Hamilton on
Hmmm. I'll need to get clearer on a few things to do that.

I am tied to photo album in so far as I need three sizes, thumbnail, midsize, and full-size images, with the latter two slideshowable.

Regards
Richard

Collapse
Posted by Dave Bauer on
See

ad_proc -private image::get_convert_to_sizes {
} {
   List of sizes to convert an image to. List of maximum width x height.
   @author Dave Bauer (mailto:dave@solutiongrove.com)
   @creation-date 2006-08-27
 
} {
   #TODO make a parameter in content repository
        # avatar size to match gravatar.com
   return [list thumbnail 150x150 view 500x500 avatar 80x80]

Which apparently, I didn't make a parameter yet :)

Quick solution is to just add whatever sizes you want there.

Longer solution is to add the parameter to CR and use that.

Note these are square dimensions b/c it will make either dimension no larger than those sizes which retaining the aspect ratio of the original.

Collapse
Posted by Richard Hamilton on
Ok, well I could begin by having a look at adding the parameters! Probably could be a comma delimited list of max dimensions:

{avatar 80,thumbnail 150,view 500}

I would still need the bulk upload feature though. Perhaps I could rip that out and adapt it.

Which CR user interface do you use when working on things like this? xowiki?

I am not exactly clear exactly where and how the user interface for the batched image uploads would best live. Should that be a feature added to xowiki (bulk upload of content items) or added elsewhere?

Also, do we have a way to organise the display of xowiki objects in the admin pages into folders? I suppose if that were possible then there would be no reason at all not to go that route.

Richard

Collapse
Posted by Richard Hamilton on
Dave,

Last night I worked through the data model and confirmed that the photo album application does in fact use the CR. The only thing I can see that differs from your suggestion is that albums are of content_type pa_album instead of the more general content_type content_folder.

As the data model is basically sound it seems a shame to discard so much proven code. I think it would be ideal to have the existing code as a means of entering and organising images complete with Ajax ui already built, and be able to export images to an xowiki instance such that the exported images appear as xowiki::File entries. This would preserve the current bulk upload capability whilst allowing images to be used in xowiki.

I have mapped the data structure which I will post below for reference.

Richard

Collapse
Posted by Richard Hamilton on
-4
|
-100 content_folder - Name, pages
|
|_______989 ::xowiki::FormPage - Name, xowiki:916
|         |
|        1386 ::xowiki::File - Name, file02.jpg
|
|
979 content_folder - Name, photo-album_966
|
1040 pa_album - Name, myAlbum
|
1268 pa_photo - Name, file01.jpg
Collapse
Posted by Richard Hamilton on
As an experiment last night I tried changing the parent_id of the pa_photo cr_item 1268 from the pa_album 1040 to the ::xowiki::FormPage 989. I adjusted the name field to have the file: prefix and ensured that the content type was image/pjpeg. However, xowiki throws method dispatch errors presumably because the oo inheritance has not been constructed.

I'd like to be able to export images to an xowiki instance by creating a second cr_item for each exported image that is a child of the target xowiki instance. I don't know how to do this?

Collapse
Posted by Richard Hamilton on
Actually, the better way around might be to create an import function within xowiki that allows the selection of a pa_album from which all pa_photos would be imported. This way you could create an xowiki instance and import the contents of an existing photo album. Ideally this would simply be new pointers to the same content since we wouldn't want to store the images twice.

Regards
Richard