Bric::SOAP::Template - SOAP interface to Bricolage templates.
$Revision: 1.14.4.3 $
$Date: 2003/10/03 22:43:43 $
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.
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.
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: NONE
Side Effects: NONE
Notes: SQL tweaking paramters (Order, Limit, etc.) as in Bric::SOAP::Story are not available here. We should add them to Bric::Biz::Asset::Formatting->list() and then support them here too.
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: NONE
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.
Throws: NONE
Side Effects: NONE
Notes: NONE
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().
Throws: NONE
Side Effects: NONE
Notes: Due to the way Bric::Biz::Asset::Formatting->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: NONE
Side Effects: NONE
Notes: NONE
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>