Show
Ignore:
Timestamp:
03.08.2010 13:41:27 (9 years ago)
Author:
kjdon
Message:

in oai.cfg can define oaiinfo elements, which are addition items describing the repository. previously they were just output as elements, which invalidates the schema. Added them into the description element, using the new gsdl_oaiinfo schema

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/oaiservr/identifyaction.cpp

    r22287 r22557  
    8787    output << "    <oai-identifier xmlns=\"http://www.openarchives.org/OAI/1.1/oai-identifier\"\n"; 
    8888    output << "        xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"; 
    89     output << "        xsi:schemaLocation=\"http://www.openarchives.org/OAI/1.1/oai-identifier    http://www.openarchives.org/OAI/1.1/oai-identifier.xsd\">\n"; 
     89    output << "        xsi:schemaLocation=\"http://www.openarchives.org/OAI/1.1/oai-identifier\n"; 
     90    output << "           http://www.openarchives.org/OAI/1.1/oai-identifier.xsd\">\n"; 
    9091  } else { 
    9192 
     
    9394    output << "      xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"; 
    9495    output << "      xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai-identifier\n"; 
    95     output << "      http://www.openarchives.org/OAI/2.0/oai-identifier.xsd\">\n"; 
     96    output << "        http://www.openarchives.org/OAI/2.0/oai-identifier.xsd\">\n"; 
    9697 
    9798     
    9899  } 
    99100 
    100   output << "    <scheme>oai</scheme>\n"; 
    101   output << "    <repositoryIdentifier>"<< repositoryId <<"</repositoryIdentifier>\n"; 
    102   output << "    <delimiter>:</delimiter>\n"; 
    103   output << "    <sampleIdentifier>oai:"<<repositoryId<<":demo:HASH983080b052e9230b7ccf94</sampleIdentifier>\n"; 
    104   output << "  </oai-identifier>\n"; 
     101  output << "      <scheme>oai</scheme>\n"; 
     102  output << "      <repositoryIdentifier>"<< repositoryId <<"</repositoryIdentifier>\n"; 
     103  output << "      <delimiter>:</delimiter>\n"; 
     104  output << "      <sampleIdentifier>oai:"<<repositoryId<<":demo:HASH983080b052e9230b7ccf94</sampleIdentifier>\n"; 
     105  output << "    </oai-identifier>\n"; 
    105106 
    106   output << utf8convert << "  </description>\n"; 
    107107  // list all configuration information 
    108108  text_tmap::iterator here = this->configuration->getInformation()->begin(); 
    109109  text_tmap::iterator end  = this->configuration->getInformation()->end(); 
    110   while (here != end) { 
    111     output << utf8convert << "  <" << here->first << ">" << here->second; 
    112     output << utf8convert << "  </" << here->first << ">\n"; 
    113     ++here; 
     110  if (here != end) { 
     111    output << "    <gsdl xmlns=\"http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo\"\n"; 
     112    output << "       xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"; 
     113    output << "       xsi:schemaLocation=\"http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo\n"; 
     114    output << "         http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo.xsd\">\n"; 
     115   
     116 
     117    while (here != end) { 
     118      output << utf8convert << "      <Metadata name=\"" << here->first << "\">" << here->second << "</Metadata>\n"; 
     119      ++here; 
     120    } 
     121    output << "    </gsdl>\n"; 
    114122  } 
     123   
     124  output << utf8convert << "  </description>\n"; 
    115125   
    116126  return true;