man Bric::Biz::Workflow::Parts::Desk () - Desks in Workflow

NAME

Bric::Biz::Workflow::Parts::Desk - Desks in Workflow

VERSION

$LastChangedRevision$

DATE

$LastChangedDate: 2005-07-18 12:53:16 -0700 (Mon, 18 Jul 2005) $

SYNOPSIS

 use Bric::Biz::Workflow::Parts::Desk;

 my $desk = new Bric::Biz::Workflow::Parts::Desk($init);

 my $desk = lookup Bric::Biz::Workflow::Parts::Desk($param);

 my @dsks = list Bric::Biz::Workflow::Parts::Desk($param);

 my $name = $desk->get_name;
 my $desk = $desk->set_name($name);

 my $dscr = $desk->get_description;
 my $desk = $desk->set_description($dscr);

 $desk    = $desk->link_desk($param)

 $desk    = $desk->unlink_desk({});

 $desk    = $desk->add_rule({'rule_pkg'  => $pkg,
                             'rule_name' => $name})

 $desk    = $desk->del_rule({'rule_pkg'  => $pkg, 'rule_name' => $name});

 # Return a list of assets on this desk.
 @assets  = $desk->assets();

 # Transfer a asset to a different desk.
 $ret     = $desk->transfer($asset_obj, $another_desk);

 # Accept a asset from another desk.
 $ret     = $desk->accept($asset_obj);

 $desk    = $desk->save;

DESCRIPTION

A desk is something that defines the steps in a workflow. Assets arrive at a desk and remain there until they are approved and moved to the next desk in the workflow.

A desk may have any number of assets associated with it at any time. Users may checkout copies of these assets from the desk, make changes to them and check them back into the desk. Users may also get read only copies.

INTERFACE

Constructors

The following is a list of parameter keys and their associated values. Keys for CW$init are:

*
name The name of this desk
*
description A description of this desk
*
publish Boolean; true if this is a publish desk Throws: NONE Side Effects: NONE Notes: NONE Looks up and instantiates a new Bric::Biz::Workflow::Parts::Desk object based on the Bric::Biz::Workflow::Parts::Desk object ID or name passed. If CW$id or CW$name is not found in the database, CWlookup() returns CWundef. Throws:
*
Unable to prepare SQL statement.
*
Unable to connect to database.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle.
*
Too many Bric::Biz::Workflow::Parts::Desk objects found. Side Effects: NONE. Notes: NONE.
@objs = Bric::Biz::Workflow::Parts::Desk->list($param);
Returns a list of desk objects based on CW$param. Keys of CW$param are: Return all desks matching a certain name Return all desks with a matching description. Boolean; returns all desks that can or cannot publish assets. Boolean; Return all in/active desks. Return all desks in the group corresponding to this group ID. Throws:
*
Unable to prepare SQL statement.
*
Unable to connect to database.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. Side Effects: NONE. Notes: Searches against CWname and CWdescription use the LIKE operator, so '%' can be used for substring searching. Return a list of desk IDs. See CWlist() for a list of the relevant keys in the CW$params hash reference. Throws:
*
Unable to prepare SQL statement.
*
Unable to connect to database.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. Side Effects: NONE. Notes: Searches against CWname and CWdescription use the LIKE operator, so '%' can be used for substring searching.

Destructors

$self->DESTROY
Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

Public Class Methods

Returns an anonymous hash of introspection data for this object. If called with a true argument, it will return an ordered list or anonymous array of introspection data. If a second true argument is passed instead of a first, then a list or anonymous array of introspection data will be returned for properties that uniquely identify an object (excluding CWid, which is assumed). 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:
short
date
blob
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 representing the values and display names to use in a select list. Throws: NONE. Side Effects: NONE. Notes: NONE.

Public Instance Methods

Return a list of assets on this desk. Throws: NONE Side Effects: NONE Notes: NONE Checkin/checkout an asset from this desk. Throws: NONE Side Effects: NONE Notes: NONE Transfer an asset to a different desk. Keys for CW$param are:

*
asset An asset object.
*
to The desk to which this asset should be transfered. Throws: NONE Side Effects: NONE Notes: NONE Accept an asset from another desk. Keys for CW$param are:
*
from The desk from which this asset is coming. Can be omitted if this is the first desk in the workflow.
*
asset The asset to accept. Throws: NONE Side Effects: NONE Notes: NONE Remove an asset from this desk. Throws: NONE Side Effects: NONE Notes: NONE Return a list of assets on this desk. Throws: NONE Side Effects: NONE Notes: NONE Return an anonymous hash of assets on this desk. The keys are the key names of the class of each asset, and the values are anonymous arrays of the assets of that type. Throws: NONE. Side Effects: NONE. Notes: NONE. Get/Set is-publish-desk flag. Throws: NONE Side Effects: NONE Notes: NONE Get/Set the active flag. Throws: NONE Side Effects: NONE Notes: NONE
$desk->remove;
Get/Set the active flag. Throws: NONE Side Effects: NONE Notes: NONE Checks the user to see if s/he has the right privileges to checkout stories. Throws: NONE Side Effects: NONE Notes: NONE

PRIVATE

Private Class Methods

NONE

Private Instance Methods

A few of these still need documenting.

_sync_checkin
_sync_checkout
_sync_transfer
Retrieve the group object if it's set in this object. Otherwise, try to look it up via the ID field passed. Throws: NONE Side Effects: NONE Notes: NONE Insert values into the Desk table from the desk structure. Throws: NONE Side Effects: NONE Notes: NONE Update values from the desk structure. Throws: NONE Side Effects: NONE Notes: NONE Remove this desk. Throws: NONE Side Effects: NONE Notes: NONE

Private Functions

Function used by CWlookup() and CWlist() to return a list of Bric::Biz::Workflow::Parts::Desk objects or, if called with an optional third argument, returns a list of Bric::Biz::Workflow::Parts::Desk object IDs (used by CWlist_ids()). Throws:

*
Unable to prepare SQL statement.
*
Unable to connect to database.
*
Unable to select column into arrayref.
*
Unable to execute SQL statement.
*
Unable to bind to columns to statement handle.
*
Unable to fetch row from statement handle. Side Effects: NONE. Notes: NONE.

NOTES

NONE

AUTHOR

Garth Webb <garth@perijove.com>

SEE ALSO

Bric, Bric::Biz::Workflow, perl