[Zope] Q: about the system
Michael R. Bernstein
webmaven@lvcm.com
16 Oct 2001 12:24:38 -0700
On Mon, 2001-10-15 at 13:35, Adrian Mugnolo wrote:
> Hi,
>
> I'm considering Zope for some upcoming projects and I have two
> architecture questions about the system:
>
> 1) Is there a way to code output filters in the Zope model? If yes,
> do they fit in the product model? Are they limited to Python code?
> Where can I get a running example? By "output filters" I mean a very
> last stage code processor. Let's say I need to run HTML validation,
> compression, macro expansion, etc., after all DTML processing and
> inheritance has happened.
Well, it sort of depends. The only example that I can think of offhand
is the integration work some people have done to run Zope-generated
pages through Roxen Challenger on the way out. If that's possible, then
you can probably figure out a way to plug Zope into your page
post-proccesor of choice. Searching for 'roxen' on the Zope mailing
lists may be helpful.
> 2) Is Zope limited to dynamic page generation/caching/serving? What
> about having static pregenerated pages instead? If positive, where
can
> I find an example? By "pregenerated" pages I mean "cook once, serve
> many times" static pages pushed to a standard httpd.
As long as you're careful with the URL's of links within your site, you
can suck down a copy using wget quite easily, and replicate on as many
static servers as you like.
By 'careful', I mean that URL's that point toward folder objects should
end in a '/', or wget will create a file with the name of the folder,
instead of a directory that contains an index.html file, thereby
preventing subfolders from being created (you can't have a folder and a
file with the same name in a filesystem directory ).
Similarly, links between pages should be site-relative (i.e. omit the
machine identifier, and begin with a '/'), rather than absolute or
relative links. This is to avoid the machine name of your server being
hard coded into URLs, which would prevent you from deploying static
servers named www1.yourdomain.com, www2.yourdomain.com, etc., and also
prevent accidental masking of acquisition effects, which can sometimes
lead to wget recursively finding and copying
www.yourdomain.com/directory1/directory2/directory2/directory2/...
You should also avoid passing parameters in the URL, since wget cannot
replicate these URL parameters as file names. If you need to hard-code
some parameter to generate another view of your data, consider setting
it as a property on a folder which you can traverse it in order to pass
it in.
With these (minor) precautions, you should have no problem making a
static copy of your site using wget, and deploying it on any number of
servers.
BTW, even if you decide to serve your site dynamically, these
precautions are still a good idea, as it also makes your site very
search-engine friendly.
HTH,
Michael Bernstein.