diff --git a/plugins/search2/LuceneStatisticsDashlet.php b/plugins/search2/LuceneStatisticsDashlet.php index 3cc6544..33b9dce 100644 --- a/plugins/search2/LuceneStatisticsDashlet.php +++ b/plugins/search2/LuceneStatisticsDashlet.php @@ -101,8 +101,11 @@ class LuceneStatisticsDashlet extends KTBaseDashlet $docsInIndex = $index->getDocumentsInIndex(); // we are only interested in documents that are active - $sql = "SELECT count(*) as docsInQueue FROM index_files q INNER JOIN documents d on q.document_id=d.id WHERE d.status_id=1"; - $docsInQueue = DBUtil::getOneResultKey($sql, 'docsInQueue'); + $docsInQueue = $index->getIndexingQueue(); + $docsInQueue = count($docsInQueue); + + $errorsInQueue = $index->getIndexingQueue(true); + $errorsInQueue = count($errorsInQueue); $sql = "SELECT count(*) as docsInRepository FROM documents"; $docsInRepository = DBUtil::getOneResultKey($sql, 'docsInRepository'); @@ -138,6 +141,7 @@ class LuceneStatisticsDashlet extends KTBaseDashlet 'indexingPeriod'=>$indexingPeriod, 'docsInIndex'=>$docsInIndex, 'docsInQueue'=>$docsInQueue, + 'errorsInQueue'=>$errorsInQueue, 'docsInRepository'=>$docsInRepository, 'indexingCoverage'=>$indexingCoverage, 'queueCoverage'=>$queueCoverage, diff --git a/plugins/search2/reporting/IndexErrors.php b/plugins/search2/reporting/IndexErrors.php index 0f25265..b13a043 100644 --- a/plugins/search2/reporting/IndexErrors.php +++ b/plugins/search2/reporting/IndexErrors.php @@ -1,98 +1,106 @@ -. - * - * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, - * Blake Street, Observatory, 7925 South Africa. 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(KT_LIB_DIR . '/dispatcher.inc.php'); -require_once(KT_LIB_DIR . '/templating/templating.inc.php'); -require_once(KT_LIB_DIR . '/mime.inc.php'); - -class IndexErrorsDispatcher extends KTAdminDispatcher { - - function check() { - $this->aBreadcrumbs[] = array( - 'url' => $_SERVER['PHP_SELF'], - 'name' => _kt('Document Indexing Diagnostics'), - ); - return parent::check(); - } - - function do_main() { - - //registerTypes registers the mime types and populates the needed tables. - $indexer = Indexer::get(); - $indexer->registerTypes(); - - if($_REQUEST['rescheduleValue'] == 'reschedule') - { - - foreach(KTUtil::arrayGet($_REQUEST, 'index_error', array()) as $sDocId => $v) - { - Indexer::reindexDocument($sDocId); - - } - - } - else if($_REQUEST['rescheduleValue'] == 'rescheduleall') - { - $aIndexerValues = Indexer::getIndexingQueue(); - foreach ($aIndexerValues as $sDocValues) - { - Indexer::reindexDocument($sDocValues['document_id']); - } - - } - require_once(KT_LIB_DIR . "/templating/templating.inc.php"); - $oTemplating =& KTTemplating::getSingleton(); - $oTemplating->addLocation('Index Errors', '/plugins/search2/reporting/templates'); - - $oTemplate =& $oTemplating->loadTemplate('indexerrors'); - - $aIndexerValues = Indexer::getIndexingQueue(); - - $oTemplate->setData(array( - 'context' => $this, - 'index_errors' => $aIndexerValues - - )); - return $oTemplate; - } - - - -} - - -?> +. + * + * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, + * Blake Street, Observatory, 7925 South Africa. 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(KT_LIB_DIR . '/dispatcher.inc.php'); +require_once(KT_LIB_DIR . '/templating/templating.inc.php'); +require_once(KT_LIB_DIR . '/mime.inc.php'); + +class IndexErrorsDispatcher extends KTAdminDispatcher { + + function check() { + $this->aBreadcrumbs[] = array( + 'url' => $_SERVER['PHP_SELF'], + 'name' => _kt('Document Indexing Diagnostics'), + ); + return parent::check(); + } + + function do_main() { + + //registerTypes registers the mime types and populates the needed tables. + $indexer = Indexer::get(); + $indexer->registerTypes(); + + if($_REQUEST['rescheduleValue'] == 'reschedule') + { + + foreach(KTUtil::arrayGet($_REQUEST, 'index_error', array()) as $sDocId => $v) + { + Indexer::reindexDocument($sDocId); + + } + + } + else if($_REQUEST['rescheduleValue'] == 'rescheduleall') + { + $aIndexerValues = Indexer::getIndexingQueue(); + foreach ($aIndexerValues as $sDocValues) + { + Indexer::reindexDocument($sDocValues['document_id']); + } + + } + + $oTemplating =& KTTemplating::getSingleton(); + $oTemplating->addLocation('Index Errors', '/plugins/search2/reporting/templates'); + + $oTemplate =& $oTemplating->loadTemplate('indexerrors'); + + $aIndexerValues = Indexer::getIndexingQueue(); + foreach($aIndexerValues as $key=>$doc) + { + $extractor=$indexer->getExtractor($doc['extractor']); + $doc['extractor'] = $extractor->getDisplayName(); + $aIndexerValues[$key] = $doc; + } + + + + $oTemplate->setData(array( + 'context' => $this, + 'index_errors' => $aIndexerValues + + )); + return $oTemplate; + } + + + +} + + +?> diff --git a/plugins/search2/reporting/PendingDocuments.php b/plugins/search2/reporting/PendingDocuments.php index d13cbe7..67a67eb 100644 --- a/plugins/search2/reporting/PendingDocuments.php +++ b/plugins/search2/reporting/PendingDocuments.php @@ -1,74 +1,80 @@ -. - * - * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, - * Blake Street, Observatory, 7925 South Africa. 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(KT_LIB_DIR . '/dispatcher.inc.php'); -require_once(KT_LIB_DIR . '/templating/templating.inc.php'); - -class PendingDocumentsDispatcher extends KTAdminDispatcher -{ - function check() { - $this->aBreadcrumbs[] = array( - 'url' => $_SERVER['PHP_SELF'], - 'name' => _kt('Pending Documents Indexing Queue'), - ); - return parent::check(); - } - - function do_main() { - - //registerTypes registers the mime types and populates the needed tables. - $indexer = Indexer::get(); - $indexer->registerTypes(); - - $aPendingDocs = Indexer::getPendingIndexingQueue(); - - $oTemplating =& KTTemplating::getSingleton(); - $oTemplating->addLocation('Pending Documents', '/plugins/search2/reporting/templates'); - $oTemplate =& $oTemplating->loadTemplate('pendingdocuments'); - - $oTemplate->setData(array( - 'context' => $this, - 'pending_docs' => $aPendingDocs - - )); - return $oTemplate; - } - -} - - -?> +. + * + * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place, + * Blake Street, Observatory, 7925 South Africa. 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(KT_LIB_DIR . '/dispatcher.inc.php'); +require_once(KT_LIB_DIR . '/templating/templating.inc.php'); + +class PendingDocumentsDispatcher extends KTAdminDispatcher +{ + function check() { + $this->aBreadcrumbs[] = array( + 'url' => $_SERVER['PHP_SELF'], + 'name' => _kt('Pending Documents Indexing Queue'), + ); + return parent::check(); + } + + function do_main() { + + //registerTypes registers the mime types and populates the needed tables. + $indexer = Indexer::get(); + $indexer->registerTypes(); + + $aPendingDocs = Indexer::getPendingIndexingQueue(); + foreach($aPendingDocs as $key=>$doc) + { + $extractor = $indexer->getExtractor($doc['extractor']); + $doc['extractor'] = $extractor->getDisplayName(); + $aPendingDocs[$key] = $doc; + } + + $oTemplating =& KTTemplating::getSingleton(); + $oTemplating->addLocation('Pending Documents', '/plugins/search2/reporting/templates'); + $oTemplate =& $oTemplating->loadTemplate('pendingdocuments'); + + $oTemplate->setData(array( + 'context' => $this, + 'pending_docs' => $aPendingDocs + + )); + return $oTemplate; + } + +} + + +?> diff --git a/plugins/search2/reporting/templates/indexerrors.smarty b/plugins/search2/reporting/templates/indexerrors.smarty index b120ea5..d0cc6cf 100644 --- a/plugins/search2/reporting/templates/indexerrors.smarty +++ b/plugins/search2/reporting/templates/indexerrors.smarty @@ -23,10 +23,8 @@ - {i18n}Document ID{/i18n} + {i18n}Filename{/i18n} - {i18n}Extension{/i18n} - {i18n}Mime Type{/i18n} {i18n}Extractor{/i18n} {i18n}Index Date{/i18n} @@ -36,11 +34,8 @@ {foreach key=key from=$index_errors item=indexError} - {$indexError.document_id} - {$indexError.filename|truncate:40:'...'} - {$indexError.filetypes} - {$indexError.mimetypes} - {if $pendingDocs.extractor}{$indexError.extractor}{else}

{i18n}n/a{/i18n}

{/if} + {$indexError.filename|truncate:40:'...'} + {if $indexError.extractor}{$indexError.extractor}{else}

{i18n}n/a{/i18n}

{/if} {$indexError.indexdate} diff --git a/plugins/search2/reporting/templates/pendingdocuments.smarty b/plugins/search2/reporting/templates/pendingdocuments.smarty index 6aa2b03..e063fcb 100644 --- a/plugins/search2/reporting/templates/pendingdocuments.smarty +++ b/plugins/search2/reporting/templates/pendingdocuments.smarty @@ -15,10 +15,7 @@ -
{i18n}Document ID{/i18n} {i18n}Filename{/i18n} - {i18n}Extension{/i18n} - {i18n}Mime Type{/i18n} {i18n}Extractor{/i18n} {i18n}Index Date{/i18n} @@ -28,10 +25,7 @@ {foreach key=key from=$pending_docs item=pendingDocs} - {$pendingDocs.document_id} - {$pendingDocs.filename|truncate:40:'...'} - {$pendingDocs.filetypes} - {$pendingDocs.mimetypes} + {$pendingDocs.filename|truncate:40:'...'} {if $pendingDocs.extractor}{$pendingDocs.extractor}{else}

{i18n}n/a{/i18n}

{/if} {$pendingDocs.indexdate}