Changeset 22677

Show
Ignore:
Timestamp:
18.08.2010 21:13:11 (9 years ago)
Author:
ak19
Message:

More changes for making the collectdir movable (ticket 152): (1) Changes to GLI code so that llssite and glisite are updated to contain the COLLECTHOME property to tell server.exe where the new collect dir is. (2) server.exe must be told that it needs to restart (so it can read the new collecthome).

Location:
main/trunk/greenstone2/runtime-src/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/configaction.cpp

    r16321 r22677  
    3131#  include <windows.h> 
    3232#endif 
     33 
     34// constant for restart/reconfigure windows message (same as in w32server/fnord) 
     35// http://msdn.microsoft.com/en-us/library/ms644931%28v=VS.85%29.aspx on WM_USER 
     36// (also RegisterWindowMessage Function at http://msdn.microsoft.com/en-us/library/ms644947%28v=VS.85%29.aspx 
     37// http://msdn.microsoft.com/en-us/library/ms644927%28v=VS.85%29.aspx) 
     38#define WM_RESTART WM_USER+1 
    3339 
    3440configaction::configaction () { 
     
    8793    textout << "configured release-collection\n"; 
    8894 
     95  } else if ((args["cmd"] == "restart")) { 
     96    if(!args["c"].empty()) { 
     97        remove_colservr(args["c"], logout); 
     98        textout << "configured release-collection for reconfigure-restart\n"; 
     99    } 
     100    textout << "reconfigure-restart\n"; 
     101#ifdef GSDL_LOCAL_LIBRARY 
     102    HWND gw = FindWindow("Greenstone Digital Library Software", 
     103             "Greenstone Digital Library Software"); 
     104    PostMessage(gw, WM_RESTART, 0, 0); 
     105#endif 
    89106  } else if (args["cmd"] == "kill") { 
    90107    textout << "killed\n"; 
  • main/trunk/greenstone2/runtime-src/src/w32server/fnord.cpp

    r20949 r22677  
    100100#define RESTARTBUTTONY (MAINWINDOWHEIGHT-RESTARTBUTTONHEIGHT-15) 
    101101 
     102// constant for restart/reconfigure windows message (same as in recpt/configaction.cpp) 
     103// http://msdn.microsoft.com/en-us/library/ms644931%28v=VS.85%29.aspx on WM_USER 
     104// (also RegisterWindowMessage Function at http://msdn.microsoft.com/en-us/library/ms644947%28v=VS.85%29.aspx 
     105// http://msdn.microsoft.com/en-us/library/ms644927%28v=VS.85%29.aspx) 
     106#define WM_RESTART WM_USER+1 
     107 
    102108const char versionstring[] = "version " GSDL_VERSION; 
    103109 
     
    10701076    while (!init_done) { 
    10711077      if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) { 
    1072     if (Message.message == WM_QUIT) return Message.wParam; 
    1073     if (!IsDialogMessage (MainWindow, &Message)) { 
    1074       TranslateMessage(&Message); /* translate keyboard messages */ 
    1075       DispatchMessage(&Message);  /* return control to Windows NT */ 
    1076     } 
     1078        if (Message.message == WM_QUIT) return Message.wParam; 
     1079        if (!IsDialogMessage (MainWindow, &Message)) { 
     1080            TranslateMessage(&Message); /* translate keyboard messages */ 
     1081            DispatchMessage(&Message);  /* return control to Windows NT */ 
     1082        } 
    10771083      } else { 
    1078     Sleep (1); 
     1084        Sleep (1); 
    10791085      } 
    10801086    } 
     
    11571163   
    11581164  for (;;) { 
    1159     if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) { 
    1160       if (Message.message == WM_QUIT) break; 
    1161       if (!IsDialogMessage (MainWindow, &Message)) { 
    1162     TranslateMessage(&Message); /* translate keyboard messages */ 
    1163     DispatchMessage(&Message);  /* return control to Windows NT */ 
    1164       } 
    1165        
     1165    if (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE)) {  
     1166        if (Message.message == WM_QUIT) { 
     1167            break; 
     1168        } 
     1169         
     1170        if (Message.message == WM_RESTART) { 
     1171             
     1172            read_settings(0); 
     1173            if (!gsdl_init(false)) { // do the same as when restart library is pressed 
     1174                MessageBox(NULL,"Error re-initializing gsdl: gsdl_init()",  
     1175                    "Error initialising GSDL", MB_OK|MB_SYSTEMMODAL); 
     1176                // when Restart Library is pressed, exit(0) is called) but a break here 
     1177                // will exit Greenstone same as with WM_QUIT msg above 
     1178                break; 
     1179            }            
     1180        } 
     1181         
     1182        if (!IsDialogMessage (MainWindow, &Message)) { 
     1183            TranslateMessage(&Message); /* translate keyboard messages */ 
     1184            DispatchMessage(&Message);  /* return control to Windows NT */ 
     1185        }   
    11661186    } else { 
    11671187      if (DiffTickCounts (lastcheck, GetTickCount()) > 500) {