Changeset 29514

Show
Ignore:
Timestamp:
02.12.2014 18:42:47 (4 years ago)
Author:
ak19
Message:

Now the collectdir flag passed to gli.sh works (tested with GS3). It wasn't working before. The collectdir flag is needed by Jeremey (jts21) for his linux package manager binaries of GS3, since can't use the default collectdir location. They need to specify a different collectdir as the default one that GLI will launch with.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r29361 r29514  
    205205 
    206206        // Users may specify a non-standard collect directory (eg. when running one GLI in a network environment) 
    207         if (go.collect_directory_path != null) { 
    208             setCollectDirectoryPath(go.collect_directory_path); 
    209         } 
     207        // Processing of custom non-standard collect directory passed into gli now happens in init() 
     208        //if (go.collect_directory_path != null) { setCollectDirectoryPath(go.collect_directory_path); } 
    210209 
    211210        // More special code for running with a remote Greenstone 
     
    236235        go.local_library_path, go.library_url_string,  
    237236        go.gliserver_url_string, go.debug, go.perl_path, go.no_load, go.filename, go.site_name, 
    238         go.servlet_path); 
     237        go.servlet_path, go.collect_directory_path); 
    239238    } 
    240239 
     
    245244    String library_url_string, String gliserver_url_string, boolean debug_enabled, 
    246245    String perl_path, boolean no_load, String open_collection,  
    247     String site_name, String servlet_path)  
     246    String site_name, String servlet_path, String collect_directory_path)  
    248247    { 
    249248        if (gsdl3_path != null && !gsdl3_path.equals("")) { 
     
    580579        Classifiers.loadClassifiersList(null); 
    581580        Plugins.loadPluginsList(null); 
     581 
     582        // Users may specify a non-standard collect directory (eg. when running one GLI in a network environment) 
     583        // Set to any custom collection directory provided to gli. This happens if gli was run as: 
     584        // ./gli.sh -collectdir </full/path/to/custom/collect> 
     585        if(collect_directory_path != null) { 
     586 
     587            // create a version of the collect_dir_path without a file-separator at end 
     588            String collectDir = collect_directory_path;  
     589            if(collectDir.endsWith(File.separator)) { 
     590            collectDir = collectDir.substring(0, collectDir.length()-1); // remove file separator at end 
     591            } 
     592 
     593            // update .gli/config.xml to contain the version of the path without file-separator at end 
     594            if(collect_directory_path.equals(getDefaultGSCollectDirectoryPath(false))) { 
     595            Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(),  
     596                        true, ""); 
     597            } else { 
     598            Configuration.setString("general.open_collection"+Configuration.gliPropertyNameSuffix(),  
     599                        true, collectDir); 
     600            } 
     601 
     602            // set non_standard_collect_directory_path variable. Ensures file_separator at end 
     603            Gatherer.setCollectDirectoryPath(collect_directory_path);  
     604 
     605            // Use version of path without file-separator at end to set collecthome in gsdlsite(3).cfg 
     606            if(collectDir != null) { 
     607            collectDir = "\""+collectDir+"\""; 
     608            } 
     609            Utility.updatePropertyConfigFile(getGsdlSiteConfigFile(), "collecthome", collectDir); 
     610            // if gsdlsite.cfg does not exist (if using server.exe for instance), the above method will just return 
     611        } 
    582612 
    583613        // If using a remote Greenstone we need to download the collection configurations now