Module: OaiPmh::Metadata
- Defined in:
- lib/oaipmh/metadata/oai_dc.rb
Overview
OaiPmh::Metadata::OaiDc
Copyright © 2006 William Groppe
Will Groppe [email protected]
Only one form of metadata is supported out of the box. Dublin Core is the most basic form of metadata, and the one recommended for support in all OAI-PMH repositories.
To add additional metadata types it’s easiest just to subclass OaiPmh::Metadata::OaiDc. Subclasses should override header(xml) to ouput a valid metadata header. They should also set defaults for prefix, schema, namespace, element_ns, and fields.
Example
class CdwaLite < OaiPmh::Metadata::OaiDc
prefix = 'cdwalite'
schema = 'http://www.getty.edu/CDWA/CDWALite/CDWALite-xsd-draft-009c2.xsd'
namespace = 'http://www.getty.edu/CDWA/CDWALite'
element_ns = 'cdwalite'
fields = [] # using to_cdwalite in model
def self.header(xml)
xml.tag!('cdwalite:cdwalite',
'xmlns:cdwalite' => "http://www.getty.edu/CDWA/CDWALite",
'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
'xsi:schemaLocation' =>
%{http://www.getty.edu/CDWA/CDWALite
http://www.getty.edu/CDWA/CDWALite/CDWALite-xsd-draft-009c2.xsd}) do
yield xml
end
end
end
# Now register the new metadata class
OaiPmh.(CdwaLite)
Defined Under Namespace
Classes: OaiDc