[Zope] Wrapping pre-existing content
Phil Harris
phil.harris@zope.co.uk
Thu, 8 Mar 2001 13:17:20 -0000
That's exactly what I've done, I'm still having some namespace problems, but
I think it's mostly working.
----- Original Message -----
From: "J M Cerqueira Esteves" <jmce@artenumerica.com>
To: <zope@zope.org>
Sent: Thursday, March 08, 2001 1:05 PM
Subject: Re: [Zope] Wrapping pre-existing content
> On Thu, Mar 08, 2001 at 12:11:42PM -0000, Phil Harris wrote:
> > The hierarchy is deep, wide and heavily populated at each node. The
number
> > of folders is out of my control, as is the number of 'documents' in each
> > folder, as is the type of documents.
> >
> > I need a selective way of wrapping as well as all-encompassing way, e.g.
I
> > don't want to wrap Image or other binary types.
>
> I haven't done it before, but I believe you could solve the problem with a
> Python Script, using the Subpath binding. If one of your documents is
> for instance
>
> /foo/bar/documents/moo/miao/quack/ye_olde_document
>
> and you have created your Python script in any other place, such as
>
> /zoo/wrapper
>
> one would reach the wrapped version of the document via the URL
>
> http://your.place/zoo/wrapper/moo/miao/quack/ye_olde_document
>
> thus invoking the `wrapper' script.
>
> The `wrapper' script would simply have to use the traverse_subpath
> variable in order to locate the document under /foo/bar/documents
> (assuming all of those to be handled by `wrapper' are stored somewhere
> below that folder), determine the document type, decide on how to wrap
> it based on its type (and eventually other document properties if you
> wish) and return the (conditionally) wrapped document (not forgetting to
> set the appropriate Content-Type header).
>
> Best regards
> JM
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )