Changeset 26270 for other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
- Timestamp:
- 2012-09-27T18:37:00+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
r26262 r26270 29 29 import org.greenstone.fedora.services.FedoraGS3Exception.FedoraGS3RunException; 30 30 import org.greenstone.fedora.services.FedoraGS3Exception.NotAFedoraServerException; 31 import org.greenstone.gsdl3.util.AbstractBasicDocument; // for constants 31 32 import org.greenstone.gsdl3.util.GSXML; 32 33 import org.w3c.dom.Document; … … 888 889 // ... 889 890 // </nodeStructureInfo> 890 Element nodeStructureInfo = doc.createElement(GSXML.NODE_STRUCTURE_ELEM+ GSXML.INFO_ATT);891 Element nodeStructureInfo = doc.createElement(GSXML.NODE_STRUCTURE_ELEM+"Info"); 891 892 Element root = srcDocElement.getOwnerDocument().getDocumentElement(); 892 893 893 if(root.hasAttribute( "numSiblings")) {894 String numSiblings = root.getAttribute( "numSiblings");894 if(root.hasAttribute(AbstractBasicDocument.INFO_NUM_SIBS)) { 895 String numSiblings = root.getAttribute(AbstractBasicDocument.INFO_NUM_SIBS); 895 896 Element infoEl = doc.createElement(GSXML.INFO_ATT); 896 infoEl.setAttribute(GSXML.NAME_ATT, "numSiblings");897 infoEl.setAttribute(GSXML.NAME_ATT, AbstractBasicDocument.INFO_NUM_SIBS); 897 898 infoEl.setAttribute(GSXML.VALUE_ATT, numSiblings); 898 899 nodeStructureInfo.appendChild(infoEl); 899 900 } 900 901 901 if(root.hasAttribute( "siblingPosition")) {902 String siblingPosition = root.getAttribute( "siblingPosition");902 if(root.hasAttribute(AbstractBasicDocument.INFO_SIB_POS)) { 903 String siblingPosition = root.getAttribute(AbstractBasicDocument.INFO_SIB_POS); 903 904 Element infoEl = doc.createElement(GSXML.INFO_ATT); 904 infoEl.setAttribute(GSXML.NAME_ATT, "siblingPosition");905 infoEl.setAttribute(GSXML.NAME_ATT, AbstractBasicDocument.INFO_SIB_POS); 905 906 infoEl.setAttribute(GSXML.VALUE_ATT, siblingPosition); 906 907 nodeStructureInfo.appendChild(infoEl); 907 908 } 908 909 909 if(root.hasAttribute( "numChildren")) {910 String numChildren = root.getAttribute( "numChildren");910 if(root.hasAttribute(AbstractBasicDocument.INFO_NUM_CHILDREN)) { 911 String numChildren = root.getAttribute(AbstractBasicDocument.INFO_NUM_CHILDREN); 911 912 Element infoEl = doc.createElement(GSXML.INFO_ATT); 912 infoEl.setAttribute(GSXML.NAME_ATT, "numChildren");913 infoEl.setAttribute(GSXML.NAME_ATT, AbstractBasicDocument.INFO_NUM_CHILDREN); 913 914 infoEl.setAttribute(GSXML.VALUE_ATT, numChildren); 914 915 nodeStructureInfo.appendChild(infoEl); 915 916 } 917 918 if(root.hasAttribute(AbstractBasicDocument.INFO_DOC_TYPE)) { 919 String documentType = root.getAttribute(AbstractBasicDocument.INFO_DOC_TYPE); 920 Element infoEl = doc.createElement(GSXML.INFO_ATT); 921 infoEl.setAttribute(GSXML.NAME_ATT, AbstractBasicDocument.INFO_DOC_TYPE); 922 infoEl.setAttribute(GSXML.VALUE_ATT, documentType); 923 nodeStructureInfo.appendChild(infoEl); 924 } 925 916 926 docNode.appendChild(nodeStructureInfo); 917 927 } … … 2478 2488 for(int i = 0; i < docIDs.length; i++) { 2479 2489 System.out.println("Descendents and numChildren:\n" 2480 + con.getDocumentStructure(docIDs[i], new String[] {"descendants"}, new String[] { "numChildren"}));2490 + con.getDocumentStructure(docIDs[i], new String[] {"descendants"}, new String[] {AbstractBasicDocument.INFO_NUM_CHILDREN})); 2481 2491 System.out.println("Parent and numSiblings:\n" 2482 + con.getDocumentStructure(docIDs[i], new String[] {"parent"}, new String[] { "numSiblings"}));2492 + con.getDocumentStructure(docIDs[i], new String[] {"parent"}, new String[] {AbstractBasicDocument.INFO_NUM_SIBS})); 2483 2493 } 2484 2494 … … 2490 2500 System.out.println(con.getContent(errorCases)); 2491 2501 System.out.println(con.getDocumentMetadata(errorCases, new String[]{"all"})); 2492 System.out.println(con.getDocumentStructure(errorCases, new String[] {"descendants"}, new String[] { "numChildren"}));2502 System.out.println(con.getDocumentStructure(errorCases, new String[] {"descendants"}, new String[] {AbstractBasicDocument.INFO_NUM_CHILDREN})); 2493 2503 2494 2504 System.out.println("\nCLASSIFIER BROWSE");
Note:
See TracChangeset
for help on using the changeset viewer.