Being a fan of HTML::Mason (http://www.masonhq.com) for web
development, I've put together a contrib based on my own modifications
to get HTML::Mason working on 5.6. It should work on 6.0 as well, but I
haven't had time to test it there yet. 
    HTML::Mason is a solution for embedding Perl in HTML pages that goes
far beyond traditional approaches like Embperl, HTML::Template and
Text::Template (which we know and love). While many use PHP for such
solutions, I personally find PHP to be poorly designed, am more
comfortable in Perl, and find the CPAN to be indispensible.
    I have not yet written a panel for it, so the interface is all
command-line. Once installed, individual ibays can be Mason-enabled, if
they correspond to virtual hosts. The exception is the primary ibay. In
the future I plan to fix this limitation to permit any ibay to be
Mason-enabled, with or without a virtual host.
    The property to enable mason is called 'Mason', with global
variables made available via 'MasonGlobals'. 

Example: Mason-enable the primary ibay.

/sbin/e-smith/db accounts setprop primary Mason enabled
/sbin/e-smith/signal-event remoteaccess-update

Example: Mason-enable a virtually-hosted ibay, with $dbh and $schema globals.

/sbin/e-smith/db accounts setprop <ibay> Mason enabled
/sbin/e-smith/db accounts setprop <ibay> MasonGlobals '$dbh,$schema'
/sbin/e-smith/signal-event remoteaccess-update

    The default setup is to tell apache to pass any .html files to
Mason, and to hide .mas and /handler/ files. At some point I will also
make this configurable, as some prefer .mhtml, and even .css for dynamic
stylesheets. 
    This contrib currently uses two custom templates. There's probably a
better way, stay tuned. In the meantime, if you have 20LoadModule80
and/or 30AddModule60 custom templates for apache, move them before
installing this contrib, and then you can merge them. mod_perl must be
enabled for this contrib. 

    The rpms you'll need are:

perl-AppConfig-1.52-1.i386.rpm
perl-Class-Container-0.09-1.i386.rpm
perl-Class-Data-Inheritable-0.02-1.i386.rpm
perl-Devel-StackTrace-1.03-1.i386.rpm
perl-Exception-Class-1.11-1.i386.rpm
perl-HTML-Mason-1.18-1.i386.rpm
perl-libapreq-1.1-1.i386.rpm
perl-Params-Validate-0.56-1.i386.rpm
perl-Scalar-List-Utils-1.11-1.i386.rpm
perl-Template-Toolkit-2.08-1.i386.rpm
perl-TimeDate-1.14-1.i386.rpm
e-smith-mason-1.0.0-01.noarch.rpm

    These are all available in my contrib area on any e-smith.org
download mirror. For example...

ftp://ftp.ibiblio.org/pub/linux/distributions/e-smith/contrib/MichaelSoulier/

    Warning: I have not heavily tested this, but it is currently running
two Mason-enabled virtual hosts on my 5.6 server. I'll test it on 6.0
soon. 

    Please report any problems directly to me, as this is _not_ a
supported work of Mitel Networks. 

    More information on HTML::Mason:

    http://www.masonhq.com/
    http://www.masonbook.com/
    
    Cheers,
    Mike

-- 
Michael P. Soulier <[EMAIL PROTECTED]>, 613-592-2122 x2522
SME Solutions, Mitel Networks Corporation
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to