[Bps-public-commit] rt-extension-tika branch, master, updated. f6e0e54dcd2efc6775015b673473bb6d2874a8e4

Dave Goehrig dave at bestpractical.com
Tue Nov 29 11:37:33 EST 2016


The branch, master has been updated
       via  f6e0e54dcd2efc6775015b673473bb6d2874a8e4 (commit)
      from  d3d5ff8886a51f89ef849a9cd3418adbb03bd3af (commit)

Summary of changes:
 Makefile.PL                   |   1 +
 jar/tika-server.jar           | Bin 0 -> 53580851 bytes
 lib/RT/Extension/Tika.pm      |  36 ++++++++++++++++++++++++++++++++++--
 sbin/rt-tika-fulltext-indexer |   8 +++++++-
 sbin/start-tika-server        |   3 +++
 5 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 jar/tika-server.jar
 create mode 100755 sbin/start-tika-server

- Log -----------------------------------------------------------------
commit f6e0e54dcd2efc6775015b673473bb6d2874a8e4
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Tue Nov 29 11:28:14 2016 -0500

    updating documentation and adding jar file

diff --git a/Makefile.PL b/Makefile.PL
index 4e59a75..fe5c9f8 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,6 +6,7 @@ repository 'https://github.com/bestpractical/rt-extension-tika';
 
 requires_rt '4.4.0';
 rt_too_new '4.6.0';
+install_share 'jar';
 
 sign;
 WriteAll;
diff --git a/jar/tika-server.jar b/jar/tika-server.jar
new file mode 100644
index 0000000..e06b4d4
Binary files /dev/null and b/jar/tika-server.jar differ
diff --git a/lib/RT/Extension/Tika.pm b/lib/RT/Extension/Tika.pm
index f5a43c2..4fc5c2c 100644
--- a/lib/RT/Extension/Tika.pm
+++ b/lib/RT/Extension/Tika.pm
@@ -46,20 +46,52 @@ May need root permissions
 
 If you are using RT 4.2 or greater, add this line:
 
-    Plugin('rt::extension::tika');
+    Plugin('RT::Extension::Tika');
 
 For RT 4.0, add this line:
 
-    Set(@Plugins, qw(rt::extension::tika));
+    Set(@Plugins, qw(RT::Extension::Tika));
 
 or add C<rt::extension::tika> to your existing C<@Plugins> line.
 
+By default this extension will index text, html, pdf, doc, and docx files.
+You can add additional mime types by adding them to a list:
+
+    Set(@TikaMimeTypes,'application/rtf','application/x-rtf',
+         'application/vnd.oasis.opendocument.text',
+         'application/vnd.oasis.opendocument.text-master');
+
 =item Clear your mason cache
 
     rm -rf /opt/rt4/var/mason_data/obj
 
 =item Restart your webserver
 
+=item Start the tika server
+
+From  the /opt/rt4 directory you can start the server using:
+
+    ./local/plugins/RT-Extension-Tika/sbin/start-tika-server
+
+Optionally you can run it via java as:
+
+    java -jar /opt/rt4/local/plugins/RT-Extension-Tika/lib/auto/share/dist/RT-Extension-Tika/tika-server.jar
+
+You can get a list of options (host, port, CORS) by running:
+
+    java -jar /opt/rt4/local/plugins/RT-Extension-Tika/lib/auto/share/dist/RT-Extension-Tika/tika-server.jar -?
+
+By default the server will listen on localhost:9998
+
+=item Add the indexer to a cron job
+
+In the directory /opt/rt4 you can run the indexer as:
+
+	./local/plugins/RT-Extension-Tika/sbin/rt-tika-fulltext-indexer
+
+This indexer replaces the rt-fulltext-indexer.  If you are
+currently running that make sure that job first.
+
 =back
 
 =head1 AUTHOR
diff --git a/sbin/rt-tika-fulltext-indexer b/sbin/rt-tika-fulltext-indexer
index 0c9b748..335e812 100755
--- a/sbin/rt-tika-fulltext-indexer
+++ b/sbin/rt-tika-fulltext-indexer
@@ -170,6 +170,12 @@ sub attachment_loop {
     {
         # Indexes all text/plain and text/html attachments
         my $attachments = RT::Attachments->new( RT->SystemUser );
+	my @extra = (RT->Config->Get('TikaMimeTypes'));
+	my @MIMETYPES = ( 'text/plain', 'text/html','application/pdf', 
+		'application/msword', 
+		'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+		@extra
+	);
         my $txn_alias = $attachments->Join(
             ALIAS1 => 'main',
             FIELD1 => 'TransactionId',
@@ -185,7 +191,7 @@ sub attachment_loop {
         $attachments->Limit(
             FIELD    => 'ContentType',
             OPERATOR => 'IN',
-            VALUE    => ['text/plain', 'text/html','application/pdf', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
+            VALUE    => [ @MIMETYPES ],
         );
         $attachments->Limit( FIELD => 'id', OPERATOR => '>', VALUE => $LAST );
         $attachments->OrderBy( FIELD => 'id', ORDER => 'asc' );
diff --git a/sbin/start-tika-server b/sbin/start-tika-server
new file mode 100755
index 0000000..c9b5a74
--- /dev/null
+++ b/sbin/start-tika-server
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+java -jar $(dirname 1)/local/plugins/RT-Extension-Tika/lib/auto/share/dist/RT-Extension-Tika/tika-server.jar

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list