[Seaside] ZnZincStaticServerAdaptor and debug

François Stephany tulipe.moutarde at gmail.com
Tue Apr 15 16:06:19 UTC 2014


I quickly put this together:
It will serve stuff placed in the assets directory (which must sit next to
the image). Nothing really fancy but does the job:

ZnSeasideStaticServerAdaptorDelegate subclass: #CCStaticServerDelegate
    instanceVariableNames: ''
    classVariableNames: ''
    category: 'Cocotte-Web'

CCStaticServerDelegate>>handleRequest: znRequest
    znRequest url firstPathSegment = 'assets'
        ifTrue: [
            znRequest url removeFirstPathSegment. "eats the /assets/"
            ^self staticDelegate handleRequest: znRequest ]
        ifFalse: [  ^self adaptor process: znRequest ]

CCStaticServerDelegate>>initializeStaticDelegate
    | assetDirectory |
    assetDirectory := (FileLocator imageDirectory / 'assets').
    ^ ZnStaticFileServerDelegate new
        directory: (ZnFileSystemUtils directory: assetDirectory)  ;
        yourself

And the Adaptor:

ZnZincStaticServerAdaptor subclass: #CCZincStaticServerAdaptor
    instanceVariableNames: ''
    classVariableNames: ''
    category: 'Cocotte-Web'

ZnZincStaticServerAdaptor>>defaultDelegate
    ^ CCStaticServerDelegate with: self


On Sun, Apr 13, 2014 at 3:16 PM, Johan Brichau <johan at inceptive.be> wrote:

> To serve static files from a directory during development, there still is
> the Seaside-Filesystem package.
> -> Load the 'Filesystem' group from ConfigurationOfSeaside3
>
> But I also do intend to replace it with serving static files from Zinc
> directly though. But, in the meantime, it's doing the job.
>
> Johan
>
> On 10 Apr 2014, at 08:39, François Stephany <tulipe.moutarde at gmail.com>
> wrote:
>
> > Ok. I've got quite a bit of external files, I'll roll my own ;)
> >
> > thanks !
> > ​
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20140415/990268de/attachment.htm


More information about the seaside mailing list