man Bric::Biz::ATType () - A class to represent AssetType types.

NAME

Bric::Biz::ATType - A class to represent AssetType types.

VERSION

$LastChangedRevision$

DATE

$LastChangedDate: 2004-08-12 17:13:34 -0700 (Thu, 12 Aug 2004) $

SYNOPSIS

 use Bric::Biz::ATType;

DESCRIPTION

This class sets up properties that are common to all elements (Bric::Biz::AssetType) objects of a type.

INTERFACE

Constructors

$obj = Bric::Biz::ATType->new($init);
Constructs and returns a new Bric::Biz::ATType object initialized with the parameters in the CW$init hash reference. The supported keys for CW$init are:
name
The name of this ATType.
description
A short description of this ATType.
top_level
A boolean value flagging whether elements (AssetTypes) of this this ATType represent top level elements (story type elements or media type elements) or subelements. Defaults to false.
paginated
A boolean value flagging whether elements (AssetTypes) of this this ATType represent pages. Defaults to false.
fixed_url
A boolean value flagging whether elements (AssetTypes) of this this ATType are fixed URL elements. Defaults to false.
related_story
A boolean value flagging whether elements (AssetTypes) of this this ATType are rleated story elements. Defaults to false.
related_media
A boolean value flagging whether elements (AssetTypes) of this this ATType are rleated media elements. Defaults to false.
media
A boolean value flagging whether elements (AssetTypes) of this this ATType are media elements. Defaults to false.
biz_class_id
The ID corresponding to the Bric::Util::Class entry for one of the following classes:
Bric::Biz::Asset::Busines::Story
Bric::Biz::Asset::Busines::Media
Bric::Biz::Asset::Busines::Media::Image
Bric::Biz::Asset::Busines::Media::Audio
Bric::Biz::Asset::Busines::Media::Video
Throws: NONE. Side Effects: NONE. Notes: NONE. Looks up and instantiates a new Bric::Biz::ATType object based on the Bric::Biz::ATType object ID or name passed. If CW$id or CW$name is not found in the database, CWlookup() returns CWundef. Throws:
*
Too many Bric::Biz::ATType objects found.
*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. Side Effects: NONE. Notes: NONE. Returns a list or anonymous array of Bric::Biz::ATType objects based on the search parameters passed via an anonymous hash. The supported lookup keys are:
name
Lookup ATType by name.
name
Lookup ATType by description.
top_level
Boolean; return all top level ATTypes
paginated
Boolean; return all paginated ATTypes.
fixed_url
Boolean; return all fixed URL ATTypes.
active
Boolean; return all active ATTypes. If passed as all, returns all ATTypes.
related_story
Boolean; return all related story ATTypes.
related_media
Boolean; return all related media ATTypes.
media
Boolean; return all media ATTypes.
biz_class_id
Return all ATTypes associated with this business class ID. See CWnew() for a list of business asset classes.
grp_id
Return all ATTypes in the Bric::Util::Grp::ElementType group corresponding to this ID. Throws:
*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. Side Effects: NONE. Notes: NONE.

Destructors

$st->DESTROY
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY. Throws: NONE. Side Effects: NONE. Notes: NONE.

Public Class Methods

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

*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. 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 CWid, 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:
name
The name of the property or attribute. Is the same as the hash key when an anonymous hash is returned.
disp
The display name of the property or attribute.
get_meth
A reference to the method that will retrieve the value of the property or attribute.
get_args
An anonymous array of arguments to pass to a call to get_meth in order to retrieve the value of the property or attribute.
set_meth
A reference to the method that will set the value of the property or attribute.
set_args
An anonymous array of arguments to pass to a call to set_meth in order to set the value of the property or attribute.
type
The type of value the property or attribute contains. There are only three types:
short
date
blob
len
If the value is a 'short' value, this hash key contains the length of the field.
search
The property is searchable via the list() and list_ids() methods.
req
The property or attribute is required.
props
An anonymous hash of properties used to display the property or attribute. Possible keys include:
type
The display field type. Possible values are
text
textarea
password
hidden
radio
checkbox
select
length
The Length, in letters, to display a text or password field.
maxlength
The maximum length of the property or value - usually defined by the SQL DDL.
rows
The number of rows to format in a textarea field.
cols
The number of columns to format in a textarea field.
vals
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.

Public Instance Methods

Get/Set the name of this AT type. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the description for this AT type. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the top level flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the paginated flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the fixed url flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the related story flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the related media flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the media flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the business class ID. See CWnew() for a list of the business asset classes. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set the active flag. Throws: NONE. Side Effects: NONE. Notes: NONE. Deletes the AT type from the database. Throws:

*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to execute SQL statement. Side Effects: NONE. Notes: NONE. Save the AT type and/or all changes to the database. Throws:
*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to execute SQL statement. Side Effects: NONE. Notes: NONE.

Private Class Methods

NONE

Private Instance Methods

_update_attype
Updates the ATType in the database. Throws:
*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to execute SQL statement. Side Effects: NONE. Notes: NONE.
_insert_attype
Inserts the ATType into the database. Throws:
*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to execute SQL statement. Side Effects: NONE. Notes: NONE.

Private Functions

Function used by CWlookup() and CWlist() to return a list of Bric::Biz::ATType objects or, if called with an optional third argument, returns a list of Bric::Biz::ATType object IDs (used by CWlist_ids()). Throws:

*
Unable to connect to database.
*
Unable to prepare SQL statement.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. Side Effects: NONE. Notes: NONE.

NOTES

NONE

AUTHOR

Garth Webb <garth@perijove.com>

Refactored by David Wheeler <david@wheeler.net>

SEE ALSO

perl, Bric, Bric::Biz::AssetType