added wordperfect support
This commit is contained in:
parent
f56c943403
commit
b326ae4bb4
87
src/filters/rclwpd
Executable file
87
src/filters/rclwpd
Executable file
@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# @(#$Id: rclwpd,v 1.1 2007-08-26 13:34:59 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
|
# Some inspiration from estraier
|
||||||
|
#================================================================
|
||||||
|
# rclwpd
|
||||||
|
# convert wordperfect documents to html, by executing the wpd2html program:
|
||||||
|
# http://libwpd.sourceforge.net/download.html
|
||||||
|
#================================================================
|
||||||
|
|
||||||
|
# set variables
|
||||||
|
LANG=C ; export LANG
|
||||||
|
LC_ALL=C ; export LC_ALL
|
||||||
|
progname="rclwpd"
|
||||||
|
filetype=wpd
|
||||||
|
|
||||||
|
|
||||||
|
#RECFILTCOMMONCODE
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the previous line unmodified!! Code imported from the
|
||||||
|
# recfiltcommon file
|
||||||
|
|
||||||
|
# Utility code common to all shell filters. This could be sourced at run
|
||||||
|
# time, but it's slightly more efficient to include the code in the
|
||||||
|
# filters at build time (with a sed script).
|
||||||
|
|
||||||
|
# Describe error in a way that can be interpreted by our caller
|
||||||
|
senderror()
|
||||||
|
{
|
||||||
|
echo RECFILTERROR $*
|
||||||
|
# Also alert on stderr just in case
|
||||||
|
echo ":2:$progname::: $*" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
iscmd()
|
||||||
|
{
|
||||||
|
cmd=$1
|
||||||
|
case $cmd in
|
||||||
|
*/*)
|
||||||
|
if test -x $cmd ; then return 0; else return 1; fi ;;
|
||||||
|
*)
|
||||||
|
oldifs=$IFS; IFS=":"; set -- $PATH; IFS=$oldifs
|
||||||
|
for d in $*;do test -x $d/$cmd && return 0;done
|
||||||
|
return 1 ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
checkcmds()
|
||||||
|
{
|
||||||
|
for cmd in $*;do
|
||||||
|
if iscmd $cmd
|
||||||
|
then
|
||||||
|
a=1
|
||||||
|
else
|
||||||
|
senderror HELPERNOTFOUND $cmd
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# show help message
|
||||||
|
if test $# -ne 1 -o "$1" = "--help"
|
||||||
|
then
|
||||||
|
echo "Convert a $filetype file to HTML text for Recoll indexing."
|
||||||
|
echo "Usage: $progname [infile]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
infile="$1"
|
||||||
|
|
||||||
|
# check the input file existence (may be '-' for stdin)
|
||||||
|
if test "X$infile" != X- -a ! -f "$infile"
|
||||||
|
then
|
||||||
|
senderror INPUTNOSUCHFILE "$infile"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# protect access to our temp files and directories
|
||||||
|
umask 77
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# !! Leave the following line unmodified !
|
||||||
|
#ENDRECFILTCOMMONCODE
|
||||||
|
|
||||||
|
checkcmds wpd2html
|
||||||
|
|
||||||
|
# output the result. wpd2html output doesn't seem to need any adjustment?
|
||||||
|
|
||||||
|
wpd2html "$infile" 2> /dev/null
|
||||||
@ -1,4 +1,4 @@
|
|||||||
# @(#$Id: mimeconf,v 1.32 2007-07-01 06:52:21 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: mimeconf,v 1.33 2007-08-26 13:34:59 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
|
|
||||||
# Recoll : associations of mime types to processing filters.
|
# Recoll : associations of mime types to processing filters.
|
||||||
# There are different sections for decompression, 'interning' for indexing
|
# There are different sections for decompression, 'interning' for indexing
|
||||||
@ -42,6 +42,7 @@ application/vnd.sun.xml.math = exec rclsoff
|
|||||||
application/vnd.sun.xml.writer = exec rclsoff
|
application/vnd.sun.xml.writer = exec rclsoff
|
||||||
application/vnd.sun.xml.writer.global = exec rclsoff
|
application/vnd.sun.xml.writer.global = exec rclsoff
|
||||||
application/vnd.sun.xml.writer.template = exec rclsoff
|
application/vnd.sun.xml.writer.template = exec rclsoff
|
||||||
|
application/vnd.wordperfect = exec rclwpd
|
||||||
application/x-abiword = exec rclabw
|
application/x-abiword = exec rclabw
|
||||||
application/x-dvi = exec rcldvi
|
application/x-dvi = exec rcldvi
|
||||||
application/x-flac = exec rclflac
|
application/x-flac = exec rclflac
|
||||||
@ -77,6 +78,7 @@ application/vnd.sun.xml.impress.template = presentation
|
|||||||
application/vnd.sun.xml.writer = wordprocessing
|
application/vnd.sun.xml.writer = wordprocessing
|
||||||
application/vnd.sun.xml.writer.global = wordprocessing
|
application/vnd.sun.xml.writer.global = wordprocessing
|
||||||
application/vnd.sun.xml.writer.template = wordprocessing
|
application/vnd.sun.xml.writer.template = wordprocessing
|
||||||
|
application/vnd.wordperfect = wordprocessing
|
||||||
application/x-abiword = wordprocessing
|
application/x-abiword = wordprocessing
|
||||||
application/x-dvi = document
|
application/x-dvi = document
|
||||||
application/x-flac = sownd
|
application/x-flac = sownd
|
||||||
@ -102,6 +104,7 @@ text = \
|
|||||||
application/vnd.sun.xml.writer \
|
application/vnd.sun.xml.writer \
|
||||||
application/vnd.sun.xml.writer.global \
|
application/vnd.sun.xml.writer.global \
|
||||||
application/vnd.sun.xml.writer.template \
|
application/vnd.sun.xml.writer.template \
|
||||||
|
application/vnd.wordperfect \
|
||||||
application/x-abiword \
|
application/x-abiword \
|
||||||
application/x-dvi \
|
application/x-dvi \
|
||||||
application/x-kword \
|
application/x-kword \
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# @(#$Id: mimemap,v 1.24 2007-07-01 06:52:21 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: mimemap,v 1.25 2007-08-26 13:34:59 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
# Recoll: associations of file name extensions to mime types
|
# Recoll: associations of file name extensions to mime types
|
||||||
|
|
||||||
.txt = text/plain
|
.txt = text/plain
|
||||||
@ -62,6 +62,14 @@
|
|||||||
.kwd = application/x-kword
|
.kwd = application/x-kword
|
||||||
|
|
||||||
.wpd = application/vnd.wordperfect
|
.wpd = application/vnd.wordperfect
|
||||||
|
.wpl = application/vnd.wordperfect
|
||||||
|
.wpi = application/vnd.wordperfect
|
||||||
|
.wpm = application/vnd.wordperfect
|
||||||
|
.wp5 = application/vnd.wordperfect
|
||||||
|
.wp6 = application/vnd.wordperfect
|
||||||
|
.wp8 = application/vnd.wordperfect
|
||||||
|
.mem = application/vnd.wordperfect
|
||||||
|
|
||||||
.rtf = text/rtf
|
.rtf = text/rtf
|
||||||
|
|
||||||
.mp3 = audio/mpeg
|
.mp3 = audio/mpeg
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# @(#$Id: mimeview,v 1.7 2007-07-01 06:52:21 dockes Exp $ (C) 2004 J.F.Dockes
|
# @(#$Id: mimeview,v 1.8 2007-08-26 13:34:59 dockes Exp $ (C) 2004 J.F.Dockes
|
||||||
|
|
||||||
## ##########################################
|
## ##########################################
|
||||||
# External viewers, launched by the recoll GUI when you click on a result
|
# External viewers, launched by the recoll GUI when you click on a result
|
||||||
@ -27,6 +27,7 @@ application/vnd.sun.xml.math = openoffice %f
|
|||||||
application/vnd.sun.xml.writer = openoffice %f
|
application/vnd.sun.xml.writer = openoffice %f
|
||||||
application/vnd.sun.xml.writer.global = openoffice %f
|
application/vnd.sun.xml.writer.global = openoffice %f
|
||||||
application/vnd.sun.xml.writer.template = openoffice %f
|
application/vnd.sun.xml.writer.template = openoffice %f
|
||||||
|
application/vnd.wordperfect = openoffice %f
|
||||||
application/x-fsdirectory = rox %f
|
application/x-fsdirectory = rox %f
|
||||||
application/x-dvi = xdvi %f
|
application/x-dvi = xdvi %f
|
||||||
application/x-flac = xmms %f
|
application/x-flac = xmms %f
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user