On Wednesday, Mar 26, 2003, at 21:01 Europe/London, Don Shanks wrote:

I have a simple application, or so I think. In writing my dynamic
content website, I notice that 90% of the actiual XML files loaded are
identical. Basically a xml document with some custom XSP tags loads and
all data is pulled from a database depending upon the uri requested.
What I would like to do is process the following chain:

Look for file in filesystem
  If it's there serve it
Else
  Look for file reference in database
    If it's there serve a standard xml file
  Else
    Return 404

I knida figured that maybe the right Idea was to extend the File
Provider to run an additional check. Is this the right approach? Or
should I just create a new provider altogether.

I use plugins for this sort of thing. The plugin runs before axkit, and like a regular mod_perl handler it decides what to do with the request. At the end of running the plugin I set $r->filename() possibly to an XSP file, so that the XSP can generate what it needs to.


Plugins are nice and easy to test too using Test::MockObject.

Matt.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to