The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XML::DB::Resource - Wrapper class for documents or document fragments

SYNOPSIS

    $resource = $collection->getResource($id);  
    $id = $resource->getId();
    $xml = $resource->getContent();
    $resource->setContent($xml);
    $collection->storeResource($resource);
    $parentColl = $resource->getParentCollection(); 

DESCRIPTION

This is an abstract class implementing the Service interface Database from the XML:DB base specification. It should only be used indirectly, as superclass for a specific Resource type. The only current example is XMLResource.

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).

PUBLIC METHODS

getContent

    Usage : $r->getContent()

    Purpose : Returns the stored data

    Argument : None

    Returns : XML String

getId

    Usage : $r->getId()

    Purpose : Returns the stored id (may be undef)

    Argument : None

    Returns : id or undef

getParentCollection

    Usage : $collection = $r->getParentCollection()

    Purpose : Returns the collection this resource belongs to

    Argument : none

    Returns : Collection

setContent

    Usage : $r->setContent($doc)

    Purpose : stores the content (overwriting any previous content)

    Argument : XML document

    Returns : void

getResourceType

    Usage : $type = $r->getResourceType()

    Purpose : Returns resource type of implementing class

    Argument : none

    Returns : string

new

    Purpose : Constructor

    Comments : The constructor should not be called directly; new Resources are created via their parent Collection, or implicitly while building a ResourceSet.