Net::OAI::Base - A base class for all OAI-PMH responses
if ( $object->resumptionToken() ) { ... } if ( $object->error() ) { print "verb action resulted in error code:" . $object->errorCode() . " message:" . $object->errorString() . "\n"; } print "xml response can be found here: " . $obj->file() . "\n"; print "the response xml is " . $obj->xml();
Net::OAI::Base is the base class for all the OAI-PMH verb responses. It is used to provide similar methods to all the responses. The following classes inherit from Net::OAI::Base.
Net::OAI::GetRecord
Net::OAI::Identify
Net::OAI::ListIdentifiers
Net::OAI::ListMetadataFormats
Net::OAI::ListRecords
Net::OAI::ListSets
Returns the content of the mandatory responseDate element.
In scalar context this method returns just the base URL (text content) of the mandatory OAI request element.
$requestText = $OAI->request();
In array context a hash with the delivered attributes of the OAI request element (mirroring the valid query parameters) is appended.
my ($requestURI, %requestParams) = $OAI->request(); print STDERR "Repository URL: ", $requestURI, "\n"; print STDERR "verb was: ", $requestParams->{'verb'}, "\n";
Returns undef / () if the OAI response could not be parsed or did not contain the mandatory response element.
undef
()
Returns -1 for HTTP or XML errors, 1 for OAI error respones, 0 for no errors;
Returns an error code associated with the verb result.
Returns an error message associated with an error code.
Returns the HTTP Retry-After header in case of HTTP level errors.
Returns the HTTP::Response object in case of HTTP level errors.
Returns a Net::OAI::ResumptionToken object associated with the call. If there was no resumption token returned in the response then you will be returned undef.
Returns a reference to a scalar that contains the raw content of the response as XML.
Returns the path to a file that contains the complete XML response.
Ed Summers <ehs@pobox.com>
To install Net::OAI::Base, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OAI::Base
CPAN shell
perl -MCPAN -e shell install Net::OAI::Base
For more information on module installation, please visit the detailed CPAN module installation guide.