Commit b19603ade46bb28f4fcdc73883c4030502ce1523
1 parent
250cf875
KTS-2647
"Folder utilisation dashlet should get the indexer location from the indexer and not from the config.ini" Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7662 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
37 additions
and
1 deletions
plugins/housekeeper/HouseKeeperPlugin.php
| @@ -53,7 +53,9 @@ class HouseKeeperPlugin extends KTPlugin | @@ -53,7 +53,9 @@ class HouseKeeperPlugin extends KTPlugin | ||
| 53 | $cacheDir = $config->get('cache/cacheDirectory'); | 53 | $cacheDir = $config->get('cache/cacheDirectory'); |
| 54 | $logDir = $config->get('urls/logDirectory'); | 54 | $logDir = $config->get('urls/logDirectory'); |
| 55 | $docsDir = $config->get('urls/documentRoot'); | 55 | $docsDir = $config->get('urls/documentRoot'); |
| 56 | - $luceneDir = $config->get('indexer/luceneDirectory'); | 56 | + |
| 57 | + $indexer = Indexer::get(); | ||
| 58 | + $luceneDir = $indexer->getIndexDirectory(); | ||
| 57 | 59 | ||
| 58 | $systemDir = OS_UNIX?'/tmp':'c:/windows/temp'; | 60 | $systemDir = OS_UNIX?'/tmp':'c:/windows/temp'; |
| 59 | 61 | ||
| @@ -85,6 +87,8 @@ class HouseKeeperPlugin extends KTPlugin | @@ -85,6 +87,8 @@ class HouseKeeperPlugin extends KTPlugin | ||
| 85 | 'canClean'=>true | 87 | 'canClean'=>true |
| 86 | ); | 88 | ); |
| 87 | 89 | ||
| 90 | + if (is_dir($docsDir)) | ||
| 91 | + { | ||
| 88 | $this->folders[] = | 92 | $this->folders[] = |
| 89 | array( | 93 | array( |
| 90 | 'name'=>_kt('KnowledgeTree Documents'), | 94 | 'name'=>_kt('KnowledgeTree Documents'), |
| @@ -92,6 +96,10 @@ class HouseKeeperPlugin extends KTPlugin | @@ -92,6 +96,10 @@ class HouseKeeperPlugin extends KTPlugin | ||
| 92 | 'pattern'=>'', | 96 | 'pattern'=>'', |
| 93 | 'canClean'=>false | 97 | 'canClean'=>false |
| 94 | ); | 98 | ); |
| 99 | + } | ||
| 100 | + | ||
| 101 | + if (is_dir($luceneDir)) | ||
| 102 | + { | ||
| 95 | $this->folders[] = | 103 | $this->folders[] = |
| 96 | array( | 104 | array( |
| 97 | 'name'=>_kt('KnowledgeTree Document Index'), | 105 | 'name'=>_kt('KnowledgeTree Document Index'), |
| @@ -99,6 +107,7 @@ class HouseKeeperPlugin extends KTPlugin | @@ -99,6 +107,7 @@ class HouseKeeperPlugin extends KTPlugin | ||
| 99 | 'pattern'=>'', | 107 | 'pattern'=>'', |
| 100 | 'canClean'=>false | 108 | 'canClean'=>false |
| 101 | ); | 109 | ); |
| 110 | + } | ||
| 102 | 111 | ||
| 103 | } | 112 | } |
| 104 | 113 |
search2/indexing/indexerCore.inc.php
| @@ -1343,6 +1343,18 @@ abstract class Indexer | @@ -1343,6 +1343,18 @@ abstract class Indexer | ||
| 1343 | * @return int | 1343 | * @return int |
| 1344 | */ | 1344 | */ |
| 1345 | public abstract function getDocumentsInIndex(); | 1345 | public abstract function getDocumentsInIndex(); |
| 1346 | + | ||
| 1347 | + /** | ||
| 1348 | + * Returns the path to the index directory | ||
| 1349 | + * | ||
| 1350 | + * @return string | ||
| 1351 | + */ | ||
| 1352 | + public function getIndexDirectory() | ||
| 1353 | + { | ||
| 1354 | + $config = KTConfig::getSingleton(); | ||
| 1355 | + $directory = $config->get('indexer/luceneDirectory'); | ||
| 1356 | + return $directory; | ||
| 1357 | + } | ||
| 1346 | } | 1358 | } |
| 1347 | 1359 | ||
| 1348 | ?> | 1360 | ?> |
| 1349 | \ No newline at end of file | 1361 | \ No newline at end of file |
search2/indexing/indexers/JavaXMLRPCLuceneIndexer.inc.php
| @@ -250,5 +250,20 @@ class JavaXMLRPCLuceneIndexer extends Indexer | @@ -250,5 +250,20 @@ class JavaXMLRPCLuceneIndexer extends Indexer | ||
| 250 | return $stats->countDocuments; | 250 | return $stats->countDocuments; |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | + /** | ||
| 254 | + * Returns the path to the index directory | ||
| 255 | + * | ||
| 256 | + * @return string | ||
| 257 | + */ | ||
| 258 | + public function getIndexDirectory() | ||
| 259 | + { | ||
| 260 | + $stats = $this->lucene->getStatistics(); | ||
| 261 | + if ($stats === false || !is_object($stats)) | ||
| 262 | + { | ||
| 263 | + return false; | ||
| 264 | + } | ||
| 265 | + return $stats->indexDirectory; | ||
| 266 | + } | ||
| 267 | + | ||
| 253 | } | 268 | } |
| 254 | ?> | 269 | ?> |
| 255 | \ No newline at end of file | 270 | \ No newline at end of file |