Changeset 37420


Ignore:
Timestamp:
2023-03-07T11:45:17+13:00 (14 months ago)
Author:
kjdon
Message:

have moved this block of code to after the bit where we work out site and servlet for gs3. otherwise, when we do specify a collection (eg in webswing gli), we try to make the collection path without knowing the site_name, which doesn't work properly

File:
1 edited

Legend:

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

    r37413 r37420  
    395395                // up fedora further below, together with the local tomcat
    396396            }
    397                        
    398             // the no_load flag to GLI is processed at the end of handling open_collection_file_path
    399             open_collection_file_path = open_collection;
    400             if (open_collection_file_path == null) {
    401                 open_collection_file_path = Configuration.getString(
    402                 "general.open_collection"+Configuration.gliPropertyNameSuffix(), true);
    403             }
    404             else {
    405                 // see if it is expressed as a relative filename, in which case, prepend
    406                 // collect_directory_path
    407                 File open_collection_file = new File(open_collection_file_path);
    408                 if (!open_collection_file.isAbsolute()) {
    409                 // dealing with a relative dir
    410                 // => prefix collect_directory_path
    411                 // but first need to work out this out for ourselves, as standard/non-standard collect_dir
    412                 // has not yet been determined
    413                
    414                 String resolved_collect_directory_path =
    415                     (collect_directory_path != null)
    416                     ? collect_directory_path : getDefaultGSCollectDirectoryPath(false);  // false => without dir sep at end
    417 
    418                 open_collection_file_path = resolved_collect_directory_path + File.separator + open_collection_file_path;
    419                 }
    420    
    421             }
    422             // we haven't worked out site name yet, so do this step later ...
    423             //initCollectDirectoryPath();
    424            
    425             if (no_load || (isGsdlRemote && open_collection_file_path.equals(""))) {
    426                 open_collection_file_path = null;
    427             }
    428397
    429398           
     
    612581                }
    613582            }
     583
     584
     585            // have we got a specified collection to open?
     586            // the no_load flag to GLI is processed at the end of handling open_collection_file_path
     587            open_collection_file_path = open_collection;
     588            if (open_collection_file_path == null) {
     589                open_collection_file_path = Configuration.getString(
     590                "general.open_collection"+Configuration.gliPropertyNameSuffix(), true);
     591            }
     592            else {
     593                // see if it is expressed as a relative filename, in which case, prepend
     594                // collect_directory_path
     595                File open_collection_file = new File(open_collection_file_path);
     596                if (!open_collection_file.isAbsolute()) {
     597                // dealing with a relative dir
     598                // => prefix collect_directory_path
     599                // but first need to work out this out for ourselves, as standard/non-standard collect_dir
     600                // has not yet been determined
     601
     602                String resolved_collect_directory_path =
     603                    (collect_directory_path != null)
     604                    ? collect_directory_path : getDefaultGSCollectDirectoryPath(false);  // false => without dir sep at end
     605
     606                open_collection_file_path = resolved_collect_directory_path + File.separator + open_collection_file_path;
     607                }
     608   
     609            }
     610           
     611            if (no_load || (isGsdlRemote && open_collection_file_path.equals(""))) {
     612                open_collection_file_path = null;
     613            }
     614
    614615
    615616            initCollectDirectoryPath();
Note: See TracChangeset for help on using the changeset viewer.