Bric::SOAP::Template - SOAP interface to Bricolage templates. $LastChangedRevision$ $LastChangedDate: 2005-10-10 09:15:55 +0200 (Mon, 10 Oct 2005) $ 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 Template module $soap->uri('http://bricolage.sourceforge.net/Bric/SOAP/Template'); # get a list of template_ids in the root category my $template_ids = $soap->list_ids(name(category => '/'))->result; This module provides a SOAP interface to manipulating Bricolage templates.

Public Class Methods
This method queries the story database for matching templates and returns a list of ids. If no templates 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). The template's element name. The template's file_name. The output channel for the template. A category containing the story, given as the complete category path from the root. Example: "/news/linux". The name of the workflow containing the template. The name of the site that the template is in. a single OR search that hits element and filename. The priority of the template. Stories that have been published have a publish_status of "1", otherwise "0". Lower bound on deploy date. Given in XML Schema dateTime format (CCYY-MM-DDThh:mm:ssTZ). Upper bound on deploy date. Given in XML Schema dateTime format (CCYY-MM-DDThh:mm:ssTZ). Lower bound on expire date. Given in XML Schema dateTime format (CCYY-MM-DDThh:mm:ssTZ). Upper bound on expire date. Given in XML Schema dateTime format (CCYY-MM-DDThh:mm:ssTZ). Throws: Side Effects: NONE Notes: In addition to the parameters listed above, you can use most of the parameters listed in the documentation for the list method in Bric::Biz::Asset::Template. The export method retrieves a set of templates 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: Specifies a single template_id to be retrieved. Specifies a list of template_ids. The value for this option should be an array of interger "template_id" elements. Throws: Side Effects: NONE Notes: NONE 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: The XML document containing objects to be created. The document must contain at least one template object. Specifies the initial workflow the story is to be created in Specifies the initial desk the story is to be created on Throws: Side Effects: NONE Notes: New stories are put in the first "template workflow" unless you pass in the --workflow option. The start desk of the workflow is used unless you pass the --desk option. The update method updates template using the data in an XML document of the format created by export(). A common use of update() is to export() a selected template 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: The XML document where the objects to be updated can be found. The document must contain at least one template and may contain any number of related template objects. A list of "template_id" integers for the assets to be updated. These must match id attributes on template 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(). Specifies the workflow to move the template to Specifies the desk to move the template to Throws: Side Effects: NONE Notes: Due to the way Bric::Biz::Asset::Template->new() works it isn't possible to fully update file_name. To change it you need to update it indirectly by changing category, element and the file_name extension. This should be fixed. The delete() method deletes templates. It takes the following options: Specifies a single template_id to be deleted. Specifies a list of template_ids to delete. Throws: Side Effects: NONE Notes: NONE Returns the module name, that is the first argument passed to bric_soap. Returns the class name used for 'lookup' (used in the delete method). Returns true if $param is an allowed parameter to the $method method.

Private Class Methods
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(). Serializes a single template object into a <template> element using the given writer and args. Sam Tregar <stregar@about-inc.com> Bric::SOAP