Changeset 27671 for main/trunk
- Timestamp:
- 2013-06-20T13:16:02+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIXML.java
r26096 r27671 78 78 public static final String USE_STYLESHEET = "useOAIStylesheet"; 79 79 public static final String STYLESHEET = "OAIStylesheet"; 80 // words used to compose oai responses 80 81 // words used to compose oai responses and read in OAIConfig.xml 81 82 public static final String ADMIN_EMAIL = "adminEmail"; 82 83 public static final String BAD_ARGUMENT = "badArgument"; … … 104 105 public static final String ILLEGAL_OAI_VERB = "Illegal OAI verb"; 105 106 public static final String INDEX_STEM = "indexStem"; 107 public static final String INFO_METADATA = "Metadata"; // this has capital M 106 108 public static final String LASTMODIFIED = "lastmodified"; 107 109 public static final String MAPPING = "mapping"; … … 117 119 public static final String OAIPMH = "OAIPMH"; 118 120 public static final String OAI_RESUMPTION_TOKENS = "OAIResumptionTokens"; 121 public static final String OAI_INFO = "oaiInfo"; 119 122 public static final String OAI_SERVICE = "oaiService"; 120 123 public static final String OAI_SET_LIST = "oaiSetList"; … … 127 130 public static final String REQUEST = "request"; 128 131 public static final String REPOSITORY_NAME = "repositoryName"; 132 public static final String REPOSITORY_ID = "repositoryId"; 129 133 public static final String RESPONSE = "response"; 130 134 public static final String RESPONSE_DATE = "responseDate"; … … 620 624 return duplicate; 621 625 } 622 626 623 627 public static void copyElement(Element to, Element from, String elem_name) { 624 628 … … 633 637 } 634 638 } 639 635 640 public static HashMap<String, String> getParamMap(NodeList params) { 636 641 HashMap<String, String> map = new HashMap<String, String>(); … … 643 648 return map; 644 649 } 650 651 645 652 /** Parse an XML document from a given file */ 646 653 static public Document parseXMLFile (File xml_file) { … … 678 685 return document; 679 686 } 680 687 681 688 /** Parse an XML document from a given reader */ 682 689 static public Document parseXML (Reader xml_reader) { … … 733 740 734 741 742 public static Element createOAIIdentifierXML(String repository_id, String sample_collection, String sample_doc_id) { 743 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>"; 744 745 Document xml_doc = new XMLConverter().getDOM(xml); 746 return (Element)response_doc.importNode(xml_doc.getDocumentElement(), true); 747 748 749 } 750 751 public static Element createGSDLElement() { 752 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>"; 753 Document xml_doc = new XMLConverter().getDOM(xml); 754 return (Element)response_doc.importNode(xml_doc.getDocumentElement(), true); 755 756 757 } 735 758 } 736 759
Note:
See TracChangeset
for help on using the changeset viewer.