From b7761908116999fee1e9db18523dce3a8fec1b41 Mon Sep 17 00:00:00 2001 From: Brad Shuttleworth Date: Tue, 28 Feb 2006 15:18:42 +0000 Subject: [PATCH] last. --- kthelp/ktcore/EN/browse.html | 2 +- kthelp/ktcore/EN/search.html | 19 +++++++++++++++++++ plugins/ktcore/KTDashlets.php | 18 ++++++------------ plugins/ktstandard/contents/BaseIndexer.php | 9 +++++---- plugins/ktstandard/contents/OpenDocumentIndexer.php | 16 ++++++++++++++++ plugins/ktstandard/contents/PdfIndexer.php | 16 ++++++++++++++++ plugins/ktstandard/contents/PowerpointIndexer.php | 17 ++++++++++++++++- plugins/ktstandard/contents/PsIndexer.php | 16 +++++++++++++++- plugins/ktstandard/contents/TextIndexer.php | 4 +--- plugins/ktstandard/contents/WordIndexer.php | 22 ++++++++++++++++++++++ templates/kt3/portlets/search_portlet.smarty | 2 ++ templates/ktcore/dashlets/indexer_status.smarty | 13 +++++++------ templates/ktstandard/action/discussion_thread_list_item.smarty | 2 +- 13 files changed, 127 insertions(+), 29 deletions(-) create mode 100644 kthelp/ktcore/EN/search.html diff --git a/kthelp/ktcore/EN/browse.html b/kthelp/ktcore/EN/browse.html index 65a0c83..25ed2d5 100644 --- a/kthelp/ktcore/EN/browse.html +++ b/kthelp/ktcore/EN/browse.html @@ -29,7 +29,7 @@ permissions-based, so the system only returns items that the logged in user is allowed to access.

Simple (quick) search
-

Specify a search term to search all text – including +

Specify a search term to search all text - including document metadata and the contents of the following file types (if your administrator has configured these options): MS Word, MS Excel, MS PowerPoint, Adobe PDF, and Plain Text files.

diff --git a/kthelp/ktcore/EN/search.html b/kthelp/ktcore/EN/search.html new file mode 100644 index 0000000..8e21e81 --- /dev/null +++ b/kthelp/ktcore/EN/search.html @@ -0,0 +1,19 @@ + +Search + +

Search

+

KnowledgeTree provides three versatile search options – +simple (quick) search, advanced search, and saved searches. Search is +permissions-based, so the system only returns items that the logged in user is +allowed to access.

+ +

Specify a search term to search all text - including +document metadata and the contents of the following file types (if your +administrator has configured these options): MS Word, MS Excel, MS PowerPoint, +Adobe PDF, and Plain Text files.

+ +

Please Note: words shorter than 4 characters long (e.g. "the" or +"for") are discarded from the search. Search also only ever returns fully matching words +(e.g. "Know" will not match "KnowledgeTree").

+ + \ No newline at end of file diff --git a/plugins/ktcore/KTDashlets.php b/plugins/ktcore/KTDashlets.php index 0a5a7af..85c53be 100644 --- a/plugins/ktcore/KTDashlets.php +++ b/plugins/ktcore/KTDashlets.php @@ -171,17 +171,11 @@ class KTIndexerStatusDashlet extends KTBaseDashlet { } $oTrigger = new $sTrigger; - $sCommand = KTUtil::findCommand($oTrigger->commandconfig, $oTrigger->command); - $sFriendly = $oTrigger->getFriendlyCommand(); - - // check that we do not specify inactivity. - if ($sFriendly === false) { $sCommand = null; } - // otherwise check for friendly name. - else if (!is_null($sFriendly)) { $sCommand = $sFriendly; } - else if ($sCommand) { $sCommand = sprintf(_('command: %s'), $sCommand); } - - // only worry about _broken_ triggers. - if (!empty($sCommand)) { continue; } + $sDiagnostic = $oTrigger->getDiagnostic(); + // empty is OK. + if (is_null($sDiagnostic) || ($sDiagnostic == false)) { + continue; + } $aTypes = (array) $oTrigger->mimetypes; $aTypesStr = array(); @@ -191,7 +185,7 @@ class KTIndexerStatusDashlet extends KTBaseDashlet { //} } - $aTriggerSet[] = array('types' => $aTypesStr, 'command' => $sCommand); + $aTriggerSet[] = array('types' => $aTypesStr, 'diagnostic' => $sDiagnostic); } } diff --git a/plugins/ktstandard/contents/BaseIndexer.php b/plugins/ktstandard/contents/BaseIndexer.php index d4d76d8..06cca2e 100644 --- a/plugins/ktstandard/contents/BaseIndexer.php +++ b/plugins/ktstandard/contents/BaseIndexer.php @@ -35,10 +35,11 @@ class KTBaseIndexerTrigger { * If it is false, the temporary file will be sent as the last * parameter. */ - var $use_pipes = true; - - function getFriendlyCommand() { - return null; // _('Built-in') + var $use_pipes = true; + + /* return a diagnostic string _if_ there is something wrong. NULL otherwise. */ + function getDiagnostic() { + return null; } function setDocument($oDocument) { diff --git a/plugins/ktstandard/contents/OpenDocumentIndexer.php b/plugins/ktstandard/contents/OpenDocumentIndexer.php index 2a2772e..e209ee5 100644 --- a/plugins/ktstandard/contents/OpenDocumentIndexer.php +++ b/plugins/ktstandard/contents/OpenDocumentIndexer.php @@ -40,6 +40,22 @@ class KTOpenDocumentIndexerTrigger extends KTBaseIndexerTrigger { } return _('Built-in'); } + + function findLocalCommand() { + $sCommand = KTUtil::findCommand("import/unzip", "unzip"); + return $sCommand; + } + + function getDiagnostic() { + $sCommand = $this->findLocalCommand(); + + // can't find the local command. + if (empty($sCommand)) { + return sprintf(_('Unable to find required command for indexing. Please ensure that %s is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please visit the KTDMS site.'), $this->command, $this->support_url); + } + + return null; + } function extract_contents($sFilename, $sTmpFilename) { $sUnzipCommand = KTUtil::findCommand("import/unzip", "unzip"); diff --git a/plugins/ktstandard/contents/PdfIndexer.php b/plugins/ktstandard/contents/PdfIndexer.php index 4081660..738039e 100644 --- a/plugins/ktstandard/contents/PdfIndexer.php +++ b/plugins/ktstandard/contents/PdfIndexer.php @@ -12,6 +12,22 @@ class KTPdfIndexerTrigger extends KTBaseIndexerTrigger { var $use_pipes = false; // see BaseIndexer for how the extraction works. + function findLocalCommand() { + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command); + return $sCommand; + } + + function getDiagnostic() { + $sCommand = $this->findLocalCommand(); + + // can't find the local command. + if (empty($sCommand)) { + return sprintf(_('Unable to find required command for indexing. Please ensure that %s is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please visit the KTDMS site.'), $this->command, $this->support_url); + } + + return null; + } + } ?> diff --git a/plugins/ktstandard/contents/PowerpointIndexer.php b/plugins/ktstandard/contents/PowerpointIndexer.php index fce05b6..caec00a 100644 --- a/plugins/ktstandard/contents/PowerpointIndexer.php +++ b/plugins/ktstandard/contents/PowerpointIndexer.php @@ -9,7 +9,22 @@ class KTPowerpointIndexerTrigger extends KTBaseIndexerTrigger { var $args = array(); var $use_pipes = true; - // see BaseIndexer for how the extraction works. + function findLocalCommand() { + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command); + return $sCommand; + } + + function getDiagnostic() { + $sCommand = $this->findLocalCommand(); + + // can't find the local command. + if (empty($sCommand)) { + return sprintf(_('Unable to find required command for indexing. Please ensure that %s is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please visit the KTDMS site.'), $this->command, $this->support_url); + } + + return null; + } + } ?> diff --git a/plugins/ktstandard/contents/PsIndexer.php b/plugins/ktstandard/contents/PsIndexer.php index 17aca4c..8979981 100644 --- a/plugins/ktstandard/contents/PsIndexer.php +++ b/plugins/ktstandard/contents/PsIndexer.php @@ -11,7 +11,21 @@ class KTPostscriptIndexerTrigger extends KTBaseIndexerTrigger { var $args = array(); var $use_pipes = true; - // see BaseIndexer for how the extraction works. + function findLocalCommand() { + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command); + return $sCommand; + } + + function getDiagnostic() { + $sCommand = $this->findLocalCommand(); + + // can't find the local command. + if (empty($sCommand)) { + return sprintf(_('Unable to find required command for indexing. Please ensure that %s is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please visit the KTDMS site.'), $this->command, $this->support_url); + } + + return null; + } } ?> diff --git a/plugins/ktstandard/contents/TextIndexer.php b/plugins/ktstandard/contents/TextIndexer.php index 6c855ca..25363ec 100644 --- a/plugins/ktstandard/contents/TextIndexer.php +++ b/plugins/ktstandard/contents/TextIndexer.php @@ -8,9 +8,7 @@ class KTTextIndexerTrigger extends KTBaseIndexerTrigger { 'text/csv' => true, ); - function getFriendlyCommand() { - return _('Built-in'); - } + // no need for diagnostic - this is always available. function extract_contents($sFilename, $sTempFilename) { $contents = file_get_contents($sFilename); diff --git a/plugins/ktstandard/contents/WordIndexer.php b/plugins/ktstandard/contents/WordIndexer.php index b377a90..3388883 100644 --- a/plugins/ktstandard/contents/WordIndexer.php +++ b/plugins/ktstandard/contents/WordIndexer.php @@ -19,6 +19,28 @@ class KTWordIndexerTrigger extends KTBaseIndexerTrigger { } return parent::extract_contents($sFilename, $sTempFilename); } + + function findLocalCommand() { + if (OS_WINDOWS) { + $this->command = 'c:\antiword\antiword.exe'; + $this->commandconfig = 'indexer/antiword'; + $this->args = array(); + } + + $sCommand = KTUtil::findCommand($this->commandconfig, $this->command); + return $sCommand; + } + + function getDiagnostic() { + $sCommand = $this->findLocalCommand(); + + // can't find the local command. + if (empty($sCommand)) { + return sprintf(_('Unable to find required command for indexing. Please ensure that %s is installed and in the KnowledgeTree Path. For more information on indexers and helper applications, please visit the KTDMS site.'), $this->command, $this->support_url); + } + + return null; + } } ?> diff --git a/templates/kt3/portlets/search_portlet.smarty b/templates/kt3/portlets/search_portlet.smarty index 2d123d3..dc6b689 100644 --- a/templates/kt3/portlets/search_portlet.smarty +++ b/templates/kt3/portlets/search_portlet.smarty @@ -1,6 +1,8 @@
+

{i18n}How do I search?{/i18n} +{i18n}How do I search?{/i18n}

{if (!empty($saved_searches))}

Saved Searches

diff --git a/templates/ktcore/dashlets/indexer_status.smarty b/templates/ktcore/dashlets/indexer_status.smarty index 63481bc..03afe57 100644 --- a/templates/ktcore/dashlets/indexer_status.smarty +++ b/templates/ktcore/dashlets/indexer_status.smarty @@ -5,26 +5,27 @@ no active indexers registered. No content indexing will occur.{/i18n}

{else} {if empty($transforms)} -

All indexers should be working correctly.

+

{i18n}All indexers claim to be working correctly.{/i18n}

{else} - + {foreach item=aRow from=$transforms} - - + {/foreach} diff --git a/templates/ktstandard/action/discussion_thread_list_item.smarty b/templates/ktstandard/action/discussion_thread_list_item.smarty index c397634..f4f10c5 100644 --- a/templates/ktstandard/action/discussion_thread_list_item.smarty +++ b/templates/ktstandard/action/discussion_thread_list_item.smarty @@ -4,5 +4,5 @@ - + -- libgit2 0.21.4
Mime TypesCommandDiagnostic
+

{foreach key=mimetype item=v from=$aRow.types name=mimetype} {$mimetype} {if (!$smarty.foreach.mimetype.last)}
{/if} {/foreach} +

{if empty($aRow.command)} -

{i18n}No indexer.{/i18n}

- {else}{$aRow.command}{/if}
+

{if empty($aRow.diagnostic)}{i18n}No indicated problem.{/i18n} {else}{$aRow.diagnostic}{/if}

+
{$thread->getNumberOfViews()} {$thread->getNumberOfReplies()} {$last_comment->getDate()}{if $thread->getState()}Closed at metadata version {$thread->getCloseMetadataVersion()}{else}Open{/if}{if $thread->getState()}Closed at metadata version {$thread->getCloseMetadataVersion()}.
Reason: {$thread->getCloseReason()}{else}Open{/if}