-
Notifications
You must be signed in to change notification settings - Fork 28
Installation
There are two versions of JavaThumbnailer:
- If you want to include this as a library to your own project, or use it from command-line only, you should take the Standalone Version.
- For integration into the regain Desktop search, take the Regain Plugin Version.
External Dependencies: In any case, you should install LibreOffice/OpenOffice as well if you want to convert office files.
- Get the recent version of JavaThumbnailer at the Download Page (or [build it from source](Building from Source).)
- To run it via the commandline:
java -jar javathumbnailer-standalone.jar input.doc [output.png]
- To use it in your own project, include this
.jar
in your classpath. For an example of usage (and configuration), see the code in Main.java.
- Get the recent version of regain.
- Get the recent version of JavaThumbnailer at the Download Page (or [build it from source](Building from Source), in which case you needn't follow the rest of the steps here.)
-
Save javathumbnailer-crawlerplugin-${version}.jar it into the
/plugins/
-Folder of regain. (Delete previous versions of this plugin if you upgrade.) -
Edit
CrawlerConfiguration.xml
to suit your needs. Here are the default values:<!-- | Create Thumbnails of the indexed documents during the thumbnailing process. | These Thumbnails can be used in the search results. +--> <crawlerPlugin enabled="true"> <class>de.uni_siegen.wineme.come_in.thumbnailer.plugin.ThumbnailerPlugin</class> <config> <section name="thumbnailing"> <!-- Folder where the created thumbnails should be stored. (This is currently hardcoded on the search side, so it must be /thumbs/ on the server. Please forgive.) --> <param name="thumbnailFolder">web/thumbs/</param> <!-- Desired Image dimensions of the thumbnail. --> <param name="imageWidth">160</param> <param name="imageHeight">120</param> </section> <section name="externalHelpers"> <!-- Where is OpenOffice installed? If not available, try to auto-detect folders --> <!-- <param name="openOfficeHome">file://c:/Programme/OpenOffice.org 3</param> --> <!-- Where is the profile to use? If not available, a temporary profile is created (at each crawling process start) --> <!-- <param name="openOfficeProfile">plugins/ressources/ooo-template-dir</param> --> </section> </config> </crawlerPlugin>
3b. (Optional) Create an [openoffice profile](How to create an OpenOffice Profile).
- Extract
web/
to your web/-Folder (Server: deployed folder). It contains:
-
search_example.jsp
: Modified version ofregain/web/common/search.jsp
. If you didn't modify it, you can overwrite the regain version ofsearch.jsp
. (Same forsearch_xml_example.jsp
) -
img/image_missing.png
: Example of an image that is shown instead of the thumbnail when thumbnail generation failed -
taglib/regain-thumbnailer.tld
: Tag declarations. Used only by the server version. -
taglib/thumbnailer.jar
: Tag implementations. Used by server & desktop version.
(If you don't use the desktop search, you can skip this section.)
-
Add the thumbnailer-Tag in
DesktopConfiguration.xml
:<!-- Register namespaces for Simple Server --> <simple_register_namespace> <!-- Default namespaces: search, config, status --> <namespace name="search">net.sf.regain.search.sharedlib</namespace> <namespace name="config">net.sf.regain.ui.desktop.config.sharedlib</namespace> <namespace name="status">net.sf.regain.ui.desktop.status.sharedlib</namespace> <!-- For thumbnailer Plugin --> <namespace name="thumbnailer">de.uni_siegen.wineme.come_in.thumbnailer.plugin.sharedlib</namespace> </simple_register_namespace>
(If you don't use the tomcat server search, you can skip this section.)
- Copy
web/taglib/thumbnailer.jar
into the deployed application folderWEB-INF/lib
. - Make sure you added
<%@taglib uri="taglib/regain-thumbnailer.tld" prefix="thumbnailer" %>
at the top of your jsp where you use the tag<thumbnailer:img/>
. - Restart Tomcat or the regain-application.
Q1. When indexing office files, I get the following Exception: com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one
. What does this mean?
A1. This has 2 common causes:
- The OpenOffice-Process started by regain cannot read the file (Permission denied). Make sure that the file is world-readable or at least readable to regain.
- Or: The corresponding OpenOffice-Program was not installed. (E.g. - You're trying to convert an xls-File, but Calc is not installed.) Under Debian, you should install at least:
sudo apt-get install openoffice.org-headless openoffice.org-writer openoffice.org-calc openoffice.org-impress openoffice.org-draw