[Zope3-dev] pattern exploration: view chains (xslt, pdf, etc.)

Gary Poster garyposter@earthlink.net
Sun, 7 Apr 2002 09:57:21 -0400


On Sunday 07 April 2002 06:17 am, you wrote:
> I've implemented a container traversal that gives a different view
> depending on the file extension given. So, mydocument.txt gives you the
> txt;view which renders plain ascii. mydocument.html gives you html;view,
> and mydocument.pdf invokes ReportLab to send back a PDF.

That sounds cool, and more useful on an everyday basis than my idea--and a 
better approach for handling generic documents, which is where I came up with 
my idea.  So, yes, this is probably better for what I was talking about.

However, I don't think it replaces the view chain pattern.  Your approach 
gives a clean and user-friendly way to specify views, while mine allows you 
to generically modify any html content, for instance, so that tacking on 
"html2pdf;view" or whatever at the end of a standard html view will always 
give you a pdf output.  Or another view chain could allow you to use xslt to 
generically extract certain information you want from whatever xml/xhtml 
file, or whatever.

mydocument.pdf could also simply be a shortcut for 
"mydocument/default;view/html2pdf;view" and implemented as such...

I think it might be useful, and so want to make sure the architecture can 
support it.  I will hopefully futz about with it this week to make sure it is 
possible without any core changes, and then leave it for now.

Gary