From fcf027b22f0dd2f5df48a5253224f0e853ba176a Mon Sep 17 00:00:00 2001 From: dockes Date: Fri, 15 Jun 2007 11:41:50 +0000 Subject: [PATCH] added abiword + some oofice cleanup --- src/filters/rclabw | 8 +++++--- src/filters/rclsoff | 40 ++++++++++++++++++++++++++++++---------- src/sampleconf/mimeconf | 10 ++++++++-- src/sampleconf/mimemap | 3 ++- src/sampleconf/mimeview | 3 ++- 5 files changed, 47 insertions(+), 17 deletions(-) diff --git a/src/filters/rclabw b/src/filters/rclabw index ed2767ef..88135515 100755 --- a/src/filters/rclabw +++ b/src/filters/rclabw @@ -1,5 +1,5 @@ #!/bin/sh -# @(#$Id: rclabw,v 1.1 2007-06-15 09:25:23 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: rclabw,v 1.2 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes # Parts taken from Estraier: #================================================================ # Estraier: a personal full-text search system @@ -97,7 +97,9 @@ encoding=`sed -e '/$//' \ if test X$encoding = X ; then encoding=UTF-8;fi # Note: there can be newlines inside the description field, we don't want -# them... +# them... Have 2 use 2 different selectors for the single-line and +# multiple-line cases because of the generic tag end ( for all meta +# tags) descsedprog=' /\([^<]*\)<\/m>/ { s//\1/ @@ -149,7 +151,7 @@ creator=`sed -n -e "$metasedprog" "$infile"` # a single line in the xml (no multiple

per line, no embedded newlines # in text). contentsedprog=' -/

]/{ s/<[^>]*>/ /g p } diff --git a/src/filters/rclsoff b/src/filters/rclsoff index e674a50a..f704de74 100755 --- a/src/filters/rclsoff +++ b/src/filters/rclsoff @@ -1,5 +1,5 @@ #!/bin/sh -# @(#$Id: rclsoff,v 1.10 2007-06-08 13:51:09 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: rclsoff,v 1.11 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes # Parts taken from Estraier: #================================================================ # Estraier: a personal full-text search system @@ -127,26 +127,45 @@ cd $tmpdir/rclsofftmp descsedprog='//,/<\/dc:description>/{ s!.*!! s!.*!! +H +${ +g +s/\n/ /g p } +} ' -description=`sed -n -e "$descsedprog" < meta.xml | tr '\n' ' '` +description=`sed -n -e "$descsedprog" meta.xml` +#echo description "$description" -subject=`sed -e "s/\"/'/" -e 's/.*\([^<]*\).*/\1/p;d' < meta.xml` +# Takes tag name as parameter and creates sed program to extract single +# line meta tags values. +setmetasedprog() { +metasedprog="s/\"/'/g"' +/.*<'"$1"'>\([^<]*\).*/s//\1/p +' +} -title=`sed -e "s/\"/'/" -e 's/.*\([^<]*\).*/\1/p;d' < meta.xml` +setmetasedprog dc:subject +subject=`sed -n -e "$metasedprog" meta.xml` +#echo subject: $subject -keywords=`sed -e "s/\"/'/" -e 's/.*\([^<]*\).*/\1/p;d' \ - < meta.xml` +setmetasedprog dc:title +title=`sed -n -e "$metasedprog" meta.xml` +#echo title: $title + +setmetasedprog meta:keyword +keywords=`sed -n -e "$metasedprog" meta.xml` +#echo keywords: $keywords + +setmetasedprog dc:creator +creator=`sed -n -e "$metasedprog" meta.xml` +#echo creator: $creator # Note: next expr inserts a newline at each end of paragraph (for preview) content="`sed -e 's!!\\ !g' -e 's/<[^>]*>/ /g' < content.xml`" -#echo description "$description" -#echo subject "$subject" -#echo title "$title" -#echo keywords "$keywords" #echo content "$content" # output the result @@ -155,6 +174,7 @@ echo '' "$title" '' echo '' echo '' echo '' +echo '' echo '

' # The strange 'BEGIN' setup is to prevent 'file' from thinking this file diff --git a/src/sampleconf/mimeconf b/src/sampleconf/mimeconf index af47d6f6..e0bcfc5c 100644 --- a/src/sampleconf/mimeconf +++ b/src/sampleconf/mimeconf @@ -1,4 +1,4 @@ -# @(#$Id: mimeconf,v 1.27 2007-06-08 13:51:09 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: mimeconf,v 1.28 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes # Recoll : associations of mime types to processing filters. # There are different sections for decompression, 'interning' for indexing @@ -41,6 +41,7 @@ application/vnd.sun.xml.math = exec rclsoff application/vnd.sun.xml.writer = exec rclsoff application/vnd.sun.xml.writer.global = exec rclsoff application/vnd.sun.xml.writer.template = exec rclsoff +application/x-abiword = exec rclabw application/x-dvi = exec rcldvi application/x-lyx = exec rcllyx application/x-kword = exec rclkwd @@ -73,6 +74,8 @@ application/vnd.sun.xml.impress.template = presentation application/vnd.sun.xml.writer = wordprocessing application/vnd.sun.xml.writer.global = wordprocessing application/vnd.sun.xml.writer.template = wordprocessing +application/x-abiword = wordprocessing +application/x-kword = wordprocessing application/x-fsdirectory = folder application/x-dvi = document audio/mpeg = sownd @@ -88,13 +91,16 @@ text/x-c = source [categories] -texts = application/msword \ +texts = \ + application/msword \ application/pdf \ application/postscript \ application/vnd.sun.xml.writer \ application/vnd.sun.xml.writer.global \ application/vnd.sun.xml.writer.template \ + application/x-abiword \ application/x-dvi \ + application/x-kword \ application/x-lyx \ application/x-scribus \ image/vnd.djvu \ diff --git a/src/sampleconf/mimemap b/src/sampleconf/mimemap index 648a97dd..aeac1ac6 100644 --- a/src/sampleconf/mimemap +++ b/src/sampleconf/mimemap @@ -1,4 +1,4 @@ -# @(#$Id: mimemap,v 1.22 2007-06-08 13:51:09 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: mimemap,v 1.23 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes # Recoll: associations of file name extensions to mime types .txt = text/plain @@ -54,6 +54,7 @@ .sxg = application/vnd.sun.xml.writer.global .stw = application/vnd.sun.xml.writer.template +.abw = application/x-abiword .lyx = application/x-lyx .sla = application/x-scribus .scd = application/x-scribus diff --git a/src/sampleconf/mimeview b/src/sampleconf/mimeview index 593c2c7d..474739f4 100644 --- a/src/sampleconf/mimeview +++ b/src/sampleconf/mimeview @@ -1,4 +1,4 @@ -# @(#$Id: mimeview,v 1.5 2007-06-08 13:59:55 dockes Exp $ (C) 2004 J.F.Dockes +# @(#$Id: mimeview,v 1.6 2007-06-15 11:41:50 dockes Exp $ (C) 2004 J.F.Dockes ## ########################################## # External viewers, launched by the recoll GUI when you click on a result @@ -9,6 +9,7 @@ application/x-all = xdg-open %f application/x-kword = kword %f +application/x-abiword = abiword %f application/msword = openoffice %f application/pdf = xpdf %f