Bric::SOAP::Util - utility class for the Bric::SOAP classes $LastChangedRevision$ $LastChangedDate: 2007-10-31 10:26:08 +0100 (Wed, 31 Oct 2007) $ use Bric::SOAP::Util qw(category_path_to_script) my $category_id = category_path_to_id($path); This module provides various utility methods of use throughout the Bric::SOAP classes.

Exportable Functions
Returns a category_id for the path specified or undef if none match. Throws: NONE Side Effects: NONE Notes: NONE Returns an output channel ID for an output channel name. Throws: NONE Side Effects: NONE Notes: NONE Returns a workflow ID for a workflow name. Throws: NONE Side Effects: NONE Notes: NONE Returns a site_id for the path specified or undef if none match. Throws: NONE Side Effects: NONE Notes: NONE 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 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", $id ] or [ "story", $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 $ocdata array reference will be loaded into the asset. If the asset is being updated, then "load_ocs()" compares the output channels in $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., "$data-"{stories}{story}[0]{output_channels}{output_channel}. A hash reference of the output channels in the element type that define the asset (i.e., the story element type or the media element type). 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 $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 type data from the data hash. Calls _deserialize_element recursively down through containers. Throws: NONE Side Effects: NONE Notes:

Private Class Methods
Deserializes a single element from <elements> data into $element. Calls recursively down through containers building up fixup data from related objects in @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 element 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", $id ] or [ "story", $id ]. These are the related objects serialized. Sam Tregar <stregar@about-inc.com> Bric::SOAP