Forum OpenACS Development: Storing images for reuse

Collapse
Posted by Malte Sussdorff on
We face the problem, that we want to store images, but also other files, in OpenACS to be included by the complex survey package.

The idea at the moment is to extend file-storage with a return_url and offer a link to the return_url with the file_id (didn't lookup the exact name), so the calling package could store this in formation, on the page with the actions for the files (in other words: index.tcl :)).

When displaying, it would just call filestorage to retrieve the latest version of the file and display it according to mime type (either providing a link or displaying it inline).

What do you think? Is this a feasible approach?

Collapse
Posted by Dave Bauer on
I just had an idea.

What would be best here is to use an acs_rel to define the relationship.

Imagine someone tries to delete the file-storage file that is attached to several surveys.

The referential integrity should disallow deleting the file until the relationships are resolved.

Hmmm, this generic stuff does have a use.

Collapse
Posted by Dave Bauer on
Actually you can probably just do that with a foreign key on cr_items :)

Oh well, sounded good.

Collapse
Posted by Don Baccus on
You don't need file storage to do this, but should be able to do it via the CR directly.  But why do you need to modify the file-storage (or CR) template files to do this?  For starters in general we don't want to build in such inter-package dependencies ("kludges") unless there's no other decent way to do it.

Maybe I'm not understanding fully what you're trying to do...

Collapse
Posted by Malte Sussdorff on
Here is what I'm trying to do:
  • Files can be uploaded to a certain place, which can be structured in a hierachical manner (/my-pictures/class1 and /my-pictures/class2).
  • Permissions can be given on the file (at the very least, read permissions on a group/public scope).
  • Using a browsing interface, you can access the hierachical structure mentioned above and select a file for linking/inclusion. Imagine this as a replacement for "upload file". You don't upload the file but you link it out of the CR
  • The package displays the linked file according to mime/type.
Here is why I though of File-Storage:
  • Files can be uploaded and given permission.
  • There exists a browsing interface for looking up the files in a hierarchical manner
  • Adding a "link me up" from the index page sounded like the easiest thing to do.
Here is why I did not want to use CR directly:
  • The upload and permission interface would have to be build
  • The browsing interface would have to be build
  • I'm too lazy to write up a whole media catalogue like it exists at GPI. Talking of which, maybe I could reuse it ?