Ignore:
Timestamp:
2011-08-26T18:49:30+12:00 (13 years ago)
Author:
ak19
Message:

Introduced the --mode=gli command line parameter, where the gli value is used as the property prefix when retrieving autoenter and start_browser properties from the config file. These changes go towards working with a single merged server config file (glisite.cfg and llssite.cfg)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/w32server/fnord.cpp

    r22677 r24498  
    875875// --location=directory (the path to GSDLHOME which defaults to the
    876876// directory where server.exe lives)
     877// --mode=gli (when server.exe is run from GLI). If GLI, "gli." is
     878// the prefix used to load autoenter and start_browser properties
     879// (gli.autoenter, gli.start_browser) from the config file
    877880// --config=file (the path to the configuration file to use which defaults
    878881// to GSDLHOME\llssite.cfg)
    879882// --cmd=init  Used to initialize the llssite.cfg file only - jmt12 18/11/2003
    880 static void parse_args(const text_t cmdline, text_t &location, text_t &config_file, text_t &command) {
     883static void parse_args(const text_t cmdline, text_t &location, text_t &mode, text_t &config_file, text_t &command) {
    881884
    882885  location.clear();
    883886  config_file.clear();
     887  mode.clear();
    884888  command.clear(); // jmt12 18/11/2003
    885889
    886   if (cmdline.size() < 3) return;
     890  if (cmdline.size() < 4) return;
    887891
    888892  text_t name, val;
     
    895899      if (name == "location") {
    896900    location = val;
     901      } else if(name == "mode") {
     902    mode = val;
    897903      } else if (name == "config") {
    898904    config_file = val;
     
    916922  if (name == "location") {
    917923    location = val;
     924  } else if (name == "mode") {
     925    mode = val;
    918926  } else if (name == "config") {
    919927    config_file = val;
     
    953961
    954962  // parse arguments
    955   text_t location, config_file, command;
    956   parse_args(CmdLineStr, location, config_file, command);
     963  text_t location, mode, config_file, command;
     964  parse_args(CmdLineStr, location, mode, config_file, command);
    957965  gsdl_conffile = config_file;
     966  if (mode.empty()) {
     967    // if the server is run on its own, mode_prefix is "" with no '.' suffix
     968    gsdl_mode_property_prefix = "";
     969  } else {
     970    // if the server is launched from GLI, the mode_prefix is "gli" and needs
     971    // '.' suffixed when accessing certain properties from the config file.     
     972    gsdl_mode_property_prefix = mode + ".";
     973  }
    958974 
    959975  // Try to generate the llssite.cfg file if it's missing
Note: See TracChangeset for help on using the changeset viewer.