diff --git a/plugins/search2/ExternalDashlet.php b/plugins/search2/ExternalDashlet.php
index d22f829..4c27a29 100644
--- a/plugins/search2/ExternalDashlet.php
+++ b/plugins/search2/ExternalDashlet.php
@@ -7,31 +7,31 @@
* Document Management Made Simple
* Copyright (C) 2008 KnowledgeTree Inc.
* Portions copyright The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
- * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
* California 94120-7775, or email info@knowledgetree.com.
- *
+ *
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
- *
+ *
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
- * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
- * must display the words "Powered by KnowledgeTree" and retain the original
+ * must display the words "Powered by KnowledgeTree" and retain the original
* copyright notice.
* Contributor( s): ______________________________________
*
@@ -47,74 +47,6 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
$this->sClass = 'ktError';
}
- function addIssue($resource, $status)
- {
- $this->resources[] = array(
- 'name'=>$resource,
- 'status'=>str_replace(
-
- array("\n",_kt('Administrator Guide')),
- array('
', sprintf("%s", _kt('Administrator Guide'))), $status));
- }
-
- function checkResources()
- {
- $check = true;
- // check if we have a cached result
- if (isset($_SESSION['ExternalResourceStatus']))
- {
- // we will only do the check every 5 minutes
- if (time() - $_SESSION['ExternalResourceStatus']['time'] < 5 * 60)
- {
- $check = false;
- $this->resources = $_SESSION['ExternalResourceStatus']['resources'];
- }
- }
-
- // we will only check if the result is not cached, or after 5 minutes
- if ($check)
- {
- $this->checkOpenOffice();
- $this->checkLucene();
- $this->checkDF();
- $_SESSION['ExternalResourceStatus']['time'] = time();
- $_SESSION['ExternalResourceStatus']['resources'] = $this->resources;
- }
-
- return (count($this->resources) > 0);
- }
-
- function checkOpenOffice()
- {
- $diagnose = SearchHelper::checkOpenOfficeAvailablity();
- if (!is_null($diagnose))
- {
- $this->addIssue(_kt('Open Office Server'), $diagnose);
- }
- }
-
- function checkLucene()
- {
- $indexer = Indexer::get();
- $diagnose = $indexer->diagnose();
- if (!is_null($diagnose))
- {
- $this->addIssue(_kt('Document Indexer'), $diagnose);
- }
- }
-
- function checkDF()
- {
- $df = KTUtil::findCommand('externalBinary/df','df');
-
- if (false === $df)
- {
- $this->addIssue(_kt('Storage Utilization'), _kt('Could not locate the df binary.'));
- }
- }
-
-
-
function is_active($oUser)
{
if (!Permission::userIsSystemAdministrator())
@@ -122,7 +54,14 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
return false;
}
- return $this->checkResources() > 0;
+ $this->resources = KTUtil::getSystemSetting('externalResourceIssues');
+ if (empty($this->resources))
+ {
+ return false;
+ }
+ $this->resources = unserialize($this->resources);
+
+ return count($this->resources) > 0;
}
function render()
@@ -131,6 +70,12 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/external_resources');
$sUrl = KTUtil::kt_url();
+ foreach($this->resources as $k=>$v)
+ {
+ $this->resources[$k]['status'] = str_replace(
+ array("\n",_kt('Administrator Guide')),
+ array('
', sprintf("%s", _kt('Administrator Guide'))), $v['status']);
+ }
$aTemplateData = array(
'context' => $this,
@@ -142,4 +87,4 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
}
}
-?>
+?>
\ No newline at end of file
diff --git a/plugins/search2/IndexingStatusDashlet.php b/plugins/search2/IndexingStatusDashlet.php
index 1c12545..a7288f3 100644
--- a/plugins/search2/IndexingStatusDashlet.php
+++ b/plugins/search2/IndexingStatusDashlet.php
@@ -7,31 +7,31 @@
* Document Management Made Simple
* Copyright (C) 2008 KnowledgeTree Inc.
* Portions copyright The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
- * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
* California 94120-7775, or email info@knowledgetree.com.
- *
+ *
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
- *
+ *
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
- * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
- * must display the words "Powered by KnowledgeTree" and retain the original
+ * must display the words "Powered by KnowledgeTree" and retain the original
* copyright notice.
* Contributor( s): ______________________________________
*
@@ -54,20 +54,17 @@ class IndexingStatusDashlet extends KTBaseDashlet
return false;
}
- if (isset($_SESSION['IndexingStatus']))
+ $indexerDiagnosis = KTUtil::getSystemSetting('indexerDiagnostics');
+ $extractorDiagnosis = KTUtil::getSystemSetting('extractorDiagnostics');
+ if (!empty($indexerDiagnosis)) $indexerDiagnosis = unserialize($indexerDiagnosis);
+ if (!empty($extractorDiagnosis)) $extractorDiagnosis = unserialize($extractorDiagnosis);
+
+ if (empty($indexerDiagnosis) && empty($extractorDiagnosis))
{
- $this->indexerName = $_SESSION['IndexingStatus']['indexerName'];
- $this->indexerDiagnosis = $_SESSION['IndexingStatus']['indexerDiagnosis'];
- $this->extractorDiagnosis = $_SESSION['IndexingStatus']['extractorDiagnosis'];
+ return false;
}
- else
- {
- $indexer = Indexer::get();
- $this->indexerName = $indexer->getDisplayName();
- $this->indexerDiagnosis = $indexer->diagnose();
+ $this->indexerDiagnosis = $indexerDiagnosis;
$this->extractorDiagnosis = array();
- $extractorDiagnosis = $indexer->diagnoseExtractors();
-
$result = array();
foreach($extractorDiagnosis as $class=>$diagnosis)
@@ -85,19 +82,9 @@ class IndexingStatusDashlet extends KTBaseDashlet
$this->indexerDiagnosis = str_replace(
- array("\n",_kt('Administrator Guide')),
+ array("\n",'Administrator Guide'),
array('
', sprintf("%s", _kt('Administrator Guide'))), $this->indexerDiagnosis);
- $_SESSION['IndexingStatus']['indexerName'] = $this->indexerName;
- $_SESSION['IndexingStatus']['indexerDiagnosis'] = $this->indexerDiagnosis;
- $_SESSION['IndexingStatus']['extractorDiagnosis'] = $this->extractorDiagnosis;
- }
-
- if (empty($this->indexerDiagnosis) && empty($this->extractorDiagnosis))
- {
- return false;
- }
-
return true;
}
@@ -107,7 +94,7 @@ class IndexingStatusDashlet extends KTBaseDashlet
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/indexing_status');
$url = KTUtil::kt_url();
-
+
$aTemplateData = array(
'context' => $this,
'indexerName' => $this->indexerName,
diff --git a/plugins/search2/LuceneStatisticsDashlet.php b/plugins/search2/LuceneStatisticsDashlet.php
index 05f443c..c211a16 100644
--- a/plugins/search2/LuceneStatisticsDashlet.php
+++ b/plugins/search2/LuceneStatisticsDashlet.php
@@ -7,31 +7,31 @@
* Document Management Made Simple
* Copyright (C) 2008 KnowledgeTree Inc.
* Portions copyright The Jam Warehouse Software (Pty) Limited
- *
+ *
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 3 as published by the
* Free Software Foundation.
- *
+ *
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
- * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
* California 94120-7775, or email info@knowledgetree.com.
- *
+ *
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU General Public License version 3.
- *
+ *
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
- * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
- * must display the words "Powered by KnowledgeTree" and retain the original
+ * must display the words "Powered by KnowledgeTree" and retain the original
* copyright notice.
* Contributor( s): ______________________________________
*
@@ -39,6 +39,9 @@
class LuceneStatisticsDashlet extends KTBaseDashlet
{
+ private $stats;
+
+
function LuceneStatisticsDashlet()
{
$this->sTitle = _kt('Document Indexer Statistics');
@@ -46,6 +49,12 @@ class LuceneStatisticsDashlet extends KTBaseDashlet
function is_active($oUser)
{
+ $stats = KTUtil::getSystemSetting('indexerStats');
+ if (empty($stats))
+ {
+ return false;
+ }
+ $this->stats = unserialize($stats);
return Permission::userIsSystemAdministrator();
}
@@ -54,108 +63,9 @@ class LuceneStatisticsDashlet extends KTBaseDashlet
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate('ktcore/search2/lucene_statistics');
-
- $check = true;
- // check if we have a cached result
- if (isset($_SESSION['LuceneStats']))
- {
- // we will only do the check every 5 minutes
- if (time() - $_SESSION['LuceneStats']['time'] < 5 * 60)
- {
- $check = false;
- $stats = $_SESSION['LuceneStats']['stats'];
- }
- }
-
- // we will only check if the result is not cached, or after 5 minutes
- if ($check)
- {
- $optimisationDate = KTUtil::getSystemSetting('luceneOptimisationDate', '');
-
- $noOptimisation = false;
- if ($optimisationDate == '')
- {
- $optimisationDate = _kt('N/A');
- $optimisationPeriod = $optimisationDate;
- }
- else
- {
- $optimisationPeriod = KTUtil::computePeriodToDate($optimisationDate, null, true);
- $noOptimisation = $optimisationPeriod['days'] > 2;
- $optimisationPeriod = $optimisationPeriod['str'];
- $optimisationDate = date('Y-m-d H:i:s', $optimisationDate);
- }
-
- $indexingDate = KTUtil::getSystemSetting('luceneIndexingDate', '');
- if ($indexingDate == '')
- {
- $indexingDate = _kt('N/A');
- $indexingPeriod = $indexingDate;
- }
- else
- {
- $indexingPeriod = KTUtil::computePeriodToDate($indexingDate);
- $indexingDate = date('Y-m-d H:i:s', $indexingDate);
- }
-
- $index = Indexer::get();
- $docsInIndex = $index->getDocumentsInIndex();
-
- // we are only interested in documents that are active
- $docsInQueue = $index->getIndexingQueue(false);
- $docsInQueue = count($docsInQueue);
-
- $errorsInQueue = $index->getIndexingQueue(true);
- $errorsInQueue = count($errorsInQueue);
-
- $sql = "SELECT count(*) as docsInRepository FROM documents";
- $docsInRepository = DBUtil::getOneResultKey($sql, 'docsInRepository');
-
- if ($docsInRepository == 0)
- {
- $indexingCoverage = '0.00%';
- $queueCoverage = $indexingCoverage;
- }
- else
- {
- // compute indexing coverage
- $indexingCoverage = _kt('Not Available');
- if (is_numeric($docsInIndex))
- {
- $indexingCoverage = ($docsInIndex * 100) / $docsInRepository;
- $indexingCoverage = number_format($indexingCoverage, 2, '.',',') . '%';
- }
-
- // compute queue coverage
- $queueCoverage = _kt('Not Available');
- if (is_numeric($docsInQueue))
- {
- $queueCoverage = ($docsInQueue * 100) / $docsInRepository;
- $queueCoverage = number_format($queueCoverage, 2, '.',',') . '%';
- }
- }
-
- $stats = array(
- 'optimisationDate'=>$optimisationDate,
- 'optimisationPeriod'=>$optimisationPeriod,
- 'indexingDate'=>$indexingDate,
- 'indexingPeriod'=>$indexingPeriod,
- 'docsInIndex'=>$docsInIndex,
- 'docsInQueue'=>$docsInQueue,
- 'errorsInQueue'=>$errorsInQueue,
- 'docsInRepository'=>$docsInRepository,
- 'indexingCoverage'=>$indexingCoverage,
- 'queueCoverage'=>$queueCoverage,
- 'noOptimisation'=>$noOptimisation
- );
-
- $_SESSION['LuceneStats']['time'] = time();
- $_SESSION['LuceneStats']['stats'] = $stats;
- }
-
$aTemplateData = array(
'context' => $this,
- 'stats'=>$stats
+ 'stats'=>$this->stats
);
diff --git a/search2/bin/cronIndexStats.php b/search2/bin/cronIndexStats.php
new file mode 100644
index 0000000..f24e45c
--- /dev/null
+++ b/search2/bin/cronIndexStats.php
@@ -0,0 +1,51 @@
+.
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ * California 94120-7775, or email info@knowledgetree.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
+ * must display the words "Powered by KnowledgeTree" and retain the original
+ * copyright notice.
+ * Contributor( s): ______________________________________
+ *
+ */
+
+chdir(dirname(__FILE__));
+require_once(realpath('../../config/dmsDefaults.php'));
+require_once('indexing/indexerCore.inc.php');
+
+$verbose = false;
+
+if (is_array($argv) && in_array('verbose', $argv)) $verbose = true;
+
+if ($verbose) print _kt("Cache index stats and diagnostics") . "...\n";
+
+$indexer = Indexer::get();
+$indexer->updateIndexStats();
\ No newline at end of file
diff --git a/search2/bin/cronOptimize.php b/search2/bin/cronOptimize.php
new file mode 100644
index 0000000..b3cbd54
--- /dev/null
+++ b/search2/bin/cronOptimize.php
@@ -0,0 +1,43 @@
+.
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ * California 94120-7775, or email info@knowledgetree.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
+ * must display the words "Powered by KnowledgeTree" and retain the original
+ * copyright notice.
+ * Contributor( s): ______________________________________
+ *
+ */
+
+require_once('optimise.php');
+
+
+?>
\ No newline at end of file
diff --git a/search2/bin/cronResources.php b/search2/bin/cronResources.php
new file mode 100644
index 0000000..4791c3a
--- /dev/null
+++ b/search2/bin/cronResources.php
@@ -0,0 +1,98 @@
+.
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ * California 94120-7775, or email info@knowledgetree.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
+ * must display the words "Powered by KnowledgeTree" and retain the original
+ * copyright notice.
+ * Contributor( s): ______________________________________
+ *
+ */
+
+chdir(dirname(__FILE__));
+require_once(realpath('../../config/dmsDefaults.php'));
+
+class ResourceChecker
+{
+ var $resources;
+
+ function addIssue($resource, $status)
+ {
+ $this->resources[] = array(
+ 'name'=>$resource,
+ 'status'=>$status);
+ }
+
+
+ function checkOpenOffice()
+ {
+ $diagnose = SearchHelper::checkOpenOfficeAvailablity();
+ if (!is_null($diagnose))
+ {
+ $this->addIssue('Open Office Server', $diagnose);
+ }
+ }
+
+ function checkLucene()
+ {
+ $indexer = Indexer::get();
+ $diagnose = $indexer->diagnose();
+ if (!is_null($diagnose))
+ {
+ $this->addIssue('Document Indexer', $diagnose);
+ }
+ }
+
+ function checkDF()
+ {
+ $df = KTUtil::findCommand('externalBinary/df','df');
+
+ if (false === $df)
+ {
+ $this->addIssue('Storage Utilization', 'Could not locate the df binary.');
+ }
+ }
+
+
+ function check()
+ {
+ $this->checkOpenOffice();
+ $this->checkLucene();
+ $this->checkDF();
+
+ KTUtil::setSystemSetting('externalResourceIssues', serialize($this->resources));
+ }
+}
+
+$checker = new ResourceChecker();
+$checker->check();
+
+?>
\ No newline at end of file
diff --git a/search2/indexing/bin/cronOptimize.php b/search2/indexing/bin/cronOptimize.php
new file mode 100644
index 0000000..da5c88b
--- /dev/null
+++ b/search2/indexing/bin/cronOptimize.php
@@ -0,0 +1,42 @@
+.
+ *
+ * You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco,
+ * California 94120-7775, or email info@knowledgetree.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * KnowledgeTree" logo and retain the original copyright notice. If the display of the
+ * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
+ * must display the words "Powered by KnowledgeTree" and retain the original
+ * copyright notice.
+ * Contributor( s): ______________________________________
+ *
+ */
+
+require_once('optimise.php');
+
+?>
\ No newline at end of file
diff --git a/search2/indexing/indexerCore.inc.php b/search2/indexing/indexerCore.inc.php
index 8966964..cd7881f 100755
--- a/search2/indexing/indexerCore.inc.php
+++ b/search2/indexing/indexerCore.inc.php
@@ -899,6 +899,100 @@ abstract class Indexer
return Indexer::getIndexingQueue(false);
}
+ public function updateIndexStats()
+ {
+ $optimisationDate = KTUtil::getSystemSetting('luceneOptimisationDate', '');
+
+ $noOptimisation = false;
+ if ($optimisationDate == '')
+ {
+ $optimisationDate = _kt('N/A');
+ $optimisationPeriod = $optimisationDate;
+ }
+ else
+ {
+ $optimisationPeriod = KTUtil::computePeriodToDate($optimisationDate, null, true);
+ $noOptimisation = $optimisationPeriod['days'] > 2;
+ $optimisationPeriod = $optimisationPeriod['str'];
+ $optimisationDate = date('Y-m-d H:i:s', $optimisationDate);
+ }
+
+ $indexingDate = KTUtil::getSystemSetting('luceneIndexingDate', '');
+ if ($indexingDate == '')
+ {
+ $indexingDate = _kt('N/A');
+ $indexingPeriod = $indexingDate;
+ }
+ else
+ {
+ $indexingPeriod = KTUtil::computePeriodToDate($indexingDate);
+ $indexingDate = date('Y-m-d H:i:s', $indexingDate);
+ }
+
+ $index = Indexer::get();
+ $docsInIndex = $index->getDocumentsInIndex();
+
+ // we are only interested in documents that are active
+ $docsInQueue = $index->getIndexingQueue(false);
+ $docsInQueue = count($docsInQueue);
+
+ $errorsInQueue = $index->getIndexingQueue(true);
+ $errorsInQueue = count($errorsInQueue);
+
+ $sql = "SELECT count(*) as docsInRepository FROM documents";
+ $docsInRepository = DBUtil::getOneResultKey($sql, 'docsInRepository');
+
+ if ($docsInRepository == 0)
+ {
+ $indexingCoverage = '0.00%';
+ $queueCoverage = $indexingCoverage;
+ }
+ else
+ {
+ // compute indexing coverage
+ $indexingCoverage = _kt('Not Available');
+ if (is_numeric($docsInIndex))
+ {
+ $indexingCoverage = ($docsInIndex * 100) / $docsInRepository;
+ $indexingCoverage = number_format($indexingCoverage, 2, '.',',') . '%';
+ }
+
+ // compute queue coverage
+ $queueCoverage = _kt('Not Available');
+ if (is_numeric($docsInQueue))
+ {
+ $queueCoverage = ($docsInQueue * 100) / $docsInRepository;
+ $queueCoverage = number_format($queueCoverage, 2, '.',',') . '%';
+ }
+ }
+
+
+ $stats = array(
+ 'optimisationDate'=>$optimisationDate,
+ 'optimisationPeriod'=>$optimisationPeriod,
+ 'indexingDate'=>$indexingDate,
+ 'indexingPeriod'=>$indexingPeriod,
+ 'docsInIndex'=>$docsInIndex,
+ 'docsInQueue'=>$docsInQueue,
+ 'errorsInQueue'=>$errorsInQueue,
+ 'docsInRepository'=>$docsInRepository,
+ 'indexingCoverage'=>$indexingCoverage,
+ 'queueCoverage'=>$queueCoverage,
+ 'noOptimisation'=>$noOptimisation
+ );
+
+ KTUtil::setSystemSetting('indexerStats', serialize($stats));
+
+ $indexer = Indexer::get();
+
+ $diagnosis = $indexer->diagnose();
+ KTUtil::setSystemSetting('indexerDiagnostics', serialize($diagnosis));
+
+ $extractorDiagnosis = $indexer->diagnoseExtractors();
+
+ KTUtil::setSystemSetting('extractorDiagnostics', serialize($extractorDiagnosis));
+ }
+
/**
* The main function that may be called repeatedly to index documents.
*
diff --git a/sql/mysql/install/data.sql b/sql/mysql/install/data.sql
index 9a2bb97..22a6d27 100644
--- a/sql/mysql/install/data.sql
+++ b/sql/mysql/install/data.sql
@@ -1090,13 +1090,15 @@ LOCK TABLES `scheduler_tasks` WRITE;
INSERT INTO `scheduler_tasks` VALUES
(1,'Indexing','search2/bin/cronIndexer.php','',0,'1min','2007-10-01',NULL,0,'system'),
(2,'Index Migration','search2/bin/cronMigration.php','',0,'5mins','2007-10-01',NULL,0,'system'),
-(3,'Index Optimisation','search2/bin/optimise.php','',0,'weekly','2007-10-01',NULL,0,'system'),
+(3,'Index Optimization','search2/bin/cronOptimize.php','',0,'weekly','2007-10-01',NULL,0,'system'),
(4,'Periodic Document Expunge','bin/expungeall.php','',0,'weekly','2007-10-01',NULL,0,'disabled'),
(5,'Database Maintenance','bin/dbmaint.php','optimize',0,'monthly','2007-10-01',NULL,0,'disabled'),
(6,'Open Office test','bin/checkopenoffice.php','',0,'1min','2007-10-01',NULL,0,'enabled'),
(7,'Cleanup Temporary Directory','search2/bin/cronCleanup.php','',0,'1min','2007-10-01',NULL,0,'enabled'),
(8,'Disk Usage and Folder Utilisation Statistics','plugins/housekeeper/bin/UpdateStats.php','',0,'5mins','2007-10-01',NULL,0,'enabled'),
-(9,'Check Latest Version','plugins/ktstandard/AdminVersionPlugin/bin/UpdateNewVersion.php','',0,'daily','2007-10-01',NULL,0,'enabled');
+(9,'Check Latest Version','plugins/ktstandard/AdminVersionPlugin/bin/UpdateNewVersion.php','',0,'daily','2007-10-01',NULL,0,'enabled'),
+(10,'Refresh Index Statistics','search2/bin/cronIndexStats.php','',0,'daily','2007-10-01',NULL,0,'enabled'),
+(11,'Refresh Resource Dependancies','search2/bin/cronResources.php','',0,'daily','2007-10-01',NULL,0,'enabled');
/*!40000 ALTER TABLE `scheduler_tasks` ENABLE KEYS */;
UNLOCK TABLES;
@@ -2013,7 +2015,7 @@ UNLOCK TABLES;
LOCK TABLES `zseq_scheduler_tasks` WRITE;
/*!40000 ALTER TABLE `zseq_scheduler_tasks` DISABLE KEYS */;
-INSERT INTO `zseq_scheduler_tasks` VALUES (9);
+INSERT INTO `zseq_scheduler_tasks` VALUES (11);
/*!40000 ALTER TABLE `zseq_scheduler_tasks` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/sql/mysql/upgrade/3.5.2/zdashboard_tasks2.sql b/sql/mysql/upgrade/3.5.2/zdashboard_tasks2.sql
new file mode 100644
index 0000000..71102bc
--- /dev/null
+++ b/sql/mysql/upgrade/3.5.2/zdashboard_tasks2.sql
@@ -0,0 +1,9 @@
+select @id:=max(id)+1 from scheduler_tasks;
+INSERT INTO `scheduler_tasks` VALUES (@id,'Refresh Index Statistics','search2/bin/cronIndexStats.php','',0,'1min','2007-10-01',NULL,0,'enabled');
+
+select @id:=max(id)+1 from scheduler_tasks;
+INSERT INTO `scheduler_tasks` VALUES (@id,'Refresh Resource Dependancies','search2/bin/cronResources.php','',0,'1min','2007-10-01',NULL,0,'enabled');
+
+UPDATE zseq_scheduler_tasks set id=@id;
+
+UPDATE scheduler_tasks set task='Index Optimization', script_url = 'search2/bin/cronOptimize.php' where script_url = 'search2/bin/optimise.php';
\ No newline at end of file