sakaiproject/Hilary — pull request #319 by simong (2013-01-09 17:26:32+00:00)
Title: Preview Processor

This PR introduces the Node.JS Preview Processor.
This PR is dependant on the cross tenant authentication (https://github.com/sakaiproject/Hilary/pull/310)

### Dependencies
* Libre Office to convert Office files
* pdftk to split PDF files
* GraphicsMagick to convert image files (this was a requirement for profile pics already)

### Configuration
* set `config.previews.enabled` to true in the main config.js
* configure the path of soffice.bin, on OS X this would be `/Applications/LibreOffice.app/Contents/MacOS/soffice.bin`
* configure the path of pdftk (on my install it sits in my $PATH by default)

### Running it
If the enabled value is set to true, it will be included in the app lifecycle.

### Gotchas
If you have pending stuff left in your queue, the next server start up will barf as it connects to the queue and tries to start processing before the REST endpoints are registered.
This kills the PP.
Fix: comment out emitter.emit('error') in the oae-rest/lib/util file for now.
Once https://github.com/sakaiproject/Hilary/issues/314 gets fixed, this issue will go away

Since the PP requires special dependencies and configuration, the tests that actually try to generate previews are disabled by default. Only if config.previews.enabled is set to true will they run.