Bric::Biz::Asset::Business::Parts::Tile::Container - Container Element
$LastChangedRevision$
$LastChangedDate: 2005-08-17 13:28:00 -0700 (Wed, 17 Aug 2005) $
# Creation of Objects
my $container = Bric::Biz::Asset::Business::Parts::Tile::Container->new($init);
my $container = Bric::Biz::Asset::Business::Parts::Tile::Container->lookup({
id => $id
});
my @containers = Bric::Biz::Asset::Business::Parts::Tile::Container->list($params);
my @ids = Bric::Biz::Asset::Business::Parts::Tile::Container->list_ids($params);
$container = $container->add_element(\@containers);
my @elements = $container->get_elements;
$container = $container->delete_elements(\@containers);
$container = $container->is_container;
$container = $container->reorder->(@new_order);
This class contains the contents of container elements, also known as story type elements, media type elements, and container subelements. These objects can contain one or more subelements, and those subelements can be either data elements or other container elements. This class inherits from Bric::Biz::Asset::Business::Parts::Tile.
Construct a new container element object. The supported initial attributes are:
A string identifying the type of document the new container element is associated with. It's value can be "story " or "media".
The ID of the story or media document the new container element is associated with.
The order of this element relative to the other subelements of the parent element.
The order of this element relative to the other container elements based on the same Bric::Biz::AsetType object that are subelements of the parent element.
The ID of the container element that is the parent of the new container element.
A Bric::Biz::AssetType object that defines the structure of this container element.
An ID for the Bric::Biz::AssetType object that defines the structure of this container element.
A boolean value indicating whether the container element is active or inactive.
Throws:
Side Effects: NONE.
Notes: NONE.
Looks up a container element in the database by its ID and returns it. The lookup parameters are:
The ID of the conainer element to lookup. Required.
A story or media document object with which the conainer element is associated. Required unless object_type is specified.
The type of document object with which the container element is associated. Must be either "media" or "story". Required unless object is specified.
Throws:
Side Effects: NONE.
Notes: NONE.
Searches for and returns a list or anonymous array of container element objects. The supported parameters that can be searched are:
A story or media object with which the container elements are associated. Required unless object_type is specified.
The type of document with which the container elements are associated. Required unless object is specified.
The ID of a story or container object with wich the container elements are associated. Can only be used if object_type is also specified and object is not specified.
The name of the container elements. Since the SQL LIKE operator is used with this search parameter, SQL wildcards can be used.
The key name of the container elements. Since the SQL LIKE operator is used with this search parameter, SQL wildcards can be used.
The ID of the container element that is the parent element of the container elements. Pass undef to this parameter to specify that the parent_id must be NULL.
The ID of the Bric::Biz::AssetType object that specifies the structure of the container elements.
A boolean value indicating whether the returned data elements are active or inactive.
Throws: NONE.
Side Effects: NONE.
Notes: NONE
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.
Returns a list or anonymous array of container element IDs. The search parameters are the same as for list().
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
See also Bric::Biz::Asset::Business::Parts::Tile, from which Bric::Biz::Asset::Business::Parts::Tile::Container inherits.
Returns the ID of the Bric::Biz::AssetType object that defines the structure of this element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Sets the ID of the Bric::Biz::AssetType object that defines the structure of this element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns the order number for this object relative to other container elements based on the same Bric::Biz::AssetType object.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Sets the order number for this object relative to other container elements based on the same Bric::Biz::AssetType object.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns the ID of a story related to this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Sets the ID of a story related to this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns the ID of a media document related to this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Sets the ID of a media document related to this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Creates a relationship between the container element and a story document.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
If a story is related to this container element, this method returns that story object.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Creates a relationship between the container element and a media document.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
If a media document is related to this container element, this method returns that media object.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns the Bric::Biz::AssetType object that defines the structure of this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
An alias for $container->get_name.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
An alias for $container->get_key_name.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns a list or anonymous array of the Bric::Biz::AssetType::Parts::Data objects that define the types of data elements that can be subelements of this container element. This list would exclude any data elements that can only be added as subelements to this container element once, and have already been added.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns a list or anonymous array of the Bric::Biz::AssetType::Parts::Data objects that define the types of data elements that can be subelements of this container element. This is synonymous with $container->get_element->get_containers, since containers do not support occurence constraints.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Pass a Bric::Biz::AssetType::Parts::Data object and a value for a new data element, and that new data element will be added as a subelement of the container element. An optional third argument specifies the place for that data element in the order of subelements of this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Adds a new container subelement to this container element. Pass in the required Bric::Biz::AssetType object specifying the structure of the new container subelement.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns a specific data subelement of this container element. Pass in the key name of the data element to be retreived. By default, the first data element with that key name will be returned. Pass in an optional second argument to specify the object_order of the data element to be retrieved.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
my @data = $element->get_data_elements;
@data = $element->get_data_elements(@key_names);
Returns a list or anonymous array of the data subelements of this element. If called with no arguments, it returns all of the data subelements. If passed a list of key names, the only the data subelements with those key names will be returned.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns the value of a specific data subelement of this container element. Pass in the key name of the data element to be retreived. By default, the first data element with that key name will be returned. Pass in an optional second argument to specify the object_order of the data element to be retrieved. Pass in the optional $date_format argument if you expect the data returned from $key_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.
Returns a specific conainer subelement of this container element. Pass in the key name of the container element to be retreived. By default, the first container element with that key name will be returned. Pass in an optional second argument to specify the object_order of the container element to be retrieved.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
my @containers = $element->get_containers;
@containers = $element->get_containers(@key_names);
Returns a list or anonymous array of the container subelements of this container subelement. If called with no arguments, it returns all of the container subelements. If passed a list of key names, the only the container subelements with those key names will be returned.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Returns a list or anonymous array of all of the data and container subelements of this container subelement, in the order specified by their place attributes. If called with no arguments, it returns all of the subelements. If passed a list of key names, the only the subelements with those key names will be returned.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
An alias for get_elements(), provided for backwards compatability.
Adds an element to the current container element as a subelement. It will be given a place attribute and an object_order attribute relative to the other subelements of this container element.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
An alias for add_element(), provided for backwards compatability.
Removes the specified subelements from the current element. The arguments that can be passed via the array reference can be either container or data element objects or hash references with the following keys:
The type of element to be deleted. The value of this parameter must be either "data" or "container".
The ID of the element to be deleted.
Throws: NONE.
Side Effects: Will shift and reorder the remaining subelements to fit. So if telements 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.
An alias for delete_elements(), provided for backwards compatability.
Prepares the conainer 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.
Pass in an array reference of subelements in the order they are to be placed relative to one another, and they will be reordered in that order.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
An alias for reorder_elements(), provided for backwards compatability.
Returns true, since container elements are, in fact, container elements.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Prepares this container element and its subelements to be removed.
Throws: NONE.
Side Effects: NONE.
Notes: NONE
Saves the changes to the container element to the database.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
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: NONE.
Side Effects: NONE.
Notes: NONE.
Called by save(), this method deletes the container element from the database.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Called by lookup(), this method actually looks a container element up in the database.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Called by save(), this method inserts the container element into the database.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Called by save(), this method updates the container element into the database.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
Called by save() this method preforms all the operations on the subelements.
Throws: NONE.
Side Effects: NONE.
Notes: NONE.
NONE
"Michael Soderstrom" <miraso@pacbell.net> Bricolage Engineering
perl, Bric, Bric::Biz::Asset, Bric::Biz::Asset::Business, Bric::Biz::Asset::Business::Parts::Tile