Hi Folks,
I have an ugly hack that lets me attach a photo (from photo-album) to a lars-blogger entry (OpenACS 5.0b4).
You do not want to ask for the current code - it is truly an ugly hack. I create a clipboard with the name of the blog entry and then send the user off to pick out photos and put them on that clipboard. It breaks as soon as you change the name of the blog entry, and is totally exploitable by anyone who can create a clipboard in photo-album. For a site with exactly two registered users, this doesn't much matter. It has the advantage of requiring no new code in photo-album, only a couple new lines added to entry-chunk in lars-blogger, one tcl/adp pair to create the clipboard (just a hack of clipboard-ae), and no new data model.
Obviously, this ugly hack needs some work.
Easy option: add a database table that maps the lars-blogger entry_id to the photo-album clipboard id. This would close the exploit and let the user rename the blog entry without breaking things (probably triggering a rename of the clipboard to keep from confusing the user).
HOWEVER, I have this suspicion that that is still doing it all wrong, and what I should really be doing is either:
(a) looking at acs_objects and making the photos children of the blog entry
(b) using acs_rels and defining relationships between photos and blog entries.
(c) asking if anyone already has code that does this. :)
Comments on options (a) or (b)? I suspect I break a bunch of stuff by making the photos children of a blog entry (instead of an album). Is this a reasonable thing to do with acs_rels? (Or is acs_rels only for people and groups?)
Something fairly general might make it easier to attach photos to etp as well...