Commit dd28916fa59dabe060aafcfe77db73a1cc7dc5b7

Authored by Charl Joseph Mert
2 parents eea8c15d add495eb

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

dmsctl.sh
1 -#!/bin/sh 1 +#!/bin/bash
2 2
3 # Boot KnowledgeTree services 3 # Boot KnowledgeTree services
4 # chkconfig: 2345 55 25 4 # chkconfig: 2345 55 25
@@ -6,6 +6,8 @@ @@ -6,6 +6,8 @@
6 # 6 #
7 # processname: ktdms 7 # processname: ktdms
8 8
  9 +cd $(dirname $0)
  10 +
9 HOSTNAME=`hostname` 11 HOSTNAME=`hostname`
10 RETVAL=0 12 RETVAL=0
11 PID="" 13 PID=""
@@ -16,6 +18,14 @@ INSTALL_PATH=`pwd` @@ -16,6 +18,14 @@ INSTALL_PATH=`pwd`
16 JAVABIN=/usr/bin/java 18 JAVABIN=/usr/bin/java
17 ZEND_DIR=/usr/local/zend 19 ZEND_DIR=/usr/local/zend
18 20
  21 +if [ -f /etc/zce.rc ];then
  22 + . /etc/zce.rc
  23 +else
  24 + echo "/etc/zce.rc doesn't exist!"
  25 + exit 1;
  26 +fi
  27 +
  28 +
19 # OpenOffice 29 # OpenOffice
20 SOFFICEFILE=soffice 30 SOFFICEFILE=soffice
21 SOFFICE_PIDFILE=$INSTALL_PATH/var/log/soffice.bin.pid 31 SOFFICE_PIDFILE=$INSTALL_PATH/var/log/soffice.bin.pid
@@ -279,6 +289,24 @@ noserver() { @@ -279,6 +289,24 @@ noserver() {
279 help 289 help
280 } 290 }
281 291
  292 +firstrun() {
  293 + echo "We running for the first time, FIX ZEND"
  294 + if grep --quiet LD_LIBRARAY_PATH /etc/zce.rc ; then
  295 + echo "Nothing to be done ... maybe"
  296 + else
  297 + echo "PATH=/usr/local/zend/bin:$PATH" >> /etc/zce.rc
  298 + if [ -z $LD_LIBRARY_PATH ] ; then
  299 + echo "LD_LIBRARY_PATH=$ZEND_DIR/lib" >> /etc/zce.rc
  300 + else
  301 + echo "LD_LIBRARY_PATH=$ZEND_DIR/lib:$LD_LIBRARY_PATH" >> /etc/zce.rc
  302 + fi
  303 + fi
  304 +
  305 + touch $INSTALL_PATH/var/bin/.dmsinit.lock
  306 +
  307 + $ZEND_DIR/bin/zendctl.sh restart
  308 +}
  309 +
282 [ $# -lt 1 ] && help 310 [ $# -lt 1 ] && help
283 311
284 if [ ! -z ${2} ]; then 312 if [ ! -z ${2} ]; then
@@ -291,6 +319,8 @@ if [ "x$3" != "x" ]; then @@ -291,6 +319,8 @@ if [ "x$3" != "x" ]; then
291 MYSQL_PASSWORD=$3 319 MYSQL_PASSWORD=$3
292 fi 320 fi
293 321
  322 +# Are we running for first time
  323 +[[ -e $INSTALL_PATH/var/bin/.dmsinit.lock ]] || firstrun
294 324
295 case $1 in 325 case $1 in
296 help) help 326 help) help
@@ -302,6 +332,7 @@ case $1 in @@ -302,6 +332,7 @@ case $1 in
302 start_soffice 332 start_soffice
303 start_lucene 333 start_lucene
304 start_scheduler 334 start_scheduler
  335 + #[[ -e $ZEND_DIR/bin/zendctl.sh ]] && $ZEND_DIR/bin/zendctl.sh restart
305 fi 336 fi
306 ;; 337 ;;
307 stop) if [ "${SERVER}" != "all" ]; then 338 stop) if [ "${SERVER}" != "all" ]; then
@@ -327,4 +358,4 @@ case $1 in @@ -327,4 +358,4 @@ case $1 in
327 ;; 358 ;;
328 esac 359 esac
329 360
330 -exit $ERROR  
331 \ No newline at end of file 361 \ No newline at end of file
  362 +exit $ERROR
plugins/thumbnails/thumbnails.php
@@ -170,6 +170,11 @@ class thumbnailGenerator extends BaseProcessor @@ -170,6 +170,11 @@ class thumbnailGenerator extends BaseProcessor
170 $default->log->debug('Thumbnail Generator Plugin: PDF file does not exist, cannot generate a thumbnail'); 170 $default->log->debug('Thumbnail Generator Plugin: PDF file does not exist, cannot generate a thumbnail');
171 return false; 171 return false;
172 } 172 }
  173 +
  174 + if (WINDOWS_OS) {
  175 + $thumbnailfile = KT_DIR . $thumbnailfile;
  176 + }
  177 +
173 // if a previous version of the thumbnail exists - delete it 178 // if a previous version of the thumbnail exists - delete it
174 if (file_exists($thumbnailfile)) { 179 if (file_exists($thumbnailfile)) {
175 @unlink($thumbnailfile); 180 @unlink($thumbnailfile);
@@ -177,7 +182,10 @@ class thumbnailGenerator extends BaseProcessor @@ -177,7 +182,10 @@ class thumbnailGenerator extends BaseProcessor
177 // do generation 182 // do generation
178 // if (extension_loaded('imagick')) { 183 // if (extension_loaded('imagick')) {
179 $pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert'; 184 $pathConvert = (!empty($default->convertPath)) ? $default->convertPath : 'convert';
180 - $result = shell_exec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile"); 185 + if (WINDOWS_OS) {
  186 + $pathConvert = '"' . $pathConvert . '"';
  187 + }
  188 + $result = KTUtil::pexec("{$pathConvert} -size 200x200 {$pdfFile}[0] -resize 200x200 $thumbnailfile");
181 return true; 189 return true;
182 //}else{ 190 //}else{
183 //$default->log->debug('Thumbnail Generator Plugin: Imagemagick not installed, cannot generate a thumbnail'); 191 //$default->log->debug('Thumbnail Generator Plugin: Imagemagick not installed, cannot generate a thumbnail');
@@ -212,6 +220,10 @@ class ThumbnailViewlet extends KTDocumentViewlet { @@ -212,6 +220,10 @@ class ThumbnailViewlet extends KTDocumentViewlet {
212 global $default; 220 global $default;
213 $varDir = $default->internalVarDirectory; 221 $varDir = $default->internalVarDirectory;
214 $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg'; 222 $thumbnailfile = $varDir . '/thumbnails/'.$documentId.'.jpg';
  223 +
  224 + if (WINDOWS_OS) {
  225 + $thumbnailfile = KT_DIR . $thumbnailfile;
  226 + }
215 227
216 // if the thumbnail doesn't exist try to create it 228 // if the thumbnail doesn't exist try to create it
217 if (!file_exists($thumbnailfile)){ 229 if (!file_exists($thumbnailfile)){
search2/indexing/extractors/PSExtractor.inc.php
@@ -61,6 +61,8 @@ class PSExtractor extends ApplicationExtractor @@ -61,6 +61,8 @@ class PSExtractor extends ApplicationExtractor
61 61
62 public function diagnose() 62 public function diagnose()
63 { 63 {
  64 + // no rpm's available for pstotext, removing the diagnose for it so it doesn't prevent the indexing from running
  65 + return null;
64 if (OS_WINDOWS) 66 if (OS_WINDOWS)
65 { 67 {
66 // pstotext is not available under windows, so no need to diagnose it 68 // pstotext is not available under windows, so no need to diagnose it
setup/wizard/lib/services/windowsLucene.php
@@ -429,7 +429,6 @@ class windowsLucene extends windowsService { @@ -429,7 +429,6 @@ class windowsLucene extends windowsService {
429 $luceneExe = $this->getLuceneExe(); 429 $luceneExe = $this->getLuceneExe();
430 $luceneSource = $this->getLuceneSource(); 430 $luceneSource = $this->getLuceneSource();
431 $luceneDir = $this->getluceneDir(); 431 $luceneDir = $this->getluceneDir();
432 -// $javaJVM = $this->getJavaJVM();  
433 if($luceneExe && $luceneSource && $luceneDir) { 432 if($luceneExe && $luceneSource && $luceneDir) {
434 $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto"; 433 $cmd = "\"{$luceneExe}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"".$luceneSource."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$luceneDir."\" -auto";
435 if(DEBUG) { 434 if(DEBUG) {
setup/wizard/lib/services/windowsOpenOffice.php
@@ -201,7 +201,6 @@ class windowsOpenOffice extends windowsService { @@ -201,7 +201,6 @@ class windowsOpenOffice extends windowsService {
201 public function install() { 201 public function install() {
202 $status = $this->status(); 202 $status = $this->status();
203 if($status == '') { 203 if($status == '') {
204 - //$binary = $this->util->openOfficeSpecified();  
205 $binary = $this->getBin(); 204 $binary = $this->getBin();
206 if($binary != '') { 205 if($binary != '') {
207 $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";; 206 $cmd = "\"{$this->winservice}\" install $this->name "."-displayname {$this->name} -start auto \"".$binary."\" -headless -invisible -nofirststartwizard -\"accept=socket,host={$this->host},port={$this->port};urp;\"";;
setup/wizard/steps/database.php
@@ -781,7 +781,7 @@ class database extends Step @@ -781,7 +781,7 @@ class database extends Step
781 if($binaries) { 781 if($binaries) {
782 foreach ($binaries as $k=>$bin) { 782 foreach ($binaries as $k=>$bin) {
783 if($k != 1) { 783 if($k != 1) {
784 - $updateBin = 'UPDATE config_settings c SET c.value = "'.$bin.'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";'; 784 + $updateBin = 'UPDATE config_settings c SET c.value = "'.str_replace('\\', '\\\\', $bin).'" where c.group_name = "externalBinary" and c.display_name = "'.$k.'";';
785 $this->util->dbUtilities->query($updateBin); 785 $this->util->dbUtilities->query($updateBin);
786 } 786 }
787 } 787 }
@@ -790,6 +790,7 @@ class database extends Step @@ -790,6 +790,7 @@ class database extends Step
790 // if Windows, hard code (relative to SYSTEM_ROOT) where we expect the Zend MSI installer to have placed them 790 // if Windows, hard code (relative to SYSTEM_ROOT) where we expect the Zend MSI installer to have placed them
791 if (WINDOWS_OS) { 791 if (WINDOWS_OS) {
792 $winBinaries = array('php' => 'ZendServer\bin\php.exe', 'python' => 'openoffice\program\python.exe', 792 $winBinaries = array('php' => 'ZendServer\bin\php.exe', 'python' => 'openoffice\program\python.exe',
  793 + 'java' => 'jre\bin\java.exe',
793 // since we don't know where convert is yet, let's just assume somewhere for now (manually test) 794 // since we don't know where convert is yet, let's just assume somewhere for now (manually test)
794 'convert' => 'imagick\convert.exe', 795 'convert' => 'imagick\convert.exe',
795 'zip' => 'bin\zip\zip.exe', 'unzip' => 'bin\unzip\unzip.exe'); 796 'zip' => 'bin\zip\zip.exe', 'unzip' => 'bin\unzip\unzip.exe');
setup/wizard/templates/services.tpl
@@ -10,6 +10,7 @@ @@ -10,6 +10,7 @@
10 The wizard will review your system to determine whether you can run KnowledgeTree background services. <br/>Once the scan is completed, you&rsquo;ll see whether your system has met the requirements or whether there are areas you need to address. 10 The wizard will review your system to determine whether you can run KnowledgeTree background services. <br/>Once the scan is completed, you&rsquo;ll see whether your system has met the requirements or whether there are areas you need to address.
11 </p> 11 </p>
12 <!--Continue Message--> 12 <!--Continue Message-->
  13 +<?php if($validation) { ?>
13 <?php 14 <?php
14 if(!$errors && !$warnings) { 15 if(!$errors && !$warnings) {
15 ?> 16 ?>
@@ -33,10 +34,10 @@ @@ -33,10 +34,10 @@
33 }?> 34 }?>
34 <?php 35 <?php
35 if($errors || $warnings) { 36 if($errors || $warnings) {
36 -// var_dump($errors);  
37 ?> 37 ?>
38 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://wiki.knowledgetree.com/Web_Based_Installer#Service_Dependencies" target="_blank">Click here for help on overcoming service issues</a> 38 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://wiki.knowledgetree.com/Web_Based_Installer#Service_Dependencies" target="_blank">Click here for help on overcoming service issues</a>
39 <?php } ?> 39 <?php } ?>
  40 +<?php } ?>
40 <!--Content--> 41 <!--Content-->
41 <div id="step_content_configuration" class="step"> 42 <div id="step_content_configuration" class="step">
42 <?php if(!$alreadyInstalled) { ?> 43 <?php if(!$alreadyInstalled) { ?>
@@ -170,6 +171,7 @@ @@ -170,6 +171,7 @@
170 All services are already installed. 171 All services are already installed.
171 <!-- </p>--> 172 <!-- </p>-->
172 <?php } ?> 173 <?php } ?>
  174 + <?php if($validation) { ?>
173 <h3><?php echo "<span class='{$serviceCheck}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>"; ?>Services Check</h3> 175 <h3><?php echo "<span class='{$serviceCheck}'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>"; ?>Services Check</h3>
174 <?php if($silent) { ?> 176 <?php if($silent) { ?>
175 <?php if($serviceCheck != 'tick') { 177 <?php if($serviceCheck != 'tick') {
@@ -216,6 +218,9 @@ @@ -216,6 +218,9 @@
216 <?php if($silent) { ?> 218 <?php if($silent) { ?>
217 </div> 219 </div>
218 <?php } ?> 220 <?php } ?>
  221 + <?php } else { ?>
  222 + Services have to be manually started after the installation has been run. <a href="http://wiki.knowledgetree.com/KnowledgeTree_Setup_Wizard_Troubleshoot#Services" target="_blank">Click here for help on starting services</a>
  223 + <?php } ?>
219 </div> 224 </div>
220 <input type="submit" name="Previous" value="Previous" class="button_previous"/> 225 <input type="submit" name="Previous" value="Previous" class="button_previous"/>
221 <input type="submit" name="Next" value="Next" class="button_next"/> 226 <input type="submit" name="Next" value="Next" class="button_next"/>