Changeset 15658


Ignore:
Timestamp:
2008-05-22T19:10:12+12:00 (16 years ago)
Author:
ak19
Message:

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

    r15222 r15658  
    13981398            // just *contain* the letter, but actually start with it:
    13991399            String resultTitle = results[i].getTitle(0);
    1400             if(resultTitle.toLowerCase().startsWith(letter.toLowerCase())) {
     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
    14011404                v.add(results[i].getPid());
    14021405                //LOG.debug(resultTitle);
     
    14691472            boolean accepted = false; // accept the resultTitle found
    14701473           
     1474            // skip the collection object itself, since it's not a document
     1475            if(resultTitle.equalsIgnoreCase(GREENSTONE_+collName+_COLLECTION)) {
     1476                accepted = false;
     1477            }
    14711478            // if titleContents is a single word and we are checking
    1472             // whether resultTitle contains titleContents:
    1473             if(indexOfFirstSpace == -1) { // titleContents is a single word
     1479            // whether resultTitle contains titleContents:
     1480            else if(indexOfFirstSpace == -1) { // titleContents is a single word
     1481                   
    14741482                if(!startsWith) // titles that *contain* the word titleContents
    14751483                    accepted = true; //accept all titles found
     
    14791487                    accepted = true;
    14801488               
    1481             } else { // otherwise, titleContents is a phrase of >1 word, need
     1489            }
     1490            else { // otherwise, titleContents is a phrase of >1 word, need
    14821491                // to check that the result title contains the entire phrase
    14831492                if(startsWith && resultTitle.toLowerCase().startsWith(
     
    14881497                    accepted = true;
    14891498            }
     1499           
    14901500            // if the resultTitle fit the criteria, store its pid
    14911501            if(accepted) {
     
    15581568        // (i.e. all collections).
    15591569        FieldSearchResult objects = null;
     1570        final String[] retrieveFields = {"pid", "title"};
    15601571        try {
    15611572            objects = AutoFinder.findObjects(
    1562                     APIA, new String[]{"pid", "title"}, maxresults, query);
     1573                    APIA, retrieveFields, maxresults, query);
    15631574            // collection = APIA.findObjects(new String[]{"pid", "title"},
    15641575                // new NonNegativeInteger(Integer.toString(maxresults)), query);
Note: See TracChangeset for help on using the changeset viewer.