XML::DB::Database - Abstract class for extension by XML:SimpleDB drivers |
XML::DB::Database - Abstract class for extension by XML:SimpleDB drivers
use XML::DB::Database;
This is an abstract class implementing the interface Database from the XML:DB base specification. It should only be used indirectly, as superclass for a specific database driver which implements the Database interface. Examples are Exist.pm and Xindice.pm.
Graham Seaman CPAN ID: GSEAMAN graham@opencollector.org
Copyright (c) 2002 Graham Seaman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl(1).
Usage : getName()
Purpose : Returns the database name (eg. 'eXist')
Argument : None
Returns : String
Usage : getConformanceLevel()
Purpose : Returns the conformance level of this implementation (see http://www.xmldb.org)
Argument : None
Returns : String
Usage : $collection = getCollection($uri, $username, $passwd)
Purpose : Returns a Collection
Argument : uri for collection, optional name and password
Returns : Collection
Usage : if (db::acceptsURI(exist:://....)){ ...
Purpose : Returns true if database accepts URI starting with name (eg. 'eXist', 'Xindice')
Argument : A URI
Returns : Boolean
Comment : Broken. FIXME
Usage : $property = getProperty($name)
Purpose : Returns named property
Argument : name of property
Returns : String or null
Usage : $property = setProperty($name, $value)
Purpose : Sets property to value
Argument : name and value
I<Returns> : void
Usage : Should be called indirectly via DatabaseManager
Purpose : Constructor
The following methods should be implemented by all concrete driver implementations. They are part of the internal working of this package, not part of the XML:DB specification. All can potentially throw exceptions.
createId($collectionName)
Usage : $id = $driver->createId($collectionName)
Purpose : Creates a new unique OID for this collection.
Argument : collectionName The name of the collection including database instance.
Returns : The generated id
Usage : $driver->createCollection($parentCollection, $collectionName )
Purpose : Creates specified Collection
Arguments :
Returns : 1 on success
Usage : $driver->dropCollection($collectionName )
Purpose : Deletes specified collection from the database
Argument : $collectionName - The name of the collection including database instance.
Returns : 1 on success
Usage : $collections = $driver->listChildCollections($collectionName )
Purpose : Lists all child collections under this collection.
Argument : $collectionName - The name of the collection including database instance.
Returns : Arrayref for the list of child collections.
Usage : $xml = $driver->queryCollection($collectionName, $style, $query, \%namespaces)
Purpose : Executes a query against a collection
Arguments :
Returns : The result of the query as XML.
Usage : $document = $driver->getDocument($collectionName, $id )
Purpose : Retrieves a document from the collection
Arguments
Returns : The retrieved Document
Usage : $count = getDocumentCount($collectionName )
Purpose : Returns the number of documents stored in this collection.
Argument : $collectionName - The name of the collection including database instance.
Returns : The number of documents in the collection
Usage : $id = insertDocument($collectionName, $content, $id )
Purpose : Inserts a new document into the collection
Arguments :
Returns : The id of the inserted document.
Usage : @documents = listDocuments($collectionName )
Purpose : Returns a set containing all documents in the collection.
Argument : $collectionName - The name of the collection including database instance.
Returns : Arrayref of document ids in the specified collection
Usage : $xml = queryDocument($collectionName, $style, $query, %namespaces, $id )
Purpose : Executes a query against a Document in this collection
Arguments :
Returns : The result of the query as XML.
Usage : removeDocument($collectionName, $id )
Purpose : Deletes a document from the collection.
Arguments :
Returns : 1 on success
Usage : \@resources = $db->splitContents($data)
Purpose : Breaks fragments returned by query into separate elements to create a ResourceSet
Arguments : Data returned by query (string)
Returns : Array ref
XML::DB::Database - Abstract class for extension by XML:SimpleDB drivers |