Changeset 10382


Ignore:
Timestamp:
2005-08-01T15:33:54+12:00 (19 years ago)
Author:
mdewsnip
Message:

Can now base a new collection on an existing one, when using a remote Greenstone server.

File:
1 edited

Legend:

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

    r10380 r10382  
    323323        //check that this creation has worked - simply by checking for the existence of the collect.cfg file
    324324        String collection_directory_path = getCollectionDirectoryPath(name);
    325         File collect_cfg_file = new File(collection_directory_path + "collect.cfg");
     325        File collect_cfg_file = new File(collection_directory_path + "etc" + File.separator + "collect.cfg");
    326326        if (!collect_cfg_file.exists()) {
    327327        // no point continuing
     
    357357        }
    358358
    359         ProfileXMLFileManager.loadProfileXMLFile(new File(collection_directory_path, Utility.META_DIR));
     359        ProfileXMLFileManager.loadProfileXMLFile(new File(collection_directory_path + "metadata"));
    360360
    361361        // Before creating the CollectionDesignManager check if we are basing it upon some other collection
    362362        if (base_collection_directory != null) {
    363363        DebugStream.println("Basing new collection on existing one: " + base_collection_directory);
     364
     365        // If we're using a remote Greenstone server, download the collection shell to get the files needed
     366        if (Gatherer.isGsdlRemote) {
     367            String base_collection_name = base_collection_directory.getName();
     368            RemoteGreenstoneServer.downloadCollection(base_collection_name);
     369        }
     370
    364371        collection.setBaseCollection(base_collection_directory.getAbsolutePath());
    365372        // copy over other needed directories
    366373        copyExtraBaseCollStuff(new File(collection_directory_path), base_collection_directory);
     374
    367375        // Try to import any existing metadata sets for this collection
    368376        // Look in base_collection_directory/metadata and import any metadata sets found.
    369         File base_metadata_directory = new File(base_collection_directory, Utility.META_DIR);
     377        File base_metadata_directory = new File(base_collection_directory, "metadata");
    370378        ArrayList base_metadata_sets = MetadataSetManager.listMetadataSets(base_metadata_directory);
    371379        if (base_metadata_sets != null) {
Note: See TracChangeset for help on using the changeset viewer.