Changeset 32883 for gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/util/IIIFXML.java
- Timestamp:
- 2019-03-08T11:40:31+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/util/IIIFXML.java
r32874 r32883 56 56 // IIIF error codes 57 57 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 59 61 // General 60 62 public static final String IIIF_PMH = "IIIF-PMH"; // **** 61 public static final String RESPONSE_DATE = "responseDate"; // ****63 //public static final String RESPONSE_DATE = "responseDate"; // **** 62 64 public static final String REQUEST = "request"; 63 65 … … 71 73 public static final String METADATA = "metadata"; 72 74 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"; // **** 78 76 79 77 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 84 79 /*************************above are final values****************************/ 85 86 87 //initialized in getIIIFConfigXML() 80 88 81 public static Element iiif_config_elem = null; 89 82 90 83 public static final String iiif_version = "2.1"; // **** 91 84 public static String baseURL = ""; 92 85 … … 169 162 GSXML.setNodeText(request_elem, baseURL); 170 163 171 //Node resp_date = GSXML.getChildByTagName(response, RESPONSE_DATE); // ****172 173 164 return response; 174 165 } … … 211 202 } 212 203 213 // This is the response message sent when there's a request to activate/deactivate a non- OAIcollection214 // A request to activate a non-existent/non- OAIcollection 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. 215 206 // So we still return status code OK (OK status code is needed for servercontrol.pm of activate.pl to recognise 216 207 // that the command had been "successful" when it runs de/activate). … … 278 269 * escaped sequences (eg, '%3A'). 279 270 */ 271 /* 280 272 public static String iiifEncode(String original_str) { // **** 281 273 logger.info("iiifEncode() " + original_str); … … 287 279 return original_str; 288 280 } 289 281 */ 282 290 283 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; 293 285 Element iiif = response_doc.createElement(tag_name); 294 //Element resp_date = response_doc.createElement(RESPONSE_DATE); // ****295 286 Element req = response_doc.createElement(REQUEST); 296 //oai.appendChild(resp_date);297 287 iiif.appendChild(req); 298 288 299 289 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 } 321 291 } 322 292
Note:
See TracChangeset
for help on using the changeset viewer.