Changeset 21775
- Timestamp:
- 2010-03-11T16:45:58+13:00 (14 years ago)
- Location:
- other-projects/gs3-webservices-java-client/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/SearchResultsDisplay.java
r15222 r21775 323 323 String docContent = docNode.getContent(); 324 324 if(docContent != null) { 325 326 325 docContent = docContent.replaceAll( 326 "ALIGN=\"JUSTIFY\"", "ALIGN=\"LEFT\""); 327 327 } 328 this.docContentEditPane.setText(docContent); 328 329 this.docContentEditPane.setText(docContent); 329 330 this.docContentEditPane.setCaretPosition(0); // set 'cursor' at top 330 331 } -
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraConnection.java
r15659 r21775 766 766 767 767 /** All "greenstone:*" objects in fedora (be they collections or documents) 768 * have a TOC datastream. This method returns the content (XML) of the TOC 769 * datastream as is. (Calls default fedora-system 3 dissemination <pid>/TOC.) 768 * have a TOC datastream, unless they have only 1 section (SECTION1). 769 * This method returns the content (XML) of the TOC datastream as is. 770 * (Calls default fedora-system 3 dissemination <pid>/TOC.) 770 771 * @return a String version of the XML in the TOC datastream for the fedora 771 772 * object denoted by pid. … … 780 781 throws RemoteException, UnsupportedEncodingException 781 782 { 783 try { 782 784 MIMETypedStream tocStream = APIA.getDatastreamDissemination(pid, TOC, null); 783 785 //asOfDateTime = null to get the current version of the dataStream 784 785 786 // need to set the charset encoding to UTF8 786 787 return new String(tocStream.getStream(), UTF8); 788 } catch(RemoteException re) { 789 // if TOC does not exist, then it means there is only 1 section, dsID: SECTION1 790 return new String("<Section id=\"1\"></Section>".getBytes(), UTF8); //set charset 791 } 787 792 } 788 793 … … 1317 1322 // If sectionNumber=1, then the top-level element/document element 1318 1323 // of the TOC XML is requested, so return the TOC as is. 1319 if(sectionNumber.equals("1")) 1324 if(sectionNumber.equals("1")) { 1320 1325 return docEl; 1326 } 1321 1327 1322 1328 // Get all <Section> elements and find the -
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
r21573 r21775 1035 1035 // set the text content to what was retrieved 1036 1036 Element nodeContent = doc.createElement(GSXML.NODE_CONTENT_ELEM); 1037 Text textNode = doc.createTextNode(sectionContent );1037 Text textNode = doc.createTextNode(sectionContent.trim()); 1038 1038 1039 1039 nodeContent.appendChild(textNode); … … 1301 1301 * serviceNames: DocumentContent/Metadata/StructureRetrieve, ClassifierBrowse, 1302 1302 * ClassifierBrowseMetadataRetrieve. 1303 * All collections in this Digital Library (Fedora Repository) share 1304 * the same services, so this method returns the same as 1305 * describeService(serviceName). 1303 1306 * @param collectionName - the name of the collection whose services are to 1304 1307 * be described. It will be converted to a fedora collection pid, which is of … … 1333 1336 * return nothing special except their names; browse (and any query) 1334 1337 * return more complex XML responses. 1335 * All collections in this Digital Library (Fedora Repository) share1336 * the same services, so this method returns the same as1337 * describeService(serviceName).1338 1338 * @param serviceName - the name of the service in the collection which is to 1339 1339 * be described.*/ … … 1355 1355 attribute = doc.createAttribute(GSXML.TYPE_ATT); 1356 1356 1357 if(serviceName.toLowerCase().endsWith("retrieve")) 1357 if(serviceName.toLowerCase().endsWith("retrieve")) { 1358 1358 attribute.setValue(GSXML.SERVICE_TYPE_RETRIEVE); 1359 1359 } 1360 1360 else if(serviceName.toLowerCase().contains("browse")) { 1361 1361 attribute.setValue(GSXML.SERVICE_TYPE_BROWSE); … … 1390 1390 else if(serviceName.toLowerCase().contains("query")) { 1391 1391 attribute.setValue(GSXML.SERVICE_TYPE_QUERY); 1392 if(serviceName.equals("TextQuery")) 1392 if(serviceName.equals("TextQuery")) { 1393 1393 describeTextQueryService(service); 1394 else if(serviceName.equals("FieldQuery"))1394 } else if(serviceName.equals("FieldQuery")) { 1395 1395 describeFieldQueryService(service); 1396 } 1396 1397 } 1397 1398 … … 2045 2046 // there may be fewer searchTerms than fieldNames (since some 2046 2047 // fieldNames may have been left empty), so loop on searchTerms 2047 if(map.containsKey(fieldNames[i])) { // fieldName is already2048 if(map.containsKey(fieldNames[i])) { // fieldName is already 2048 2049 // in the list, so append comma with new value 2049 2050 String termsList = (String)map.get(fieldNames[i]);
Note:
See TracChangeset
for help on using the changeset viewer.