Forum OpenACS Q&A: Response to file-storage 4.x changing where files are stored

Collapse
Posted by Jun Yamog on
Hi Jowell,

There is no problem with the reading.  Since CR is smart enough to figure it out as you have explained above.  The problem is writing to new versions.  Since it does not get the original storage type but rather it gets the parameter.  When CR reads it looks at the storage type so its not retrieving on the proper storage.

What I did was actually very simple.  I just read the storage type on the db rather than reading the existing paramater on version-add-2.tcl.  Then changed the a single "if" statement.  With this approach the file-storage is able to store on the file system and db at the same time safely.

It would really be great to have that proc to move all content to file system from db and vise versa.

With regards to the url it seems that a query on the view did not yeild any results for me.  And greping around yields no other code using it.  I maybe wrong since my file-storage is already modified.  I just use the cr_items.name column to give you the file name of the file, so I don't get the default "index" as the filename.

Maybe we should put in this quick fix in file-storage so it will still continue to work even though the admin changed the parameter.  Also if Yon's new file-storage will not make it into 4.5 final I think we should study the perfomance problem and my solution to it.  What do you think?  Who is currently maintaining file-storage now?  Do you think these fixes should be placed in the SDM?