NAME
PICA::Store - CRUD interface to a PICA::Record storage
DESCRIPTION
This class is an abstract class to provide a simple CRUD (create/insert, retrieve/get, update, delete) access to a record store of PICA::Record objects.
See PICA::SQLiteStore and PICA::SOAPClient for specific implementations. Other implementations that may be implemented later include WebDAV, and REST (for instance Jangle).
SYNOPSIS
use PICA::Store;
# connect to store via SOAP API (SOAPClient)
$store = PICA::Store->new( webcat => $baseurl, %params );
# connect to SQLiteStore
$store = PICA::Store->new( SQLite => $dbfile, %params );
# Get connection details from a config file
$store = PICA::Store->new( config => "myconf.conf" );
# CRUD operations
%result = $store->get( $id );
%result = $store->create( $record );
%result = $store->update( $id, $record, $version );
%result = $store->delete( $id );
# set additional access parameters
$store->access( userkey => $userkey, password => $passwd );
METHODS
new ( %parameters )
Return a new PICA::Store. You must either specify a parameter named 'webcat' to get a PICA::SOAPClient or a parameter named 'SQLite' to get a PICA::SQLiteStore. Alternatively you can specify a parameter named 'config' that points to a configuration file. If you set this parameter to undef, the file will be searched as environment variable PICASTORE or picastore.conf in the current directory.
get
Retrieve a record.
create
Insert a new record.
update
Update an existing record.
delete
Delete a record.
access ( key => value ... )
Set general access parameters (userkey, password, dbsid and/or language). Returns the store itself so you can chain anothe method call. By default the parameters are just ignored so any subclass should override this method to make sense of it.
SEE ALSO
This distribution contains the command line client picawebcat
based on PICA::Store. See also PICA::SQLiteStore, PICA::SOAPClient, and PICA::SOAPServer.
AUTHOR
Jakob Voss <jakob.voss@gbv.de>
LICENSE
Copyright (C) 2007-2009 by Verbundzentrale Goettingen (VZG) and Jakob Voss
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.