NAME

Bric::SOAP::Workflow - SOAP interface to Bricolage workflow.

VERSION

$Revision: 1.9 $

DATE

$Date: 2002/05/01 22:20:29 $

SYNOPSIS

use SOAP::Lite;
import SOAP::Data 'name';

# setup soap object to login with
my $soap = new SOAP::Lite
  uri      => 'http://bricolage.sourceforge.net/Bric/SOAP/Auth',
  readable => DEBUG;
$soap->proxy('http://localhost/soap',
             cookie_jar => HTTP::Cookies->new(ignore_discard => 1));
# login
$soap->login(name(username => USER), 
               name(password => PASSWORD));

# set uri for Workflow module
$soap->uri('http://bricolage.sourceforge.net/Bric/SOAP/Workflow');

DESCRIPTION

This module provides a SOAP interface to manipulating Bricolage workflow. This include facilities for moving objects onto desks, checkin, checkout, publishing and deploying.

INTERFACE

Public Class Methods

publish

This method handles the publishing of story and media objects. Returns "publish_ids", an array of "story_id" and/or "media_id" integers published. The method accepts the following parameters:

story_id

A single story to publish.

media_id

A single media object to publish.

publish_ids

A list of "story_id" and/or "media_id" elements to be published.

publish_related_stories

If this is set to true then related stories will be published too. In the web interface this happens if and only if the related stories have never been published before. This option is off by default.

publish_related_media

If this is set to true then related media will be published too. In the web interface this happens if and only if the related media objects have never been published before. This option is false by default.

to_preview

Set this to true to publish to the preview destination instead of the publish destination. This will fail if PREVIEW_LOCAL is On in bricolage.conf.

Throws: NONE

Side Effects: Stories and media have their publish_status field set to true.

Notes: Would be nice to implement "publish_date" option for delayed publish here.

The code for this method came mostly from comp/widgets/publish/callback.mc. It would be nice to collect this code in a module so it could be kept in one place.

deploy

This method handles deploying templates. The method returns "deploy_ids", a lits of "template_id" integers deployed on success. The method accepts the following parameters:

template_id

A single template to publish.

deploy_ids

A list of "template_id" elements to be published.

Throws: NONE

Side Effects: Templates have their deploy_status set to true.

Notes: Code here comes from comp/widgets/desk/callback.mc. It might be cool to move this code into a module so it could be shared. It's not nearly as gnarly as the publish() code though.

checkout

This method checks out a story, media and/or template objects. After this call the objects are visible on the user's workspace in the web interface and are not available for other users to edit.

An error will result if you try to checkout an object that is not checked in.

The method returns a list of ids checked out on success.

The method accepts the following parameters:

story_id

A single story to checkout.

media_id

A single media object to checkout.

template_id

A single template object to checkout.

checkout_ids

A list of "story_id", "template_id" and/or "media_id" elements to be checked out.

Throws: NONE

Side Effects: NONE

Notes: NONE

checkin

This method checks in a story, media and/or template objects. After this call the objects are no longer visible on the user's workspace in the web interface and are available for other users to edit.

An error will result if you try to checkin an object that is not checked out.

The method returns a list of ids checked in.

The method accepts the following parameters:

story_id

A single story to checkin.

media_id

A single media object to checkin.

template_id

A single template object to checkin.

checkin_ids

A list of "story_id", "template_id" and/or "media_id" elements to be checked in.

Throws: NONE

Side Effects: NONE

Notes: NONE

move

This method moves objects between workflows and desks. The method returns a list of ids moved. The method accepts the following parameters:

desk (required)

The name of the desk to move to.

workflow

The name of the workflow to move to. If this is unspecified then desk must refer to a desk in the current workflow for the object. If specified then only one type of object can be successfully moved since workflows are type-specific, I think.

story_id

A single story to move.

media_id

A single media object to move.

template_id

A single template object to move.

move_ids

A list of "story_id", "template_id" and/or "media_id" elements to be checked in.

Throws: NONE

Side Effects: NONE

Notes: NONE

Private Class Methods

@ids = _collect_ids("publish_ids", [ "story_id", "media_id" ], $env);

This method takes care of extracting a collating the id parameters accepted by the above methods. The result is an array of SOAP::Data objects with name() and value() set accordingly.

Throws: NONE

Side Effects: NONE

Notes: I bet this method is inefficient. Using XPath syntax just feels slow...

AUTHOR

Sam Tregar <stregar@about-inc.com>

SEE ALSO

Bric::SOAP

POD ERRORS

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

Around line 835:

You forgot a '=back' before '=head1'