Commit a292c30fb6659078a5a48435b6e2fb509fbcb5ab

Authored by Megan Watson
1 parent 0d571b5a

On unix the destination directory should be the var directory. Added indexes to …

…the end of the path in the KnowledgeTreeIndexer.properties file
PT: 1838493
    
Committed by: Megan Watson
Reviewed by: Paul Barrett
setup/wizard/lib/services/unixLucene.php
1 1 <?php
2 2 /**
3   -* Unix Lucene Service Controller.
  3 +* Unix Lucene Service Controller.
4 4 *
5 5 * KnowledgeTree Community Edition
6 6 * Document Management Made Simple
... ... @@ -51,7 +51,7 @@ class unixLucene extends unixService {
51 51 private $javaXmx;
52 52 public $name = "KTLucene";
53 53 public $hrname = "KnowledgeTree Indexer Service";
54   -
  54 +
55 55 /**
56 56 * Load defaults needed by service
57 57 *
... ... @@ -70,76 +70,76 @@ class unixLucene extends unixService {
70 70 $this->setLuceneSourceLoc("ktlucene.jar");
71 71 $this->setShutdownScript("shutdown.php");
72 72 }
73   -
74   -
  73 +
  74 +
75 75 public function setIndexerDir($indexerDir) {
76 76 $this->indexerDir = $indexerDir;
77 77 }
78   -
  78 +
79 79 private function getIndexerDir() {
80 80 return $this->indexerDir;
81 81 }
82   -
  82 +
83 83 private function setShutdownScript($shutdownScript) {
84 84 $this->shutdownScript = $shutdownScript;
85 85 }
86   -
  86 +
87 87 public function getShutdownScript() {
88 88 return $this->shutdownScript;
89 89 }
90   -
  90 +
91 91 private function setLucenePidFile($lucenePidFile) {
92 92 $this->lucenePidFile = $lucenePidFile;
93 93 }
94   -
  94 +
95 95 private function getLucenePidFile() {
96 96 return $this->lucenePidFile;
97 97 }
98   -
  98 +
99 99 private function setLuceneDir($luceneDir) {
100 100 $this->luceneDir = $luceneDir;
101 101 }
102   -
  102 +
103 103 public function getLuceneDir() {
104 104 return $this->luceneDir;
105 105 }
106   -
  106 +
107 107 private function setJavaXms($javaXms) {
108 108 $this->javaXms = "-Xms$javaXms";
109 109 }
110   -
  110 +
111 111 public function getJavaXms() {
112 112 return $this->javaXms;
113 113 }
114   -
  114 +
115 115 private function setJavaXmx($javaXmx) {
116 116 $this->javaXmx = "-Xmx$javaXmx";
117 117 }
118   -
  118 +
119 119 public function getJavaXmx() {
120 120 return $this->javaXmx;
121 121 }
122   -
  122 +
123 123 private function setLuceneSource($luceneSource) {
124 124 $this->luceneSource = $luceneSource;
125 125 }
126   -
  126 +
127 127 public function getLuceneSource() {
128 128 return $this->luceneSource;
129 129 }
130   -
  130 +
131 131 private function setLuceneSourceLoc($luceneSourceLoc) {
132 132 $this->luceneSourceLoc = $this->getLuceneDir().$luceneSourceLoc;
133 133 }
134   -
  134 +
135 135 public function getLuceneSourceLoc() {
136 136 return $this->luceneSourceLoc;
137 137 }
138   -
  138 +
139 139 public function getJavaOptions() {
140 140 return " {$this->getJavaXmx()} {$this->getJavaXmx()} -jar ";
141 141 }
142   -
  142 +
143 143 /**
144 144 * Stop Service
145 145 *
... ... @@ -157,7 +157,7 @@ class unixLucene extends unixService {
157 157 }
158 158 return $state;
159 159 }
160   -
  160 +
161 161 public function install() {
162 162 $status = $this->status();
163 163 if($status == '') {
... ... @@ -166,7 +166,7 @@ class unixLucene extends unixService {
166 166 return $status;
167 167 }
168 168 }
169   -
  169 +
170 170 public function status() {
171 171 $cmd = "ps ax | grep ".$this->getLuceneSource();
172 172 $response = $this->util->pexec($cmd);
... ... @@ -183,14 +183,14 @@ class unixLucene extends unixService {
183 183 return '';
184 184 }
185 185 }
186   -
  186 +
187 187 return '';
188 188 }
189   -
  189 +
190 190 public function uninstall() {
191 191 $this->stop();
192 192 }
193   -
  193 +
194 194 /**
195 195 * Start Service
196 196 *
... ... @@ -213,26 +213,26 @@ class unixLucene extends unixService {
213 213 // return false;
214 214 // }
215 215 //$response = $this->util->pexec($cmd);
216   -
  216 +
217 217 // return $response;
218 218 return false;
219 219 }
220   -
  220 +
221 221 return true;
222 222 }
223   -
  223 +
224 224 public function getName() {
225 225 return $this->name;
226 226 }
227   -
  227 +
228 228 public function getHRName() {
229 229 return $this->hrname;
230 230 }
231   -
  231 +
232 232 public function getStopMsg($installDir) {
233 233 return "";//"Execute from terminal : $installDir/dmsctl.sh stop";
234 234 }
235   -
  235 +
236 236 /**
237 237 * Write Lucene Service property file
238 238 *
... ... @@ -251,7 +251,7 @@ class unixLucene extends unixService {
251 251 $content .= "server.deny=\n";
252 252 $conf = $this->util->getDataFromSession('configuration');
253 253 $varDirectory = $conf['paths']['varDirectory']['path'];
254   - $content .= "indexer.directory=$varDirectory\n";
  254 + $content .= "indexer.directory=$varDirectory" . DIRECTORY_SEPARATOR . "indexes\n";
255 255 $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n";
256 256 fwrite($fp, $content);
257 257 fclose($fp);
... ...
setup/wizard/lib/services/windowsLucene.php
... ... @@ -5,7 +5,7 @@
5 5 * KnowledgeTree Community Edition
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2008,2009 KnowledgeTree Inc.
8   -*
  8 +*
9 9 *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
... ... @@ -135,7 +135,7 @@ class windowsLucene extends windowsService {
135 135 public $hrname = "KnowledgeTree Indexer Service. (KTLucene)";
136 136  
137 137 public $description = "KnowledgeTree Indexer Service.";
138   -
  138 +
139 139 /**
140 140 * Load defaults needed by service
141 141 *
... ... @@ -464,15 +464,15 @@ class windowsLucene extends windowsService {
464 464  
465 465 return '';
466 466 }
467   -
  467 +
468 468 public function getHRName() {
469 469 return $this->hrname;
470 470 }
471   -
  471 +
472 472 public function getStopMsg($installDir) {
473 473 return "";//"Execute from command prompt : $installDir/dmsctl.bat stop";
474 474 }
475   -
  475 +
476 476 /**
477 477 * Write Lucene Service property file
478 478 *
... ... @@ -491,7 +491,7 @@ class windowsLucene extends windowsService {
491 491 $content .= "server.deny=\n";
492 492 $conf = $this->util->getDataFromSession('configuration');
493 493 $varDirectory = $conf['paths']['varDirectory']['path'];
494   - $content .= "indexer.directory=$varDirectory\n";
  494 + $content .= "indexer.directory=$varDirectory" . DIRECTORY_SEPARATOR . "indexes\n";
495 495 $content .= "indexer.analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer\n";
496 496 fwrite($fp, $content);
497 497 fclose($fp);
... ...
setup/wizard/steps/install.php
... ... @@ -105,10 +105,15 @@ class install extends step
105 105 {
106 106 $this->callHome();
107 107 if ($this->util->isMigration()) { // copy indexing directory if this is a migration
108   - $migrateSessionData = $this->getDataFromPackage('migrate', 'installation');
109   - $configSessionData = $this->getDataFromSession('configuration');
  108 + $migrateSessionData = $this->getDataFromPackage('migrate', 'installation');
  109 + $configSessionData = $this->getDataFromSession('configuration');
110 110 $src = $migrateSessionData['location'] . DS . 'var' . DS . 'indexes';
111   - $dst = $configSessionData['paths']['varDirectory']['path'] . DS . 'indexes';
  111 +
  112 + if(WINDOWS_OS){
  113 + $dst = $configSessionData['paths']['varDirectory']['path'] . DS . 'indexes';
  114 + }else{
  115 + $dst = $configSessionData['paths']['varDirectory']['path'];
  116 + }
112 117 $this->util->copyDirectory($src, $dst);
113 118 }
114 119 }
... ... @@ -126,11 +131,11 @@ class install extends step
126 131 }
127 132 $this->temp_variables['ce_check'] = $this->ce_check;
128 133 }
129   -
  134 +
130 135 function registerPlugins() {
131   -
  136 +
132 137 }
133   -
  138 +
134 139 public function callHome() {
135 140 $conf = $this->getDataFromSession("install"); // retrieve database information from session
136 141 $dbconf = $this->getDataFromSession("database");
... ... @@ -143,7 +148,7 @@ class install extends step
143 148 $this->util->dbUtilities->query($query);
144 149 $this->util->dbUtilities->close(); // close the database connection
145 150 }
146   -
147   -
  151 +
  152 +
148 153 }
149 154 ?>
150 155 \ No newline at end of file
... ...