Forum OpenACS Development: Re: Attachments package does not work without .LRN

Collapse
Posted by Dave Bauer on
Here is a simpler option or 2)

1) add a "if dotlrn is installed" bit around the part that generates the dotlrn URL, although generally frowned upon

or

2) Add a callback to the attachments package to generate the URL to the correct file storage. Leave it unimplemented in the stock attachments package and if it is unimplemented default to the file storage mapping. In dotlrn add a callback implementation that returns the users personal folder.

In the future then, other code could override the default folder, for example, if users had a dotfolio personal file storage or other non-dotlrn folder to use.

Collapse
Posted by Janine Ohmer on
Thanks, Dave.

I wasn't clear enough in my initial message. I actually was planning on putting the "if dotlrn is installed" bit around the existing code, but I still need somewhere to put the files in the non-dotlrn case. That was what I was asking about.

My particular installation, being fairly stock, has only one file-storage instance. But there could be many of them. Do we want to require the person setting this up to mount a file-storage instance under forums, along with the attachments instance, just for use by attachments? In looking at what the code was before I changed it I think this is what it was doing; it starts from its parent's package_id and looks for a file-storage instance there.