Bric::Biz::Asset::Business(3)

NAME
Bric::Biz::Asset::Business - An object that houses the business Assets

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2004-07-06 16:42:29 -0700 (Tue, 06 Jul 2004) $

SYNOPSIS
 # Constructor
 $biz = Bric::Biz::Asset::Business->new($param);
 # DB object looukp
 $biz = Bric::Biz::Asset::Business->lookup({'id' => $biz_id});

 # Getting a list of objects
 ($biz_asset_list||@biz_assets) = Bric::Biz::Asset::Business->list( $criteria )

 # Geting a list of ids
 ($biz_ids || @biz_ids) = Bric::Biz::Asset::Business->list_ids( $criteria )

 ## METHODS INHERITED FROM Bric::Biz::Asset ##

 # Class Methods
 $key_name = Bric::Biz::Asset->key_name()
 %priorities = Bric::Biz::Asset->list_priorities()
 $data = Bric::Biz::Asset->my_meths

 # looking up of objects
 ($asset_list || @assets) = Bric::Biz::Asset->list( $param )

 # General information
 $asset       = $asset->get_id()
 $asset       = $asset->set_name($name)
 $name        = $asset->get_name()
 $asset       = $asset->set_description($description)
 $description = $asset->get_description()
 $priority    = $asset->get_priority()
 $asset       = $asset->set_priority($priority)
 $alias_id    = $asset->get_alias_id()
 $asset       = $asset->set_alias_id($alias_id)

 # User information
 $usr_id      = $asset->get_user__id()
 $modifier    = $asset->get_modifier()

 # Version information
 $vers        = $asset->get_version();
 $vers_id     = $asset->get_version_id();
 $current     = $asset->get_current_version();
 $checked_out = $asset->get_checked_out()

 # Expire Data Information
 $asset       = $asset->set_expire_date($date)
 $expire_date = $asset->get_expire_date()

 # Desk stamp information
 ($desk_stamp_list || @desk_stamps) = $asset->get_desk_stamps()
 $desk_stamp                        = $asset->get_current_desk()
 $asset                             = $asset->set_current_desk($desk_stamp)

 # Workflow methods.
 $id    = $asset->get_workflow_id;
 $obj   = $asset->get_workflow_object;
 $asset = $asset->set_workflow_id($id);

 # Output channel associations.
 my @ocs = $asset->get_output_channels;
 $asset->add_output_channels(@ocs);
 $asset->del_output_channels(@ocs);

 # Access note information
 $asset                 = $asset->add_note($note)
 ($note_list || @notes) = $asset->get_notes()

 # Access active status
 $asset            = $asset->deactivate()
 $asset            = $asset->activate()
 ($asset || undef) = $asset->is_active()

 $asset = $asset->save()

 # returns all the groups this is a member of
 ($grps || @grps) = $asset->get_grp_ids()

DESCRIPTION
This is the parent class for all the business assets ( i.e. Stories, images etc.)

Assumption here is that all Business assets have rights, publish dates and keywords associated with them.

This class contains all the interfact to these data points

INTERFACE

  Constructors

$asset = Bric::Biz::Asset::Business->new( $initial_state )
    new will only be called by Bric::Biz::Asset::Business's inherited classes

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  Destructors

$self->DESTROY
    Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

my $key_name = Bric::Biz::Asset::Business->key_name()
    Returns the key name of this class.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$meths = Bric::Biz::Asset::Business->my_meths
(@meths || $meths_aref) = Bric::Biz::Asset::Business->my_meths(TRUE)
my (@meths || $meths_aref) = Bric::Biz:::Asset::Business->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.

  Public Instance Methods

$title = $asset->get_title()
    Returns the title field for this asset

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    title is the same as the name field

$asset = $asset->set_title($title)
    sets the title for this asset

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    title is the same as the name field

$alias_id = $biz->get_alias_id()
    Returns the alias id from this business asset

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$biz = $biz->set_source__id($s_id)
    Sets the source id upon this story

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$source = $biz->get_source__id()
    Returns the source id from this business asset

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$at_id = $biz->get_element__id()
    Returns the asset type id that this story is associated with

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$biz = $biz->set_element__id($at_id)
    Sets the asset type id that this story is associated with.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

my $primary_oc_id = $p->get_primary_oc_id
    Returns the asset's primary output channel ID.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

my $oc = $p->get_primary_oc
    Returns the primary output channel object.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$self = $p->set_primary_oc_id($primary_oc_id)
    Sets the asset's primary output channel ID.

    Throws: NONE.

    Side Effects: The URIs for the asset will be changed.

    Notes: NONE.

$biz->add_contributor($contrib, $role );
    Takes a contributor object or id and their role in the context of this story and associates them

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

($contribs || @contribs) = $story->get_contributors()
    Returns a list or list ref of the contributors that have been assigned to this story

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$role = $biz->get_contributor_role($contrib)
    Returns the role played by this contributor

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$story = $story->delete_contributors( $contributors )
    Recieves a list of contributrs or their ids and deletes them from the story

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$asset = $asset->reorder_contributors(@contributors)
    Takes a list of ids and sets the new order upon them

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

my @ocs = $biz->get_output_channels
my $ocs_aref = $biz->get_output_channels
my @ocs = $biz->get_output_channels(@oc_ids)
my $ocs_aref = $biz->get_output_channels(@oc_ids)
    Returns a list or anonymous array of the output channels the business asset will be output to when it is published. If @oc_ids is passed, then only the output channels with those IDs are returned, if they're associated with this asset.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   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.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

$ba = $ba->add_output_channels(@ocs)
    Adds output channels to the list of output channels to which this story will be output upon publication.

    Throws: NONE.

    Side Effects: NONE.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   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.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

$biz = $biz->del_output_channels(@ocs)
$biz = $biz->del_output_channels(@oc_ids)
    Removes output channels from this asset, so that it won't be output to these output channels when it is published.

    Throws: NONE.

    Side Effects: NONE.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   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.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

get_element_name()
    Returns the name of the asset type that this is based on. This is the same as the name of the top level tile.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

get_element_key_name()
    Returns the key name of the asset type that this is based on. This is the same as the key name of the top level tile.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

(@parts || $parts) = $biz->get_possible_data()
    Returns the possible data that can be added to the top level tile of this business asset based upon rules defined in asset type

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

(@containers || $containers) = $biz->get_possible_containers()
    Returns the containers that are possible to add to the top level container of this businesss asset

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $story->set_cover_date($cover_date)
    Sets the cover date.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to unpack date.

    *   Unable to format date.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects:

    NONE

    Notes:

    NONE

my $cover_date = $story->get_cover_date($format)
    Returns cover date.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to unpack date.

    *   Unable to format date.

    Side Effects:

    NONE

    Notes:

    NONE

my $first_publish_date = $story->get_first_publish_date($format)
    Returns the date the business asset was first published.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to unpack date.

    *   Unable to format date.

    Side Effects: NONE.

    Notes: NONE.

$self = $story->set_publish_date($publish_date)
    Sets the publish date.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to unpack date.

    *   Unable to format date.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects:

    Also sets the first publish date if it hasn't been set before.

    Notes:

    NONE

my $publish_date = $story->get_publish_date($format)
    Returns publish date.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to unpack date.

    *   Unable to format date.

    Side Effects: NONE.

    Notes: NONE.

(@objs || $objs) = $asset->get_related_objects
    Return all the related story or media objects for this business asset.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$element = $ba->get_element
     my $element = $ba->get_element;
     $element = $ba->get_tile; # Deprecated form.

    Returns the top level element that contains content for this document.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$uri = $biz->get_primary_uri
    Returns the primary URL for this business asset. The primary URL is determined by the pre- and post- directory strings of the primary output channel, the URI of the business object's asset type, and the cover date if the asset type is not a fixed URL.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$bool = $biz->is_fixed
    Returns a boolean value: true if the business asset has a fixed URL (for example, a Cover), false otherwise.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

($tiles || @tiles) = $biz->get_tiles()
    Returns the tiles that are held with in the top level tile of this business asset. Convenience shortcut to "$ba->get_tile->get_tiles".

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$ba = $ba->add_data( $atd_obj, $data )
    This will create a tile and add it to the container. Convenience shortcut to "$ba->get_tile->add_data".

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$new_container = $ba->add_container( $atc_obj )
    This will create and return a new container tile that is added to the current container. Convenience shortcut to "$ba->get_tile->add_container".

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$data = $ba->get_data( $name, $obj_order )
$data = $ba->get_data( $name, $obj_order, $format )
    Returns the data of a given name and object order. Convenience shortcut to "$ba->get_tile->get_data".

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$container = $ba->get_container( $name, $obj_order )
    Returns a container object of the given name that falls at the given object order position. Convenience shortcut to "$ba->get_tile->get_container".

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$ba = $ba->add_keywords(@keywords);
$ba = $ba->add_keywords(\@keywords);
$ba = $ba->add_keywords(@keyword_ids);
$ba = $ba->add_keywords(\@keyword_ids);
    Associates a each of the keyword in a list or array reference of keywords with the business asset.

    Throws: NONE.

    Side Effects: NONE

    Notes: NONE

@keywords = $cat->get_keywords;
@keywords = $cat->get_keywords(@keyword_ids);
    Returns a list of keyword objects associated with this business asset. If passed a list of keyword IDs, it will return only those keyword objects.

    Throws: NONE

    Side Effects: NONE

    Notes: NONE

$kw_aref || @kws = $asset->get_all_keywords()
    Returns an array ref or an array of keyword objects assigned to this Business Asset and to its categories.

    Throws: NONE

    Side Effects: NONE

    Notes: NONE

$ba = $ba->del_keywords(@keywords);
$ba = $ba->del_keywords(\@keywords);
$ba = $ba->del_keywords(@keyword_ids);
$ba = $ba->del_keywords(\@keyword_ids);
    Dissociates a list or array reference of keyword objects or IDs from the business asset.

    Throws: NONE.

    Side Effects: NONE

    Notes: NONE

($self || undef) = $ba->has_keyword($keyword)
    Returns true if the keyword object is associated with this asset.

    Throws: NONE.

    Side Effects: NONE

    Notes: Uses "get_keywords()" internally.

$self = $self->cancel()
    Called upon a checked out asset. This unchecks it out.

    Throws:

    "Cannot cancel a non checked out asset"

    Side Effects:

    This will remove the coresponding object from the database

    Notes:

    NONE

($ba || undef) = $ba->is_current()
    Return whether this is the most current version or not.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

= $biz = $biz->checkout( { user__id => $user_id })
    checks out the asset to the specified user

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$ba = $ba->save()
    Commits the changes to the database

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$story_name = $story->check_uri;
$story_name = $story->check_uri($user_id);
    Returns name of story that has clashing URI.

    "Notes:" This method has been deprecated. URI uniqueness is now checked by "save()", so this method is no longer strictly necessary.

  PRIVATE

  Private Class Methods

$self = $self->_init()
    Preforms functions needed to create new business assets

    Throws:

    *   Cannot create an asset without an element or alias ID.

    *   Cannot create an asset with both an element and an alias ID.

    *   Cannot create an asset without a site.

    *   Cannot create an alias to an asset in the same site.

    *   Cannot create an alias to an alias.

    *   Cannot create an alias to an asset based on an element that is not associated with this site.

    Side Effects:

    NONE

    Notes:

    NONE

  Private Instance Methods

$at_obj = $self->_construct_uri()
    Returns URI contructed from the output chanel paths, categories and the date.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$at_obj = $self->_get_element_object()
    Returns the asset type object that coresponds to this business object

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_sync_contributors()
    Syncs the contributors for this story

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$self = $self->_delete_uris;
    Deletes the URI records for this document. Called by "save()" when the document has been deactivated.

    Throws:

    Exception::DA
$self = $self->_update_uris;
    Updates the URI records for this document.

    Throws:

    Error::NotUnique
    Exception::DA

  Private Functions

my $oc_coll = $get_oc_coll->($ba)
    Returns the collection of output channels for this asset. Bric::Util::Coll::OutputChannel object. See that class and its parent, Bric::Util::Coll, for interface details.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   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.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

my $kw_coll = &$get_kw_coll($self)
    Returns the collection of keywords for this business asset. The collection is a Bric::Util::Coll::Keyword object. See that class and its parent, Bric::Util::Coll, for interface details.

    Throws:

    *   Bric::_get() - Problems retrieving fields.

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   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.

    *   Incorrect number of args to Bric::_set().

    *   Bric::set() - Problems setting fields.

    Side Effects: NONE.

    Notes: NONE.

NOTES
NONE

AUTHOR
michael soderstrom <miraso@pacbell.net>

SEE ALSO
Bric, Bric::Biz::Asset