Changeset 15659


Ignore:
Timestamp:
2008-05-22T19:21:19+12:00 (15 years ago)
Author:
ak19
Message:

Corrected previous. Browsing docs (by title) in a Fedora repository of Greenstone docs skips the collection itself, as it is not a document

File:
1 edited

Legend:

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

    r15658 r15659  
    13981398            // just *contain* the letter, but actually start with it:
    13991399            String resultTitle = results[i].getTitle(0);
    1400             if(resultTitle.equalsIgnoreCase(GREENSTONE_+collName+_COLLECTION)) {
    1401                 continue; // try next one
    1402             } else if(resultTitle.toLowerCase().startsWith(letter.toLowerCase())) {
    1403                 // skip the collection itself
    1404                 v.add(results[i].getPid());
    1405                 //LOG.debug(resultTitle);
     1400            if(resultTitle.toLowerCase().startsWith(letter.toLowerCase())) {
     1401                String pid = results[i].getPid();
     1402                // skip the collection object itself
     1403                if(!pid.equalsIgnoreCase(GREENSTONE_+collName+_COLLECTION)) {
     1404                    v.add(pid);
     1405                    //LOG.debug(resultTitle);
     1406                }
    14061407            }
    14071408        }
     
    14721473            boolean accepted = false; // accept the resultTitle found
    14731474           
    1474             // skip the collection object itself, since it's not a document
    1475             if(resultTitle.equalsIgnoreCase(GREENSTONE_+collName+_COLLECTION)) {
     1475            String resultPID = results[i].getPid();
     1476            // skip the collection object itself, since it's not a document
     1477            if(resultPID.equalsIgnoreCase(GREENSTONE_+collName+_COLLECTION)) {
    14761478                accepted = false;
    14771479            }
     
    14791481            // whether resultTitle contains titleContents:
    14801482            else if(indexOfFirstSpace == -1) { // titleContents is a single word
    1481                    
    14821483                if(!startsWith) // titles that *contain* the word titleContents
    14831484                    accepted = true; //accept all titles found
     
    14871488                    accepted = true;
    14881489               
    1489             }
     1490            } 
    14901491            else { // otherwise, titleContents is a phrase of >1 word, need
    14911492                // to check that the result title contains the entire phrase
     
    15001501            // if the resultTitle fit the criteria, store its pid
    15011502            if(accepted) {
    1502                 v.add(results[i].getPid());
     1503                v.add(resultPID);
    15031504                //System.out.println(resultTitle);
    15041505            }
Note: See TracChangeset for help on using the changeset viewer.