Bric::Util::Burner::Mason - Bric::Util::Burner subclass to publish business assets using Mason formatting assets.
$Revision: 1.16.2.1 $
$Date: 2002/10/21 20:07:06 $
use Bric::Util::Burner::Mason;
# Create a new Mason burner using the settings from $burner
$mason_burner = Bric::Util::Burner::Mason->new($burner);
# burn an asset, get back a list of resources
@resources = $mason_burner->burn_one($ba, $at, $oc, $cat);
This module handles burning business assets using Mason formatting assets.
Creates a new Mason burner object. Takes a single parameters - $burner - which is a Bric::Util::Burner object. The new object will has its attributes initialized by the passed object.
Publishes an asset. Returns a list of resources burned. Parameters are:
$ba
A business asset object to publish.
$at
A asset type object for $ba
$oc
An output channel object to use for the publish
cat
A category in which to publish.
Compiles the template found in $ba. If the compile succeeds with no errors, chk_syntax() returns true. Otherwise, it returns false, and the error will be in the $err varible passed by reference.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Finds the first instance of the template with the name $tmpl_name in the URI directory hierarchy in $uri. Returns the template path, if it exists, and undef if it does not. For example:
my $uri = '/foo/bar/bletch';
my $tmpl_name = 'story.mc';
my $template = $burner->find_template($uri, $tmpl_name);
The find_template() method will look first for '/foo/bar/bletch/story.mc', and return that string if the template exists. If it doesn't, it'll look for '/foo/bar/story.mc'. If it doesn't find that, it'll look for '/foo/story.mc' and then '/story.mc'. If it finds none of these, it will rutrn null (or an empty list in an array context.
Throws: NONE.
Side Effects: NONE.
Notes: Uses HTML::Mason::Interp->lookup() internally to determine if the template exists.
Returns the path to the first template it finds in @tmpl_list. It uses find_template() (see above) to examine each template in @tmpl_list in turn. Thus, this method looks down the directory hierarchy of each template in @tmpl_list before moving on to the next one. For example:
my @tmpl_list = ('/foo/bar/story.mc', '/sci/anthro/fizzle.mc');
my $template = $burner->find_first_template(@tmpl_list)
In this example, find_first_template will return the name of the first template it finds in this order:
/foo/bar/story.mc'
/foo/story.mc'
/story.mc'
/sci/anthro/fizzle.mc'
/sci/fizzle.mc'
/fizzle.mc'
If no template is found to exist, find_first_template will return undef (or an empty list in an array context).
Throws: NONE.
Side Effects: NONE.
Notes: See also find_template() above.
A method to be called from template space. Use this method to display paginated elements. If this method is used, the burn system will run once for every page in the story; this is so autohandlers will be called when appropriate.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
A method to be called from template space. This method will find the mason element associated with the element passed in and call $m->comp.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
This method can be used in an autohandler template. It calls the next template in the chain, whether its the next autohandler down the line or the template itself.
Throws: NONE.
Side Effects: NONE.
Notes:
This is a wrapper around masons 'call_next' method. We wrap it here to make sure we have control over the burn process at this level if we need it. It also gives us the opportunity to tailor the verbiage to suit our application better.
Writes out the current page and starts a new one.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
NONE
Adds a Bric::Dist::Resource object to this burn.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Given an element (a business asset/data tile) return the template element that formats it.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Return the current element in this context.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Return the current element type in this context.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Push and pops an element from the element stack. As a story is burned, the burn process can travel down several elements deep. This stack records the order in which each element was transversed so when the burn process exits an element, the correct and current element is at the top of the stack.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Creates a top-level dhandler. This dhandler, when executed, will find the proper template in its URI hierarchy. The reason we create this dhandler is to ensure that a mason component gets executed at the end of the URI hierarchy, so that all the corresponding autohandlers will also be executed properly.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
NONE.
Garth Webb gtgarth@perijove.comlt
Sam Tregar gtstregar@about-inc.comlt
David Wheeler gtdavid@wheeler.netlt
Hey! The above document had some coding errors, which are explained below:
You forgot a '=back' before '=head2'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
=back without =over