NAME

Bric::Dist::ActionType - Interface to types of actions supported by Bricolage distribution.

VERSION

$Revision: 1.7 $

DATE

$Date: 2002/08/30 22:13:39 $

SYNOPSIS

use Bric::Dist::ActionType;

# Constructors.
# Create a new object.
my $at = Bric::Dist::ActionType->new;
# Look up an existing object.
$at = Bric::Dist::ActionType->lookup({ id => 1 });
# Get a list of action type objects.
my @servers = Bric::Dist::ActionType->list({ description => 'File%' });

# Class methods.
# Get a list of object IDs.
my @st_ids = Bric::Dist::ActionType->list_ids({ description => 'File%' });
# Get an introspection hashref.
my $int = Bric::Dist::ActionType->my_meths;

# Instance Methods.
my $id = $at->get_id;
my $name = $at->get_name;
my $description = $at->get_description;
my @medias = $at->get_media_types;
my $medias = $at->get_medias_href;
print "AT is ", $at->is_active ? '' : 'not ', "active\n";

DESCRIPTION

This class defines types of actions that can be performed on resources. Types of actions include "Akamaize," "Gzip," "Put," "Delete," etc. All actions are created at development time by Bricolage developers and cannot be created or changed by users. Users can specify what types of actions apply to jobs executed for given server types by accessing the Bric::Dist::Action class. Use Bric::Dist::ActionType objects to help define Bric::Dist::Action objects.

INTERFACE

Constructors

my $at = Bric::Dist::ActionType->lookup({ id => $id })
my $at = Bric::Dist::ActionType->lookup({ name => $name })

Looks up and instantiates a new Bric::Dist::ActionType object based on the Bric::Dist::ActionType object ID or name passed. If $id or $name is not found in the database, lookup() returns undef.

Throws:

Side Effects: If $id is found, populates the new Bric::Dist::ActionType object with data from the database before returning it.

Notes: NONE.

my (@ats || $ats_aref) = Bric::Dist::ActionType->list($params)

Returns a list or anonymous array of Bric::Dist::ActionType objects based on the search parameters passed via an anonymous hash. The supported lookup keys are:

Throws:

Side Effects: Populates each Bric::Dist::ActionType object with data from the database before returning them all.

Notes: NONE.

Destructors

$at->DESTROY

Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

Public Class Methods

my (@at_ids || $at_ids_aref) = Bric::Dist::ActionType->list_ids($params)

Returns a list or anonymous array of Bric::Dist::ActionType object IDs based on the search criteria passed via an anonymous hash. The supported lookup keys are the same as those for list().

Throws:

Side Effects: NONE.

Notes: NONE.

$meths = Bric::Dist::ActionType->my_meths

Returns an anonymous hash of instrospection data for this object. The format for the introspection is as follows:

Each hash key is the name of a property or attribute of the object. The value for a hash key is another anonymous hash containing the following keys:

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

Public Instance Methods

my $id = $at->get_id

Returns the ID of the Bric::Dist::ActionType object.

Throws:

Side Effects: NONE.

Notes: If the Bric::Dist::ActionType object has been instantiated via the new() constructor and has not yet been saved, the object will not yet have an ID, so this method call will return undef.

my $name = $at->get_name

Returns the name of this type of action.

Throws:

Side Effects: NONE.

Notes: NONE.

my $description = $at->get_description

Returns the description of this type of action.

Throws:

Side Effects: NONE.

Notes: NONE.

my (@medias || $medias_aref) = $at->get_media_types

Returns a list or anonymous array of the MEDIA types that apply to this action. Returns an empty list (or undef in a scalar context) if this action applies to all MEDIA types.

Throws:

Side Effects: NONE.

Notes: NONE.

my (@medias || $medias_aref) = $at->get_medias_href

Returns an anonymous hash of the MEDIA types that apply to this action. Returns undef if this action applies to all MEDIA types.

Throws:

Side Effects: NONE.

Notes: NONE.

$self = $st->is_active

Returns $self if the Bric::Dist::ActionType object is active, and undef if it is not.

Throws:

Side Effects: NONE.

Notes: NONE.

PRIVATE

Private Class Methods

NONE.

Private Instance Methods

NONE.

Private Functions

my $at_aref = &$get_em( $pkg, $params )
my $at_ids_aref = &$get_em( $pkg, $params, 1 )

Function used by lookup() and list() to return a list of Bric::Dist::ActionType objects or, if called with an optional third argument, returns a listof Bric::Dist::ActionType object IDs (used by list_ids()).

Throws:

Side Effects: NONE.

Notes: NONE.

NOTES

NONE.

AUTHOR

David Wheeler <david@wheeler.net>

SEE ALSO

Bric

POD ERRORS

Hey! The above document had some coding errors, which are explained below:

Around line 234:

=back doesn't take any parameters, but you said =back 4

Around line 562:

=back doesn't take any parameters, but you said =back 4