Ignore:
Timestamp:
2012-08-10T20:31:34+12:00 (12 years ago)
Author:
ak19
Message:

Now the dc:identifier is set for OAI to either gs.OAIResourceURL if this was set by the user, else to srclinkFile if this exists, else a url to the Greenstone version of a document. This is the logic that GS2 used (in the output_custom_metadata function of dublincore.cpp of runtime-src's oaiservr). Having made this change, doing get-document over OAI works, as is required for the Downloading Over OAI tutorial. Get-document was previously not implemented during the updates to get GS3's OAI server to validate, since the OAI validator never checked for this. This is an optional operation that Greenstone 2 provided, and which GS3 now also allows.

File:
1 edited

Legend:

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

    r25635 r26096  
    9999    public static final String GRANULARITY = "granularity";
    100100    public static final String GS3OAI = "GS3OAI";
     101    public static final String GS_OAI_RESOURCE_URL = "gs.OAIResourceURL";
    101102    public static final String HAS_OAI = "hasOAI";
    102103    public static final String HEADER = "header";
     
    177178     */
    178179    public static String oai_version = "2.0";
     180    public static String baseURL = "";
    179181   
    180182    /**response owner document */
     
    194196      return oai_version;
    195197    }
     198   
     199    public static String getBaseURL() {
     200        return baseURL;
     201    }
     202   
    196203    public static Element createElement(String tag_name) {
    197204      return response_doc.createElement(tag_name);
     
    286293    }
    287294    /** Read in OAIConfig.xml (residing web/WEB-INF/classes/) and use it to configure the receptionist etc.
    288      *  the oai_version variable is also set in here.
     295     *  the oai_version and baseURL variables are also set in here.
    289296     *  The init() method is also called in here. */
    290297    public static Element getOAIConfigXML() {
     
    310317      oai_version = GSXML.getNodeText(protocol_version).trim();
    311318
     319      // initialize baseURL
     320      Element base_url_elem = (Element)GSXML.getChildByTagName(oai_config_elem, BASE_URL);
     321      baseURL = GSXML.getNodeText(base_url_elem);
     322     
    312323      //initialize token_expiration
    313324      Element expiration = (Element)GSXML.getChildByTagName(oai_config_elem, RESUMPTION_TOKEN_EXPIRATION);
     
    387398        }
    388399      }//end of for()
    389       Element base_url_elem = (Element)GSXML.getChildByTagName(oai_config_elem, BASE_URL);
    390       String base_url = GSXML.getNodeText(base_url_elem);
    391       GSXML.setNodeText(request_elem, base_url);
     400     
     401      GSXML.setNodeText(request_elem, baseURL);
    392402     
    393403      Node resp_date = GSXML.getChildByTagName(response, RESPONSE_DATE);
Note: See TracChangeset for help on using the changeset viewer.