NAME

Bric::Biz::AssetType - Registers new types of assets with their fields and the rules governing them.

VERSION

$Revision: 1.17 $

DATE

$Date: 2002/03/10 03:48:16 $

SYNOPSIS

# Create new types of assets.
$element = Bric::Biz::AssetType->new($init)
$element = Bric::Biz::AssetType->lookup({id => $id})
($at_list || @ats) = Bric::Biz::AssetType->list($param)
($id_list || @ids) = Bric::Biz::AssetType->list_ids($param)

# Return the ID of this object.
$id = $element->get_id()

# Get/set this asset type's name.
$element = $element->set_name( $name )
$name       = $element->get_name()

# Get/set the description for this asset type
$element  = $element->set_description($description)
$description = $element->get_description()

# Get/set the primary output channel ID for this asset type.
$element = $element->set_primary_oc_id($oc_id);
$oc_id = $element->get_primary_oc_id;

# Attribute methods.
$val  = $element->set_attr($name, $value);
$val  = $element->get_attr($name);
\%val = $element->all_attr;

# Attribute metadata methods.
$val = $element->set_meta($name, $meta, $value);
$val = $element->get_meta($name, $meta);

# Manage output channels.
$element        = $element->add_output_channels([$output_channel])
($oc_list || @ocs) = $element->get_output_channels()
$element        = $element->delete_output_channels([$output_channel])

# Manage the parts of an asset type.
$element            = $element->add_data($field);
$element_data       = $element->new_data($param);
$element            = $element->copy_data($at, $field);
($part_list || @parts) = $element->get_data($field);
$element            = $element->del_data($field);

# Add, retrieve and delete containers from this asset type.
$element            = $element->add_containers($at || [$at]);
(@at_list || $at_list) = $element->get_containers();
$element            = $element->del_containers($at || [$at]);

# Set the repeatability of a field.
($element || 0) = $element->is_repeatable($at_container);
$element        = $element->make_repeatable($at_container);
$element        = $element->make_nonrepeatable($at_container);

# Get/set the active flag.
$element  = $element->activate()
$element  = $element->deactivate()
(undef || 1) = $element->is_active()

# Save this asset type.
$element = $element->save()

DESCRIPTION

The asset type class registers new type of assets that will go through work flow. The individual parts will describe how the fields of the story will be laid out.

The AssetType object is composed of AssetType Parts Data objects and AssetType Parts Container objects. These hold the fields that will become Assets when they enter workflow. Rules can be set upon these.

The AssetType object also holds what output channels this asset will be allowed to go through.

INTERFACE

Constructors

$element = Bric::Biz::AssetType->new($init)

Will return a new asset type object with the optional initial state

Supported Keys:

Throws: NONE

Side Effects: NONE

Notes: NONE

$element = Bric::Biz::AssetType->lookup($param)

Keys for $param are:

This will return the asset type that matches the id that is defined

Throws:

"Missing required paramter 'id'"

Side Effects:

NONE

Notes:

NONE

($at_list || @at_list) = Bric::Biz::AssetType->list($param);

This will return a list of objects that match the criteria defined

Supported Keys:

name

The name of the asset type. Matched with case-insentive LIKE.

description

The description of the asset type. Matched with case-insentive LIKE.

output_channel

The ID of an output channel. Returned will be all AssetType objects that contain this output channel.

data_name

The name of an AssetType::Data object. Returned will be all AssetType objects that reference this particular AssetType::Data object.

map_type__id

The map_type__id of an AssetType::Data object.

active

Set to 0 to return active and inactive asset types. 1, the default, returns only active asset types.

type__id

match elements of a particular attype

top_level

set to 1 to return only top-level elements

media

match against a particular media asste type (att.media)

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($at_list || @ats) = Bric::Biz::AssetType->list_ids($param)

This will return a list of objects that match the criteria defined

See the 'list' function for the allowed keys of $param.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Destructors

$self->DESTROY

Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

Public Class Methods

NONE

$meths = Bric::Biz::AssetType->my_meths
(@meths || $meths_aref) = Bric::Biz::AssetType->my_meths(TRUE)

Returns an anonymous hash of instrospection data for this object. If called with a true argument, it will return an ordered list or anonymous array of intrspection data. The format for each introspection item 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

$id = $element->get_id()

This will return the id for the database

Throws: NONE

Side Effects: NONE

Notes: NONE

$element = $element->set_name( $name )

This will set the name field for the asset type

Throws: NONE

Side Effects: NONE

Notes: NONE

$name = $element->get_name()

This will return the name field for the asset type

Throws: NONE

Side Effects: NONE

Notes: NONE

$element = $element->set_description($description)

this sets the description field

Throws: NONE

Side Effects: NONE

Notes: NONE

$description = $element->get_description()

This returns the description field

Throws: NONE

Side Effects: NONE

Notes: NONE

$element = $element->set_primary_oc_id( $primary_oc_id )

This will set the primary output channel id field for the asset type

Throws: NONE

Side Effects: NONE

Notes: NONE

$primary_oc_id = $element->get_primary_oc_id()

This will return the primary output channel id field for the asset type

Throws: NONE

Side Effects: NONE

Notes: NONE

$name = $at->get_type_name

Get the type name of the asset type.

Throws: NONE

Side Effects: NONE

Notes: NONE

$burner = $at->get_burner

Get the burner associated with the asset type. Possible values are the constants BURNER_MASON and BURNER_TEMPLATE defined in this package.

Throws: NONE

Side Effects: NONE

Notes: NONE

$at->set_burner(Bric::Biz::AssetType::BURNER_MASON);

Get the burner associated with the asset type. Possible values are the constants BURNER_MASON and BURNER_TEMPLATE defined in this package.

Throws: NONE

Side Effects: NONE

Notes: NONE

$desc = $at->get_type_description

Get the type description of the asset type.

Throws: NONE

Side Effects: NONE

Notes: NONE

($at || undef) = $at->get_top_level

Return whether this is a top level story or not.

Throws: NONE

Side Effects: NONE

Notes: NONE

($at || undef) = $at->get_paginated

Return whether this asset type should produce a paginated asset or not.

Throws: NONE

Side Effects: NONE

Notes: NONE

($at || undef) = $at->is_related_media

Return whether this asset type can have related media objects.

Throws: NONE

Side Effects: NONE

Notes: NONE

($at || undef) = $at->is_related_story

Return whether this asset type can have related story objects.

Throws: NONE

Side Effects: NONE

Notes: NONE

($at || undef) = $at->is_media()
$at = $at->set_media()
$at = $at->clear_media()

Mark this Asset Type as representing a media object or a story object. Media objects do not support all the options that story objects to like nested containers or references, but they include options that story doesnt like autopopulated fields.

The 'is_media' method returns true if this is a media object and false otherwise. The 'set_media' method marks this as a media object. It does not take any arguments, and always sets the media flag to true, so you cant do this:

$at->set_media(0)

and expect to set the media flag to false. To unset the media flag (set it to false) use the 'clear_media' method.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$at->get_biz_class()
$at->get_biz_class_id()
$at->set_biz_class('class' => '' || 'id' => '');

The methods 'get_biz_class' and 'get_biz_class_id' get the business class name or the business class ID respectively from the class table.

The 'set_biz_class' method sets the business class for this asset type given either a class name or an ID from the class table.

This value represents the kind of bussiness object this asset type will represent. There are just two main kinds, story and media objects. However media objects have many subclasses, one for each type of supported media (image, audio, video, etc) increasing the number of package names this value could be set to.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($at || undef) = $at->get_reference
$at = $at->set_reference(1 || 0)

Return whether this asset type references other data.

Throws: NONE

Side Effects: NONE

Notes: NONE

($at || undef) = $at->get_fixed_url

Return whether this asset type should produce a fixed url asset or not.

Throws: NONE

Side Effects: NONE

Notes: NONE

$at_type = $at->get_at_type

Return the at_type object associated with this element.

Throws: NONE

Side Effects: NONE

Notes: NONE

$val = $element->set_attr($name, $value);
$val = $element->get_attr($name);
$val = $element->del_attr($name);

Get/Set/Delete attributes on this asset type.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$val = $element->set_meta($name, $field, $value);
$val = $element->get_meta($name, $field);
$val = $element->get_meta($name);

Get/Set attribute metadata on this asset type. Calling the 'get_meta' method without '$field' returns all metadata names and values as a hash.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($oc_list || @oc_list) = $element->get_output_channels();

This returns a list of output channels that have been associated with this asset type

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->add_output_channels( [ $output_channel])

This accepts a list of output channels to be associated with this asset type

Throws: NONE

Side Effects: NONE

Notes: NONE

$element = $element->delete_output_channels([$output_channel])

This takes a list of output channels and removes their association from the object

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($part_list || @part_list) = $element->get_data()

This will return a list of the fields and containers that make up this asset type

Throws:

NONE

Side Effects:

NONE

Notes:

The parts returned here may not have their parent IDs or order set if this object has not been saved yet.

$element = $element->add_data([$field])

This takes a list of fields and associates them with the element object

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->new_data($param)

Adds a new data point, creating a new Bric::Biz::AssetType::Parts::Data object. The keys to $param are the same as the keys for the hash ref passed to Bric::Biz::AssetType::Parts::Data::new.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->copy_data($param)

Copy the definition for a data field from another asset type. Keys for $param are:

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->del_data( [ $field || $container ])

This will take a list of parts and will disassociate them from the story type

Throws: NONE

Side Effects: NONE

Notes: NONE

$element = $element->add_containers([$at]);

Add AssetTypes to be contained by this AssetType.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(@at_list || $at_list) = $element->get_containers();

Return all contained AssetTypes.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->del_containers([$at]);

Release an AssetType from its servitude to this AssetType. The AssetType itself will not be deleted. It will simply not be associated with this AssetType any more.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($element || 0) = $element->is_repeatable($at_container); =item $element = $element->make_repeatable($at_container); =item $element = $element->make_nonrepeatable($at_container);

Get/Set the repeatable flag for a contained AssetType. Note that this repeatability only applies to this AssetTypes relation to the contained AssetType.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->is_active()

Return the active flag.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->activate()

This will set the active flag to one for the object

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->deactivate()

This will set the active flag to undef for the asset type

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(undef || 1) $element->get_active()

This will return undef if the element has been deactivated and one otherwise

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(undef || $self) = $field->remove()

Removes this object completely from the DB. Returns 1 if active or undef otherwise

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$element = $element->save()

This will save all of the changes to the database

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

PRIVATE

Private Class Methods

_do_list

called from list and list ids this will query the db and return either ids or objects

Throws: NONE

Side Effects: NONE

Notes: NONE

Private Instance Methods

$self = $self->_select_asset_type($id);

Select columns from the element table with primary key $id.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_update_asset_type();

Update values in the element table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_insert_asset_type

Insert new values into the element table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_select_output_channel_id

Select the output channel ID from the element output_channel mapping table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_insert_output_channel_id

Insert a new output_channel ID in the AssetType OutputChannel mapping table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_delete_output_channel_id

Delete an output_channel ID from the AssetType OutputChannel mapping table.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_get_parts

Call the list function of Bric::Biz::AssetType::Parts::Container to return a list of conainer parts of this AssetType object, or return the existing parts if weve already loaded them.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Private Functions

NONE

NOTES

supported new Keys Define supported list keys Define supported list_ids keys Check the languages stuff

AUTHOR

michael soderstrom ( miraso@pacbell.net )

SEE ALSO

perl,Bric,Bric::Biz::Asset

POD ERRORS

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

Around line 491:

You forgot a '=back' before '=head2'

Around line 493:

'=item' outside of any '=over'

Around line 506:

You forgot a '=back' before '=head2'

Around line 514:

'=item' outside of any '=over'

Around line 596:

Expected '=item *'

Around line 598:

Expected '=item *'

Around line 600:

Expected '=item *'

Around line 602:

Expected '=item *'

Around line 604:

Expected '=item *'

Around line 606:

Expected '=item *'

Around line 608:

Expected '=item *'

Around line 734:

You forgot a '=back' before '=head2'

Around line 740:

'=item' outside of any '=over'

Around line 2196:

You forgot a '=back' before '=head1'

Around line 2204:

'=item' outside of any '=over'

Around line 2337:

=cut found outside a pod block. Skipping to next block.

Around line 2341:

You forgot a '=back' before '=head2'

Around line 2530:

'=item' outside of any '=over'

Around line 2805:

You forgot a '=back' before '=head2'

Around line 2814:

=back without =over