API:EPrints/OpenArchives

From EPrints Documentation
Revision as of 18:29, 11 August 2009 by Tdb01r (talk | contribs) (New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Latest Source Code (3.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki

NAME

EPrints::OpenArchives - Methods for open archives support in EPrints.

DESCRIPTION

This module contains methods used by the EPrints OAI interface. See http://www.openarchives.org/ for more information.

METHODS

make_header

 $xml = EPrints::OpenArchives::make_header( $session, $eprint, $oai2 )

Return a DOM tree containing the generic <header> part of a OAI response describing an EPrint.

Return the OAI2 version if $oai2 is true.

make_record

 $xml = EPrints::OpenArchives::make_record( $session, $eprint, $fn, $oai2 )

Return XML DOM describing the entire OAI <record> for a single eprint.

If $oai2 is true return the XML suitable for OAI v2.0

$fn is a pointer to a function which takes ( $eprint, $session ) and returns an XML DOM tree describing the metadata in the desired format.

to_oai_identifier

 $oai_id EPrints::OpenArchives::to_oai_identifier( $archive_id, $eprintid )

Give the full OAI identifier of an eprint, given the local eprint id.

$archive_id is the ID used for OAI, which may be different from that used by EPrints.

from_oai_identifier

 $eprintid = EPrints::OpenArchives::from_oai_identifier( $session, $oai_identifier )

Return the local eprint id of an oai eprint identifier.

Return undef if this does not match a possible eprint.

This does not check the eprint actually exists, just that the OAI identifier is suitable.

encode_setspec

 $encoded = EPrints::OpenArchives::encode_setspec( @bits )

This encodes a list of values in such a way that it is a legal OAI setspec, even if it contains non-ascii characters etc.

decode_setspec

 @decoded = EPrints::OpenArchives::decode_setspec( $encoded )

This decodes a list of parameters encoded by encode_setspec

text2bytestring

 $encoded = EPrints::OpenArchives::text2bytestring( $string )

Converts a string into hex. eg. "A" becomes "41".

bytestring2text

 $decoded = EPrints::OpenArchives::bytestring2text( $encstring )

Does the reverse of text2bytestring.