Bric::Dist::ActionType - Interface to types of actions supported by Bricolage distribution.
$LastChangedRevision$
$LastChangedDate$
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";
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.
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.
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:
Action type ID. May use ANY for a list of possible values.
An action type name. May use ANY for a list of possible values.
An action type description. May use ANY for a list of possible values.
The ID of a Bric::Util::MediaType object that determine the types of files on which actions of this type will act. May use ANY for a list of possible values.
The name of a Bric::Util::MediaType object that determine the types of files on which actions of this type will act. May use ANY for a list of possible values.
Throws:
Side Effects: Populates each Bric::Dist::ActionType object with data from the database before returning them all.
Notes: NONE.
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
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.
Returns an anonymous hash of introspection data for this object. If called with a true argument, it will return an ordered list or anonymous array of introspection data. If a second true argument is passed instead of a first, then a list or anonymous array of introspection data will be returned for properties that uniquely identify an object (excluding id, which is assumed).
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:
The name of the property or attribute. Is the same as the hash key when an anonymous hash is returned.
The display name of the property or attribute.
A reference to the method that will retrieve the value of the property or attribute.
An anonymous array of arguments to pass to a call to get_meth in order to retrieve the value of the property or attribute.
A reference to the method that will set the value of the property or attribute.
An anonymous array of arguments to pass to a call to set_meth in order to set the value of the property or attribute.
The type of value the property or attribute contains. There are only three types:
If the value is a 'short' value, this hash key contains the length of the field.
The property is searchable via the list() and list_ids() methods.
The property or attribute is required.
An anonymous hash of properties used to display the property or attribute. Possible keys include:
The display field type. Possible values are
The Length, in letters, to display a text or password field.
The maximum length of the property or value - usually defined by the SQL DDL.
The number of rows to format in a textarea field.
The number of columns to format in a textarea field.
An anonymous hash of key/value pairs reprsenting the values and display names to use in a select list.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
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.
Returns the name of this type of action.
Throws:
Side Effects: NONE.
Notes: NONE.
Returns the description of this type of action.
Throws:
Side Effects: NONE.
Notes: NONE.
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.
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.
Returns $self if the Bric::Dist::ActionType object is active, and undef if it is not.
Throws:
Side Effects: NONE.
Notes: NONE.
NONE.
NONE.
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.
NONE.
David Wheeler