NAME

Bric::Biz::Keyword - A general class to manage keywords.

VERSION

$Revision: 1.9 $

DATE

$Date: 2001/12/10 21:39:29 $

SYNOPSIS

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();

DESCRIPTION

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.

INTERFACE

Constructors

$obj = new Bric::Biz::Keyword($init);

Keys for $init are:

Creates a new keyword and keyword object. Takes either a keyword ID or the keyword itself.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$obj = lookup Bric::Biz::Keyword($key_id);

Retrieves an existing keyword from the database. Takes either a keyword ID or the keyword itself.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

@objs = list Bric::Biz::Keyword($param);

The possible keys to $param are the following;

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Destructors

$success = $key->delete;

Deletes the keyword from the database.

Throws:

"Delete Failed"

Side Effects:

NONE

Notes:

NONE

Public Class Methods

$val = my_meths->{$key}->[0]->($obj);

Introspect this object.

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

Public Instance Methods

$name = $key->get_name();

Returns the name of this synonym

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$name = $key->set_name($name);

Sets the name of this synonym

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$name = $key->get_screen_name();

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

$name = $key->set_screen_name($name);

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

$meaning = $key->get_meaning();

Sets the screen name of this synonym

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$meaning = $key->set_screen_name($name);

Sets the screen name of this synonym

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$bool = $key->get_prefered();

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

$success = $key->set_prefered(1 || 0);

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

$state = $key->get_state();

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

$state = $key->set_state();

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

$sets = $key->make_synonymous([$kw_id]);

Make the current keyword a synonym of other keywords by passing keys:

Throws:

NONE

Side Effects:

NONE

Notes:

NONE

$success = $key->save;

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

Private Methods

Private Class Methods

NONE

Private Instance Methods

NONE

NOTES

NONE

AUTHOR

"Garth Webb" <garth@perijove.com> Bricolage Engineering

SEE ALSO

perl, Bric, Bric::Util::Grp::Keyword, Bric::Biz::Category

POD ERRORS

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

Around line 377:

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

Around line 388:

'=item' outside of any '=over'

Around line 418:

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

Around line 424:

'=item' outside of any '=over'

Around line 514:

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

Around line 520:

'=item' outside of any '=over'

Around line 852:

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

Around line 969:

=back without =over