Changeset 26309 for other-projects/gs3-webservices-java-client/trunk
- Timestamp:
- 2012-10-11T19:10:46+13:00 (12 years ago)
- Location:
- other-projects/gs3-webservices-java-client/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
r26286 r26309 493 493 ex = this.getEX(id); 494 494 } 495 else { // docID refers to a document 495 else { // docID refers to a document 496 497 docNode.setAttribute(GSXML.DOC_TYPE_ATT, "hierarchy"); 498 docNode.setAttribute(GSXML.NODE_RANK_ATT, "NaN"); 499 496 500 // work out the document's fedora PID and section ID, and then 497 501 // obtain the EX (extracted metadata) and DC datastreams for the doc … … 509 513 dc = this.getDC(docPID); 510 514 dls = this.getDLS(docPID); 515 docNode.setAttribute(GSXML.NODE_TYPE_ATT, "root"); 511 516 } 512 517 else { 513 518 ex = getSectionEXMetadata(docPID, sectionID); 514 519 dc = getSectionDCMetadata(docPID, sectionID); 520 docNode.setAttribute(GSXML.NODE_TYPE_ATT, "leaf"); 515 521 } 516 522 } … … 1796 1802 1797 1803 Element responseMsg = createResponseMessage(doc, classifierNodeList, ex, 1798 GSXML.REQUEST_TYPE_ DESCRIBE, /*collectionName+/ */"ClassifierBrowse");1804 GSXML.REQUEST_TYPE_PROCESS, /*collectionName+/ */"ClassifierBrowse"); 1799 1805 try { 1800 1806 return FedoraCommons.elementToString(responseMsg); … … 1840 1846 attribute.setValue(classifierID); 1841 1847 classNode.setAttributeNode(attribute); 1842 Attr typeAttribute = doc.createAttribute(GSXML.CHILD_TYPE_ATT);1843 typeAttribute.setValue(GSXML.VLIST);1844 classNode.setAttributeNode(typeAttribute);1845 1848 1846 1849 if(firstLevel == -1) { // CL1 - toplevel node … … 1849 1852 classifierNodeList.appendChild(classNode); 1850 1853 classNode.appendChild(nodeStructure); 1851 1852 1854 nodeStructure.appendChild(root); 1855 root.setAttribute(GSXML.CHILD_TYPE_ATT, GSXML.VLIST); 1856 1853 1857 if(structure.indexOf("descendants") != -1) { 1854 1858 getTitlesByLetterStructure(collectionName, root, classifierID, true, null); … … 1868 1872 attribute.setValue(toplevelID); 1869 1873 toplevelNode.setAttributeNode(attribute); 1870 typeAttribute = doc.createAttribute(GSXML.CHILD_TYPE_ATT);1871 typeAttribute.setValue(GSXML.VLIST);1872 toplevelNode.setAttributeNode(typeAttribute);1873 1874 Element node = (Element)toplevelNode.cloneNode(true); // clone nodes before appending children 1874 1875 … … 1876 1877 toplevelNode.appendChild(nodeStructure); 1877 1878 nodeStructure.appendChild(node); 1879 node.setAttribute(GSXML.CHILD_TYPE_ATT, GSXML.VLIST); 1878 1880 1879 1881 if(structure.indexOf("siblings") != -1) { // get the children of the parents too … … 1884 1886 } else { 1885 1887 node.appendChild(classNode); 1888 classNode.setAttribute(GSXML.CHILD_TYPE_ATT, GSXML.VLIST); 1886 1889 } 1887 1890 } else { … … 1889 1892 classifierNodeList.appendChild(node); 1890 1893 node.appendChild(nodeStructure); 1891 nodeStructure.appendChild(classNode); 1894 nodeStructure.appendChild(classNode); 1895 classNode.setAttribute(GSXML.CHILD_TYPE_ATT, GSXML.VLIST); 1892 1896 } 1893 1897 … … 2001 2005 // <classifierNode childType="VList" nodeID="CL1.x"> 2002 2006 subClassifier = doc.createElement(GSXML.CLASS_NODE_ELEM); 2003 Attr typeAttribute = doc.createAttribute(GSXML.CHILD_TYPE_ATT); 2004 typeAttribute.setValue(GSXML.VLIST); 2005 subClassifier.setAttributeNode(typeAttribute); 2006 Attr attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 2007 attribute.setValue(classifierID+"."+count); 2008 subClassifier.setAttributeNode(attribute); 2007 subClassifier.setAttribute(GSXML.CHILD_TYPE_ATT, GSXML.VLIST); 2008 subClassifier.setAttribute(GSXML.NODE_ID_ATT, classifierID+"."+count); 2009 subClassifier.setAttribute(GSXML.CLASSIFIER_STYLE_ATT, GSXML.VLIST); 2009 2010 } 2010 2011 classifierNode.appendChild(subClassifier); // either way, append the subClassifier node … … 2337 2338 } 2338 2339 2339 // Build Greenstone XML Query response message f or from2340 // Build Greenstone XML Query response message from 2340 2341 // the pids (which should be document identifiers) 2341 2342 Document doc = builder.newDocument(); … … 2345 2346 GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER); 2346 2347 Element metadata = doc.createElement(GSXML.METADATA_ELEM); 2347 2348 Attr attribute = doc.createAttribute(GSXML.NAME_ATT); 2349 attribute.setValue(NUM_DOCS_MATCHED); 2350 metadata.setAttributeNode(attribute); 2351 2352 attribute = doc.createAttribute(GSXML.VALUE_ATT); 2353 attribute.setValue(Integer.toString(pids.length)); 2354 metadata.setAttributeNode(attribute); 2355 2348 metadata.setAttribute(GSXML.NAME_ATT, NUM_DOCS_MATCHED); 2349 metadata.setAttribute(GSXML.VALUE_ATT, Integer.toString(pids.length)); 2350 metadataList.appendChild(metadata); 2351 2352 metadata = doc.createElement(GSXML.METADATA_ELEM); 2353 metadata.setAttribute(GSXML.NAME_ATT, "numDocsReturned"); 2354 metadata.setAttribute(GSXML.VALUE_ATT, Integer.toString(pids.length)); 2356 2355 metadataList.appendChild(metadata); 2357 2356 … … 2367 2366 for(int i = 0; i < pids.length; i++) { 2368 2367 Element docNode = doc.createElement(GSXML.DOC_NODE_ELEM); 2369 attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 2370 attribute.setValue(pids[i]); 2371 docNode.setAttributeNode(attribute); 2372 2373 attribute = doc.createAttribute(GSXML.DOC_TYPE_ATT); 2374 attribute.setValue("hierarchy"); 2375 docNode.setAttributeNode(attribute); 2376 2377 attribute = doc.createAttribute(GSXML.NODE_TYPE_ATT); 2378 attribute.setValue("root"); 2379 docNode.setAttributeNode(attribute); 2368 docNode.setAttribute(GSXML.NODE_ID_ATT, pids[i]); 2369 docNode.setAttribute(GSXML.DOC_TYPE_ATT, "hierarchy"); 2370 docNode.setAttribute(GSXML.NODE_TYPE_ATT, "root"); 2371 docNode.setAttribute(GSXML.NODE_RANK_ATT, "NaN"); 2372 2380 2373 docNodeList.appendChild(docNode); 2381 2374 } … … 2383 2376 Element responseMsg = createResponseMessage(doc, docNodeList, ex, 2384 2377 GSXML.REQUEST_TYPE_PROCESS, service); 2378 2379 //docNodeList.getParentNode().appendChild(metadataList); // need to add term info 2380 2385 2381 try{ 2386 2382 return FedoraCommons.elementToString(responseMsg); -
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/GSearchConnection.java
r26286 r26309 208 208 // for debugging 209 209 //javax.swing.JOptionPane.showMessageDialog(null, "GSearchConnection.gFindObjects:" + valueFound); 210 210 //LOG.error("gfindObjects result: " + valueFound); 211 211 212 return valueFound; 212 213 }
Note:
See TracChangeset
for help on using the changeset viewer.