Changeset 21835 for other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
- Timestamp:
- 2010-03-26T18:37:14+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
r21775 r21835 161 161 * administrative password and username of the fedora server showing 162 162 * the values in the properties file as default. If the necessary 163 * initialisation are not present in the file, the ycorresponding fields163 * initialisation are not present in the file, the corresponding fields 164 164 * in the dialog will be blank. 165 165 * If no password was set on the fedora repository when installing it, … … 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 * All collections in this Digital Library (Fedora Repository) share the 1304 * same services, so this method returns the same services as getServiceList(); 1306 1305 * @param collectionName - the name of the collection whose services are to 1307 1306 * be described. It will be converted to a fedora collection pid, which is of … … 1679 1678 * user to browse the titles of documents in the given collection by letter 1680 1679 * and returning the results. 1681 * @param classifierID is the id of the classifieron which to browse. In1680 * @param classifierIDs are the ids of the classifiers on which to browse. In 1682 1681 * this case, the classifier indicates whether we browse titles by letter, or 1683 1682 * browse (documents) by collection; and it is of the form <CL(letter)>. … … 1687 1686 * the documents that start with the letter indicated by parameter classifier. 1688 1687 */ 1689 public String browse(String collectionName, String classifierID)1688 public String browse(String collectionName, String[] classifierIDs) 1690 1689 { 1691 1690 Document doc = builder.newDocument(); … … 1696 1695 GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER); 1697 1696 1697 for(int i = 0; i < classifierIDs.length; i++) { 1698 1698 // <classifierNode nodeID="classifierNum"> 1699 1699 Element requestedClassifierNode = doc.createElement( 1700 1700 GSXML.CLASS_NODE_ELEM); 1701 1701 Attr attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 1702 attribute.setValue(classifierID );1702 attribute.setValue(classifierIDs[i]); 1703 1703 requestedClassifierNode.setAttributeNode(attribute); 1704 1704 classifierNodeList.appendChild(requestedClassifierNode); … … 1711 1711 Element classifierNode = doc.createElement(GSXML.CLASS_NODE_ELEM); 1712 1712 attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 1713 attribute.setValue(classifierID );1713 attribute.setValue(classifierIDs[i]); 1714 1714 classifierNode.setAttributeNode(attribute); 1715 1715 nodeStructure.appendChild(classifierNode); … … 1719 1719 // classifier CL2 = browse by collection; 1720 1720 //remove the CL prefix and obtain the number from the id: 1721 int classifierNum = Integer.parseInt(classifierID .replace("CL", ""));1721 int classifierNum = Integer.parseInt(classifierIDs[i].replace("CL", "")); 1722 1722 switch(classifierNum) { 1723 1723 case 1: … … 1727 1727 // Retrieve the document structure for each subClassifierID: 1728 1728 // all the documents that begin with its letter. 1729 // remove the starting CL1730 1729 String letter = String.valueOf(ch); 1731 try {1730 try { 1732 1731 String[] docPIDs = this.browseTitlesByLetter( 1733 1732 collectionName, letter); … … 1740 1739 GSXML.CLASS_NODE_ELEM); 1741 1740 attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 1742 attribute.setValue(classifierID +"."+num);1741 attribute.setValue(classifierIDs[i]+"."+num); 1743 1742 subClassifier.setAttributeNode(attribute); 1744 1743 classifierNode.appendChild(subClassifier); … … 1760 1759 GSXML.CLASS_NODE_ELEM); 1761 1760 attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 1762 attribute.setValue(classifierID +"."+0); //1761 attribute.setValue(classifierIDs[i]+"."+0); // 1763 1762 subClassifier.setAttributeNode(attribute); 1764 1763 classifierNode.appendChild(subClassifier); … … 1769 1768 default: 1770 1769 ex = new FedoraGS3RunException( // cause is regular exception 1771 new Exception("Unknown classifier ID: " + classifierID)); 1772 } 1770 new Exception("Unknown classifier ID: " + classifierIDs[i])); 1771 } 1772 } 1773 1773 Element responseMsg = createResponseMessage(doc, classifierNodeList, ex, 1774 1774 GSXML.REQUEST_TYPE_DESCRIBE, collectionName+"/ClassifierBrowse"); … … 2209 2209 System.out.println("\nCLASSIFIER BROWSE"); 2210 2210 System.out.println(con.browse("gs2mgdemo", //"ClassifierBrowse", 2211 "CL1"));2211 new String[]{"CL1"})); 2212 2212 2213 2213 System.out.println("\nCLASSIFIER BROWSE METADATA RETRIEVE");
Note:
See TracChangeset
for help on using the changeset viewer.