Skip to content
Benjamin Pick edited this page Oct 19, 2016 · 26 revisions

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.

Standalone Version

  1. Get the recent version of JavaThumbnailer at the Download Page (or [build it from source](Building from Source).)
  2. To run it via the commandline: java -jar javathumbnailer-standalone.jar input.doc [output.png]
  3. 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.

Regain Plugin Version

  1. Get the recent version of regain.
  2. 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.)

Crawler Plugin

  1. Save javathumbnailer-crawlerplugin-${version}.jar it into the /plugins/-Folder of regain. (Delete previous versions of this plugin if you upgrade.)

  2. 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).

Search

  1. Extract web/ to your web/-Folder (Server: deployed folder). It contains:
  • search_example.jsp : Modified version of regain/web/common/search.jsp . If you didn't modify it, you can overwrite the regain version of search.jsp. (Same for search_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.

Desktop Search

(If you don't use the desktop search, you can skip this section.)

  1. 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>
    

Server Search

(If you don't use the tomcat server search, you can skip this section.)

  1. Copy web/taglib/thumbnailer.jar into the deployed application folder WEB-INF/lib.
  2. 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/>.
  3. Restart Tomcat or the regain-application.

Installation FAQ

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