Bric::Biz::Keyword - A general class to manage keywords.
$Revision: 1.2.2.3 $
$Date: 2001/12/10 21:00:27 $
use Bric::Biz::Keyword;
# Create a new keyword object.
my $key = new Bric::Biz::Keyword($init);
# Lookup an existing keyword.
my $key = new Bric::Biz::Keyword($key_id);
# Create a list of keyword objects.
my $key = list Bric::Biz::Keyword($param);
# Get/set the keyword name.
$name = $key->get_name();
$success = $key->set_name($name);
# Get/set the screen (display) name.
$screen = $key->get_screen_name();
$success = $key->set_screen_name($screen);
# Get/set the meaning of this keyword
$meaning = $key->get_meaning();
$success = $key->set_meaning($meaning);
# Get/set the prefered flag
$bool = $key->get_prefered();
$success = $key->set_prefered();
# Get/set the state State can be 'pending', 'rejected' or 'accepted'.
$state = $key->get_state();
$state = $key->set_state();
# Add a keyword to a list of synonyms..
$sets = $key->make_synonymous($keyword_id || $keyword_obj);
# Save this asset to the database.
$success = $key->save();
# Delete this asset from the database.
$success = $key->delete();
The Keyword module allows assets to be characterized by a set of topical keywords. These keywords can be used to group assets or during a search on a particular topic.
Keywords can have synonyms which can be used to determine sets of assets that are categorically similar. Out of a group of synonymous keywords one can be marked as preferred which means that all other synonyms will behave as if they were the preferred keyword.
Additionally keys associated with an asset can be weighted according to relevance.
Keys for $init are:
name
The name of this keyword
screen_name
The way this name should be displayed on screen (ie name='George', screen name='George Washington')
meaning
The specific meaning of this keyword to differentiate it from different synonyms.
prefered
Whether this is the prefered synonym when this keyword has synonyms.
Creates a new keyword and keyword object. Takes either a keyword ID or the keyword itself.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Retrieves an existing keyword from the database. Takes either a keyword ID or the keyword itself.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
The possible keys to $param are the following;
synonyms
Returns all the synonyms for the given keyword or keyword ID.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Deletes the keyword from the database.
Throws:
"Delete Failed"
Side Effects:
NONE
Notes:
NONE
Introspect this object.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the name of this synonym
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the name of this synonym
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Returns the screen name of this synonym. The screen name is how the synonym should be displayed on screen (i.e. name='george' screen_name='Washington, George')
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the screen name of this synonym. If no meaning is given, the default meaning '_default' will be used.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the screen name of this synonym
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the screen name of this synonym
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
A keyword can be marked as preferred. A preferred keyword is a keyword in a list of synonyms that should be used in preference to any other synonymous keywords.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Set the preferred flag for this keyword. See the 'is_preferred' method for more information on preferred keywords.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Get the state of this keyword. The state can be one of 'pending', 'rejected', 'accepted' or 'active'.
A state of 'pending' means that the keyword has been suggested, but has not yet been confirmed to be an accepted keyword by the asset owner.
A state of 'rejected' means that the keyword has been rejected as a possible keyword for this asset. However, at any point up until the asset finishes passing through the workflow, it can be promoted to 'accepted' by another owner of the asset.
A state of 'accepted' means that the keyword has been accepted as a valid keyword. At any point up until the asset finishes passing through the workflow, this keyword can still be marked as 'rejected' by another owner of the asset.
A state of 'active' means that the keyword has been accepted and cannot be marked as 'accepted' or 'rejected' during the workflow. The state of a keyword becomes 'active' if its state is 'accepted' when the asset with which it was associated reaches the end of the workflow.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Sets the state of this keyword. See method 'get_state' for list of the possible states and their descriptions.
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Make the current keyword a synonym of other keywords by passing keys:
keyword_id
A keyword object ID
Throws:
NONE
Side Effects:
NONE
Notes:
NONE
Save the keyword and/or all changes to the database.
Throws:
"Unable to save";
Side Effects:
Will give default values to screen_name and sort_name if they are not set.
Notes:
NONE
NONE
NONE
NONE
"Garth Webb" <garth@perijove.com> Bricolage Engineering
perl, Bric, Bric::Util::Grp::Keyword, Bric::Biz::Category
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'
You forgot a '=back' before '=head2'
'=item' outside of any '=over'
You forgot a '=back' before '=head2'
=back without =over