Bric::Util::Burner - A class to manage deploying of formatting assets and publishing of business assets.
$Revision: 1.24.2.1 $
$Date: 2002/09/11 01:50:50 $
use Bric::Util::Burner;
# Create a new publish object.
$burner = new Bric::Util::Burner;
# Deploy a formatting asset.
$burner = $burner->deploy($formatting_asset);
# Undeploy a formatting asset.
$burner = $burner->undeploy($formatting_asset);
# Burn an asset given an output chanels and category
$burner->burn_one($asset, $output_channel, $category);
This module accomplishes two tasks:
Manages the process of deploying and undeploying of formatting assets through deploy() and undeploy().
Manages the process of publishing a asset with the burn_one() method. The actual work of publishing is done by one of Bric::Util::Burner's sub-classes depending on the burner_type of the asset being published. See Bric::Util::Burner::Mason and Bric::Util::Burner::Template for details.
It is anticipated that new Burner sub-classes will be added to the system. Here's a brief guide to adding a new Burner to Bricolage:
Write Bric::Util::Burner::Foo
You'll need to create a new sub-class of Bric::Util::Burner that implements three methods - new(), chk_syntax(), and burn_one(). You can use an existing sub-class as a model for the interface and implementation of these methods. Make sure that when you execute your templates, you do it in the namespace reserved by the TEMPLATE_BURN_PKG directive -- get this constant by adding
use Bric::Config qw(:burn);
To your new Burner subclass.
Modify Bric::Biz::AssetType
To use your Burner you'll need to be able to assign elements to it. To do this edit Bric::Biz::AssetType and add a constant for your burner. For example, Bric::Util::Burner::Template's constant is BURNER_TEMPLATE. Next, edit the my_meths() entry for the "burner" type to include a val entry for your constant.
Modify Bric::Util::Burner
You'll need to make a modification to Bric::Util::Burner to make it call your module when it sees an element assigned to your burner. The code you're looking for is in the _get_subclass() method. Add the approprate elsifs to assigns the appropriate class name for your burner.
Modify Bric::Biz::Asset::Formatting
Here you'll make modifications to support the template files needed by your burner. Do a search for the string "tmpl" and you'll find the appropriate sections. This is where you'll setup your naming convention and allowed filename extensions.
Modify comp/widgets/tmpl_prof/edit_new.html
Add your template filename extensions to the file_type select entry so that users can create new template files for your burner.
Done! Now start testing...
Creates a new burn object. Keyw to $init are:
data
The directory where the Burner stores temporary files. Defaults to BURN_DATA_ROOT set in bricolage.conf.
comp
The directory templates are deployed to. Defaults to BURN_COMP_ROOT set in bricolage.conf.
out
The staging area directory where the burner places content files upon publication or preview. Defaults to BURN_DATA_ROOT set in bricolage.conf.
Throws:
NONE
Side Effects:
NONE
Notes:
Bric::Util::Burner doesn't support lookup().
Bric::Util::Burner doesn't support list().
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.
Deploys a template to the file system.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Deletes a template from the file system.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sends story or media to preview server and returns URL. Params:
$ba
A business asset object to publish.
$key
story or media
$user_id
user_id to publish as.
$m
mason object (optional).
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Publishes an asset, then remove from workflow. Returns 1 if publish was successful, else 0. Parameters are:
$ba
A business asset object to publish.
$key
story or media
$user_id
user_id to publish as.
$publish_date
Date to set up publishing job for - if left blank, the present.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Publishes an asset. Returns a list of resources burned. Parameters are:
$ba
A business asset object to publish.
$oc
An output channel object to use for the publish
cat
A category in which to publish.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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.
Returns the subclass of Bric::Util::Burner appropriate for handling the $ba template object.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
"Garth Webb" <garth@perijove.com>
Sam Tregar <stregar@about-inc.com>
Bric, Bric::Util::Burner::Mason, Bric::Util::Burner::Template.
Hey! The above document had some coding errors, which are explained below:
You forgot a '=back' before '=head1'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'