<!--
    This is the configuration file for the OAI server. The property values in this file are repository-wise.
    There will be one copy for each oaiserver specified in oai.servlets
    param in build.properties (eg OAIConfig-oaisever.xml)
    On greenstone install, OAIConfig.xml.svn gets copied to OAIConfig.xml.in (in resources/oai)
    On the first ant start, OAIConfig.xml.in gets copied to each OAIConfig-oaiserver.xml.in (in web.writablehome). This won't happen if the new file is already there, allowing customisation of OAIConfig-oaiserver.xml.in. Delete this file if you want it regenerated.
    On each ant start, OAIConfig-oaiserver.xml.in get copied to OAIConfig-oaiserver.xml (in web.writablehome/WEB-INF/classes)
    !! Don't edit .xml version, only edit .in version (in web.writablehome)

-->
<OAIConfig>       
  <!-- The name of this oai repository, which is human readable. -->
  <repositoryName>Greenstone3 OAI repository</repositoryName>
  <!-- The unique id of this repository - if using version 2.0 should correspond to your domain name -->
  <repositoryIdentifier></repositoryIdentifier>
  <!-- The version of OAI specification this repository supports. 2.0 -->
  <protocolVersion>2.0</protocolVersion>
  <!-- A UTC date time that is the guaranteed lower limit of all datestamps recording changes, midifications etc. in the repository
  This element is not necessary in this file since the earliest datestamp is dynamically found out by searching thru all oai collections in the repository to get the earliest built time amongst the collections. This will be used if the 
  collections all have 0 earliest datestamp, or if there are no collections. -->
  <earliestDatestamp>1970-01-01</earliestDatestamp>
  <!-- The manner in which the repository supports the notion of deleted records -->
  <deletedRecord>persistent</deletedRecord>
  <!-- The granularity of the datestamp. May be YYYY-MM-DD (day granularity) or YYYY-MM-DDThh:mm:ssZ (seconds granularity) -->
  <granularity>YYYY-MM-DDThh:mm:ssZ</granularity>
  <!-- The repository maintainer email address. There can be more than one. -->
  <adminEmail></adminEmail>
  <!-- Metadata describing the repository. Any metadata can go here -->
  <oaiInfo>
    <!-- <metadata name="meta-name">meta-value</metadata>-->
  </oaiInfo>
  <!-- Information above this line goes into the response to the Identify request -->
  <!-- OAI super sets. This exposes a group of collections as a single OAI set.
  Copy and fill in the values for each super set you want. This sets up a super set, then each collection for this super set must state in its OAIPMH service element that it belongs to the super set (<oaiSuperSet name="xxx"/> where xxx is the setSpec)-->
<!--  <oaiSuperSet>
    <setSpec>oai set identifier</setSpec>
    <setName>Human readable set name</setName>
    <setDescription>Set description</setDescription>
  </oaiSuperSet>-->

  <!-- set the following to no if you don't want a stylesheet to be specified in the OAI output -->
  <useOAIStylesheet>yes</useOAIStylesheet>
  <!-- uncomment and set value if you want to use a different stylesheet to the default interfaces/oai/oai2.xsl -->
  <!--<OAIStylesheet></OAIStylesheet> -->
  
  <!-- The time period in which a newly generated resumption token will remain valid, specified in second. Hence, the default
  value 7200 is equivalent to 2 hours.        
  If the resumeAfter parameter is less than 0, this value will not be used.
  -->
  <resumptionTokenExpiration>7200</resumptionTokenExpiration>
  <!-- How many sets/identifiers/records to send for the request before issuing a resumption token. A value less than 0 (e.g. -1) indicates that a complete list of records will be returned. -->
  <resumeAfter>250</resumeAfter>
  <!-- a list of metadata formats supported by this repository -->
  <!-- a simple format has a flat list of metadata elements -->
  <!-- allowExtraElements='false' means the list specified here is complete
        and no extra metadatas are allowed -->
  <ListMetadataFormats>
    <metadataFormat simple="true" allowExtraElements="false">
      <metadataPrefix>oai_dc</metadataPrefix>
      <schema>http://www.openarchives.org/OAI/2.0/oai_dc.xsd</schema>
      <metadataNamespace>http://www.openarchives.org/OAI/2.0/oai_dc/</metadataNamespace>
      <metadata>
        <oai_dc:dc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc.xsd  http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
	<!-- <element name="oai name"/> - will look for this oai-name metadata in the document and output it -->
	<!-- <element name="oai-name"><mapping select="allvalues|firstvalue|firstvalidmetadata" elements="comma-separated-list-of-gs-metadata"/></element> - will map gs-metadata to oai-name metadata. 
	     allvalues: will display all values of each metadata element
	     firstvalue: will go through each metadata element until it finds a value, and will return only one value.
	     firstvalidmetadata: will go through each element until it finds one that has a value, then output all values of that element. 
	     default is allvalues -->
	<element name="dc:title"><mapping select="firstvalidmetadata" elements="dc.Title,Title"/></element>
	<element name="dc:creator"><mapping elements="dc.Creator"/></element>
	<element name="dc:subject"><mapping elements="dc.Subject"/></element>
	<element name="dc:description"><mapping elements="dc.Description"/></element>
	<element name="dc:publisher"><mapping elements="dc.Publisher"/></element>
	<element name="dc:contributor"><mapping elements="dc.Contributor"/></element>
	<element name="dc:date"><mapping elements="dc.Date"/></element>
	<element name="dc:type"><mapping elements="dc.Type"/></element>
	<element name="dc:format"><mapping elements="dc.Format"/></element>
	<element name="dc:identifier"><mapping elements="dc.Identifier,Identifier" select="firstvalue"/></element>
	<!-- gsflink.source, gsflink.document, and gsflink.printdocument are URLs for the source file, greenstone version of the document, and print friendly greenstone version of the document, respectively -->
	<element name="dc:identifier"><mapping elements="gs.OAIResourceURL,gsflink.source" select="allvalues"/></element>
	<element name="dc:source"><mapping elements="dc.Source"/></element>
	<element name="dc:language"><mapping elements="dc.Language"/></element>
	<element name="dc:relation"><mapping elements="dc.Relation"/></element>
	<element name="dc:coverage"><mapping elements="dc.Coverage"/></element>
	<element name="dc:rights"><mapping elements="dc.Rights"/></element>
        </oai_dc:dc>
      </metadata>
    </metadataFormat>
    <!-- simple=false here, as we have a nested structure for the record -->
    <!-- allowExtraElements=true - a collection can add new elements into the format,
         as well as redefining whats here -->
    <!-- a collection version can add/replace <attributeMapping> and <element> nodes.
         These must be contained in the same XML node structure starting with <rdf:RDF>-->
    <metadataFormat simple="false" allowExtraElements="true">
        <metadataPrefix>edm</metadataPrefix>
        <schema>http://www.europeana.eu/schemas/edm/EDM.xsd</schema>
        <metadataNamespace>http://www.europeana.eu/schemas/edm/</metadataNamespace>
        <metadata>
          <rdf:RDF
              xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
              xmlns:dc="http://purl.org/dc/elements/1.1/"
              xmlns:dcterms="http://purl.org/dc/terms/"
              xmlns:edm="http://www.europeana.eu/schemas/edm/"
              xmlns:odrl="http://www.w3.org/ns/odrl/2/"
              xmlns:cc="http://creativecommons.org/ns#"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xmlns:wgs84_pos="http://www.w3.org/2003/01/geo/wgs84_pos#"
              xmlns:rdaGr2="http://rdvocab.info/ElementsGr2/"
              xmlns:skos="http://www.w3.org/2004/02/skos/core#"
              xmlns:foaf="http://xmlns.com/foaf/0.1/"
              xmlns:owl="http://www.w3.org/2002/07/owl#"
              xmlns:ore="http://www.openarchives.org/ore/terms/"
              xsi:schemaLocation="http://www.w3.org/1999/02/22-rdf-syntax-ns# http://www.europeana.eu/schemas/edm/EDM.xsd">
            <edm:ProvidedCHO>
              <attributeMapping name="rdf:about" element="gsflink.document"/>
              
              <element name="dc:title"><mapping select="firstvalidmetadata" elements="dc.Title,Title"/></element>
              <element name="dc:language"><mapping elements="dc.Language"/></element>
              <element name="edm:type"><mapping elements="edm.Type"/></element>
              <element name="dc:subject"><mapping elements="dc.Subject"/></element>
              <element name="dc:type"><mapping elements="dc.Type"/></element>
              <element name="dc:description"><mapping elements="dc.Description"/></element>
              <element name="dcterms:spatial"><mapping elements="dc.Coverage"/></element>
              <element name="dcterms:temporal"><mapping elements="dc.Coverage"/></element>
            </edm:ProvidedCHO>
            <ore:Aggregation>
              <attributeMapping name="rfd:about" element="gsflink:document"/>
              <edm:aggregatedCHO>
                <attributeMapping name="rdf:resource" element="gsflink.document"/>
                </edm:aggregatedCHO>
                <edm:isShownAt>
                  <attributeMapping name="rdf:resource" element="gsflink.document"/>
                </edm:isShownAt>
                <edm:isShownBy>
                  <attributeMapping name="rdf:resource" element="gsflink.source"/>
                </edm:isShownBy>
                <element name="edm:provider"><mapping elements="dc.Publisher"/></element>
                <element name="edm:dataProvider"><mapping elements="dc.Publisher"/></element>
                <element name="edm:rights" rdf:resource="http://creativecommons.org/licenses/by-nc-nd/4.0/"/>
                <edm:object>
                  <attributeMapping name="rdf:resource" element="gsflink.cover"/>
              </edm:object> 
            </ore:Aggregation>
          </rdf:RDF>
        </metadata>
    </metadataFormat>
  </ListMetadataFormats>
</OAIConfig>
