[Seaside] [ANN] Visual Text Editor + Calendar widgets demo

Philippe Marschall philippe.marschall at gmail.com
Fri May 26 11:07:32 UTC 2006

> Sometimes stuff has to be mentioned a few times before people notice
> it.  Why not describe how to use FileLibrary to help?  People might
> discover they do care after all.
> Speaking for myself, I suspect that FileLibrary is something that
> would be good to integrate into the base Seaside distribution, but
> that I just haven't had time to look at in detail yet to know for sure.
> Avi

How to use FileLibrary

What does FileLibrary do
It allows to serve static files directly from seaside without the need
for a standalone server like Apache or configure Kom. These files can
reference each other (say a CSS references an image) and can be
distrubuted the same way as normal Smalltalk code (Monticello,
SqueakMap, ...).

How to create a FileLibrary
- First create the static files and put them in some directory. From
there they can reference the other files in the same directory
normally with their filenames.
- Make sure you have a "Static File Library" that servers your files.
This is a normal entry point type that you can find in your
/seaside/config application. If you don't already have one, you can
create it if you select "Static File Library" in the type field of the
"add entry point" dialog. For the rest of this text we assume you
chose "files" as the path.
- Create a subclass of WAFileLibrary, for the rest of this text I
assume its name is MyFileLibrary.
- To add the files to your file library there are two ways.
First programmatically with MyFileLibrary class >> #addAllFilesIn: /
#addFileNamed:. For example MyFileLibrary addAllFilesIn:
'/path/to/directory/with/files' or MyFileLibrary addFileNamed:
Two via the web interface. Go to your /seaside/config application and
there click configure for your "Static File Library". Select
MyFileLibrary in the "Add Library:" drop down and click add. Then
click "configure" behind MyFileLibrary. There you can add a file by
uploading it (select the file, then click "Add")

How to integrate a FileLibrary into your existing application
Files from a FileLibrary are ingetrated the same way other static
files are integrated. They have a constant path that is
'/seaside/<Static File Library>/<filename>' so for example.
So for CSS and JS files you would add a link in an #updateRoot: method
whereas for images you would pass the path to an #url: method.

Note that a "Static File Library" can consist of several file library
and can even have traditional script or style libraries.


More information about the Seaside mailing list