Changeset 4601


Ignore:
Timestamp:
2003-06-12T13:33:34+12:00 (21 years ago)
Author:
kjdon
Message:

now the current coll is back in the list, but it is fixed and always selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java

    r4573 r4601  
    5656    File[] possible_collections = gsdl_collection_directory.listFiles();
    5757    for(int i = 0; possible_collections != null && i < possible_collections.length; i++) {
    58         if (possible_collections[i].getName().equals(current_coll_name)) {
    59         // we dont want to add the current collection to the list
    60         continue;
    61         }
    6258        // The simpliest case is if the directory etc/collect.cfg file and a metadata/ in it. Thus it can easily be built upon.
    6359        File collect_cfg_file = new File(possible_collections[i], Utility.CONFIG_DIR);
     
    7066            Entry entry = new Entry(collection_title);
    7167            entry.setProperty(collection_name);
     68            if (collection_name.equals(current_coll_name)) {
     69            // the current collection is always selected
     70            entry.setFixed(true);
     71            entry.setSelected(true);
     72            }
    7273            collection_checklist_model.add(entry);
    7374            entry = null;
     75
    7476        }
    7577        collection_name = null;
     
    135137        Entry entry = (Entry) collection_checklist_model.get(i);
    136138        if(entry.isSelected()) {
    137         found_entry = true;
     139        if (!entry.getProperty().equals(current_coll_name)){
     140            found_entry = true;
     141        }
    138142        command.append(" ");
    139143        command.append(entry.getProperty());
     
    141145        entry = null;
    142146    }
    143     // It is possible that there were no entries in which case we return null.
     147    command.append("\n");
     148    command.append("\n");
     149   
     150    // It is possible that there was only one entry - the current collection -  in which case we return null.
    144151    if(found_entry) {
    145         // we need to add on the current collection
    146         command.append(" ");
    147         command.append(current_coll_name);
    148         command.append("\n");
    149         command.append("\n");
    150152        return command.toString();
    151153    }
Note: See TracChangeset for help on using the changeset viewer.