Personal tools
You are here: Home Members tseaver Software kiss kiss-0.1 kiss Product README
Document Actions

kiss Product README

by Tres Seaver last modified 2006-10-17 16:10

Overview

Sometimes the full TTW Zope machinery is overkill: we just want to be able to serve some static content from the filesystem, perhaps doing a little bit of templating (wrapping the standard O-wrap) or transformation (e.g., converting ReST to HTML). This product offers a quick way to do that in Zope2.

Installation

Unpack the tarball, and move (or symlink) the 'kiss-x.y.z' directory to 'Products/kiss' in your INSTANCE_HOME.

Using the Product

Create an instance of the 'KISS Filesystem Proxy' metatype in a folder; set its 'filesystem_path' to the directory on your filesystem containing the readonly content (the user as whom Zope is running needs read acccess here!). If you supply a path without a leading slash, then it will be evaluated relative to the INSTANCE_HOME.

Mapping Filesystem Entities

Subdirectories within the top-level directory are mapped to "subproxies" (each instances of the same Proxy class as the one you created).

Files are mapped based on their extensions, as follows:

  • '.rst' files become insances of a custom FSZReST class, which adds a hook for rendering the ReST text within an HTML <div> (rather than rendering the whole page).
  • '.pt' and '.zpt' become ZopePageTemplates;
  • '.jpeg', '.jpg', '.gif', '.png' become instances of OFS.Image.Image;
  • '.html' files are mapped as static OFS.Image.File instances; however, if the URL requests a file with '.html' extension, and none is found, then the proxy will also look for a file with the same basename and an '.rst' extension, and return a FSZReST instance if found.
  • All other files are mapped to OFS.Image.File instances.

Populating the Directory

The proxy you created in the ZMI has a default view which redirects to 'index.html'; you therefore need to supply at least a static HTML named 'index.html' or a ReST text file, 'index.rst'.

You may also wish to


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: