Bric::Biz::Category - A module to group assets into categories.
$Revision: 1.6 $
$Date: 2001/12/04 18:17:44 $
# Return a new category object.
my $cat = new Bric::Biz::Category($init);
my $cat = lookup Bric::Biz::Category({'id' => $cat_id});
my $cat = list Bric::Biz::Category($crit);
$cat->get_name;
$cat->get_description;
# Return a list of keywords associated with this category.
@keys = $cat->keywords();
# Return a list of assets asscociated with this category.
@assets = $cat->assets();
# Return a list of child categories of this category.
@cats = $cat->children();
# Return the parent of this category.
$parent = $cat->parent();
# Attribute methods.
$val = $element->set_attr($name, $value);
$val = $element->get_attr($name);
$val = $element->set_meta($name, $field, $value);
$val = $element->get_meta($name, $field);
# Ad string methods
$txt = $element->get_ad_string;
$element->set_ad_string($value);
$txt = $element->get_ad_string2;
$element->set_ad_string2($value);
# Add/Delete child categories for this category.
$cat->add_child([$cat || $cat_id]);
$cat->del_child([$cat || $cat_id]);
# Add/Delete keywords associated with this category.
$cat->add_keyword([$kw_id]);
$cat->del_keyword([$kw_id]);
# Add/Delete assets associated with this category.
$cat->add_asset([$asset || $asset_id]);
$cat->del_asset([$asset || $asset_id]);
# Save information for this category to the database.
$cat->save;
Allows assets to be grouped into categories. In addition to assets a category can contain other categories, allowing a hierarchical layout of categories and assets.
Create a new object of type Bric::Biz::Category
Keys for $init are:
name
The name for this category.
description
A description of this category
directory
The directory name this category should be associated with.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Return an object given an ID.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Return a list of category objects based on certain criteria
Criteria keys:
'children of'
Given a category object returns its children.
'keyword'
Given a keyword, list all category objects containing that keyword.
Throws:
"Method not implemented"
Side Effects:
NONE
Notes:
This is the default list constructor which should be overrided in all derived classes even if it just calls 'die'.
Deletes the object.
Throws:
NONE
Side Effects:
NONE
Notes:
This method should be here even if its empty so that we don't waste time making Bricolage's autoload method try to find it.
NONE
Returns an anonymous hash of instrospection data for this object. If called with a true argument, it will return an ordered list or anonymous array of intrspection data. The format for each introspection item introspection is as follows:
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:
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.
Return the name of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the name of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Return all the parent category of this category
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the list of ancestors for this category formatted into a URI.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the list of ancestors for this category formatted into a localized directory structure.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
An alias for ancestry_path().
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the description of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Get/Set ad strings on this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the description of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Get/Set attributes on this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Get/Set attribute metadata on this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns a list of keywords associated with this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns a list of assets associated with this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the children of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the parent of this category or undef if it is a top level category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Addes a category as a child of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Delete a child of this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Associates a keyword with this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Removes a keyword association from this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Add an asset to this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Removes an asset from this category.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Get/Set the active flag.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Save this category
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
NONE
NONE
This class is implimented on the backend using the group structure. The class Bric::Util::Grp::Category handles all the database interactions.
"Garth Webb" <garth@perijove.com> Bricolage Engineering
perl, Bric::Util::Grp::Category, Bric, Bric::Biz::Keyword, Bric::Biz::Asset
Hey! The above document had some coding errors, which are explained below:
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
Expected '=item *'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
=back without =over