From 4064f0ad9e54723d896c273616b5d0eaeb4df72c Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 24 Oct 2017 23:24:00 +0200 Subject: [PATCH] Add SeedDMS indexer and previewers for presentations --- 10-seeddms.sh | 2 +- seeddms/seeddms-previewers.patch | 10 ++++++++-- seeddms/srv/seeddms/www/conf/settings.xml | 5 ++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/10-seeddms.sh b/10-seeddms.sh index e21b665..b4b6a10 100755 --- a/10-seeddms.sh +++ b/10-seeddms.sh @@ -3,7 +3,7 @@ SOURCE_DIR=$(realpath $(dirname "${0}")) # Install dependencies for SeedDMS -apt-get -y --no-install-recommends install ghostscript id3 imagemagick libreoffice-calc libreoffice-writer php7.0-gd php7.0-fpm php7.0-mbstring php7.0-pgsql php7.0-xml php-pear poppler-utils unoconv +apt-get -y --no-install-recommends install ghostscript id3 imagemagick libreoffice-calc libreoffice-impress libreoffice-writer php7.0-gd php7.0-fpm php7.0-mbstring php7.0-pgsql php7.0-xml php-pear poppler-utils unoconv # Install SeedDMS wget https://sourceforge.net/projects/seeddms/files/seeddms-5.1.3/seeddms-quickstart-5.1.3.tar.gz/download -O /srv/seeddms.tgz diff --git a/seeddms/seeddms-previewers.patch b/seeddms/seeddms-previewers.patch index 75ea814..86c0f02 100644 --- a/seeddms/seeddms-previewers.patch +++ b/seeddms/seeddms-previewers.patch @@ -1,7 +1,7 @@ diff -ruN orig/SeedDMS/Preview/PdfPreviewer.php pear/SeedDMS/Preview/PdfPreviewer.php --- orig/SeedDMS/Preview/PdfPreviewer.php 2017-05-03 14:14:18.000000000 +0200 +++ pear/SeedDMS/Preview/PdfPreviewer.php 2017-10-07 19:01:01.169624330 +0200 -@@ -27,10 +27,15 @@ +@@ -27,10 +27,18 @@ function __construct($previewDir, $timeout=5) { /* {{{ */ parent::__construct($previewDir, $timeout); $this->converters = array( @@ -14,6 +14,9 @@ diff -ruN orig/SeedDMS/Preview/PdfPreviewer.php pear/SeedDMS/Preview/PdfPreviewe + 'application/vnd.ms-excel' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'", + 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'", + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'", ++ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'", ++ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'", ++ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -f pdf --stdout -v '%f' > '%o'", + 'text/html' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", + 'text/plain' => "unoconv -d document -f pdf --stdout -v '%f' > '%o'", ); @@ -22,7 +25,7 @@ diff -ruN orig/SeedDMS/Preview/PdfPreviewer.php pear/SeedDMS/Preview/PdfPreviewe diff -ruN orig/SeedDMS/Preview/Previewer.php pear/SeedDMS/Preview/Previewer.php --- orig/SeedDMS/Preview/Previewer.php 2017-05-03 14:14:18.000000000 +0200 +++ pear/SeedDMS/Preview/Previewer.php 2017-10-07 19:02:22.781623907 +0200 -@@ -40,7 +40,16 @@ +@@ -40,7 +40,19 @@ 'text/plain' => "convert -resize %wx '%f' '%o'", 'application/pdf' => "convert -density 100 -resize %wx '%f[0]' '%o'", 'application/postscript' => "convert -density 100 -resize %wx '%f[0]' '%o'", @@ -35,6 +38,9 @@ diff -ruN orig/SeedDMS/Preview/Previewer.php pear/SeedDMS/Preview/Previewer.php + 'application/vnd.ms-excel' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.oasis.opendocument.spreadsheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => "unoconv -d spreadsheet -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", ++ 'application/vnd.ms-powerpoint' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", ++ 'application/vnd.oasis.opendocument.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", ++ 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => "unoconv -d presentation -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'text/html' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", + 'text/plain' => "unoconv -d document -e PageRange=1-1 -f pdf --stdout '%f' | convert -resize %wx pdf:- '%o'", ); diff --git a/seeddms/srv/seeddms/www/conf/settings.xml b/seeddms/srv/seeddms/www/conf/settings.xml index 98b92d8..7df6617 100644 --- a/seeddms/srv/seeddms/www/conf/settings.xml +++ b/seeddms/srv/seeddms/www/conf/settings.xml @@ -23,7 +23,7 @@ - pdftotext -enc UTF-8 -nopgbrk %s - | sed -e 's/ [a-zA-Z0-9.]\{1\} / /g' -e 's/[0-9.]//g' + pdftotext -enc UTF-8 -nopgbrk %s -' unoconv -d document -f txt --stdout %s unoconv -d document -f txt --stdout %s unoconv -d document -f txt --stdout %s @@ -31,6 +31,9 @@ unoconv -d spreadsheet -f csv --stdout %s unoconv -d spreadsheet -f csv --stdout %s unoconv -d spreadsheet -f csv --stdout %s + unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - - + unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - - + unoconv -d presentation -f pdf --stdout %s | pdftotext -enc UTF-8 -nopgbrk - - id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g' id3 -l -R %s | egrep '(Title|Artist|Album)' | sed 's/^[^:]*: //g' unoconv -d document -f txt --stdout %s