<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>HTML::Mason::Resolver - Component path resolver base class</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@localhost" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><A NAME="__index__"></a></p> <ul> <li><A HREF="#name">NAME</a></li> <li><A HREF="#synopsis">SYNOPSIS</a></li> <li><A HREF="#description">DESCRIPTION</a></li> <li><A HREF="#class__container">Class::Container</a></li> <li><A HREF="#methods">METHODS</a></li> <ul> <li><A HREF="#using_a_resolver_with_html__maso">Using a Resolver with HTML::Mason::ApacheHandler</a></li> </ul> <li><A HREF="#see_also">SEE ALSO</a></li> </ul> <hr name="index" /> </div> <!-- INDEX END --> <p> </p> <h1><A NAME="name">NAME</a></h1> <p>HTML::Mason::Resolver - Component path resolver base class</p> <p> </p> <hr /> <h1><A NAME="synopsis">SYNOPSIS</a></h1> <pre> # make a subclass and use it</pre> <p> </p> <hr /> <h1><A NAME="description">DESCRIPTION</a></h1> <p>The resolver is responsible for translating a component path like /foo/index.html into a component. By default, Mason expects components to be stored on the filesystem, and uses the HTML::Mason::Resolver::File class to get information on these components.</p> <p>The HTML::Mason::Resolver provides a virtual parent class from which all resolver implementations should inherit.</p> <p> </p> <hr /> <h1><A NAME="class__container">Class::Container</a></h1> <p>This class is used by most of the Mason object's to manage constructor parameters and has-a relationships with other objects.</p> <p>See the documentation on this class for details on how to declare what paremeters are valid for your subclass's constructor.</p> <p>HTML::Mason::Resolver is a subclass of Class::Container so you do not need to subclass it yourself.</p> <p> </p> <hr /> <h1><A NAME="methods">METHODS</a></h1> <p>If you are interested in creating a resolver subclass, you must implement the following methods.</p> <dl> <dt><strong><A NAME="new" class="item">new</a></strong></dt> <dd> <p>This method is optional. The new method included in this class is simply inherited from <code>Class::Container</code>. If you need something more complicated done in your new method you will need to override it in your subclass.</p> </dd> <dt><strong><A NAME="get_info" class="item">get_info</a></strong></dt> <dd> <p>Takes three arguments: an absolute component path, a component root key, and a component root path. Returns a new <a HREF="ComponentSource.html">HTML::Mason::ComponentSource</a> object.</p> </dd> <dt><strong><A NAME="glob_path" class="item">glob_path</a></strong></dt> <dd> <p>Takes two arguments: a path glob pattern, something like "/foo/*" or "/foo/*/bar", and a component root path. Returns a list of component paths for components which match this glob pattern.</p> <p>For example, the filesystem resolver simply appends this pattern to the component root path and calls the Perl <code>glob()</code> function to find matching files on the filesystem.</p> </dd> </dl> <p> </p> <h2><A NAME="using_a_resolver_with_html__maso">Using a Resolver with HTML::Mason::ApacheHandler</a></h2> <p>If you are creating a new resolver that you intend to use with the <a HREF="ApacheHandler.html">HTML::Mason::ApacheHandler</a> module, then you must implement the following method as well.</p> <dl> <dt><strong><A NAME="apache_request_to_comp_path" class="item">apache_request_to_comp_path ($r, @comp_root_array)</a></strong></dt> <dd> <p>This method, given an Apache object and a list of component root pairs, should return a component path or undef if none exists. This method is used by the <a HREF="ApacheHandler.html">HTML::Mason::ApacheHandler</a> class to translate web requests into component paths. You can omit this method if your resolver subclass will never be used in conjunction with <a HREF="ApacheHandler.html">HTML::Mason::ApacheHandler</a>.</p> </dd> </dl> <p> </p> <hr /> <h1><A NAME="see_also">SEE ALSO</a></h1> <p><a HREF="Mason.html">HTML::Mason</a></p> </body> </html>