Bric::SOAP::Util - utility class for the Bric::SOAP classes
$Revision: 1.11.2.1 $
$Date: 2002/10/25 22:54:03 $
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.
$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
$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
$data = parse_asset_document($document, @extra_force_array)
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
@related = seralize_elements(writer => $writer, object => $story, args => $args)
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.
@relations = deseralize_elements(object => $story, data => $data)
Loads an asset object with element data from the data hash. Calls _deserialize_tile recursively down through containers.
Throws: NONE
Side Effects: NONE
Notes:
Deserializes a single tile 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 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", $id ] or [ "story", $id ]. These are the related objects serialized.
Sam Tregar <stregar@about-inc.com>
Hey! The above document had some coding errors, which are explained below:
Expected '=item *'
Expected '=item *'