Commit 73ab40e9c58bb9eb3b67c8c6b316827ae4dbf3b5

Authored by kevin_fourie
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
lib/browse/Criteria.inc
@@ -242,7 +242,8 @@ class BrowseCriterion { @@ -242,7 +242,8 @@ class BrowseCriterion {
242 } 242 }
243 243
244 function getWidgetBase () { 244 function getWidgetBase () {
245 - return strtr($this->getNamespace(), '-', '_'); 245 + //return strtr($this->getNamespace(), '-', '_');
  246 + return $this->getNamespace();
246 } 247 }
247 248
248 function getSearchTable() { 249 function getSearchTable() {
@@ -731,21 +732,21 @@ class SizeCriterion extends BrowseCriterion { @@ -731,21 +732,21 @@ class SizeCriterion extends BrowseCriterion {
731 'M'=>'Megabytes'); 732 'M'=>'Megabytes');
732 733
733 var $aTypeAssocs = array('B' => 1, 'KB' => 1024, 'M' => 1048576); 734 var $aTypeAssocs = array('B' => 1, 'KB' => 1024, 'M' => 1048576);
734 - 735 +
735 var $aCmps = array(); 736 var $aCmps = array();
736 737
737 var $aCmpAssocs = array(); 738 var $aCmpAssocs = array();
738 739
739 function SizeCriterion() { 740 function SizeCriterion() {
740 $this->sDisplay = _kt('File Size'); 741 $this->sDisplay = _kt('File Size');
741 - 742 +
742 $this->aCmps = array('LT'=>_kt('Less than'), 743 $this->aCmps = array('LT'=>_kt('Less than'),
743 'GT'=>_kt('Greater than'), 744 'GT'=>_kt('Greater than'),
744 'EQ'=>_kt('Equal to'), 745 'EQ'=>_kt('Equal to'),
745 'NEQ'=>_kt('Not equal to')); 746 'NEQ'=>_kt('Not equal to'));
746 - 747 +
747 $this->aCmpAssocs = array('LT' => '<', 'GT' => '>', 'EQ' => '=', 'NEQ' => '!='); 748 $this->aCmpAssocs = array('LT' => '<', 'GT' => '>', 'EQ' => '=', 'NEQ' => '!=');
748 - 749 +
749 } 750 }
750 751
751 function documentDisplay ($oDocument) { 752 function documentDisplay ($oDocument) {
@@ -928,7 +929,7 @@ class DateCreatedDeltaCriterion extends DateCreatedCriterion { @@ -928,7 +929,7 @@ class DateCreatedDeltaCriterion extends DateCreatedCriterion {
928 929
929 function DateCreatedDeltaCriterion() { 930 function DateCreatedDeltaCriterion() {
930 $this->sDisplay = _kt('Date Created Delta'); 931 $this->sDisplay = _kt('Date Created Delta');
931 - 932 +
932 $this->aTypes = array('MINUTE'=>_kt('Minutes'), 933 $this->aTypes = array('MINUTE'=>_kt('Minutes'),
933 'HOUR'=>_kt('Hours'), 934 'HOUR'=>_kt('Hours'),
934 'DAY'=>_kt('Days'), 935 'DAY'=>_kt('Days'),
lib/util/ktutil.inc
@@ -107,19 +107,20 @@ class KTUtil { @@ -107,19 +107,20 @@ class KTUtil {
107 $cacheDir = $config->get('cache/cacheDirectory'); 107 $cacheDir = $config->get('cache/cacheDirectory');
108 108
109 $base_url = @file_get_contents($cacheDir . '/' . KTUtil::SERVER_NAME_FILE); 109 $base_url = @file_get_contents($cacheDir . '/' . KTUtil::SERVER_NAME_FILE);
  110 + global $default;
110 111
111 if (false == $base_url) 112 if (false == $base_url)
112 { 113 {
113 - global $default;  
114 $default->log->info("call_page: $path - cannot call script until user logs in for the first time!"); 114 $default->log->info("call_page: $path - cannot call script until user logs in for the first time!");
115 return; 115 return;
116 } 116 }
117 117
118 -  
119 $kt_url = KTUtil::kt_url(); 118 $kt_url = KTUtil::kt_url();
120 119
121 $full_url = $kt_url . '/' . $path; 120 $full_url = $kt_url . '/' . $path;
122 121
  122 + $default->log->debug("call_page: calling $full_url");
  123 +
123 $ch = curl_init($full_url); 124 $ch = curl_init($full_url);
124 curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false); 125 curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
125 curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false); 126 curl_setopt($ch,CURLOPT_SSL_VERIFYHOST, false);
plugins/search2/LuceneStatisticsDashlet.php
@@ -101,7 +101,7 @@ class LuceneStatisticsDashlet extends KTBaseDashlet @@ -101,7 +101,7 @@ class LuceneStatisticsDashlet extends KTBaseDashlet
101 $docsInIndex = $index->getDocumentsInIndex(); 101 $docsInIndex = $index->getDocumentsInIndex();
102 102
103 // we are only interested in documents that are active 103 // we are only interested in documents that are active
104 - $docsInQueue = $index->getIndexingQueue(); 104 + $docsInQueue = $index->getIndexingQueue(false);
105 $docsInQueue = count($docsInQueue); 105 $docsInQueue = count($docsInQueue);
106 106
107 $errorsInQueue = $index->getIndexingQueue(true); 107 $errorsInQueue = $index->getIndexingQueue(true);
search2/indexing/extractorCore.inc.php
@@ -631,21 +631,29 @@ abstract class CompositeExtractor extends DocumentExtractor @@ -631,21 +631,29 @@ abstract class CompositeExtractor extends DocumentExtractor
631 631
632 $this->sourceExtractor->setSourceFile($this->sourcefile); 632 $this->sourceExtractor->setSourceFile($this->sourcefile);
633 $this->sourceExtractor->setTargetFile($intermediateFile); 633 $this->sourceExtractor->setTargetFile($intermediateFile);
  634 + $this->sourceExtractor->setDocument($this->getDocument());
634 $this->sourceExtractor->setMimeType($this->mimetype); 635 $this->sourceExtractor->setMimeType($this->mimetype);
635 $this->sourceExtractor->setExtension($this->extension); 636 $this->sourceExtractor->setExtension($this->extension);
636 if (!$this->sourceExtractor->extractTextContent()) 637 if (!$this->sourceExtractor->extractTextContent())
637 { 638 {
  639 + $this->output = $this->sourceExtractor->output;
  640 + @unlink($intermediateFile);
638 return false; 641 return false;
639 } 642 }
640 $intermediateFile = $this->sourceExtractor->getTargetFile(); 643 $intermediateFile = $this->sourceExtractor->getTargetFile();
641 644
642 $this->targetExtractor->setSourceFile($intermediateFile); 645 $this->targetExtractor->setSourceFile($intermediateFile);
643 $this->targetExtractor->setTargetFile($this->targetfile); 646 $this->targetExtractor->setTargetFile($this->targetfile);
  647 + $this->targetExtractor->setDocument($this->getDocument());
644 $this->targetExtractor->setMimeType($this->targetMimeType); 648 $this->targetExtractor->setMimeType($this->targetMimeType);
645 $this->targetExtractor->setExtension($this->targetExtension); 649 $this->targetExtractor->setExtension($this->targetExtension);
646 $result = $this->targetExtractor->extractTextContent(); 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 return $result; 658 return $result;
651 } 659 }
search2/indexing/indexerCore.inc.php
@@ -1012,6 +1012,20 @@ abstract class Indexer @@ -1012,6 +1012,20 @@ abstract class Indexer
1012 $this->logPendingDocumentInfoStatus($docId, sprintf(_kt("Processing docid: %d.\n"),$docId), 'info'); 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 $removeFromQueue = true; 1029 $removeFromQueue = true;
1016 if ($indexDocument) 1030 if ($indexDocument)
1017 { 1031 {
@@ -1030,12 +1044,7 @@ abstract class Indexer @@ -1030,12 +1044,7 @@ abstract class Indexer
1030 continue; 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 $version = $document->getMajorVersionNumber() . '.' . $document->getMinorVersionNumber(); 1049 $version = $document->getMajorVersionNumber() . '.' . $document->getMinorVersionNumber();
1041 $sourceFile = $storageManager->temporaryFile($document); 1050 $sourceFile = $storageManager->temporaryFile($document);