Ignore:
Timestamp:
2019-03-08T11:40:31+13:00 (5 years ago)
Author:
davidb
Message:

Code tidy up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/util/IIIFXML.java

    r32874 r32883  
    5656  // IIIF error codes
    5757  public static final String ID_DOES_NOT_EXIST = "idDoesNotExist";
    58 
     58  public static final String BAD_ARGUMENT      = "badArgument";
     59  public static final String BAD_VERB          = "badVerb";
     60   
    5961  // General
    6062  public static final String IIIF_PMH = "IIIF-PMH"; // ****
    61     public static final String RESPONSE_DATE = "responseDate"; // ****
     63    //public static final String RESPONSE_DATE = "responseDate"; // ****
    6264  public static final String REQUEST = "request";
    6365   
     
    7173  public static final String METADATA = "metadata";
    7274
    73     //public static final String OAIPMH = "OAIPMH"; // ****
    74    
    75     //public static final String OAI_SET_LIST = "oaiSetList"; // ****
    76     //public static final String OAI_SERVICE_UNAVAILABLE = "OAI service unavailable";
    77     public static final String OID = "OID"; // ****
     75  public static final String OID = "OID"; // ****
    7876   
    7977  public static final String IIIF_SERVICE_RACK = "IIIFPMH";
    80   //system-dependent file separator, maybe '/' or '\'
    81   //public static final String FILE_SEPARATOR = File.separator;
    82     //public static final String OAI_VERSION1 = "1.0";
    83     //public static final String IIIF_VERSION2 = "2.1"; // ****
     78
    8479  /*************************above are final values****************************/
    85    
    86    
    87   //initialized in getIIIFConfigXML()
     80
    8881  public static Element iiif_config_elem = null;
    8982   
    90     public static final String iiif_version = "2.1"; // ****
     83  public static final String iiif_version = "2.1"; // ****
    9184  public static String baseURL = "";
    9285   
     
    169162    GSXML.setNodeText(request_elem, baseURL);
    170163     
    171     //Node resp_date = GSXML.getChildByTagName(response, RESPONSE_DATE); // ****
    172    
    173164    return response;
    174165  }
     
    211202  }
    212203
    213   // This is the response message sent when there's a request to activate/deactivate a non-OAI collection
    214   // A request to activate a non-existent/non-OAI collection is not invalid, it's just that we won't process it.
     204  // This is the response message sent when there's a request to activate/deactivate a non-IIIF collection
     205  // A request to activate a non-existent/non-IIIF collection is not invalid, it's just that we won't process it.
    215206  // So we still return status code OK (OK status code is needed for servercontrol.pm of activate.pl to recognise
    216207  // that the command had been "successful" when it runs de/activate).
     
    278269   *  escaped sequences (eg, '%3A').
    279270   */
     271    /*
    280272    public static String iiifEncode(String original_str) { // ****
    281273    logger.info("iiifEncode() " + original_str);     
     
    287279    return original_str; 
    288280  }
    289 
     281    */
     282   
    290283  public static Element createResponseHeader(Document response_doc, String verb) {
    291       //String tag_name = (iiif_version.equals(IIIF_VERSION2))? IIIF_PMH : verb; // ****
    292       String tag_name = IIIF_PMH;
     284    String tag_name = IIIF_PMH;
    293285    Element iiif = response_doc.createElement(tag_name);
    294     //Element resp_date = response_doc.createElement(RESPONSE_DATE); // ****
    295286    Element req = response_doc.createElement(REQUEST);
    296     //oai.appendChild(resp_date);
    297287    iiif.appendChild(req);
    298288
    299289    return iiif;
    300   }
    301 
    302     /*
    303   public static Element createOAIIdentifierXML(Document doc, String repository_id, String sample_collection, String sample_doc_id) {
    304     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>";
    305 
    306     Document xml_doc = converter.getDOM(xml);
    307     return (Element)doc.importNode(xml_doc.getDocumentElement(), true);
    308    
    309 
    310   }
    311     */
    312 
    313     /*
    314   public static Element createGSDLElement(Document doc) {
    315     String xml = "<gsdl xmlns=\"http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo\n   http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo.xsd\"></gsdl>";
    316     Document xml_doc = converter.getDOM(xml);
    317     return (Element)doc.importNode(xml_doc.getDocumentElement(), true);   
    318   }
    319     */
    320    
     290  }   
    321291}
    322292
Note: See TracChangeset for help on using the changeset viewer.