NAME

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

VERSION

$Revision: 1.16 $

DATE

$Date: 2002/08/30 18:06:55 $

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:

object

The object to search for containers - must be a Bric::Biz::Asset::Business subclass. You must specify this parameter or object_type.

object_type

The type of object to find containers for - 'story' or 'media'. You must specify this parameter or object.

active

Find inactive stuff by setting this to 0, active with 1.

element_id

Find containers of a particular AssetType.

name

The name of the AssetType for the container

parent_id

Find containers with a given parent container.

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:

object

The object to search for containers - must be a Bric::Biz::Asset::Business subclass. You must specify this parameter or object_type.

object_type

The type of object to find containers for - 'story' or 'media'. You must specify this parameter or object.

active

Find inactive stuff by setting this to 0, active with 1.

element_id

Find containers of a particular AssetType.

name

The name of the AssetType for the container

parent_id

Find containers with a given parent container.

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 at this moment. Takes into account the current set of data elements added.

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. This is synonymous with AssetType->get_containers() since containers don't support occurence constraints.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

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

Takes an asset type data object and the data and creates a tile and then adds the tile to its self. Optionally accepts an $place argument to set the place property. 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)
$string = $tile->get_data($name, $obj_order, $date_format)

This method will search the contained tiles for one with the coresponding name ane object order field. It will then return the data from that data tile. Pass in the optional $date_format argument if you expect the data returned from $name to be of the date type, and you'd like a format other than that set in the "Date Format" preference.

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 object 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:

Doesn't actually do any deletions, just schedules them. Call save() to complete the deletion.

$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 412:

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

Around line 414:

'=item' outside of any '=over'

Around line 427:

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

Around line 431:

'=item' outside of any '=over'

Around line 489:

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

Around line 495:

'=item' outside of any '=over'

Around line 1380:

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

Around line 1388:

'=item' outside of any '=over'

Around line 1505:

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

Around line 1507:

'=item' outside of any '=over'