Ignore:
Timestamp:
2010-01-21T18:19:27+13:00 (14 years ago)
Author:
ak19
Message:

Corrections to get things working again with GSearch2.2 for Fedora3.3: 1. gFindObjects takes the same parameters as before but in a different order; 2. Needed to extend fieldmaxlength, since the PID returned got truncated otherwise.

Location:
other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services
Files:
2 edited

Legend:

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

    r15733 r21573  
    186186     * - name of the index into which the GS3 documents have been indexed
    187187     * and which FedoraGenericSearch should use to perform searches. If none is
    188      * given in the properties file, then the index name defaults "FedoraIndex".
     188     * given in the properties file, then the index name defaults to "FedoraIndex".
    189189     * @param properties is the Properties Map loaded from a properties file
    190190     * (if there was any) which specifies such things as host and port of the
     
    469469            String docPID = getDocPIDFromDocID(id);
    470470            if(sectionID.equals("") || sectionID.equals("1")) {
    471                 //metadata of toplevel document is requested
     471                // metadata of toplevel document is requested
    472472                ex = this.getEX(docPID); // slightly faster than doing
    473473                        //getSectionEXMetadata(docID, "1")
     
    662662        }catch(Exception e) {
    663663            ex = new FedoraGS3RunException(e);
     664            //ex.setSpecifics("EX metadata datastream PID: |" + docIDs[i] + "|"); // for debugging PID
    664665            ex.setSpecifics("EX metadata datastream");
    665666        }
  • other-projects/gs3-webservices-java-client/trunk/src/GS3Fedora/org/greenstone/fedora/services/GSearchConnection.java

    r15437 r21573  
    179179    */
    180180    protected String gFindObjects(String searchFieldedTerms, String sort,
    181             int hitPageStart, int hitPageSize, int snippetsMax, 
    182             int fieldMaxLength, String indexName, String resultPageXslt) throws Exception
     181            int hitPageStart, int hitPageSize, int snippetsMax,
     182            /*int fieldMaxLength,*/ String indexName, String resultPageXslt) throws Exception
    183183    {
    184184        // "Prefills as much info from the WSDL as it can. Right now it's SOAPAction,
     
    191191        call.setOperationName(G_FIND_OBJECTS);
    192192       
     193        // Max num of chars in field vals returned. Since return values exceeding
     194        // maxlength will be truncated, ensure length suffices for long PIDs returned.
     195        // The only element of the response XML we'll be using is the PID of the document
     196        // in which the searchTerm occurred.
     197        final int fieldMaxLength = 100; // NOT TRUE: max length in words of field values
     198              // returned. E.g. snippet sizes will be reduced to fieldMaxLength words too.
     199
     200        // This is the method call for Fedora 2's GSearch
     201        //String valueFound =(String)call.invoke( new Object[] {
     202        //  searchFieldedTerms, sort, hitPageStart, hitPageSize, snippetsMax,
     203        //  fieldMaxLength, indexName, resultPageXslt} );
     204
     205        // The method call for GSearch 2.2 of Fedora 3 takes the args in a different order:
    193206        String valueFound =(String)call.invoke( new Object[] {
    194                 searchFieldedTerms, sort, hitPageStart, hitPageSize, snippetsMax,
    195                 fieldMaxLength, indexName, resultPageXslt} );
    196                    
     207            searchFieldedTerms, hitPageStart, hitPageSize, snippetsMax,
     208            fieldMaxLength, indexName, sort, resultPageXslt} );
     209       
     210        // for debugging
     211        //javax.swing.JOptionPane.showMessageDialog(null, "GSearchConnection.gFindObjects:" + valueFound);
     212           
    197213        return valueFound;
    198214    }
     
    215231    {
    216232        final String sort = ""; // returns results from highest to lowest rank
    217         final int fieldMaxLength = 50; // maximum length in words of field values
    218                 // returned. E.g. snippet sizes will be reduced to fieldMaxLength
    219                 // words too. It doesn't matter what we set this too, the only
    220                 // element of the response XML we'll be using is the PID of the
    221                 // document in which the searchTerm occurred.
    222233        final String resultPageXslt = "";       
    223234       
     
    229240        return gFindObjects(fullSearchTerm, sort,
    230241            hitPageStart, hitPageSize, snippetsMax,
    231             fieldMaxLength, indexName, resultPageXslt);
     242            indexName, resultPageXslt);
    232243    }
    233244   
     
    369380       
    370381        final String sort = ""; // returns results from highest to lowest rank
    371         final int fieldMaxLength = 50; // maximum length in words of field values
    372                 // returned. E.g. snippet sizes will be reduced to fieldMaxLength
    373                 // words too
    374382        final String resultPageXslt = "";       
    375383        return gFindObjects(fieldedSearchTerms, sort,
    376384                hitPageStart, hitPageSize, snippetsMax,
    377                 fieldMaxLength, indexName, resultPageXslt);
     385                indexName, resultPageXslt);
    378386    }
    379387   
Note: See TracChangeset for help on using the changeset viewer.