Ignore:
Timestamp:
2023-02-19T23:52:08+13:00 (14 months ago)
Author:
davidb
Message:

GLI code updated to better support webswing: a specific configWebswing.xml file introduced, and Gatherer/GathererProg updated so the area for the user GLI config files is set as <GLIHOME>/webswing-users, with the logged in username then used to form a subdirectory within this area

File:
1 edited

Legend:

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

    r32926 r37330  
    6161    }
    6262
     63    GetOpt go = new GetOpt(args);
     64           
    6365    // Determine the GLI user directory path
    64     String gli_user_directory_path = System.getProperty("user.home") + File.separator;
    65         if (Utility.isWindows()) {
    66         gli_user_directory_path += "Application Data" + File.separator + "Greenstone" + File.separator + "GLI" + File.separator;
    67         }
    68         else {
    69             gli_user_directory_path += ".gli" + File.separator;
    70         }
     66    String gli_user_directory_path = null;
     67    if (go.webswing) {
     68        if (go.gsdl3_src_path != null) {
     69        // above is a (albeit a crude) test at this early stage of running,
     70        // that makes sure we're running GS3
     71
     72        // "user.dir" resolves to the user's current-working-directory
     73        // which is engineered through webswing.config to be the GLI home directory     
     74       
     75        gli_user_directory_path = System.getProperty("user.dir") + File.separator + "webswing-users" + File.separator;
     76       
     77        //gli_user_directory_path = go.gsdl3_src_path + File.separator;
     78       
     79        // or GSDL3SRCHOME ???
     80        //gli_user_directory_path = System.getProperty("user.dir") + File.separator;
     81        //gli_user_directory_path = System.getenv("GSDL3SRCHOME") + File.separator;
     82
     83        File gli_user_directory = new File(gli_user_directory_path);
     84       
     85        if (!gli_user_directory.exists() && !gli_user_directory.mkdir()) {
     86            System.err.println("Warning: Unable to make directory: " + gli_user_directory_path);
     87        }
     88        }
     89        else {
     90        System.err.println("Webswing for Greenstone2 not supported");
     91        System.exit(1);
     92        }
     93    }
     94    else {
     95        gli_user_directory_path = System.getProperty("user.home") + File.separator;
     96
     97   
     98        if (Utility.isWindows()) {
     99        gli_user_directory_path += "Application Data" + File.separator + "Greenstone" + File.separator + "GLI" + File.separator;
     100        }
     101        else {
     102        gli_user_directory_path += ".gli" + File.separator;
     103        }
     104    }
     105   
    71106    Gatherer.setGLIUserDirectoryPath(gli_user_directory_path);
    72107
     
    75110   
    76111    // Create an instance of the Gatherer class, which will parse the args and prepare the rest of the GLI
    77     final Gatherer gatherer = new Gatherer(args);
     112    final Gatherer gatherer = new Gatherer(go);
    78113       
    79114    // TESTING circumventing the old GUI event dispatch thread exceptions in GLI. Follows
Note: See TracChangeset for help on using the changeset viewer.