Bric::Biz::AssetType - Registers new types of assets with their fields and the rules governing them.
$Revision: 1.17 $
$Date: 2002/03/10 03:48:16 $
# 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()
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.
Will return a new asset type object with the optional initial state
Supported Keys:
Throws: NONE
Side Effects: NONE
Notes: NONE
Keys for $param are:
id
This is an AssetType ID that will return a single unique AssetType object.
This will return the asset type that matches the id that is defined
Throws:
"Missing required paramter 'id'"
Side Effects:
NONE
Notes:
NONE
This will return a list of objects that match the criteria defined
Supported Keys:
The name of the asset type. Matched with case-insentive LIKE.
The description of the asset type. Matched with case-insentive LIKE.
The ID of an output channel. Returned will be all AssetType objects that contain this output channel.
The name of an AssetType::Data object. Returned will be all AssetType objects that reference this particular AssetType::Data object.
The map_type__id of an AssetType::Data object.
Set to 0 to return active and inactive asset types. 1, the default, returns only active asset types.
match elements of a particular attype
set to 1 to return only top-level elements
match against a particular media asste type (att.media)
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.
NONE
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:
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:
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.
This will return the id for the database
Throws: NONE
Side Effects: NONE
Notes: NONE
This will set the name field for the asset type
Throws: NONE
Side Effects: NONE
Notes: NONE
This will return the name field for the asset type
Throws: NONE
Side Effects: NONE
Notes: NONE
this sets the description field
Throws: NONE
Side Effects: NONE
Notes: NONE
This returns the description field
Throws: NONE
Side Effects: NONE
Notes: NONE
This will set the primary output channel id field for the asset type
Throws: NONE
Side Effects: NONE
Notes: NONE
This will return the primary output channel id field for the asset type
Throws: NONE
Side Effects: NONE
Notes: NONE
Get the type name of the asset type.
Throws: NONE
Side Effects: NONE
Notes: NONE
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
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
Get the type description of the asset type.
Throws: NONE
Side Effects: NONE
Notes: NONE
Return whether this is a top level story or not.
Throws: NONE
Side Effects: NONE
Notes: NONE
Return whether this asset type should produce a paginated asset or not.
Throws: NONE
Side Effects: NONE
Notes: NONE
Return whether this asset type can have related media objects.
Throws: NONE
Side Effects: NONE
Notes: NONE
Return whether this asset type can have related story objects.
Throws: NONE
Side Effects: NONE
Notes: NONE
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
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
Return whether this asset type references other data.
Throws: NONE
Side Effects: NONE
Notes: NONE
Return whether this asset type should produce a fixed url asset or not.
Throws: NONE
Side Effects: NONE
Notes: NONE
Return the at_type object associated with this element.
Throws: NONE
Side Effects: NONE
Notes: NONE
Get/Set/Delete attributes on this asset type.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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
This returns a list of output channels that have been associated with this asset type
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
This accepts a list of output channels to be associated with this asset type
Throws: NONE
Side Effects: NONE
Notes: NONE
This takes a list of output channels and removes their association from the object
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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.
This takes a list of fields and associates them with the element object
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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
Copy the definition for a data field from another asset type. Keys for $param are:
at
An existing asset type object
field_name
A field name defined within the object passed with 'at'
field_obj
A field object. Can be given in lieu of 'at' and 'field_name'.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
This will take a list of parts and will disassociate them from the story type
Throws: NONE
Side Effects: NONE
Notes: NONE
Add AssetTypes to be contained by this AssetType.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Return all contained AssetTypes.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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
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
Return the active flag.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
This will set the active flag to one for the object
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
This will set the active flag to undef for the asset type
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
This will return undef if the element has been deactivated and one otherwise
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Removes this object completely from the DB. Returns 1 if active or undef otherwise
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
This will save all of the changes to the database
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
called from list and list ids this will query the db and return either ids or objects
Throws: NONE
Side Effects: NONE
Notes: NONE
Select columns from the element table with primary key $id.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Update values in the element table.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Insert new values into the element table.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Select the output channel ID from the element output_channel mapping table.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Insert a new output_channel ID in the AssetType OutputChannel mapping table.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Delete an output_channel ID from the AssetType OutputChannel mapping table.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
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
NONE
supported new Keys Define supported list keys Define supported list_ids keys Check the languages stuff
michael soderstrom ( miraso@pacbell.net )
Hey! The above document had some coding errors, which are explained below:
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
'=item' outside of any '=over'
=cut found outside a pod block. Skipping to next block.
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
=back without =over