Bric::SOAP::ElementType(3)

NAME
Bric::SOAP::ElementType - SOAP interface to Bricolage element type definitions.

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2006-03-11 06:15:13 -0800 (Sat, 11 Mar 2006) $

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 Element type module
  $soap->uri('http://bricolage.sourceforge.net/Bric/SOAP/ElementType');

  # get a list of all element types
  my $element_type_ids = $soap->list_ids()->result;

DESCRIPTION
This module provides a SOAP interface to manipulating Bricolage element types.

INTERFACE

  Public Class Methods

list_ids
    This method queries the database for matching element types and returns a list of ids. If no element types are found an empty list will be returned.

    This method can accept the following named parameters to specify the search. Some fields support matching and are marked with an (M). The value for these fields will be interpreted as an SQL match expression and will be matched case-insensitively. Other fields must specify an exact string to match. Match fields combine to narrow the search results (via ANDs in an SQL WHERE clause).

    key_name (M)
        The element type's key name.

    name (M)
        The element type's name.

    description (M)
        The element type's description.

    output_channel
        The output channel for the element type.

    output_channel_id
        The ID of an output channel. Returned will be all ElementType objects that contain this output channel. May use "ANY" for a list of possible values.

    field_name (M)
    data_name (M)
        The name of an ElementType::Parts::FieldType (field type) object. Returned will be all ElementType objects that reference this particular field type object.

    type
        The element type's type.

    type_id
        Match elements of a particular attype.

    active
        Set to 0 to return inactive as well as active element types.

    site_id
        Match against the given site_id. May use "ANY" for a list of possible values.

    top_level
        Boolean value for top-level (story type and media type) element types.

    media
        Boolean value for media element types.

    paginated
        Boolean value for paginated element types.

    fixed_uri
        Boolean value for fixed URI element types.

    related_story
        Boolean value for related story element types.

    related_media
        Boolean value for related media element types.

    biz_class_id
        The ID of a Bric::Util::Class object representing a business class. The ID must be for a class object representing one of Bric::Biz::Asset::Business::Story, Bric::Biz::Asset::Business::Media, or one of its subclasses.

    Throws:

    Exception::AP

    Side Effects: NONE

    Notes: NONE

export
    The export method retrieves a set of element types from the database, serializes them and returns them as a single XML document. See Bric::SOAP for the schema of the returned document.

    Accepted paramters are:

    element_type_id
        Specifies a single element_type_id to be retrieved.

    element_type_ids
        Specifies a list of element_type_ids. The value for this option should be an array of interger "element_type_id" element types.

    Throws:

    Exception::AP

    Side Effects: NONE

    Notes: NONE

create
    The create method creates new objects using the data contained in an XML document of the format created by export().

    Returns a list of new ids created in the order of the assets in the document.

    Available options:

    document (required)
        The XML document containing objects to be created. The document must contain at least one element type object.

    Throws:

    Exception::AP

    Side Effects: NONE

    Notes: You cannot directly set the top_level setting. This value is ignored on update and create; instead it is taken from the type setting.

update
    The update method updates element type using the data in an XML document of the format created by export(). A common use of update() is to export() a selected element type object, make changes to one or more fields and then submit the changes with update().

    Returns a list of new ids created in the order of the assets in the document.

    Takes the following options:

    document (required)
        The XML document where the objects to be updated can be found. The document must contain at least one element types and may contain any number of related element type objects.

    update_ids (required)
        A list of "element_type_id" integers for the assets to be updated. These must match id attributes on element type elements in the document. If you include objects in the document that are not listed in update_ids then they will be treated as in create(). For that reason an update() with an empty update_ids list is equivalent to a create().

    Throws:

    Exception::AP

    Side Effects: NONE

    Notes: You cannot directly update the top_level setting. This value is ignored on update and create; instead it is taken from the type setting.

delete
    The delete() method deletes element types. It takes the following options:

    element_type_id
        Specifies a single element_type_id to be deleted.

    element_type_ids
        Specifies a list of element_type_ids to delete.

    Throws:

    Exception::AP

    Side Effects: NONE

    Notes: NONE

$self->module
    Returns the module name, that is the first argument passed to bric_soap.

is_allowed_param
$pkg->is_allowed_param($param, $method)
    Returns true if $param is an allowed parameter to the $method method.

  Private Class Methods

$pkg->load_asset($args)
    This method provides the meat of both create() and update(). The only difference between the two methods is that update_ids will be empty on create().

$pkg->serialize_asset(writer => $writer, element_type_id => $element_id, args => $args)
    Serializes a single element type object into a "<element_type>" element using the given writer and args.

AUTHOR
Sam Tregar <stregar@about-inc.com>

SEE ALSO
Bric::SOAP