man Bric::SOAP::Util () - utility class for the Bric::SOAP classes

NAME

Bric::SOAP::Util - utility class for the Bric::SOAP classes

VERSION

$LastChangedRevision$

DATE

$LastChangedDate: 2005-07-14 18:23:31 -0700 (Thu, 14 Jul 2005) $

SYNOPSIS

  use Bric::SOAP::Util qw(category_path_to_script)

  my $category_id = category_path_to_id($path);

DESCRIPTION

This module provides various utility methods of use throughout the Bric::SOAP classes.

INTERFACE

Exportable Functions

$category_id = category_path_to_id($path)
Returns a category_id for the path specified or undef if none match. Throws: NONE Side Effects: NONE Notes: NONE
$output_channel_id = output_channel_name_to_id($path)
Returns an output channel ID for an output channel name. Throws: NONE Side Effects: NONE Notes: NONE
$workflow_id = workflow_name_to_id($path)
Returns a workflow ID for a workflow name. Throws: NONE Side Effects: NONE Notes: NONE
$site_id = site_path_to_id($path)
Returns a site_id for the path specified or undef if none match. Throws: NONE Side Effects: NONE Notes: NONE
$db_date = xs_date_to_db_date($xs_date)
Transforms an XML Schema dateTime format date to a database format date. Returns undef if the input date is invalid. Throws: NONE Side Effects: NONE Notes: NONE
$xs_date = db_date_to_xs_date($db_date)
Transforms a database format date into an XML Schema dataTime format date. Returns undef if the input date is invalid. Throws: NONE Side Effects: NONE Notes: NONE Parses an XML asset document and returns a hash structure. Inside the hash singular elements are stored as keys with scalar values. Potentially plural values are stored as array-ref values whether they're present multiple times in the document or not. This routine dies on parse errors with information about the error. After the document parameter you can pass extra items for the force_array XML::Simple option. At some point in the future this method will be augmented with XML Schema validation. Throws: NONE Side Effects: NONE Notes: NONE Creates the <elements> structure for a Story or Media object given the object and the args to export(). Returns a list of two-element arrays - [ media, CW$id ] or [ story, CW$id ]. These are the related objects serialized. Sets the output channels on a business asset. If it's a new asset, all of the output channels in the CW$ocdata array reference will be loaded into the asset. If the asset is being updated, then CWload_ocs() compares the output channels in CW$ocdata to those in the asset and adds and removes the appropriate output channels. The arguments are: The business asset with which to associate the output channels. The array reference of output channels from the SOAP data, e.g., CW$data-{stories}{story}[0]{output_channels}{output_channel}. A hash reference of the output channels in the element that defines the asset (i.e., the story type element or the media type element). The hash keys are the output channel names, and the values are the corresponding output channel objects. The key name for the class of asset being updated, either story or media. Boolean value indicating whether CW$asset is being updated or not. Throws: NONE Side Effects: NONE Notes: Only call this function if there is output channel data to be managed in the XML data. If there isn't, don't call this function, and the output channels in an asset will be left unchanged. Loads an asset object with element data from the data hash. Calls _deserialize_tile recursively down through containers. Throws: NONE Side Effects: NONE Notes:

Private Class Methods

Deserializes a single tile from <elements> data into CW$element. Calls recursively down through containers building up fixup data from related objects in CW@related. Throws: NONE Side Effects: NONE Notes: This method isn't checking compliance with the asset type constraints in some cases. After Bric::SOAP::Element is done I should contain the kung-fu necessary for this task. Serializes a single tile into the contents of an <elements> tag in the media and story elements. It calls itself recursively on containers. Returns a list of two-element arrays - [ media, CW$id ] or [ story, CW$id ]. These are the related objects serialized.

AUTHOR

Sam Tregar <stregar@about-inc.com>

SEE ALSO

Bric::SOAP