Forum OpenACS Development: Re: Getting package_id in an init.tcl script

Collapse
Posted by Janine Ohmer on
I really dislike the way attachments was implemented BTW

Oh yes, and it gets worse.

attachments has a package parameter called RelativeUrl, which is set to 'attach'. and the script to be run is attach.tcl. So in forums, the URL to go to when setting up an attachment is forums/attach/attach (groan). Objectionable though it may be, this does work.

Unfortunately, although bulk mail is processed by the bulk-mail package, it is sent by the dotlrn package. So when dotlrn/www/spam.tcl wants to send the user off to attachments, it can't just use the proc helpfully provided by attachments to get it's URL, because that turns out to be just attach/attach (relative to the community URL, of course), when it needs to be bulk-mail/attach/attach.

My first thought was "no problem, I'll automatically update the package parameter when I mount the package under bulk-mail". But noooo.... since there's only one instantiation of attachments, there's only one copy of RelativeUrl. I can't change it without breaking it's use in forums.

The same problem creeps in again on the return_url that's passed in to attachments. It can't be relative, because at the time it's used it will be relative to bulk-mail, which is wrong since you're heading back to dotlrn/www/spam-send.tcl.

Right now I've "fixed" all this with regexps but it's not what I'd call an elegant solution.