NAME
PICA::Store - CRUD interface to a PICA::Record storage
SYNOPSIS
use PICA::Store;
$server = PICA::Store->new(
SOAP => $baseurl,
userkey => $userkey, password => $password, dbsid => $dbsid );
%result = $server->get( $id );
%result = $server->create( $record );
%result = $server->update( $id, $record, $version );
%result = $server->delete( $id );
DESCRIPTION
This class provided a simple retrieve-insert-update-delete - interface to a record store. Currently there is only a CBS webcat SOAP-API but you could also wrap for instance a Jangle interface with this class.
A formal description of the CBS webcat SOAP-API can be found at http://cws.gbv.de/ws/webcatws.wsdl.
METHODS
new ( $type => $url, %params )
Create a new Server. You must specify at least a connection type and a base URL. Other parameters are userkey, password, and database id. The optional language parameter (default: "en") for error messagescan be one of "de", "en", "fr" or "ne".
Currently only the connection type "SOAP" is supported with limited error handling.
get ( $id )
Retrieve a record by ID.
Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id', 'record', and 'version'. The 'record' element contains a PICA::Record object.
create ( $record )
Insert a new record. The parameter must be a PICA::Record object.
Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id', 'record', and 'version'.
update ( $id, $record, $version )
Update a record by ID, updated record (of type PICA::Record), and version (of a previous get, create, or update command).
Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id', 'record', and 'version'.
delete ( $id )
Deletes a record by ID.
Returns a hash with either 'errorcode' and 'errormessage' or a hash with 'id'.
INTERNAL METHODS
_soap_query ( $operation, @params )
Internal method to prepare, perform and evaluate a SOAP request. Returns a hash with 'errorcode' and 'errormessage' or a hash with 'dbsid', 'id', 'record', and 'version' depending on the type of query. Do not directly call this method.
SEE ALSO
The webcat.pl script in the examples directory of this distribution provides a simple command line client based on PICA::Store.
AUTHOR
Jakob Voß <jakob.voss@gbv.de>
LICENSE
Copyright (C) 2007-2009 by Verbundzentrale Göttingen (VZG) and Jakob Voß
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 216:
Non-ASCII character seen before =encoding in 'Voß'. Assuming UTF-8