Changeset 21835

Show
Ignore:
Timestamp:
26.03.2010 18:37:14 (9 years ago)
Author:
ak19
Message:

Browse takes a list of classifierIDs, not a single one.

Location:
other-projects/gs3-webservices-java-client/trunk/src
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/GS3JavaClient.java

    r15731 r21835  
    736736            JEditorPane information = new JEditorPane(); 
    737737            information.setEditable(false); 
    738             information.setContentType("text/html"); 
     738            information.setContentType("text/html"); 
    739739            information.setText(collDataEl.info()); 
    740740             
     
    929929     * to be retrieved. */ 
    930930    public void doBrowse(ClassifierData classifier) { 
     931        String[] classifierNames = { classifier.name }; 
    931932        String response = dlAPIA.retrieveBrowseStructure( 
    932                 this.colName, this.serviceName, classifier.name); 
     933                this.colName, this.serviceName, classifierNames); 
    933934         
    934935        browseResponseObject.clear(); 
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/DigitalLibraryServicesAPIA.java

    r21812 r21835  
    201201     * classifierID (including the structures of document descendents of  
    202202     * the classifier).  
    203      * @param classifierID is of the form CL# where the number (#) marks 
    204      * out structured sections like CL1.1.3 or CL2  
     203     * @param classifierIDs - each ID is of the form CL# where the number (#) 
     204     * marks out structured sections like CL1.1.3 or CL2  
    205205     * @param collection is the name of the collection  
    206206     * @param service is the name of the browse service (=ClassifierBrowse usually)  
    207207    */ 
    208208    public String retrieveBrowseStructure( 
    209             String collection, String service, String classifierID); 
     209            String collection, String service, String[] classifierIDs); 
    210210 
    211211    /** @return a String representing Greenstone3  
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/FedoraServicesAPIA.java

    r21812 r21835  
    121121    } 
    122122 
    123     /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML 
     123    /** @return a String representing Greenstone3 DocumentStructureRetrieve XML 
    124124     * containing the document structure of the documents indicated by docIDs:  
    125125     * this means all their descendents  
     
    131131    } 
    132132     
    133     /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML  
     133    /** @return a String representing Greenstone3 DocumentStructureRetrieve XML  
    134134     * containing the document structure of the document indicated by docID:  
    135135     * this means all its descendents  
     
    142142 
    143143    // UNUSED by the client, but still a very useful method: 
    144     /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML  
     144    /** @return a String representing Greenstone3 DocumentStructureRetrieve XML  
    145145     * containing a view of the document structure of the documents denoted by  
    146146     * docs where only the requested documents and their direct children are   
     
    153153    } 
    154154     
    155     /** @return a String representing Greenstone3 DocumentMetadataRetrieve XML  
     155    /** @return a String representing Greenstone3 DocumentStructureRetrieve XML  
    156156     * containing a view of the document structure of the document denoted by  
    157157     * docID where only the document and its direct children are returned.  
     
    167167     * classifierID (including the structures of document descendents of  
    168168     * the classifier).  
    169      * @param classifierID is of the form CL# where the number (#) marks 
    170      * out structured sections like CL1.1.3 or CL2  
     169     * @param classifierIDs - each ID is of the form CL# where the number (#) 
     170     * marks out structured sections like CL1.1.3 or CL2  
    171171     * @param collection is the name of the collection  
    172172     * @param service is the name of the browse service (=ClassifierBrowse usually) 
    173173    */ 
    174174    public String retrieveBrowseStructure( 
    175             String collection, String service, String classifierID)  
     175            String collection, String service, String[] classifierIDs)  
    176176    { 
    177         return this.browse(collection, classifierID); 
     177        return this.browse(collection, classifierIDs); 
    178178    } 
    179179 
     
    194194    } 
    195195     
    196     /** @return a String representing Greenstone3 XML for a query process 
    197      * response returning the results for the query denoted by parameter 
    198      * nameValParamsMap. 
    199      * @param nameValParamsMap is a Map of name and value pairs for all the 
    200      * query field data values. The names match the field names that 
    201      * describeCollectionService() would have returned for the query service.  
    202      * @param collection is the name of the collection  
    203      * @param service is the name of the query service 
    204      * This method is only ever called when any of the services in the digital  
    205      * library described themselves as type=query. Therefore any digital 
    206      * libraries that have no query services, can just return emtpy message  
    207      * strings (or even "") since this method will never be called on them  
    208      * anyway. */ 
    209     public String query(String collection, String service,  
    210             Map nameValParamsMap)  
    211     {    
    212         return super.query(collection, service, nameValParamsMap); 
    213     } 
    214196} 
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/dlservices/GS3ServicesAPIA.java

    r15379 r21835  
    356356     * classifierID (including the structures of document descendants of  
    357357     * the classifier).  
    358      * @param classifierID is of the form CL# where the number (#) marks 
    359      * out structured sections like CL1.1.3 or CL2  
     358     * @param classifierIDs - each ID is of the form CL# where the number (#) 
     359     * marks out structured sections like CL1.1.3 or CL2  
    360360     * @param collection is the name of the collection  
    361361     * @param service is the name of the browse service (=ClassifierBrowse usually) 
    362362    */ 
    363363    public String retrieveBrowseStructure( 
    364             String collection, String service, String classifierID)  
     364            String collection, String service, String[] classifierIDs)  
    365365    { 
    366         String[] classifierIDs = { classifierID };  
    367366        return this.browseDescendants(collection, service,  
    368367                language, classifierIDs ); 
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraConnection.java

    r21775 r21835  
    244244        // get user input 
    245245        setInitialisationProperties(properties); 
    246         properties = null; // finished 
     246        properties = null; // finished 
    247247    } 
    248248     
     
    524524        // fewer files of FedoraClient.jar 
    525525        FedoraAPIAServiceLocator serviceLocator  
    526             = new FedoraAPIAServiceLocator(fedoraServerUsername, 
    527                     fedoraServerPassword); 
     526            = new FedoraAPIAServiceLocator(fedoraServerUsername, 
     527                           fedoraServerPassword); 
    528528         
    529529        APIA = null; 
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java

    r21775 r21835  
    161161     * administrative password and username of the fedora server showing  
    162162     * the values in the properties file as default. If the necessary  
    163      * initialisation are not present in the file, they corresponding fields 
     163     * initialisation are not present in the file, the corresponding fields 
    164164     * in the dialog will be blank.  
    165165     * If no password was set on the fedora repository when installing it,  
     
    13011301     * serviceNames: DocumentContent/Metadata/StructureRetrieve, ClassifierBrowse, 
    13021302     * 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(); 
    13061305     * @param collectionName - the name of the collection whose services are to 
    13071306     * be described. It will be converted to a fedora collection pid, which is of  
     
    16791678     * user to browse the titles of documents in the given collection by letter 
    16801679     * and returning the results. 
    1681      * @param classifierID is the id of the classifier on which to browse. In 
     1680     * @param classifierIDs are the ids of the classifiers on which to browse. In 
    16821681     * this case, the classifier indicates whether we browse titles by letter, or 
    16831682     * browse (documents) by collection; and it is of the form <CL(letter)>. 
     
    16871686     * the documents that start with the letter indicated by parameter classifier. 
    16881687    */ 
    1689     public String browse(String collectionName, String classifierID) 
     1688    public String browse(String collectionName, String[] classifierIDs) 
    16901689    { 
    16911690        Document doc = builder.newDocument(); 
     
    16961695                GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER); 
    16971696         
     1697    for(int i = 0; i < classifierIDs.length; i++) { 
    16981698        // <classifierNode nodeID="classifierNum"> 
    16991699        Element requestedClassifierNode = doc.createElement( 
    17001700                GSXML.CLASS_NODE_ELEM); 
    17011701        Attr attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 
    1702         attribute.setValue(classifierID); 
     1702        attribute.setValue(classifierIDs[i]); 
    17031703        requestedClassifierNode.setAttributeNode(attribute); 
    17041704        classifierNodeList.appendChild(requestedClassifierNode); 
     
    17111711        Element classifierNode = doc.createElement(GSXML.CLASS_NODE_ELEM); 
    17121712        attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 
    1713         attribute.setValue(classifierID); 
     1713        attribute.setValue(classifierIDs[i]); 
    17141714        classifierNode.setAttributeNode(attribute); 
    17151715        nodeStructure.appendChild(classifierNode); 
     
    17191719        // classifier CL2 = browse by collection; 
    17201720        //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", "")); 
    17221722        switch(classifierNum) { 
    17231723            case 1: 
     
    17271727                    // Retrieve the document structure for each subClassifierID:  
    17281728                    // all the documents that begin with its letter. 
    1729                     // remove the starting CL 
    17301729                    String letter = String.valueOf(ch); 
    1731                     try{ 
     1730                    try { 
    17321731                    String[] docPIDs = this.browseTitlesByLetter( 
    17331732                             collectionName, letter); 
     
    17401739                          GSXML.CLASS_NODE_ELEM); 
    17411740                    attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 
    1742                     attribute.setValue(classifierID+"."+num); 
     1741                    attribute.setValue(classifierIDs[i]+"."+num); 
    17431742                    subClassifier.setAttributeNode(attribute); 
    17441743                    classifierNode.appendChild(subClassifier); 
     
    17601759                            GSXML.CLASS_NODE_ELEM); 
    17611760                    attribute = doc.createAttribute(GSXML.NODE_ID_ATT); 
    1762                     attribute.setValue(classifierID+"."+0); // 
     1761                    attribute.setValue(classifierIDs[i]+"."+0); // 
    17631762                    subClassifier.setAttributeNode(attribute); 
    17641763                    classifierNode.appendChild(subClassifier); 
     
    17691768            default: 
    17701769                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    } 
    17731773        Element responseMsg = createResponseMessage(doc, classifierNodeList, ex, 
    17741774                GSXML.REQUEST_TYPE_DESCRIBE, collectionName+"/ClassifierBrowse"); 
     
    22092209            System.out.println("\nCLASSIFIER BROWSE"); 
    22102210            System.out.println(con.browse("gs2mgdemo", //"ClassifierBrowse",  
    2211                     "CL1")); 
     2211                              new String[]{"CL1"})); 
    22122212             
    22132213            System.out.println("\nCLASSIFIER BROWSE METADATA RETRIEVE"); 
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/FedoraToGS3Interface.java

    r15437 r21835  
    278278     * user to browse the titles of documents in the given collection by letter 
    279279     * and returning the results. 
    280      * @param classifierID is the id of the classifier on which to browse. In 
     280     * @param classifierIDs are the ids of the classifiers on which to browse. In 
    281281     * this case, the classifier indicates whether we browse titles by letter, or 
    282282     * browse (documents) by collection; and it is of the form &lt;CL(letter)&gt;. 
     
    286286     * the documents that start with the letter indicated by parameter classifier. 
    287287    */ 
    288     public String browse(String collectionName, String classifierID); 
     288    public String browse(String collectionName, String[] classifierIDs); 
    289289     
    290290    /* @returns the document identifiers returned for a search on the titles of