Forum OpenACS Development: Fixing File Storage Data Model to support WebDAV and virtual URLs

Right now, the file storage package stores the upload filename in the cr_revisions.title attribute and the user specified title in cr_items.name.

This is very confusing, and makes it difficult to treat file-storage items similarly to other content items.

In particular the new /view/index.vuh page that allows relative links in uploaded html files to work relies on the user to guess that the title must be the same as the uploaded filename.

I would like to fix this and have already done some tests to get this working with the upcoming WebDAV support package. I have created a preliminary upgrade script that creates a sepearte content item for each unique filename, and relates all revisions with the same filename with that item.

Doing this will allow consistent easy URls for all file-storage objects and make it more consistent to handle file-storage objects.

Also it makes file-storage work more similarly to a filesystem. When a file with a new filename is uploaded, it becomes a new file in file-storage.

Hi Dave,

This is great.  I do have some questions:

- do we really need to create a separate content item for the upgrade?  Can't we just rename cr_items.name or maybe just leave it alone for current items?  There might be some html pointing to the old url.

- i have encountered a small issue when I implemented something similar.  which name do you follow?  live, if no live then latest?  Also its kinda weird for example ver1 is myreport.pdf then another person uploads ver2 myreport.doc.  So if someone downloads ver1 its myreport.doc in pdf format.  Well I didn't have a work around on that... hehehe  Or since you treat new file names as a content item, even if the user uploads it as a new version?