Commit f71fb0a526f003ca878c99e1d87bc38c17b95524
1 parent
7e9d33bc
KTS-3900
"Drop OpenOffice for text extraction" Fixed. Disabled the starOffice extractor, commented out OO code in the base extractor. Committed by: Megan Watson Reviewed by: Donald Jackson git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@9602 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
10 additions
and
6 deletions
search2/indexing/extractorCore.inc.php
| @@ -494,7 +494,7 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | @@ -494,7 +494,7 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | ||
| 494 | 494 | ||
| 495 | $config = KTConfig::getSingleton(); | 495 | $config = KTConfig::getSingleton(); |
| 496 | $this->params = $config->get('indexer/' . $cmd . 'cmdline', $params); | 496 | $this->params = $config->get('indexer/' . $cmd . 'cmdline', $params); |
| 497 | - $this->useOO = $config->get('indexer/useOpenOffice', true); | 497 | + $this->useOO = false; //$config->get('indexer/useOpenOffice', true); |
| 498 | if (!$config->get('indexer/use_' . $cmd, true) || OS_WINDOWS) | 498 | if (!$config->get('indexer/use_' . $cmd, true) || OS_WINDOWS) |
| 499 | { | 499 | { |
| 500 | $this->cmd = false; | 500 | $this->cmd = false; |
| @@ -502,8 +502,8 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | @@ -502,8 +502,8 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | ||
| 502 | 502 | ||
| 503 | if ($this->useOO) | 503 | if ($this->useOO) |
| 504 | { | 504 | { |
| 505 | - require_once('extractors/StarOfficeExtractor.inc.php'); | ||
| 506 | - $this->oo = new StarOfficeExtractor(); | 505 | +// require_once('extractors/StarOfficeExtractor.inc.php'); |
| 506 | +// $this->oo = new StarOfficeExtractor(); | ||
| 507 | } | 507 | } |
| 508 | } | 508 | } |
| 509 | 509 | ||
| @@ -547,6 +547,7 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | @@ -547,6 +547,7 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | ||
| 547 | // if failure, fallthrough, and attempt OO | 547 | // if failure, fallthrough, and attempt OO |
| 548 | } | 548 | } |
| 549 | 549 | ||
| 550 | + /* | ||
| 550 | if ($this->useOO) | 551 | if ($this->useOO) |
| 551 | { | 552 | { |
| 552 | $this->oo->setSourceFile($this->sourcefile); | 553 | $this->oo->setSourceFile($this->sourcefile); |
| @@ -567,25 +568,26 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | @@ -567,25 +568,26 @@ abstract class OOFallbackDocumentExtractor extends ExternalDocumentExtractor | ||
| 567 | } | 568 | } |
| 568 | else | 569 | else |
| 569 | { | 570 | { |
| 571 | + */ | ||
| 570 | global $default; | 572 | global $default; |
| 571 | $docId = $this->document->getId(); | 573 | $docId = $this->document->getId(); |
| 572 | $cmd = $this->cmd; | 574 | $cmd = $this->cmd; |
| 573 | $default->log->info("The document {$docId} cannot be indexed as {$cmd} is not available and OpenOffice is not in use."); | 575 | $default->log->info("The document {$docId} cannot be indexed as {$cmd} is not available and OpenOffice is not in use."); |
| 574 | file_put_contents($this->targetfile, ''); | 576 | file_put_contents($this->targetfile, ''); |
| 575 | return true; | 577 | return true; |
| 576 | - } | 578 | + //} |
| 577 | } | 579 | } |
| 578 | 580 | ||
| 579 | public function diagnose() | 581 | public function diagnose() |
| 580 | { | 582 | { |
| 581 | - if ($this->cmd !== false || !$this->useOO) | 583 | + if ($this->cmd !== false) // || !$this->useOO) |
| 582 | { | 584 | { |
| 583 | // cmd is found. we don't care about oo. | 585 | // cmd is found. we don't care about oo. |
| 584 | // if we can't use oo, well, not much we can do.... | 586 | // if we can't use oo, well, not much we can do.... |
| 585 | return null; | 587 | return null; |
| 586 | } | 588 | } |
| 587 | 589 | ||
| 588 | - return $this->oo->diagnose(); | 590 | + return false; //$this->oo->diagnose(); |
| 589 | } | 591 | } |
| 590 | } | 592 | } |
| 591 | 593 |
search2/indexing/extractors/StarOfficeExtractor.inc.php
| @@ -71,6 +71,8 @@ class StarOfficeExtractor extends ExternalDocumentExtractor | @@ -71,6 +71,8 @@ class StarOfficeExtractor extends ExternalDocumentExtractor | ||
| 71 | 71 | ||
| 72 | public function getSupportedMimeTypes() | 72 | public function getSupportedMimeTypes() |
| 73 | { | 73 | { |
| 74 | + // disable | ||
| 75 | + return array(); | ||
| 74 | $supported = array(); | 76 | $supported = array(); |
| 75 | 77 | ||
| 76 | if ($this->useOO) | 78 | if ($this->useOO) |