NAME

Bric::Biz::Asset::Business::Media - The parent class of all media objects

VERSION

$Revision: 1.40.2.22 $

DATE

$Date: 2004/02/06 06:10:17 $

SYNOPSIS

use Bric::Biz::Asset::Business::Media;

DESCRIPTION

TBD.

INTERFACE

Constructors

$media = Bric::Biz::Asset::Business::Media->new( $initial_state )

This will create a new media object with an optionaly defined intiial state

Supported Keys:

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$media = Bric::Biz::Asset::Business::Media->lookup->( { id => $id })

This will return a media asset that matches the criteria defined

Throws: NONE.

Side Effects: NONE.

Notes: Inherited from Bric::Biz::Asset.

(@media || $media) = Bric::Biz::Asset::Business::Media->list($param);

returns a list or list ref of media objects that match the criteria defined

Supported Keys:

Throws:

Side Effects:

NONE

Notes: Inherited from Bric::Biz::Asset.

Destructors

$self->DESTROY

dummy method to not waste the time of AUTOLOAD

Public Class Methods

(@ids||$id_list) = Bric::Biz::Asset::Business::Media->list_ids( $criteria );

Returns an unordered list or array reference of media object IDs that match the criteria defined. The criteria are the same as those for the list() method except for Order and OrderDirection, which list_ids() ignore.

Throws: NONE.

Side Effects: NONE.

Notes: Inherited from Bric::Biz::Asset.

($fields || @fields) = Bric::Biz::Asset::Business::Media::autopopulated_fields()

Returns a list of the names of fields that are registered in the database as being autopopulatable for a given sub class

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

my $key_name = Bric::Biz::Asset::Business::Media->key_name()

Returns the key name of this class.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$meths = Bric::Biz::Asset::Business::Media->my_meths
(@meths || $meths_aref) = Bric::Biz::Asset::Business::Media->my_meths(TRUE)
my (@meths || $meths_aref) = Bric::Biz:::Asset::Business::Media->my_meths(0, TRUE)

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:

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.

$class_id = Bric::Biz::Asset::Business::Media->get_class_id()

Returns the class id of the Media object or class.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

Public Instance Methods

$media = $media->set_category__id($id)

Associates this media asset with the given category

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$category_id = $media->get_category__id()

Returns the category id that has been associated with this media object

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $media->set_cover_date($cover_date)

Sets the cover date and updates the URI.

Throws:

Side Effects: NONE.

Notes: NONE.

$category = $media->get_category_object()
$category = $media->get_category()

Returns the object of the category that this is a member of

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

my $uri = $media->get_uri
my $uri = $media->get_uri($oc)

Returns the URI for the media object. If the $oc output channel parameter is passed in, then the URI will be returned in the output channel's preferred format.

Throws:

Side Effects: NONE.

Notes: NONE.

$uri = $media->get_local_uri()

Returns the uri of the media object for the Bricolage application server.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$uri = $media->get_path()

Returns the path of the media object on the Bricolage file system.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$mt_obj = $media->get_media_type()

Returns the media type object associated with this object.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$media = $media->upload_file($file_handle, $file_name)

Reads a file from the passed $file_handle and stores it in the media object under $file_name.

Throws: NONE.

Side Effects: Closes the $file_handle after reading.

Notes: NONE.

$file_handle = $madia->get_file()

Returns the file handle for this given media object

Throws:

Side Effects: NONE.

Notes: NONE.

$location = $media->get_location()

The will return the location of the file on the file system, relative to MEDIA_FILE_ROOT.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$size = $media->get_size()

This is the size of the media file in bytes

Throws:

Side Effects: NONE.

Notes: NONE.

$media_name = $media->check_uri
$media_name = $media->check_uri($uid)

Returns name of media with conflicting URI, if any.

$media = $story->revert();

Reverts the current version to a prior version

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$media = $media->clone()

Clones the media object

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->save()

Saves the object to the database doing either an insert or an update

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$contribs = $self->_get_contributors()

Returns the contributors from a cache or looks em up

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_insert_contributor( $id, $role)

Inserts a row into the mapping table for contributors.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_update_contributor($id, $role)

Updates the contributor mapping table

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_delete_contributors($id)

Deletes the rows from these mapping tables

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

($fields) = $self->_get_auto_fields($biz_pkg)

returns a hash ref of the fields that are to be autopopulated from this type of media object.

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$attribute_object = $self->_get_attribute_object()

Returns the attribute object from a cache or creates a new record

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_insert_media()

Inserts a media record into the database

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_update_media()

Preforms the SQL that updates the media table

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_insert_instance()

Preforms the sql that inserts a record into the media instance table

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_update_instance()

Preforms the sql that updates the media_instance table

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_delete_media()

Removes the media row from the database

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_delete_instance()

Removes the instance row from the database

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_select_media($where, @bind);

Populates the object from a database row

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$self = $self->_do_update()

Updates the row in the data base

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

$attr_object = $self->_get_attr_obj()

returns the attribute object for this story

Throws: NONE.

Side Effects: NONE.

Notes: NONE.

NOTES

Some additional fields may be needed here such as a field for what kind of object this represents etc.

AUTHOR

"Michael Soderstrom" <miraso@pacbell.net>

SEE ALSO

perl, Bric, Bric::Biz::Asset, Bric::Biz::Asset::Business