Bric::Biz::Asset::Business::Parts::Tile::Data(3)

NAME
Bric::Biz::Asset::Business::Parts::Tile::Data - Data (Field) Element

VERSION
$LastChangedRevision$

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

SYNOPSIS
  # Creation of New Objects
  $data = Bric::Biz::Asset::Business::Parts::Tile::Data->new($params);
  $data = Bric::Biz::Asset::Business::Parts::Tile::Data->lookup({ id => $id });
  @data = Bric::Biz::Asset::Business::Parts::Tile::Data->list($params);

  # Retrieval of Object IDs
  @ids = = Bric::Biz::Asset::Business::Parts::Tile::Data->list_ids($params);

  # Manipulation of Data Field
  $data = $data->set_data( $data_value );
  $data_value = $data->get_data;

DESCRIPTION
This class contains the contents of field elements, also known as data elements. These are the objects that hold the values of story element fields. This class inherits from Bric::Biz::Asset::Business::Parts::Tile.

INTERFACE

  Constructors

my $data = Bric::Biz::Asset::Business::Parts::Tile::Data->new($init)
    Construct a new data element object. The supported initial attributes are:

    object_type
        A string identifying the type of document the new data element is associated with. It's value can be "story " or "media".

    object_instance_id
        The ID of the story or media document the new data element is associated with.

    place
        The order of this element relative to the other subelements of the parent element.

    element_data_id
        The ID of the Bric::Biz::AssetType::Parts::Data object that defines the structure of the new data element.

    parent_id
        The ID of the container element that is the parent of the new data element.

    active
        A boolean value indicating whether the container element is active or inactive.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

my $data = Bric::Biz::Asset::Business::Parts::Tile::Data->lookup($params)
    Looks up a data element in the database by its ID and returns it. The lookup parameters are:

    id  The ID of the data element to lookup. Required.

    object
        A story or media document object with which the data element is associated. Required unless "object_type" is specified.

    object_type
        The type of document object with which the data element is associated. Must be either "media" or "story". Required unless "object" is specified.

    Throws:

    Missing required Parameter 'id'.
    Missing required Parameter 'object_type' or 'object'.
    Improper type of object passed to lookup.

    Side Effects: NONE.

    Notes: NONE.

my @data = Bric::Biz::Assets::Business::Parts::Tile::Data->list($params)
    Searches for and returns a list or anonymous array of data element objects. The supported parameters that can be searched are:

    object
        A story or media object with which the data elements are associated. Required unless "object_type" is specified.

    object_type
        The type of document with which the data elements are associated. Required unless "object" is specified.

    object_instance_id
        The ID of a story or data object with wich the data elements are associated. Can only be used if "object_type" is also specified and "object" is not specified.

    name
        The name of the data elements. Since the SQL "LIKE" operator is used with this search parameter, SQL wildcards can be used.

    key_name
        The key name of the data elements. Since the SQL "LIKE" operator is used with this search parameter, SQL wildcards can be used.

    parent_id
        The ID of the container element that is the parent element of the data elements.

    element_data_id
        The ID of the Bric::Biz::AssetType::Parts::Data object that specifies the structure of the data elements.

    active
        A boolean value indicating whether the returned data elements are active or inactive.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

  Destructors

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

  Public Class Methods

my @ids = Bric::Biz::Assets::Business::Parts::Tile::Data->list_ids($params)
    Returns a list or anonymous array of data element IDs. The search parameters are the same as for "list()".

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

  Public Instance Methods
See also Bric::Biz::Asset::Business::Parts::Tile, from which Bric::Biz::Asset::Business::Parts::Tile::Data inherits.

my $element_data_id = $data->get_element_data_id
    Returns the ID of the Bric::Biz::AssetType::Parts::Data object that describes this element.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$data->set_element_data_id($element_data_id)
    Sets the ID of the Bric::Biz::AssetType::Parts::Data object that describes this element.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$atd = $data->get_element_data_obj
    Returns the Bric::Biz::AssetType::Parts::Data object that defines the structure of this data element.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$name = $data->get_element_name
    An alias for "$data->get_name".

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$key_name = $data->get_element_key_name
    An alias for "$data->get_key_name".

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$data->set_data($value)
    Sets the value of the data element.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

my $value = $data->get_data
my $value = $data->get_data($format)
    Returns the value of this data element. If the SQL type of the data object is "date", then $format, if it is passed, will be used to format the date. Otherwise, the format set in the preferences will be used.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$data->prepare_clone
    Prepares the data element to be cloned, such as when a new version of a document is created, or when a document itself is cloned.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

my $is_container = $data->is_container
    Returns false, since data elements are not container elements.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

my $is_autopopulated = $data->is_autopopulated
    Returns true if this data element's value is autopopulated.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$data->lock_val
    For autopopulated data elements, this method prevents the value from being autopopulated.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$data = $data->unlock_val
    Allows auotpopulated data elements to be autopopulated.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

my $is_locked = $data->is_locked
    Returns true if the tile has been locked.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$data = $data->save
    Saves the changes to the data element to the database.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

PRIVATE

  Private Class Methods

Bric::Biz::Asset::Business::Parts::Tile::Data->_do_list($class, $param, $ids)
    Called by "list()" or "list_ids()", this method returns either a list of ids or a list of objects, depending on the third argument.

    Throws:

    *   Object of type $obj_class not allowed to be tiled.

    *   Improper args for list.

    Side Effects: NONE.

    Notes: NONE.

  Private Instance Methods

$data->_do_insert()
    Called by "save()", this method inserts the data element into the database.

    Throws:

    *   Object must be a media or story to add tiles.

    Side Effects: NONE.

    Notes: NONE.

$data->_do_update
    Called by "save()", this method updates the data element into the database.

    Throws:

    *   Object must be a media or story to add tiles.

    Side Effects: NONE.

    Notes: NONE.

$attr_obj = $self->_get_sql_type
    Returns the sql type for the value of this data element.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$name = $self->_get_table_name()
$name = _get_table_name($object_type);
    Returns the name of the table this data element uses. This method can act as a class or instance method depending on how it's called.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

NOTES
NONE

AUTHOR
Michael Soderstrom <miraso@pacbell.net>

SEE ALSO
perl, Bric, Bric::Biz::Asset, Bric::Biz::Asset::Business, Bric::Biz::Asset::Business::Parts::Tile