B.14 Toolkits and Frameworks for Content-Generation and Other Phases

B.14.1 Apache::ASP?Active Server Pages for Apache with mod_perl

Apache::ASP provides an Active Server Pages port to the Apache web server with Perl scripting only and enables developing of dynamic web applications with session management and embedded Perl code. There are also many powerful extensions, including XML taglibs, XSLT rendering, and new events not originally part of the ASP API.

Available from CPAN. See the module manpage for more information.

B.14.2 Apache::AxKit?XML Toolkit for mod_perl

AxKit is a suite of tools for the Apache httpd server running mod_perl. It provides developers with extremely flexible options for delivering XML to all kinds of browsers, from hand-held systems to Braille readers to ordinary browsers. All this can be achieved using nothing but W3C standards, although the plug-in architecture provides the hooks for developers to write their own stylesheet systems, should they so desire. Two non-W3C stylesheet systems are included as examples.

The toolkit provides intelligent caching, which ensures that if any parameters in the display of the XML file change, the cache is overwritten. The toolkit also provides hooks for DOM-based stylesheets to cascade. This allows (for example) the initial stylesheet to provide menu items and a table of contents, while the final stylesheet formats the finished file to the desired look. It's also possible to provide multiple language support this way.

AxKit and its documentation are available from http://www.axkit.org/.

B.14.3 HTML::Embperl?Embed Perl into HTML

Embperl gives you the power to embed Perl code in your HTML documents and the ability to build your web site out of small, reusable objects in an object-oriented style. You can also take advantage of all the standard Perl modules (including DBI for database access) and use their functionality to easily include their output in your web pages.

Embperl has several features that are especially useful for creating HTML, including dynamic tables, form-field processing, URL escaping/unescaping, session handling, and more.

Embperl is a server-side tool, which means that it's browser-independent. It can run in various ways: under mod_perl, as a CGI script, or offline.

For database access, there is a module called DBIx::Recordset that works well with Embperl and simplifies creating web pages with database content.

Available from CPAN. See the module manpage for more information.

B.14.4 Apache::EmbperlChain?Process Embedded Perl in HTML in the OutputChain

Uses Apache::OutputChain to filter the output of content generators through Apache::Embperl.

Available from CPAN. See the module manpage for more information.

B.14.5 Apache::ePerl?Embedded Perl 5 Language

ePerl interprets an ASCII file that contains Perl program statements by replacing any Perl code it finds with the result of evaluating that code (which may be chunks of HTML, or could be nothing) and passing through the plain ASCII text untouched. It can be used in various ways: as a standalone Unix filter or as an integrated Perl module for general file-generation tasks and as a powerful web-server scripting language for dynamic HTML page programming.

Available from CPAN. See the module manpage for more information.

B.14.6 Apache::iNcom?E-Commerce Framework

Apache::iNcom is an e-commerce framework. It is not a ready-to-run merchant system. It integrates the different components needed for e-commerce into a coherent whole.

The primary design goals of the framework are flexibility and security. Most merchant systems will make assumptions about the structure of your catalog data and your customer data, or about how your order process works. Most also impose severe restrictions on how the programmer will interface with your electronic catalog. These are precisely the kinds of constraints that Apache::iNcom is designed to avoid.

Apache::iNcom provides the following infrastructure:

  • Session management

  • Cart management

  • Input validation

  • Order management

  • User management

  • Easy database access

  • Internationalization

  • Error handling

Most of the base functionality of Apache::iNcom is realized by using standard well-known modules such as DBI for generic SQL database access, HTML::Embperl for dynamic page generation, Apache::Session for session management, mod_perl for Apache integration, and Locale::Maketext for localization.

Here are its assumptions:

  • Data is held in a SQL database that supports transactions.

  • The user interface is presented using HTML.

  • Sessions are managed through cookies.

Available from CPAN. See the module manpage for more information.

B.14.7 Apache::Mason?Perl-Based Web Site Development and Delivery System

Apache::Mason allows web pages and sites to be constructed from shared, reusable building blocks called components. Components contain a mixture of Perl and HTML and can call each other and pass values back and forth like subroutines. Components increase modularity and eliminate repetitive work: common design elements (headers, footers, menus, logos) can be extracted into their own components, so that they need be changed only once to affect the whole site.

Other Mason features include powerful filtering and templating facilities, an HTML/data-caching model, and a web-based site-previewing utility.

Available from CPAN and http://www.masonhq.com/. See the module manpage for more information.

B.14.8 Apache::PageKit?Web Applications Framework

Apache::PageKit is a web applications framework that is based on mod_perl. This framework is distinguished from others (such as Embperl and Mason) by providing a clear separation of programming, content, and presentation. It does this by implementing a Model/View/Content/Controller (MVCC) design paradigm:

  • Model is implemented by user-supplied Perl classes

  • View is a set of HTML templates

  • Content is a set of XML files

  • Controller is PageKit

This allows programmers, designers, and content editors to work independently, using clean, well-defined interfaces.

Apache::PageKit provides the following features:

  • Component-based architecture

  • Language localization

  • Session management

  • Input validation

  • Sticky HTML forms

  • Authentication

  • Co-branding

  • Automatic dispatching of URIs

  • Easy error handling

Available from CPAN. See the module manpage for more information.

B.14.9 Template Toolkit?Template Processing System

The Template Toolkit is a collection of modules that implements a fast, flexible, powerful, and extensible template processing system. It was originally designed for generating dynamic web content, but it can be used equally well for processing any other kind of text-based documents (HTML, XML, POD, PostScript, LaTeX, etc.).

It can be used as a standalone Perl module or embedded within an Apache/mod_perl server for generating highly configurable dynamic web content. A number of Perl scripts are also provided that can greatly simplify the process of creating and managing static web content and other offline document systems.

The Apache::Template module provides a simple mod_perl interface to the Template Toolkit.

Available from CPAN. It's covered in Appendix D and at http://tt2.org/.



    Part I: mod_perl Administration
    Part II: mod_perl Performance
    Part VI: Appendixes