Forum OpenACS Development: Re: Some ideas about package structure ... comments?

Collapse
Posted by Don Baccus on
Timo - I agree about putting the default template in acs-subsite.

Lars - after looking into things after our discussion earlier today why can't you just use "resources/foo.gif" and ignore the url to the mounted package?  If for some reason you *really* need a URL to the package that is guaranteed to work, why not use [ad_conn package_url]?  I don't know why the dotlrn package was written to reference /dotlrn in hardwired fashion, but changing to "resources/foo.gif" works just fine...and packages shouldn't be cross-referencing small graphics buried in other packages (other than our current kludge of using acs-subsite/www/shared, something we can fix as we get time)

I'm also adding a suggestion made by Jeff Davis: disallow execution of scripts in the unchecked resources directory.  Actually I'm only allowing one to reference .png, .gif, .jpg and .css files - I suppose we could parameterize this but is it necessary?  Packages need to be able to depend on a set of extensions being guaranteed to work and parameterizing the list would allow the site admin to break everything.

We also discussed using ns_returnfile to quickly return such content without going through a bunch of request processor codef.  I've reviewed the code that's executed when the request processor is in performance mode, and the path through the code to the ns_returnfile used to return non-script files is quite efficient and I don't think any special treatment is necessary.

Collapse
Posted by Jeff Davis on
The reason lars would like a /resources/package-key/ is to make the things like folder-chunk lars-blogger/www/entry-chunk etc easier to include in other packages (and particularly in portlets) where the [ad_conn package_url] would be /dotlrn/ or / for example. You probably still need to pull out the package url for links so it's not a huge win.

One big win with this is that since the image path does not change accross mounted versions of the package, browsers will cache things better (think for example of dotlrn where fs forums etc are mounted under each class/club instance. As it stands, the browser can't cache the associated images since the urls are all different, but if a /resources/file-storage/x.gif url was used for all instances then the images would be cached much more often.