NAME

Bric::Biz::Asset::Business::Parts::Tile::Container - The class that contains other tiles

VERSION

$Revision: 1.7.2.2 $

DATE

$Date: 2002/02/14 20:00:21 $

SYNOPSIS

# Creation of Objects
$tile = Bric::Biz::Asset::Business::Parts::Tile::Container->new
                ($initial_state)
$tile = Bric::Biz::Asset::Business::Parts::Tile::Container->lookup
                ( { id => $id })
($tile_list, @tiles) = 
        Bric::Biz::Asset::Business::Parts::Tile::Container->list( $criteria )
($id_list || @ids) = 
        Bric::Biz::Asset::Business::Parts::Tile::Container->list_ids($criteria)


$tile = $tile->add_contained( [ $tiles])
( $t_list || @tiles ) = $tile->get_contained()
$tile = $tile->delete_contained( [ $tiles])
$tile = $tile->is_container();
$tile = $tile->reorder->( @new_order )

DESCRIPTION

This is the class for tiles that contain other tiles. These can be data tiles and or other container tiles.

INTERFACE

Constructors

$tile = Bric::Biz::Asset::Business::Parts::Tile::Container->new($init)

This will create a new tile object with the given state defined by the optional initial state argument

Supported Keys:

throws:

"Object of type $class not allowed"

side effects:

NONE

notes:

NONE

$tile = Bric::Biz::Asset::Business::Parts::Tile->lookup( { id => $id } )

This will return an existing tile object that is defined by the given id

throws:

"Missing required Parameter 'id'"

"Missing required Parameter 'object_type' or 'object'"

'Improper type of object passed to lookup'

side effects:

NONE

notes:

NONE

(@tiles||$tiles) = Bric::Biz::Assets::Parts::Tile::Container->list($param)

This will return a list or list ref of tiles that match the given criteria

Supported Keys:

throws: NONE

side effects: NONE

notes: NONE

Destructors

$self->DESTROY

Public Class Methods

(@ids||$ids) = Bric::Biz::Assets::Parts::Tile::Container->list_ids($param)

This will return a list or list ref of tile ids that match the given criteria

Supported Keys:

throws: NONE

side effects: NONE

notes: NONE

Public Instance Methods

$id = $container->get_related_instance_id()

Returns the ID of the story instance related to this container tile

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$container = $container->set_related_instance_id($id)

Set the ID of the story instance related to this container tile

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$story = $container->get_related_story()

Instantiate the related instance to this container tile based on the id. This named 'get_related_story' rather than 'get_related_instance' since that is how the template designer who will use this will probably expect it to work (ie, they probably won't think in terms of an instance'.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$tile = $tile->set_related_media($media)

Sets the media object that is related to this container

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$media = $tile->get_related_media()

Returns the media object that is related to this tile

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$name = $container->get_element()

Returns the element object

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$name = $container->get_element_name()

Returns the name of the element

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($data || @data) = $container->get_possible_data()

Returns the data fields that are allowed to be added to the container

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(@tiles || $tiles) = $container->get_possible_containers()

Returns a list of the possible containers that can be added to this object

Throws:

NONE

Side Effects:

NONE

Notes:

Looks like this still needs to be finished

$container = $container->add_data($atd, data, $object);

Takes an asset type data object and the data and the object to add it to and creates a tile and then adds the tile to its self. Now that's service.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$new_container = $container->add_container()

Given an asset type and the business asset this will create a new container tile and return it after adding it to this list

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$string = $tile->get_data( $name, $obj_order)

this will search the contained tiles for one with the coresponding name ane object order field. It will then return the string that coresponds

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$contained = $container->get_container($name, $obj_order)

Similar to get data this will return a container object that matches the given name field and onbject order description.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(@containers || $containers) = $tile->get_containers()

returns a list of the sub contained tiles

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

(@tile_ids||$tile_ids_aref) = $tile->get_tiles()

Returns a list of the tiles that are contained with in the container tile

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$tile = $tile->add_tile($tile)

Adds the given tile to this container. The tile will become a child of this container and will be given an order with respect to the other child tiles already in this container.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$tile = $tile->delete_tiles->( [ $tile || { type => $type, id => $id } ] )

Removes the tiles listed from the container

Throws:

NONE

Side Effects:

Will shift the remaining tiles to fit. So if tiles with ids of 2, 4, 7, 8, and 10 are contained and 4 and 8 are removed the new list of tiles will be 2,7, and 10

Notes:

NONE

$container = $container->perpare_clone()

When a business asset needs to clone its self. It can call this here method that will set the id to undef so that this here tile will clone its self.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$tile = $tile->reorder_tiles( @new_order )

Takes a new order of tile ids as its argument and replaces the old order

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

($self || undef) $self->is_container();

will return true since this is a container. You did look at the package name, no? This is helpfuld for people cycling through contained tiles so they can decide to call get_contained or get data

throws:

NONE

Side Effects:

NONE

Notes:

NONE

$ct = $ct->do_delete()

Prepares this tile and its children to be removed

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$ct = $ct->save()

This will insert or update the records as is needed

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

PRIVATE

Private Class Methods

_do_list()

Called by list and list_ids, this does their dirty work

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Private Instance Methods

$self = $self->_do_delete()

Removes this record from the database

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_select_container($param)

This will do a select and populate the object with the row

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$at_obj = $self->_get_element_obj()

Returns the asset type object that maps to this container tile

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

_do_insert

Inserts a row relating to this object into the data base

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self = $self->_do_update()

This will preform an update on the database. That is why I called it do update

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

_get_contained

does a list for all the active contained tiles

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$self->_sync_tiles()

Called by save this will preform all the operations on the contained tiles

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

NOTES

NONE

AUTHOR

"Michael Soderstrom" <miraso@pacbell.net> Bricolage Engineering

SEE ALSO

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

POD ERRORS

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

Around line 385:

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

Around line 387:

'=item' outside of any '=over'

Around line 400:

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

Around line 404:

'=item' outside of any '=over'

Around line 435:

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

Around line 441:

'=item' outside of any '=over'

Around line 1318:

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

Around line 1326:

'=item' outside of any '=over'

Around line 1439:

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

Around line 1441:

'=item' outside of any '=over'