Commit c6db58740bb05f5ba937859d1891496406c984d6

Authored by Mark Holtzhausen
2 parents 729dd463 d945624a

Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge

dmsctl.vbs
... ... @@ -159,20 +159,20 @@ Else
159 159 If (NOT isServiceStarted(svcName)) Then
160 160 If (NOT startService(svcName)) Then
161 161 isSuccess = FALSE
162   - writeLog "The " & KTOFFICE & " KnowledgeTree service could not be started. Result Code: " & lastErrorCode
  162 + writeLog "The " & KTOFFICE & " KnowledgeTree service could not be started. Result Code: " & getServiceErrorMessage(lastErrorCode)
163 163 Else
164 164 writeLog "The " & KTOFFICE & " KnowledgeTree service was successfully started"
165 165 End If
166 166  
167 167 writeLog "Successfully started " & KTOFFICE
168 168 Else
169   - writeLog KTOFFICE & " already started. Result Code: " & lastErrorCode
  169 + writeLog KTOFFICE & " already started. Result Code: " & getServiceErrorMessage(lastErrorCode)
170 170 End If
171 171  
172 172 If (isSuccess) Then
173 173 Wscript.Echo "The " & KTOFFICE & " KnowledgeTree service was successfully started"
174 174 Else
175   - Wscript.Echo "The " & KTOFFICE & " KnowledgeTree service could not be started. Result Code: " & lastErrorCode
  175 + Wscript.Echo "The " & KTOFFICE & " KnowledgeTree service could not be started. Result Code: " & getServiceErrorMessage(lastErrorCode)
176 176 End If
177 177  
178 178 Case "scheduler"
... ... @@ -181,20 +181,20 @@ Else
181 181 If (NOT isServiceStarted(svcName)) Then
182 182 If (NOT startService(svcName)) Then
183 183 isSuccess = FALSE
184   - writeLog "The " & KTSCHEDULER & " KnowledgeTree service could not be started. Result Code: " & lastErrorCode
  184 + writeLog "The " & KTSCHEDULER & " KnowledgeTree service could not be started. Result Code: " & getServiceErrorMessage(lastErrorCode)
185 185 Else
186 186 writeLog "The " & KTSCHEDULER & " KnowledgeTree service was successfully started"
187 187 End If
188 188  
189 189 writeLog "Successfully started " & KTSCHEDULER
190 190 Else
191   - writeLog KTSCHEDULER & " already started. Result Code: " & lastErrorCode
  191 + writeLog KTSCHEDULER & " already started. Result Code: " & getServiceErrorMessage(lastErrorCode)
192 192 End If
193 193  
194 194 If (isSuccess) Then
195 195 Wscript.Echo "The " & KTSCHEDULER & " KnowledgeTree service was successfully started"
196 196 Else
197   - Wscript.Echo "The " & KTSCHEDULER & " KnowledgeTree service could not be started. Result Code: " & lastErrorCode
  197 + Wscript.Echo "The " & KTSCHEDULER & " KnowledgeTree service could not be started. Result Code: " & getServiceErrorMessage(lastErrorCode)
198 198 End If
199 199  
200 200 Case "lucene"
... ... @@ -203,20 +203,20 @@ Else
203 203 If (NOT isServiceStarted(svcName)) Then
204 204 If (NOT startService(svcName)) Then
205 205 isSuccess = false
206   - writeLog "The " & KTLUCENE & " KnowledgeTree service could not be started. Result Code: " & lastErrorCode
  206 + writeLog "The " & KTLUCENE & " KnowledgeTree service could not be started. Result Code: " & getServiceErrorMessage(lastErrorCode)
207 207 Else
208 208 writeLog "The " & KTLUCENE & " KnowledgeTree service was successfully started"
209 209 End If
210 210  
211 211 writeLog "Successfully started " & KTLUCENE
212 212 Else
213   - writeLog KTLUCENE & " already started. Result Code: " & lastErrorCode
  213 + writeLog KTLUCENE & " already started. Result Code: " & getServiceErrorMessage(lastErrorCode)
214 214 End If
215 215  
216 216 If (isSuccess) Then
217 217 Wscript.Echo "The " & KTLUCENE & " KnowledgeTree service was successfully started"
218 218 Else
219   - Wscript.Echo "The " & KTLUCENE & " KnowledgeTree service could not be started. Result Code: " & lastErrorCode
  219 + Wscript.Echo "The " & KTLUCENE & " KnowledgeTree service could not be started. Result Code: " & getServiceErrorMessage(lastErrorCode)
220 220 End If
221 221 End Select
222 222 Else
... ... @@ -226,30 +226,36 @@ Else
226 226 If (NOT isServiceStarted(svcName)) Then
227 227 If (NOT startService(svcName)) Then
228 228 isSuccess = false
229   - End If
230   - writeLog "Successfully started " & KTOFFICE
  229 + writeLog "Couldn't start. " & KTOFFICE & " Result Code: " & getServiceErrorMessage(lastErrorCode)
231 230 Else
232   - writeLog KTOFFICE & " already started. Result Code: " & lastErrorCode
  231 + writeLog "Successfully started " & KTOFFICE
  232 + End If
  233 + Else
  234 + writeLog KTOFFICE & " already started. Result Code: " & getServiceErrorMessage(lastErrorCode)
233 235 End If
234 236  
235 237 svcName = KTSCHEDULER
236 238 If (NOT isServiceStarted(svcName)) Then
237 239 If (NOT startService(svcName)) Then
238 240 isSuccess = false
239   - End If
240   - writeLog "Successfully started " & KTSCHEDULER
  241 + writeLog "Couldn't start " & KTSCHEDULER & " Result Code: " & getServiceErrorMessage(lastErrorCode)
241 242 Else
242   - writeLog KTSCHEDULER & " already started. Result Code: " & lastErrorCode
  243 + writeLog "Successfully started " & KTSCHEDULER
  244 + End If
  245 + Else
  246 + writeLog KTSCHEDULER & " already started. Result Code: " & getServiceErrorMessage(lastErrorCode)
243 247 End If
244 248  
245 249 svcName = KTLUCENE
246 250 If (NOT isServiceStarted(svcName)) Then
247 251 If (NOT startService(svcName)) Then
248 252 isSuccess = false
249   - End If
250   - writeLog "Successfully started " & KTLUCENE
  253 + writeLog "Couldn't start " & KTLUCENE & " Result Code: " & getServiceErrorMessage(lastErrorCode)
251 254 Else
252   - writeLog KTLUCENE & " already started. Result Code: " & lastErrorCode
  255 + writeLog "Successfully started " & KTLUCENE
  256 + End If
  257 + Else
  258 + writeLog KTLUCENE & " already started. Result Code: " & getServiceErrorMessage(lastErrorCode)
253 259 End If
254 260  
255 261 If (isSuccess) Then
... ... @@ -267,20 +273,20 @@ Else
267 273 If (isServiceStarted(svcName)) Then
268 274 If (NOT stopService(svcName)) Then
269 275 isSuccess = false
270   - writeLog "The " & KTOFFICE & " KnowledgeTree service could not be stopped. Result Code: " & lastErrorCode
  276 + writeLog "The " & KTOFFICE & " KnowledgeTree service could not be stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
271 277 Else
272 278 writeLog "The " & KTOFFICE & " KnowledgeTree service was successfully stopped"
273 279 End If
274 280  
275 281 writeLog "Successfully stopped " & KTOFFICE
276 282 Else
277   - writeLog KTOFFICE & " already stopped. Result Code: " & lastErrorCode
  283 + writeLog KTOFFICE & " already stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
278 284 End If
279 285  
280 286 If (isSuccess) Then
281 287 Wscript.Echo "The " & KTOFFICE & " KnowledgeTree service was successfully stopped"
282 288 Else
283   - Wscript.Echo "The " & KTOFFICE & " KnowledgeTree service could not be stopped. Result Code: " & lastErrorCode
  289 + Wscript.Echo "The " & KTOFFICE & " KnowledgeTree service could not be stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
284 290 End If
285 291  
286 292 Case "scheduler"
... ... @@ -289,20 +295,20 @@ Else
289 295 If (isServiceStarted(svcName)) Then
290 296 If (NOT stopService(svcName)) Then
291 297 isSuccess = false
292   - writeLog "The " & KTSCHEDULER & " KnowledgeTree service could not be stopped. Result Code: " & lastErrorCode
  298 + writeLog "The " & KTSCHEDULER & " KnowledgeTree service could not be stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
293 299 Else
294 300 writeLog "The " & KTSCHEDULER & " KnowledgeTree service was successfully stopped"
295 301 End If
296 302  
297 303 writeLog "Successfully stopped " & KTSCHEDULER
298 304 Else
299   - writeLog KTSCHEDULER & " already stopped. Result Code: " & lastErrorCode
  305 + writeLog KTSCHEDULER & " already stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
300 306 End If
301 307  
302 308 If (isSuccess) Then
303 309 Wscript.Echo "The " & KTSCHEDULER & " KnowledgeTree service was successfully stopped"
304 310 Else
305   - Wscript.Echo "The " & KTSCHEDULER & " KnowledgeTree service could not be stopped. Result Code: " & lastErrorCode
  311 + Wscript.Echo "The " & KTSCHEDULER & " KnowledgeTree service could not be stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
306 312 End If
307 313  
308 314 Case "lucene"
... ... @@ -311,20 +317,20 @@ Else
311 317 If (isServiceStarted(svcName)) Then
312 318 If (NOT stopService(svcName)) Then
313 319 isSuccess = false
314   - writeLog "The " & KTLUCENE & " KnowledgeTree service could not be stopped. Result Code: " & lastErrorCode
  320 + writeLog "The " & KTLUCENE & " KnowledgeTree service could not be stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
315 321 Else
316 322 writeLog "The " & KTLUCENE & " KnowledgeTree service was successfully stopped"
317 323 End If
318 324  
319 325 writeLog "Successfully stopped " & KTLUCENE
320 326 Else
321   - writeLog KTLUCENE & " already stopped. Result Code: " & lastErrorCode
  327 + writeLog KTLUCENE & " already stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
322 328 End If
323 329  
324 330 If (isSuccess) Then
325 331 Wscript.Echo "The " & KTLUCENE & " KnowledgeTree service was successfully stopped"
326 332 Else
327   - Wscript.Echo "The " & KTLUCENE & " KnowledgeTree service could not be stopped. Result Code: " & lastErrorCode
  333 + Wscript.Echo "The " & KTLUCENE & " KnowledgeTree service could not be stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
328 334 End If
329 335 End Select
330 336 Else
... ... @@ -335,30 +341,36 @@ Else
335 341 If (isServiceStarted(svcName)) Then
336 342 If (NOT stopService(svcName)) Then
337 343 isSuccess = false
338   - End If
339   - writeLog "Successfully stopped " & KTOFFICE
  344 + writeLog "Couldn't stop." & KTOFFICE & " Result Code: " & getServiceErrorMessage(lastErrorCode)
340 345 Else
341   - writeLog KTOFFICE & " already stopped. Result Code: " & lastErrorCode
  346 + writeLog "Successfully stopped " & KTOFFICE
  347 + End If
  348 + Else
  349 + writeLog KTOFFICE & " already stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
342 350 End If
343 351  
344 352 svcName = KTSCHEDULER
345 353 If (isServiceStarted(svcName)) Then
346 354 If (NOT stopService(svcName)) Then
347 355 isSuccess = false
348   - End If
349   - writeLog "Successfully stopped " & KTSCHEDULER
  356 + writeLog "Couldn't stop." & KTSCHEDULER & " Result Code: " & getServiceErrorMessage(lastErrorCode)
350 357 Else
351   - writeLog KTSCHEDULER & " already stopped. Result Code: " & lastErrorCode
  358 + writeLog "Successfully stopped " & KTSCHEDULER
  359 + End If
  360 + Else
  361 + writeLog KTSCHEDULER & " already stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
352 362 End If
353 363  
354 364 svcName = KTLUCENE
355 365 If (isServiceStarted(svcName)) Then
356 366 If (NOT stopService(svcName)) Then
357 367 isSuccess = false
358   - End If
359   - writeLog "Successfully stopped " & KTLUCENE
  368 + writeLog "Couldn't stop." & KTLUCENE & " Result Code: " & getServiceErrorMessage(lastErrorCode)
360 369 Else
361   - writeLog KTLUCENE & " already stopped. Result Code: " & lastErrorCode
  370 + writeLog "Successfully stopped " & KTLUCENE
  371 + End If
  372 + Else
  373 + writeLog KTLUCENE & " already stopped. Result Code: " & getServiceErrorMessage(lastErrorCode)
362 374 End If
363 375  
364 376 If (isSuccess) Then
... ... @@ -669,3 +681,59 @@ Public Sub writeLog(ByVal strMessage)
669 681 objTextFile.Close
670 682 End Sub
671 683  
  684 +Public Function getServiceErrorMessage(ByVal errCode)
  685 + Select Case errCode
  686 + Case SVC_SUCCESS
  687 + getServiceErrorMessage = "Success"
  688 + Case SVC_NOT_SUPPORTED
  689 + getServiceErrorMessage = "Not Supported"
  690 + Case SVC_ACCESS_DENIED
  691 + getServiceErrorMessage = "Access Denied"
  692 + Case SVC_DEPENDENT_SERVICES_RUNNING
  693 + getServiceErrorMessage = "Dependent Services Running"
  694 + Case SVC_INVALID_SERVICE_CONTROL
  695 + getServiceErrorMessage = "Invalid Service Control"
  696 + Case SVC_SERVICE_CANNOT_ACCEPT_CONTROL
  697 + getServiceErrorMessage = "Service Cannot Accept Control"
  698 + Case SVC_SERVICE_NOT_ACTIVE
  699 + getServiceErrorMessage = "Service Not Active"
  700 + Case SVC_SERVICE_REQUEST_TIMEOUT
  701 + getServiceErrorMessage = "Service Request Timeout"
  702 + Case SVC_UNKNOWN_FAILURE
  703 + getServiceErrorMessage = "Unknown Failure"
  704 + Case SVC_PATH_NOT_FOUND
  705 + getServiceErrorMessage = "Path Not Found"
  706 + Case SVC_SERVICE_ALREADY_RUNNING
  707 + getServiceErrorMessage = "Service Already Running"
  708 + Case SVC_SERVICE_DATABASE_LOCKED
  709 + getServiceErrorMessage = "Service Database Locked"
  710 + Case SVC_SERVICE_DEPENDENCY_DELETED
  711 + getServiceErrorMessage = "Service Dependency Deleted"
  712 + Case SVC_SERVICE_DEPENDENCY_FAILURE
  713 + getServiceErrorMessage = "Service Dependency Failure"
  714 + Case SVC_SERVICE_DISABLED
  715 + getServiceErrorMessage = "Service Disabled"
  716 + Case SVC_SERVICE_LOGON_FAILURE
  717 + getServiceErrorMessage = "Service Logon Failure"
  718 + Case SVC_SERVICE_MARKED_FOR_DELETION
  719 + getServiceErrorMessage = "Service Marked For Deletion"
  720 + Case SVC_SERVICES_NO_THREAD
  721 + getServiceErrorMessage = "Service No Thread"
  722 + Case SVC_STATUS_CIRCULAR_DEPENDENCY
  723 + getServiceErrorMessage = "Status Circular Dependency"
  724 + Case SVC_STATUS_DUPLICATE_NAME
  725 + getServiceErrorMessage = "Status Duplicate Name"
  726 + Case SVC_INVALID_NAME
  727 + getServiceErrorMessage = "Status Invalid Name"
  728 + Case SVC_STATUS_INVALID_PARAMETER
  729 + getServiceErrorMessage = "Status Invalid Parameter"
  730 + Case SVC_INVALID_SERVICES_ACCOUNT
  731 + getServiceErrorMessage = "Status Invalid Service Account"
  732 + Case SVC_STATUS_SERVICE_EXISTS
  733 + getServiceErrorMessage = "Status Service Exists"
  734 + Case SVC_SERVICE_ALREADY_PAUSED
  735 + getServiceErrorMessage = "Service Already Paused"
  736 + Case Else
  737 + getServiceErrorMessage = "Unknown Failure"
  738 + End Select
  739 +End Function
... ...
plugins/ktstandard/documentpreview/documentPreview.php
... ... @@ -176,7 +176,11 @@ class DocumentPreview {
176 176  
177 177 $sInfo = $this->getMetadata();
178 178  
179   - return '<div id="preview" class="preview" onclick="javascript: destroyPanel();">'.$sInfo.'</div>';
  179 + $sInfo = '<div id="preview" class="preview" onclick="javascript: destroyPanel();">'.$sInfo.'</div>';
  180 +
  181 + $sInfo .= $this->getThumbnail();
  182 +
  183 + return $sInfo;
180 184 }
181 185  
182 186 /**
... ... @@ -280,8 +284,6 @@ class DocumentPreview {
280 284 $sInfo .= "<tr><td>{$sIdLb}</td><td><b>{$sId}</b></td></tr>";
281 285 $sInfo .= " </table></div>";
282 286  
283   - $sInfo .= $this->getThumbnail();
284   -
285 287 return $sInfo;
286 288 }
287 289  
... ...
setup/migrate/steps/migrateDatabase.php
... ... @@ -171,7 +171,7 @@ class migrateDatabase extends Step
171 171 $cmd = $exe.' -u"'.$dbAdminUser.'" -p"'.$dbAdminPass.'" --port="'.$port.'" '.$dbName.' > '.$sqlFile;
172 172 if($noFile) {
173 173 $this->error[]['error'] = "The KnowledgeTree Setup Wizard was unable to connect to your KnowledgeTree 3.6.1 database.";
174   - $this->error[]['msg'] = "Please ensure that all KnowledgeTree Services are running.";
  174 + $this->error[]['msg'] = "Please ensure that your KnowledgeTree Mysql service is running.";
175 175 $this->error[]['cmd'] = "Click <b>Next</b> after resolving the above errors.";
176 176 $this->temp_variables['manual_export'] = "";
177 177 } else {
... ...
setup/upgrade/steps/upgradeBackup.php
... ... @@ -208,7 +208,7 @@ class upgradeBackup extends Step {
208 208 $prefix = '';
209 209 if (!WINDOWS_OS)
210 210 {
211   - $prefix .= "./";
  211 + $prefix .= "";//$prefix .= "./";
212 212 }
213 213  
214 214 if (@stat($dbSocket) !== false)
... ...
setup/upgrade/templates/complete.tpl
... ... @@ -20,7 +20,8 @@
20 20 <br/>
21 21 <br/>
22 22 <?php } else { ?>
23   - To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator.
  23 + To start the services, using the instructions below:
  24 +<!-- execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator.-->
24 25 <br/>
25 26 <br/>
26 27 <?php } ?>
... ... @@ -30,11 +31,11 @@
30 31 <br/>
31 32 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
32 33 <br/>
33   - Click [Install Services]
  34 + Right-Click and run [Install Services] as administrator
34 35 <br/>
35 36 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
36 37 <br/>
37   - Click [Start Services]
  38 + Right-Click and run [Start Services] as administrator
38 39 <br/>
39 40 <br/>
40 41 <b>Alternatively:</b>
... ...
setup/wizard/installUtil.php
... ... @@ -1061,9 +1061,6 @@ class InstallUtil {
1061 1061  
1062 1062 // {{{ copyDirectory
1063 1063 function copyDirectory($sSrc, $sDst, $bMove = false) {
1064   - if (file_exists($sDst)) {
1065   - return false; //PEAR::raiseError(_kt("Destination directory already exists."));
1066   - }
1067 1064 if (!WINDOWS_OS) {
1068 1065 if ($bMove && file_exists('/bin/mv')) {
1069 1066 $this->pexec(array('/bin/mv', $sSrc, $sDst));
... ... @@ -1081,15 +1078,13 @@ class InstallUtil {
1081 1078 if ($hSrc === false) {
1082 1079 return false; //PEAR::raiseError(sprintf(_kt("Could not open source directory: %s"), $sSrc));
1083 1080 }
1084   - if (@mkdir($sDst, 0777) === false) {
1085   - return false; //PEAR::raiseError(sprintf(_kt("Could not create destination directory: %s"), $sDst));
1086   - }
  1081 + @mkdir($sDst, 0777);
1087 1082 while (($sFilename = readdir($hSrc)) !== false) {
1088 1083 if (in_array($sFilename, array('.', '..'))) {
1089 1084 continue;
1090 1085 }
1091   - $sOldFile = sprintf("%s/%s", $sSrc, $sFilename);
1092   - $sNewFile = sprintf("%s/%s", $sDst, $sFilename);
  1086 + $sOldFile = sprintf("%s" . DS . "%s", $sSrc, $sFilename);
  1087 + $sNewFile = sprintf("%s" . DS . "%s", $sDst, $sFilename);
1093 1088 if (is_dir($sOldFile)) {
1094 1089 $this->copyDirectory($sOldFile, $sNewFile, $bMove);
1095 1090 continue;
... ...
setup/wizard/resources/css/wizard.css
... ... @@ -64,7 +64,7 @@ select {
64 64 /* *** Layout Styles *** */
65 65  
66 66 #wrapper {
67   - background: white; min-height:410px;
  67 + background: white; min-height:500px;
68 68 }
69 69  
70 70 #outer-wrapper {
... ... @@ -87,12 +87,12 @@ select {
87 87 #container {
88 88 background: white url("../graphics/left.png") repeat-y left;
89 89 overflow:auto;
90   - /*min-height:630px;height:410px;*/min-height:410px;
  90 + /*min-height:630px;height:410px;*/min-height:500px;
91 91 }
92 92  
93 93 #content {
94 94 margin-left: 220px;
95   - /*height:515px;*/height:400px;
  95 + /*height:515px;*/height:500px;
96 96 }
97 97  
98 98 #content_container {
... ...
setup/wizard/steps/install.php
... ... @@ -104,6 +104,14 @@ class install extends step
104 104 public function installStep()
105 105 {
106 106 $this->callHome();
  107 + // copy indexing directory if this is a migration
  108 + $this->setDataFromSession();
  109 + if ($this->util->isMigration()) {
  110 + $migrateSessionData = $this->getDataFromPackage('migrate', 'installation');
  111 + $src = $migrateSessionData['location'] . DS . 'var' . DS . 'indexes';
  112 + $dst = SYSTEM_DIR . 'var' . DS . 'indexes';
  113 + $this->util->copyDirectory($src, $dst);
  114 + }
107 115 }
108 116  
109 117 /**
... ...
setup/wizard/templates/complete.tpl
... ... @@ -23,7 +23,8 @@
23 23 <br/>
24 24 <br/>
25 25 <?php } else { ?>
26   - To start the services, execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator.
  26 + To start the services, using the instructions below:
  27 +<!-- execute the dmsctl.bat batch file in the KnowledgeTree directory from a command prompt, run as administrator.-->
27 28 <br/>
28 29 <br/>
29 30 <?php } ?>
... ... @@ -33,11 +34,11 @@
33 34 <br/>
34 35 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
35 36 <br/>
36   - Click [Install Services]
  37 + Right-Click and run [Install Services] as administrator
37 38 <br/>
38 39 [START MENU] => [Programs] => [KnowledgeTree 3.7.x] => [services]
39 40 <br/>
40   - Click [Start Services]
  41 + Right-Click and run [Start Services] as administrator
41 42 <br/>
42 43 <br/>
43 44 <b>Alternatively:</b>
... ...