Ignore:
Timestamp:
2021-07-06T14:32:20+12:00 (3 years ago)
Author:
kjdon
Message:

OAI identifiers should be (I think??) oai:repository_id:coll_name:doc_id. So I have updated the code to use this instead of just coll_name:doc_id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java

    r33970 r35225  
    647647    return map;
    648648  }
    649    
     649
     650  public static String createOAIIdentifier(String repository_id, String collection, String doc_id) {
     651    return "oai:"+repository_id+":"+collection+":"+doc_id;
     652  }
     653 
    650654  public static Element createOAIIdentifierXML(Document doc, String repository_id, String sample_collection, String sample_doc_id) {
    651     String xml = "<oai-identifier xmlns=\"http://www.openarchives.org/OAI/2.0/oai-identifier\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai-identifier\n http://www.openarchives.org/OAI/2.0/oai-identifier.xsd\">\n <scheme>oai</scheme>\n<repositoryIdentifier>" + repository_id + "</repositoryIdentifier>\n<delimiter>:</delimiter>\n<sampleIdentifier>oai:"+repository_id+":"+sample_collection+":"+sample_doc_id+"</sampleIdentifier>\n</oai-identifier>";
     655    String sample_id = createOAIIdentifier(repository_id,sample_collection,sample_doc_id);
     656    String xml = "<oai-identifier xmlns=\"http://www.openarchives.org/OAI/2.0/oai-identifier\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://www.openarchives.org/OAI/2.0/oai-identifier\n http://www.openarchives.org/OAI/2.0/oai-identifier.xsd\">\n <scheme>oai</scheme>\n<repositoryIdentifier>" + repository_id + "</repositoryIdentifier>\n<delimiter>:</delimiter>\n<sampleIdentifier>"+sample_id+"</sampleIdentifier>\n</oai-identifier>";
    652657
    653658    Document xml_doc = converter.getDOM(xml);
Note: See TracChangeset for help on using the changeset viewer.