You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by darren chamberlain <da...@boston.com> on 2000/12/22 19:15:16 UTC

[RFC] New Apache Module, comments and name suggestions requested

I am looking for some feedback, and possibly an idea for a name for this
module.

In my experience, one of the problems with template modules like
HTML::Template, TemplateToolkit, HTML::Mason, and the others, is that
they are *toolkits* -- there is no fast way to go from Perl module to
output. These modules require extensive setup, and usually are used as
pieces in the larger context of an application. This is great for many
things, but for sites that want to use one of these modules as their
primary document processor have to write something to do the actual
processing of the templates. 

I've been working on an Apache module for a while which utilizes
Template Toolkit, and provides a more or less generic interface to the
power of TT. Configuration is done through configuration directives,
which are the options that get passed to the Template object.

Pages that get processed by the module are handed hashrefs containing
form parameters, the environment, cookes, and pnotes, which can be
accessed directly in the page (e.g.: Hello, [% env.REMOTE_ADDR %].).
I have a variety of plugins and filters planned, as well.

How is this different from using Template Toolkit directly? It's not,
except that using the module is as simple as:

<FilesMatch "*.html$">
  SetHandler  perl-script
  PerlHandler Grover
</FilesMatch>

The module's working name is Grover, but it would probably end up living
somewhere in the Apache:: namespace, if I were to put it on CPAN. I am
open to suggestions for a new name.

There is a web site set up for it at
http://sevenroot.org/software/grover/, from which the source can be
downloaded.

(darren)

-- 
Once the realization is accepted that even between the closest human beings
infinite distances continue to exist, a wonderful living side by side can
grow up, if they succeed in loving the distance between them which makes it
possible for each to see each other whole against the sky.
                -- Rainer Rilke

Re: [RFC] New Apache Module, comments and name suggestions requested

Posted by Andy Wardley <ab...@cre.canon.co.uk>.
On Dec 22,  1:15pm, darren chamberlain wrote:
> How is this different from using Template Toolkit directly? It's not,
> except that using the module is as simple as:
>
> <FilesMatch "*.html$">
>   SetHandler  perl-script
>   PerlHandler Grover
> </FilesMatch>
>
> The module's working name is Grover, but it would probably end up living
> somewhere in the Apache:: namespace, if I were to put it on CPAN. I am
> open to suggestions for a new name.

There's an Apache::Template module on the way which should provide a
nice, clean Apache interface to the Template Toolkit.  Usage should be
as simple as the example you show above, but also allow TT configuration
directives to be added to the httpd.conf.  e.g.

   <FilesMatch "*.tt2$">
       TTIncludePath  /usr/local/tt2/templates
       SetHandler     perl-script
       PerlHandler    Apache::Template
   </FilesMatch>

Progress on the module got derailed by problems with configuration merging
but I'm planning to pick it up again soon and finish it off.  If you've got
code/ideas/effort that you'd like to contribute then I'd be more than happy
to work together and pool resources.

Otherwise, you're welcome to slot the module somewhere into the
Template::* namespace if you like.  Template::Grover or something similar?


Cheers
A

-- 
Andy Wardley <ab...@kfs.org>   Signature regenerating.  Please remain seated.
     <ab...@cre.canon.co.uk>   For a good time: http://www.kfs.org/~abw/

Re: [RFC] New Apache Module, comments and name suggestions requested

Posted by Matt Sergeant <ma...@sergeant.org>.
On Fri, 22 Dec 2000, darren chamberlain wrote:

> I am looking for some feedback, and possibly an idea for a name for this
> module.
>
> In my experience, one of the problems with template modules like
> HTML::Template, TemplateToolkit, HTML::Mason, and the others, is that
> they are *toolkits* -- there is no fast way to go from Perl module to
> output. These modules require extensive setup, and usually are used as
> pieces in the larger context of an application. This is great for many
> things, but for sites that want to use one of these modules as their
> primary document processor have to write something to do the actual
> processing of the templates.
>
> I've been working on an Apache module for a while which utilizes
> Template Toolkit, and provides a more or less generic interface to the
> power of TT. Configuration is done through configuration directives,
> which are the options that get passed to the Template object.
> I have a variety of plugins and filters planned, as well.

This sounds like something that is screaming out to be added to
Apache::Dispatch...

-- 
<Matt/>

    /||    ** Director and CTO **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // **     Personal Web Site: http://sergeant.org/     **
     \\//
     //\\
    //  \\