JOD (Java Open Document converter) is an alternative to the *office headless mode that we wish to use in production. In the past the *office headless mode was used, but it is not ideal and not a suitable solution for concurrent builds. It will remain available for developers to use as a feasible alternative to the heavy handed JOD service.
The JOD service was originally built into OERPub's SWORD implementation. Connexions came across it as a viable alternative to issues raised by the developers that were not running GUI environments which enabled a reliable headless *office to run. At this time it was also realized that *office headless mode could bottleneck with concurrent tasks, which is something the JOD service already solved.
The JOD service will give us the ability to do concurrent builds and have the conversion as a service.
These instructions will assume you are using an Ubuntu system, because this would turn into a small book if we were to include instructions for every platform. Make your best effort to translate these instructures to your platform and feel free to ask the developers for assistance.
Installing MS Word -> *office dependencies
A *office installation will be required (LibreOffice, OpenOffice or StarOffice). You are free to choose whichever, but this documentation will use LibreOffice. You can adapt your environment to whichever you choose.
Installation of LibreOffice can be done using the following command:
$ sudo apt-get install libreoffice
A macro needs to be added to the into *office for the transform to be successful. (see also: oerpub.rhaptoslabs.swordpushweb)
$ wget https://raw.github.com/oerpub/oerpub.rhaptoslabs.swordpushweb/develop/docs/office_macro/Module1.xba $ mkdir -p ~/.config/.libreoffice/3/user/basic/Standard/ $ mv Module1.xba ~/.config/.libreoffice/3/user/basic/Standard/
Python-JOD is a poorly named project that provides an interfaces for the *office document conversions.
Clone and navigate into the project:
$ git clone git clone https://github.com/oerpub/Python-JOD.git
Note
Adjust PIPE_PATH
in install.sh
to reflect whichever
flavor of *office you installed.
You'll need to install maven
in order to run the install. On
ubuntu, this would be:
$ apt-get install openjdk-6-jdk maven
Then issue the installer command:
$ sudo JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") \ JRE_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::") \ ./install.sh
<https://github.com/oerpub/Python-JOD/blob/master/jodconverter-webapp-build/README.txt>`_
The '--dev-mode' flag will enable the use of the *office headless mode, rather than the full blown JOD service. This is only to be used when using this mode. We are using stderr for these messages because standard out (stdout) is used for piping output.
I think I understand the behavior, but my question is why? What's the client and why does it help to specialize File this way?