Changeset 15670


Ignore:
Timestamp:
2008-05-23T13:31:52+12:00 (16 years ago)
Author:
ak19
Message:

Changed the browse() method so that the titles-by-letter classifier returns only letter classifiers that contain document titles

File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java

    r15437 r15670  
    13781378            // for each letter of the alphabet:
    13791379            Element classifier = createClassifierElement(doc, "TitleByLetter",
    1380                 classifierNum++, "titles (by letter)", "Browse titles by letter");
     1380                classifierNum++, "titles by letter", "Browse titles by letter");
    13811381            // now add this <classifier> to the <classifierList>
    13821382            classifierList.appendChild(classifier);
     
    17221722                int num = 1;
    17231723                for(char ch = 'A'; ch <= 'Z'; ch++, num++) {
     1724                    // Retrieve the document structure for each subClassifierID:
     1725                    // all the documents that begin with its letter.
     1726                    // remove the starting CL
     1727                    String letter = String.valueOf(ch);
     1728                    try{
     1729                    String[] docPIDs = this.browseTitlesByLetter(
     1730                             collectionName, letter);
     1731                    if(docPIDs.length == 0) {
     1732                        continue; // skip letters that don't have any kids
     1733                    }
     1734                   
    17241735                    // <classifierNode nodeID="CL3.1">
    17251736                    Element subClassifier = doc.createElement(
    1726                             GSXML.CLASS_NODE_ELEM);
     1737                          GSXML.CLASS_NODE_ELEM);
    17271738                    attribute = doc.createAttribute(GSXML.NODE_ID_ATT);
    17281739                    attribute.setValue(classifierID+"."+num);
    17291740                    subClassifier.setAttributeNode(attribute);
    17301741                    classifierNode.appendChild(subClassifier);
    1731                     // now we are going to retrieve the document structure for
    1732                     // this subClassifierID: all the documents that begin with
    1733                     // its letter.
    1734                     // remove the starting CL
    1735                     String letter = String.valueOf(ch);
    1736                     try{
    1737                         String[] docPIDs = this.browseTitlesByLetter(
    1738                                 collectionName, letter);
    1739                         // append the <docNodes> for the docPIDs found as children
    1740                         // of subclassifier
    1741                         getStructureElement(subClassifier, docPIDs, DESCENDANTS);
    1742                                         //CHILDREN); // for testing
    1743                     } catch(Exception e) {
    1744                         ex = new FedoraGS3RunException(e);
    1745                         ex.setSpecifics("requested portion of TOC file or "
    1746                                 + "trouble with fielded search ");
    1747                     }
     1742                   
     1743                    // append the <docNodes> for the docPIDs found as children
     1744                    // of subclassifier
     1745                    getStructureElement(subClassifier, docPIDs, DESCENDANTS);
     1746                        //CHILDREN); // for testing
     1747                    } catch(Exception e) {
     1748                    ex = new FedoraGS3RunException(e);
     1749                    ex.setSpecifics("requested portion of TOC file or "
     1750                            + "trouble with fielded search ");
     1751                    }
    17481752                }
    17491753                break;
Note: See TracChangeset for help on using the changeset viewer.