Ignore:
Timestamp:
2008-07-02T09:04:06+12:00 (16 years ago)
Author:
davidb
Message:

Support for 'collectgroup' added, whereby Greenstone 2 collections can be grouped into different sets of collections. Thought I had all the angles covered but it turns out I've overlooked the case of 'base this on' collection feature of GLI, which currently doesn't know about the collectgroup feature. Committing what I have for now, as since there are no instructions on how to use this feature, no one is going to activating it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/gui/OpenCollectionDialog.java

    r14753 r16267  
    253253        return;
    254254        }
     255
     256        load_collection_configs(data,collect_directory);
     257
     258    }
     259
     260
     261    protected void load_collection_configs(TreeSet data, File collect_directory) {
     262
    255263        File[] collection_folders = collect_directory.listFiles();
     264
    256265        for(int i = 0; i < collection_folders.length; i++) {
    257266        File collection_folder = collection_folders[i];
    258267        String collection_foldername = collection_folder.getName();
     268
    259269        if(collection_folder.isDirectory() && !collection_foldername.equals(StaticStrings.MODEL_COLLECTION_NAME)) {
    260270            // this 'file_name' has already been prefixed by 'etc'
     
    267277            }
    268278           
    269             //String file_name = (Gatherer.GS3)? Utility.CONFIG_GS3_FILE : Utility.CONFIG_FILE;
    270279            File config_file = new File(collection_folder, file_name);
    271280            File collection_metadata_directory = new File(collection_folder, "metadata");
    272281            if (collection_metadata_directory.exists() && config_file.exists()) {
    273282            BasicCollectionConfiguration collection_configuration = new BasicCollectionConfiguration(config_file);
    274             data.add(collection_configuration);
     283
     284            // look to see if group set?
     285            // => if it is, don't add, but recurse to look for child collections in collect-group
     286
     287            if (collection_configuration.getCollectGroup().equals("true")) {
     288                load_collection_configs(data, collection_folder);
     289            }
     290            else {
     291                data.add(collection_configuration);
     292            }
    275293            }
    276294            config_file = null;
     
    282300        collect_directory = null;
    283301    }
     302
     303
    284304
    285305    public Object getElementAt(int index) {
Note: See TracChangeset for help on using the changeset viewer.