Changeset 5723


Ignore:
Timestamp:
2003-10-23T11:27:09+13:00 (21 years ago)
Author:
jmt12
Message:

Base collection is now set within new collections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r5678 r5723  
    270270        }
    271271
     272        boolean skip_import_phase = false;
     273
    272274        // Before we create the CollectionDesignManager we have to check if we are basing it upon some other collection.
    273275        if(base_collection_directory != null) {
    274         Gatherer.println("Basing new collection on existing one: " + base_collection_directory);
     276           Gatherer.println("Basing new collection on existing one: " + base_collection_directory);
     277           collection.setBaseCollection(base_collection_directory.getAbsolutePath());
    275278        // Try to import any existing metadata sets for this collection. Look in base_collection_directory/metadata and import any metadata sets found.
    276279        File base_metadata = new File(base_collection_directory, Utility.META_DIR);
     
    283286                Gatherer.println("+ Found a metadata set. Importing: " + possible_metadata_sets[i].getAbsolutePath());
    284287                collection.msm.importMDS(possible_metadata_sets[i], false);
     288                skip_import_phase = true;
    285289            }
    286290            }
     
    290294        }
    291295        // If no sets were imported, then create a new metadata with this new collections name. Note that if this is one of the 'big five' collections then I already know the importing mappings as well.
    292         boolean skip_import_phase = false;
    293296        if(collection.msm.getSets().size() == 0) {
    294297            Gatherer.println("As there are no metadata sets loaded yet, we'll make special checks for the collections available on the GS2.39CD.");
     
    376379        }
    377380       
    378         // Always import the extracted metadata set
    379         collection.msm.importMDS(new File(Utility.METADATA_DIR + Utility.EXTRACTED_METADATA_NAMESPACE + StaticStrings.METADATA_SET_EXTENSION), false);
    380 
     381        // Always import the extracted metadata set if we didn't already
     382        if(collection.msm.getSet(Utility.EXTRACTED_METADATA_NAMESPACE) == null) {
     383           collection.msm.importMDS(new File(Utility.METADATA_DIR + Utility.EXTRACTED_METADATA_NAMESPACE + StaticStrings.METADATA_SET_EXTENSION), false);
     384        }
     385           
    381386        collection.cdm = new CollectionDesignManager(new File(getCollectionConfig()));
    382387        collection.gdm = new GDMManager();
     
    12481253        // We replace the creator string with our own.
    12491254        if(command_lc.startsWith(Utility.CFG_CREATOR)) {
    1250             write(out, Utility.CFG_CREATOR + " " + email);
     1255           ///ystem.err.println("Found creator - replace with current");
     1256           write(out, Utility.CFG_CREATOR + " " + email);
    12511257        }
    12521258        else if(command_lc.startsWith(Utility.CFG_MAINTAINER)) {
    1253             write(out, Utility.CFG_MAINTAINER + " " + email);
     1259           ///ystem.err.println("Found maintainer - replace with current");
     1260           write(out, Utility.CFG_MAINTAINER + " " + email);
    12541261        }
    12551262        else if(command_lc.startsWith(Utility.CFG_COLLECTIONMETA_COLLECTIONNAME)) {
Note: See TracChangeset for help on using the changeset viewer.