- Timestamp:
- 2011-08-26T16:03:19+12:00 (13 years ago)
- Location:
- main/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java
r23432 r24492 454 454 455 455 static private String getExtraLaunchArguments(LLSSiteConfig site_cfg_file) { 456 String args = " " + site_cfg_file.getSiteConfigFilename();456 String args = " " + LLSSiteConfig.GLIMODE + " " + site_cfg_file.getSiteConfigFilename(); 457 457 458 458 if(isPersistentServer) { … … 679 679 static final private String URL = "url"; 680 680 static final private String COLLECTHOME = "collecthome"; 681 static final private String GLIMODE = "--mode=gli"; 681 682 682 683 static final public String URL_PENDING = "URL_pending"; -
main/trunk/greenstone2/glisite.cfg.in
r24208 r24492 6 6 keepport=0 7 7 externalaccess=0 8 autoenter=18 gli.autoenter=1 9 9 browser=3 10 start_browser=010 gli.start_browser=0 11 11 address_resolution_method=2 12 12 hostIP= -
main/trunk/greenstone2/gs2-web-server.bat
r23987 r24492 190 190 191 191 :: GLI launches gs2-server.bat with: 192 :: cmd /c start "window" "c:\path to\gs2-server.bat" --config=c:\path to\glisite.cfg [--quit=portnum] 192 :: cmd /c start "window" "c:\path to\gs2-web-server.bat" --config=c:\path to\glisite.cfg --quit=portnum --mode=gli 193 :: where the --options are generally optional, but always used for GLI. 193 194 :: The configfile param could contain spaces, in which case its space-separated parts spread over 194 :: multiple parameters . Need to handle things the following way, since using quotes to embed the 195 :: parameters breaks the start command, see http://ss64.com/nt/start.html 196 :: This script is launched by the start cmd as: 197 :: "c:\path to\gs2-server.bat" --config=c:\path to\config.cfg [--quit=portnum]. 198 :: But if the parameter following --config=<some string> doesn't start with a double hyphen, we 199 :: assume it to be part of the config parameter, as the configfile path may have contained spaces. 200 201 :: Store all parameters together in config file var: we may or may not have a portnumber 202 :: Get everything after the "--quitport=", if anything, and store it in port var. If no port, nothing to do. 203 set conf=%* 204 if "%conf%" == "" goto :runit 205 206 set port=%conf:*--quitport=% 207 if "%conf%" == "%port%" ( 208 set port= 209 goto :runit 210 ) else ( 211 set port=%port:~1% 212 ) 213 214 :: Because we got here, need to adjust conf by removing " --quitport=" from it and prefixing this to port 215 call set conf=%%conf:%port%=%% 216 set conf=%conf:~0,-12% 217 set port=--quitport=%port% 218 219 :: Remove trailing spaces from conf and port 220 :: (We'll put the all-important quotes around conf and port when the actual java cmd is launched) 221 set tmp=%conf% 222 call :trim %tmp% 223 set conf=%tmp% 224 set tmp=%port% 225 call :trim %port% 226 set port=%tmp% 227 set tmp= 228 229 goto :runit 230 231 :: http://www.computing.net/answers/programming/dos-batch-remove-trailing-space/9270.html 232 :trim 233 set tmp=%* 234 goto :eof 195 :: multiple parameters. In the past, we used to handle this problem here. 196 :: At present we pass all the arguments as-is to the Server.jar program and let it handle the parameters. 197 :: E.g. gs2-web-server.bat --config=C:\pinky was\here at greenstone2\glisite.cfg --mode=gli --quitport=50100 198 :: or gs2-web-server.bat --quitport=50100 --config=C:\pinky was\here at greenstone2\glisite.cfg --mode=gli 199 :: Note the (lack of) use of quotes! 200 235 201 236 202 :runit … … 242 208 243 209 ::echo port: %port%& echo conf: %conf%& echo.& echo. 244 :: "%JAVA_EXECUTABLE%" org.greenstone.server.Server2 "%GSDLHOME%" "%serverlang%" %* 245 "%JAVA_EXECUTABLE%" org.greenstone.server.Server2 "%GSDLHOME%" "%serverlang%" "%conf%" "%port%" 246 247 248 :: The 1st argument to gs2-server.bat (if any) would be --config, the 2nd is the config filename. 249 :: Both are stored in %conf% now. If the config file is glisite.cfg, then this script was launched through 250 :: GLI and would have opened a DOS console. Need to exit from this script then to close the console. 251 :: Remove --config=prefix and do a case insensitive comparison, since filepaths can have uppercase chars 252 if "%conf%" == "" goto exit 253 if /i "%conf:~9%" == "%GSDLHOME%\glisite.cfg" goto quitcmd 254 goto exit 210 :: Do not remove the quotes around %* !!! It's what helps Server2.jar deal with spaces in configfile path 211 "%JAVA_EXECUTABLE%" org.greenstone.server.Server2 "%GSDLHOME%" "%serverlang%" "%*" 212 213 214 :: All params are stored in %* now. This batch script can be called from the commandline or from GLI 215 :: If the --mode(=gli) flag was passed in as parameter, then this script was launched through GLI 216 :: and would have opened a DOS console. Need to then exit from this script to close the console. 217 set allparams=%* 218 :: And if there were absolutely no params to gs2-web-server.bat, it's not called from GLI either 219 if "%allparams%" == "" goto exit 220 set glimode=%allparams:--mode=% 221 :: if one of the parameters was --mode(=gli), we close the console 222 if /i "%allparams%" == "%glimode%" ( 223 goto exit 224 ) else ( 225 goto quitcmd 226 ) 255 227 256 228 :: Exit the batch script (close the console)
Note:
See TracChangeset
for help on using the changeset viewer.