Commit eacacb0c0f19339130367f48d96ae9edb808d39c

Authored by kevin_fourie
1 parent 4cb2ed42

Merged in from DEV trunk...

KTS-673
"The search algorithm needs some work"
Updated. Fixed references to Lucene

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-673
"The search algorithm needs some work"
Updated. Fixed references to lucene

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-1753
" Implement Disk Usage Plugin"
Updated. Not scaning temp directory if windows

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2471
"create search2 dashets"
Updated. Changed reference to lucene and added checking for 'df'

Committed By: Conrad Vermeulen
Reviewed By: Kevin Fourie

KTS-2568
"Add scheduler service to Linux"
Added php loop file.

Committed By: Kevin Fourie
Reviewed By: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@7505 c91229c3-7414-0410-bfa2-8a42b809f60b
bin/taskrunner.php 0 → 100644
  1 +<?php
  2 +/**
  3 + * $Id:$
  4 + *
  5 + * KnowledgeTree Open Source Edition
  6 + * Document Management Made Simple
  7 + * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify it under
  10 + * the terms of the GNU General Public License version 3 as published by the
  11 + * Free Software Foundation.
  12 + *
  13 + * This program is distributed in the hope that it will be useful, but WITHOUT
  14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  15 + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  16 + * details.
  17 + *
  18 + * You should have received a copy of the GNU General Public License
  19 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20 + *
  21 + * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
  22 + * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
  23 + *
  24 + * The interactive user interfaces in modified source and object code versions
  25 + * of this program must display Appropriate Legal Notices, as required under
  26 + * Section 5 of the GNU General Public License version 3.
  27 + *
  28 + * In accordance with Section 7(b) of the GNU General Public License version 3,
  29 + * these Appropriate Legal Notices must retain the display of the "Powered by
  30 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
  32 + * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * copyright notice.
  34 + * Contributor( s): ______________________________________
  35 + *
  36 + */
  37 +
  38 +// Setup php binary path
  39 +$phpPath = realpath('../../php/bin/php');
  40 +if (!is_file($phpPath))
  41 +{
  42 + die('Cannot find php.exe');
  43 +}
  44 +
  45 +// Main Scheduler Service Loop
  46 +while (1) {
  47 +
  48 + // Run the scheduler script
  49 + system("$phpPath scheduler.php");
  50 +
  51 + sleep(10); // Run every 10 seconds
  52 +
  53 +}
  54 +
  55 +?>
... ...
plugins/housekeeper/HouseKeeperPlugin.php
... ... @@ -6,32 +6,32 @@
6 6 * KnowledgeTree Open Source Edition
7 7 * Document Management Made Simple
8 8 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
  21 + *
22 22 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
23 23 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
34   - * copyright notice.
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
  34 + * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 */
37 37  
... ... @@ -75,26 +75,34 @@ class HouseKeeperPlugin extends KTPlugin
75 75 'folder'=>$logDir,
76 76 'pattern'=>'.+\.txt$',
77 77 'canClean'=>true
78   - ),
  78 + ));
  79 +
  80 + if (!OS_WINDOWS)
  81 + {
  82 + $this->folders[] =
79 83 array(
80 84 'name'=>_kt('System Temporary Folder'),
81 85 'folder'=>$systemDir,
82 86 'pattern'=>'(sess_.+)?(.+\.log$)?',
83 87 'canClean'=>true
84   - ),
  88 + );
  89 + }
  90 +
  91 + $this->folders[] =
85 92 array(
86 93 'name'=>_kt('KnowledgeTree Documents'),
87 94 'folder'=>$docsDir,
88 95 'pattern'=>'',
89 96 'canClean'=>false
90   - ),
  97 + );
  98 + $this->folders[] =
91 99 array(
92 100 'name'=>_kt('KnowledgeTree Lucene Indexes'),
93 101 'folder'=>$luceneDir,
94 102 'pattern'=>'',
95 103 'canClean'=>false
96   - ),
97   - );
  104 + );
  105 +
98 106 }
99 107  
100 108 function getDirectories()
... ...
plugins/search2/ExternalDashlet.php
... ... @@ -6,32 +6,32 @@
6 6 * KnowledgeTree Open Source Edition
7 7 * Document Management Made Simple
8 8 * Copyright (C) 2004 - 2007 The Jam Warehouse Software (Pty) Limited
9   - *
  9 + *
10 10 * This program is free software; you can redistribute it and/or modify it under
11 11 * the terms of the GNU General Public License version 3 as published by the
12 12 * Free Software Foundation.
13   - *
  13 + *
14 14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 17 * details.
18   - *
  18 + *
19 19 * You should have received a copy of the GNU General Public License
20 20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21   - *
  21 + *
22 22 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
23 23 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
24   - *
  24 + *
25 25 * The interactive user interfaces in modified source and object code versions
26 26 * of this program must display Appropriate Legal Notices, as required under
27 27 * Section 5 of the GNU General Public License version 3.
28   - *
  28 + *
29 29 * In accordance with Section 7(b) of the GNU General Public License version 3,
30 30 * these Appropriate Legal Notices must retain the display of the "Powered by
31   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  31 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
32 32 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
33   - * must display the words "Powered by KnowledgeTree" and retain the original
34   - * copyright notice.
  33 + * must display the words "Powered by KnowledgeTree" and retain the original
  34 + * copyright notice.
35 35 * Contributor( s): ______________________________________
36 36 *
37 37 */
... ... @@ -75,6 +75,7 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
75 75 {
76 76 $this->checkOpenOffice();
77 77 $this->checkLucene();
  78 + $this->checkDF();
78 79 $_SESSION['ExternalResourceStatus']['time'] = time();
79 80 $_SESSION['ExternalResourceStatus']['resources'] = $this->resources;
80 81 }
... ... @@ -97,11 +98,23 @@ class ExternalResourceStatusDashlet extends KTBaseDashlet
97 98 $diagnose = $indexer->diagnose();
98 99 if (!is_null($diagnose))
99 100 {
100   - $this->addIssue(_kt('Lucene Indexer'), $diagnose);
  101 + $this->addIssue(_kt('Document Indexer'), $diagnose);
  102 + }
  103 + }
  104 +
  105 + function checkDF()
  106 + {
  107 + $df = KTUtil::findCommand('externalBinary','df');
  108 +
  109 + if (false === $df)
  110 + {
  111 + $this->addIssue(_kt('Storage Utilization'), _kt('Could not locate the <i>df</i> binary.'));
101 112 }
102 113 }
103 114  
104   - function is_active($oUser)
  115 +
  116 +
  117 + function is_active($oUser)
105 118 {
106 119 if (!Permission::userIsSystemAdministrator())
107 120 {
... ...
search2/indexing/indexers/JavaXMLRPCLuceneIndexer.inc.php
... ... @@ -195,7 +195,7 @@ class JavaXMLRPCLuceneIndexer extends Indexer
195 195 */
196 196 public function getDisplayName()
197 197 {
198   - return _kt('Lucene Indexing Server');
  198 + return _kt('Document Indexer Service');
199 199 }
200 200  
201 201  
... ...
search2/indexing/indexers/PHPLuceneIndexer.inc.php
... ... @@ -239,7 +239,7 @@ class PHPLuceneIndexer extends Indexer
239 239 */
240 240 public function getDisplayName()
241 241 {
242   - return _kt('Lucene PHP Indexer');
  242 + return _kt('Document Indexer Library');
243 243 }
244 244 }
245 245 ?>
246 246 \ No newline at end of file
... ...
templates/ktcore/search2/adv_query_builder.smarty
... ... @@ -766,7 +766,12 @@ function butSearchClick()
766 766 <fieldset>
767 767 <legend>{i18n}Advanced Search{/i18n}</legend>
768 768  
  769 +{capture assign=options}
  770 +<a href="{$rootUrl}/search2.php?action=queryBuilder">Search Criteria Editor</a>
  771 +{/capture}
769 772  
  773 +{i18n arg_options=$options}The #options# may also be used to create more complex search criteria expressions.{/i18n}
  774 +<br><br>
770 775 {capture assign=options}
771 776 <select id="allop">
772 777 <option value="AND">{i18n}all{/i18n}
... ...
templates/ktcore/search2/adv_query_search.smarty
1   -<h2>{i18n}Query Editor{/i18n}</h2>
  1 +<h2>{i18n}Search Criteria Editor{/i18n}</h2>
2 2  
3 3 <p class="descriptiveText">
4   -{i18n}The query editor allows you to utilise the full power of the KnowledgeTree search engine by entering comprehensive expressions.{/i18n}
  4 +{i18n}The search criteria editor allows you to utilise the full power of the KnowledgeTree search engine by allowing you to perform more complicated searches by using the free text criteria format.{/i18n}
  5 +
  6 +{capture assign=options}
  7 +<a href="{$rootUrl}/search2.php?action=guiBuilder">Advanced Search</a>
  8 +{/capture}
  9 +<p>
  10 +{i18n arg_options=$options}The #options# may also be used to perform searches.{/i18n}
  11 +
5 12 <P>
6 13 <div>
7 14 <table>
... ... @@ -111,6 +118,8 @@ function txtQueryChange(el)
111 118 </script>
112 119 {/literal}
113 120 <legend>{i18n}Advanced Query{/i18n}</legend>
  121 +
  122 +
114 123 <form id=frmQuery name=frmQuery method="POST" action="{addQS}action=process{/addQS}">
115 124 <textarea id="txtAdvQuery" name="txtQuery" cols=50 rows=10 onkeypress="txtQueryChange(this)">{$txtQuery}</textarea>
116 125 <br/>
... ... @@ -139,11 +148,11 @@ function txtQueryChange(el)
139 148 <fieldset>
140 149  
141 150 <legend>{i18n}Grammar{/i18n}</legend>
142   -{i18n}Expressions may be built up using the following grammar:{/i18n}<br/>
  151 +{i18n}Criteria may be built up using the following grammar:{/i18n}<br/>
143 152 expr ::= expr {literal}{{/literal} AND | OR {literal}}{/literal} expr<br/>
144 153 expr ::= NOT expr<br/>
145 154 expr ::= (expr)<br/>
146   -expr ::= expr {literal}{ < | <= | = | > | >= | CONTAINS |STARTS WITH | ENDS WITH }{/literal} value<br/>
  155 +expr ::= field {literal}{ < | <= | = | > | >= | CONTAINS |STARTS WITH | ENDS WITH }{/literal} value<br/>
147 156 expr ::= field BETWEEN value AND value<br/>
148 157 expr ::= field DOES [ NOT ] CONTAIN value<br/>
149 158 expr ::= field IS [ NOT ] LIKE value<br/>
... ... @@ -167,12 +176,11 @@ sq.value += word + &#39; &#39;;
167 176  
168 177 <fieldset>
169 178 <legend>{i18n}Fields{/i18n}</legend>
170   -{i18n}The following fields may be used in expressions:{/i18n}
  179 +{i18n}The following fields may be used in search criteria:{/i18n}
171 180 {assign var=i value=0}
172 181 {foreach item=alias from=$aliases}
173 182 {if (substr($alias,0,2) != '["')}
174 183 {if $i>0}, {/if}
175   -
176 184 {if (($i % 8) == 0)}<br>{/if}
177 185 <span onclick="wordclicked('{$alias|escape}')">{$alias}</span>
178 186 {assign var=i value=$i+1}
... ...
templates/ktcore/search2/lucene_migration.smarty
1 1 <P>
2   -{i18n}Migration to using the new search requires text to be moved from the database full text indexes into the Lucene indexes. This may take some time depending
  2 +{i18n}Migration to using the new search requires text to be moved from the database full text indexes into the Document Indexer Service. This may take some time depending
3 3 on the size of the repository. For this reason, the process is a background task.{/i18n}
4 4 <P>
5 5  
... ...
templates/ktcore/search2/lucene_statistics.smarty
1 1 <P>
2   -{i18n}This dashlet provides some basic statistics on the Lucene index.{/i18n}
  2 +{i18n}This dashlet provides some basic statistics from the KnowledgeTree Document Indexer.{/i18n}
3 3 <P>
4 4  
5 5 <table>
... ... @@ -18,7 +18,7 @@
18 18 <tr><td valign=top>*<td>{i18n}Not all documents contain text. This will explain why the indexing coverage percentage my vary.{/i18n}
19 19 <tr><td valign=top>*<td>{i18n}The queue coverage indicates how many documents are in the queue in relation to the repository size.{/i18n}
20 20 {if $stats.noOptimisation}
21   -<tr><td valign=top>*<td><i>{i18n}To get the best performance out of Lucene, the indexes must be optimised periodically. This is managed by a background task.{/i18n}
  21 +<tr><td valign=top>*<td><i>{i18n}To get the best performance out of Document Indexer, the indexes must be optimised periodically. This is managed by a background task.{/i18n}
22 22 {/if}
23 23 </table>
24 24 <table width="100%">
... ...