.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "HTML::Mason::Resolver 3pm" .TH HTML::Mason::Resolver 3pm "2017-11-06" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTML::Mason::Resolver \- Component path resolver base class .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& # make a subclass and use it .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" 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. .PP The HTML::Mason::Resolver provides a virtual parent class from which all resolver implementations should inherit. .SH "Class::Container" .IX Header "Class::Container" This class is used by most of the Mason object's to manage constructor parameters and has-a relationships with other objects. .PP See the documentation on this class for details on how to declare what parameters are valid for your subclass's constructor. .PP HTML::Mason::Resolver is a subclass of Class::Container so you do not need to subclass it yourself. .SH "METHODS" .IX Header "METHODS" If you are interested in creating a resolver subclass, you must implement the following methods. .IP "new" 4 .IX Item "new" This method is optional. The new method included in this class is simply inherited from \f(CW\*(C`Class::Container\*(C'\fR. If you need something more complicated done in your new method you will need to override it in your subclass. .IP "get_info" 4 .IX Item "get_info" Takes three arguments: an absolute component path, a component root key, and a component root path. Returns a new HTML::Mason::ComponentSource object. .IP "glob_path" 4 .IX Item "glob_path" Takes two arguments: a path glob pattern, something like \*(L"/foo/*\*(R" or \*(L"/foo/*/bar\*(R", and a component root path. Returns a list of component paths for components which match this glob pattern. .Sp For example, the filesystem resolver simply appends this pattern to the component root path and calls the Perl \f(CW\*(C`glob()\*(C'\fR function to find matching files on the filesystem. .SS "Using a Resolver with HTML::Mason::ApacheHandler" .IX Subsection "Using a Resolver with HTML::Mason::ApacheHandler" If you are creating a new resolver that you intend to use with the HTML::Mason::ApacheHandler module, then you must implement the following method as well. .ie n .IP "apache_request_to_comp_path ($r, @comp_root_array)" 4 .el .IP "apache_request_to_comp_path ($r, \f(CW@comp_root_array\fR)" 4 .IX Item "apache_request_to_comp_path ($r, @comp_root_array)" 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 HTML::Mason::ApacheHandler class to translate web requests into component paths. You can omit this method if your resolver subclass will never be used in conjunction with HTML::Mason::ApacheHandler.