Forum OpenACS Development: Attachments dependencies

Collapse
Posted by Emmanuelle Raffenne on
Hi,

Forums depends on attachments and attachments has implicit dependency on dotlrn (not set in the info file). A grep shows:


ishbiliya:attachments emma$ grep -irn "dotlrn" *
www/attach.tcl:28: set folder_id [dotlrn_fs::get_user_shared_folder -user_id $user_id]
www/file-add-2.tcl:48:set fs_package_id [site_node::get_element -url "[dotlrn::get_url]/file-storage/" -element "package_id"]

That doesn't seem right. I'm not sure how to unbind attachments from dotlrn though. Any idea?

Collapse
Posted by Dave Bauer on
The best way is to "attach" the files the user uploads to the user_id. Well, maybe not the best way, but it is the easiest thing to do. This totally removes the dependence on file-storage. That's how the oacsattach and oacsimage plugins work. This keeps track simply of all attachments a user uploads.

I am not sure how much work this is though. It also doesn't let a user share uploaded content, but obviously depending on dotlrn is completely broken.

Collapse
Posted by Emmanuelle Raffenne on
Finally, using the dotlrn user folder to store attachments wasn't the initial behavior. Initially attachments was using the file-storage folder mapped to it. I rolled back to that. I took advantage to improve the UI somewhat.

Attachments provides a Tcl API to map a folder attachments::map_root_folder -package_id package_id -folder_id folder_id.

Now attachments can potentially be used without dotlrn (I have tested it with forums on core).

Still to do:
Forums will use attachments if it is mounted as a child node and with the name "attach" (hard coded). That needs to be fixed in forums.