XML::DB::Database - Abstract class for extension by XML:SimpleDB drivers


NAME

XML::DB::Database - Abstract class for extension by XML:SimpleDB drivers


SYNOPSIS

  use XML::DB::Database;


DESCRIPTION

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.


BUGS


AUTHOR

        Graham Seaman
        CPAN ID: GSEAMAN
        graham@opencollector.org


COPYRIGHT

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.


SEE ALSO

perl(1).


METHODS (all called indirectly by other modules)

getName

Usage : getName()

Purpose : Returns the database name (eg. 'eXist')

Argument : None

Returns : String

getName

Usage : getConformanceLevel()

Purpose : Returns the conformance level of this implementation (see http://www.xmldb.org)

Argument : None

Returns : String

getCollection

Usage : $collection = getCollection($uri, $username, $passwd)

Purpose : Returns a Collection

Argument : uri for collection, optional name and password

Returns : Collection

acceptsURI

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

getProperty

Usage : $property = getProperty($name)

Purpose : Returns named property

Argument : name of property

Returns : String or null

setProperty

Usage : $property = setProperty($name, $value)

Purpose : Sets property to value

Argument : name and value


I<Returns>   : void

new

Usage : Should be called indirectly via DatabaseManager

Purpose : Constructor


Interface

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

createCollection

Usage : $driver->createCollection($parentCollection, $collectionName )

Purpose : Creates specified Collection

Arguments :

dropCollection

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

listChildCollections

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.

queryCollection

Usage : $xml = $driver->queryCollection($collectionName, $style, $query, \%namespaces)

Purpose : Executes a query against a collection

Arguments :

getDocument

Usage : $document = $driver->getDocument($collectionName, $id )

Purpose : Retrieves a document from the collection

Arguments

getDocumentCount

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

insertDocument

Usage : $id = insertDocument($collectionName, $content, $id )

Purpose : Inserts a new document into the collection

Arguments :

listDocuments

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

queryDocument

Usage : $xml = queryDocument($collectionName, $style, $query, %namespaces, $id )

Purpose : Executes a query against a Document in this collection

Arguments :

removeDocument

Usage : removeDocument($collectionName, $id )

Purpose : Deletes a document from the collection.

Arguments :

splitContents

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

update

updateResource

 XML::DB::Database - Abstract class for extension by XML:SimpleDB drivers