[Seaside] WAFileLibrary / Resource Path
ssastre at seaswork.com
Tue Aug 21 13:54:38 UTC 2007
I see Keith, seems to have several interesting features. This conviced me to
upgrade to Seaside 2.8a1 to load Jetsam. So.. Let's see :)
> -----Mensaje original-----
> De: seaside-bounces at lists.squeakfoundation.org
> [mailto:seaside-bounces at lists.squeakfoundation.org] En nombre
> de Keith Hodges
> Enviado el: Viernes, 17 de Agosto de 2007 20:43
> Para: Seaside - general discussion
> Asunto: Re: [Seaside] WAFileLibrary / Resource Path
> Sebastian Sastre wrote:
> > XXSession>>developmentResourceURLFor: aResourceName
> > "Answers the url for aResourceName for the deployed application"
> > ^ ((WAUrl new
> > addToPath: WADispatcher default basePath ,
> > '/files/YourResourceLibrary/';
> > yourself) addToPath: aResourceName) asString
> > Could do the trick?
> > cheers,
> > Sebastian
> Dear Sebastian,
> If you have a look in the Seaside28Jetsam package there
> is a simpler way.
> WAFileLibrary defines #baseUrl which you can switch to point
> where you wish.
> WAStandardFilesPlus does everything you could want, and there
> is a config entry you can add to your application which
> selects the resource baseUrl.
> a) Your subclasses (e.g. MyLibrary) inherits the standard
> files, (so the tool bar and other things still work, but you
> can tweak them if you need to on a per application basis)
> b) You can name your library in #libraryName so as to refer
> to something other than the in image class, ie. a local directory.
> e.g. 'resources'
> c) You can put your resources in methods #myPng, or a local
> directory $imageDir/resources/my.png The file based version
> will be served in preference to the method version. (if you
> are editing or uploading your images there is no need to load
> them into the method).
> d) Everywhere you use the resource you can refer to it like so:
> html image url: (MyLibrary / 'my.png')
> e) The #resourcesBasePath configuration item, if set, will
> change the #baseUrl to point to some other server if you wish.
> with #resourcesBasePath set to:
> and #libraryName set to 'resources'
> (MyLibrary / 'my.png') will generate
> best regards
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
More information about the Seaside