Commit 73ab40e9c58bb9eb3b67c8c6b316827ae4dbf3b5
1 parent
39180d5f
Merged in from DEV trunk...
KTS-3233 "If you use a (-) in a lookup fieldset name, the browse by lookup value returns all documents associated to the fieldset." Fixed. The (-) was being replaced by an (_). Committed by: Megan Watson Reviewed by: Conrad Vermeulen KTS-3165 "Remove background task permissions problems by making web server user deal with background tasks" Fixed. Added some debug logging Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie KTS-3235 "Indexer unable to index a MS PPT 2003 document" Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie KTS-3236 "Indexing process should skip temporary files as the indexer process is likely to fail resulting in users being confused." Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie KTS-3237 "Document Indexer dashlet shows the number of documents in the queue to include the problem documents in the queue" Fixed. Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@8348 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
5 changed files
with
35 additions
and
16 deletions
lib/browse/Criteria.inc
| ... | ... | @@ -242,7 +242,8 @@ class BrowseCriterion { |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | function getWidgetBase () { |
| 245 | - return strtr($this->getNamespace(), '-', '_'); | |
| 245 | + //return strtr($this->getNamespace(), '-', '_'); | |
| 246 | + return $this->getNamespace(); | |
| 246 | 247 | } |
| 247 | 248 | |
| 248 | 249 | function getSearchTable() { |
| ... | ... | @@ -731,21 +732,21 @@ class SizeCriterion extends BrowseCriterion { |
| 731 | 732 | 'M'=>'Megabytes'); |
| 732 | 733 | |
| 733 | 734 | var $aTypeAssocs = array('B' => 1, 'KB' => 1024, 'M' => 1048576); |
| 734 | - | |
| 735 | + | |
| 735 | 736 | var $aCmps = array(); |
| 736 | 737 | |
| 737 | 738 | var $aCmpAssocs = array(); |
| 738 | 739 | |
| 739 | 740 | function SizeCriterion() { |
| 740 | 741 | $this->sDisplay = _kt('File Size'); |
| 741 | - | |
| 742 | + | |
| 742 | 743 | $this->aCmps = array('LT'=>_kt('Less than'), |
| 743 | 744 | 'GT'=>_kt('Greater than'), |
| 744 | 745 | 'EQ'=>_kt('Equal to'), |
| 745 | 746 | 'NEQ'=>_kt('Not equal to')); |
| 746 | - | |
| 747 | + | |
| 747 | 748 | $this->aCmpAssocs = array('LT' => '<', 'GT' => '>', 'EQ' => '=', 'NEQ' => '!='); |
| 748 | - | |
| 749 | + | |
| 749 | 750 | } |
| 750 | 751 | |
| 751 | 752 | function documentDisplay ($oDocument) { |
| ... | ... | @@ -928,7 +929,7 @@ class DateCreatedDeltaCriterion extends DateCreatedCriterion { |
| 928 | 929 | |
| 929 | 930 | function DateCreatedDeltaCriterion() { |
| 930 | 931 | $this->sDisplay = _kt('Date Created Delta'); |
| 931 | - | |
| 932 | + | |
| 932 | 933 | $this->aTypes = array('MINUTE'=>_kt('Minutes'), |
| 933 | 934 | 'HOUR'=>_kt('Hours'), |
| 934 | 935 | 'DAY'=>_kt('Days'), | ... | ... |
lib/util/ktutil.inc
| ... | ... | @@ -107,19 +107,20 @@ class KTUtil { |
| 107 | 107 | $cacheDir = $config->get('cache/cacheDirectory'); |
| 108 | 108 | |
| 109 | 109 | $base_url = @file_get_contents($cacheDir . '/' . KTUtil::SERVER_NAME_FILE); |
| 110 | + global $default; | |
| 110 | 111 | |
| 111 | 112 | if (false == $base_url) |
| 112 | 113 | { |
| 113 | - global $default; | |
| 114 | 114 | $default->log->info("call_page: $path - cannot call script until user logs in for the first time!"); |
| 115 | 115 | return; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - | |
| 119 | 118 | $kt_url = KTUtil::kt_url(); |
| 120 | 119 | |
| 121 | 120 | $full_url = $kt_url . '/' . $path; |
| 122 | 121 | |
| 122 | + $default->log->debug("call_page: calling $full_url"); | |
| 123 | + | |
| 123 | 124 | $ch = curl_init($full_url); |
| 124 | 125 | curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); |
| 125 | 126 | curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false); | ... | ... |
plugins/search2/LuceneStatisticsDashlet.php
| ... | ... | @@ -101,7 +101,7 @@ class LuceneStatisticsDashlet extends KTBaseDashlet |
| 101 | 101 | $docsInIndex = $index->getDocumentsInIndex(); |
| 102 | 102 | |
| 103 | 103 | // we are only interested in documents that are active |
| 104 | - $docsInQueue = $index->getIndexingQueue(); | |
| 104 | + $docsInQueue = $index->getIndexingQueue(false); | |
| 105 | 105 | $docsInQueue = count($docsInQueue); |
| 106 | 106 | |
| 107 | 107 | $errorsInQueue = $index->getIndexingQueue(true); | ... | ... |
search2/indexing/extractorCore.inc.php
| ... | ... | @@ -631,21 +631,29 @@ abstract class CompositeExtractor extends DocumentExtractor |
| 631 | 631 | |
| 632 | 632 | $this->sourceExtractor->setSourceFile($this->sourcefile); |
| 633 | 633 | $this->sourceExtractor->setTargetFile($intermediateFile); |
| 634 | + $this->sourceExtractor->setDocument($this->getDocument()); | |
| 634 | 635 | $this->sourceExtractor->setMimeType($this->mimetype); |
| 635 | 636 | $this->sourceExtractor->setExtension($this->extension); |
| 636 | 637 | if (!$this->sourceExtractor->extractTextContent()) |
| 637 | 638 | { |
| 639 | + $this->output = $this->sourceExtractor->output; | |
| 640 | + @unlink($intermediateFile); | |
| 638 | 641 | return false; |
| 639 | 642 | } |
| 640 | 643 | $intermediateFile = $this->sourceExtractor->getTargetFile(); |
| 641 | 644 | |
| 642 | 645 | $this->targetExtractor->setSourceFile($intermediateFile); |
| 643 | 646 | $this->targetExtractor->setTargetFile($this->targetfile); |
| 647 | + $this->targetExtractor->setDocument($this->getDocument()); | |
| 644 | 648 | $this->targetExtractor->setMimeType($this->targetMimeType); |
| 645 | 649 | $this->targetExtractor->setExtension($this->targetExtension); |
| 646 | 650 | $result = $this->targetExtractor->extractTextContent(); |
| 651 | + if (!$result) | |
| 652 | + { | |
| 653 | + $this->output = $this->targetExtractor->output; | |
| 654 | + } | |
| 647 | 655 | |
| 648 | - unlink(@$intermediateFile); | |
| 656 | + @unlink($intermediateFile); | |
| 649 | 657 | |
| 650 | 658 | return $result; |
| 651 | 659 | } | ... | ... |
search2/indexing/indexerCore.inc.php
| ... | ... | @@ -1012,6 +1012,20 @@ abstract class Indexer |
| 1012 | 1012 | $this->logPendingDocumentInfoStatus($docId, sprintf(_kt("Processing docid: %d.\n"),$docId), 'info'); |
| 1013 | 1013 | } |
| 1014 | 1014 | |
| 1015 | + $document = Document::get($docId); | |
| 1016 | + if (PEAR::isError($document)) | |
| 1017 | + { | |
| 1018 | + Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Cannot resolve document id %d: %s."),$docId, $document->getMessage()), 'error'); | |
| 1019 | + continue; | |
| 1020 | + } | |
| 1021 | + | |
| 1022 | + $filename = $document->getFileName(); | |
| 1023 | + if (substr($filename,0,1) == '~') | |
| 1024 | + { | |
| 1025 | + Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Filename for document id %d starts with a tilde (~). This is assumed to be a temporary file. This is ignored."),$docId), 'error'); | |
| 1026 | + continue; | |
| 1027 | + } | |
| 1028 | + | |
| 1015 | 1029 | $removeFromQueue = true; |
| 1016 | 1030 | if ($indexDocument) |
| 1017 | 1031 | { |
| ... | ... | @@ -1030,12 +1044,7 @@ abstract class Indexer |
| 1030 | 1044 | continue; |
| 1031 | 1045 | } |
| 1032 | 1046 | |
| 1033 | - $document = Document::get($docId); | |
| 1034 | - if (PEAR::isError($document)) | |
| 1035 | - { | |
| 1036 | - Indexer::unqueueDocument($docId,sprintf(_kt("indexDocuments: Cannot resolve document id %d: %s."),$docId, $document->getMessage()), 'error'); | |
| 1037 | - continue; | |
| 1038 | - } | |
| 1047 | + | |
| 1039 | 1048 | |
| 1040 | 1049 | $version = $document->getMajorVersionNumber() . '.' . $document->getMinorVersionNumber(); |
| 1041 | 1050 | $sourceFile = $storageManager->temporaryFile($document); | ... | ... |