This documentation assumes Windows users will use the Hatch Windows installer. The Linux-only steps can also be done on Windows from a source checkout but are not documented here.

Windows

Install Hatch

Execute the Hatch-Installer-(version).exe executable.

Note
See installer/windows/README.adoc for building the Windows installer from Linux or Windows. When building the Windows installer on Windows a full JDK is required for compiling.

Optional: Test Hatch

C:\>cd %ProgramFiles(x86)%\Hatch
C:\Program Files (x86)\Hatch>hatch.bat test

Install Chrome Extension

If the extension was not installed automatically when installing Hatch you can get it directly in the browser from the Chrome App Store.

Install Firefox Extension

The Firefox extension can not be installed automatically by the native application installer; it is available on the Firefox Addons site.

Continue with Using Hatch

Linux

Download Hatch Sources

git clone git://git.evergreen-ils.org/Hatch.git
cd Hatch

Download Java Dependencies

./fetch-deps.sh linux

Compile Hatch

$ ./hatch.sh compile

Configure Native Messaging

Edit extension/host/org.evergreen_ils.hatch.(chrome|firefox).json and change the path value to match the location of your copy of hatch.sh, found in the root directory of the Hatch repository.

Copy the correct host file, changing the filename to org.evergreen_ils.hatch.json, into the browser’s configuration directory.

For Chrome:

$ mkdir -p ~/.config/google-chrome/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.chrome.json ~/.config/google-chrome/NativeMessagingHosts/org.evergreen_ils.hatch.json

For Chromium:

$ mkdir -p ~/.config/chromium/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.chrome.json ~/.config/chromium/NativeMessagingHosts/org.evergreen_ils.hatch.json

For Firefox:

$ mkdir -p ~/.mozilla/native-messaging-hosts/
$ cp extension/host/org.evergreen_ils.hatch.firefox.json ~/.mozilla/native-messaging-hosts/org.evergreen_ils.hatch.json

Install Chrome Extension

Install the Chrome extension directly from the Chrome App Store.

Install Firefox Extension

Install the Firefox extension from the Firefox Addons site.

Optional: Test Hatch

Note
print commands are disabled by default in the tests to avoid unexpected printing but they can be added by un-commenting them in src/org/evergreen_ils/hatch/TestHatch.java and recompiling.
$ mkdir -p ~/.evergreen
$ ./hatch.sh test

Continue with Using Hatch

Mac

Download Hatch Sources

git clone git://git.evergreen-ils.org/Hatch.git
cd Hatch

Download Java Dependencies

./fetch-deps.sh mac

Compile Hatch

$ ./hatch.sh compile

Configure Native Messaging

Edit extension/host/org.evergreen_ils.hatch.(chrome|firefox).json and change the path value to match the location of your copy of hatch.sh, found in the root directory of the Hatch repository.

Copy the correct host file, changing the filename to org.evergreen_ils.hatch.json, into the browser’s configuration directory.

For Chrome:

$ mkdir -p ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.chrome.json ~/Library/Application\ Support/Google/Chrome/NativeMessagingHosts/org.evergreen_ils.hatch.json

For Chromium:

$ mkdir -p ~/Library/Application\ Support/Chromium/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.chrome.json ~/Library/Application\ Support/Chromium/NativeMessagingHosts/org.evergreen_ils.hatch.json

For Firefox:

$ mkdir -p ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/
$ cp extension/host/org.evergreen_ils.hatch.chrome.json ~/Library/Application\ Support/Mozilla/NativeMessagingHosts/org.evergreen_ils.hatch.json

Install Chrome Extension

Install the Chrome exenstion directly from the Chrome App Store.

Install Firefox Extension

Install the Firefox extension from the Firefox Addons site.

Optional: Test Hatch

Note
print commands are disabled by default in the tests to avoid unexpected printing but they can be added by un-commenting them in src/org/evergreen_ils/hatch/TestHatch.java and recompiling.
$ mkdir -p ~/.evergreen
$ ./hatch.sh test

Using Hatch

  • In Chrome, navigate to the browser staff URL (https://HOSTNAME/eg/staff/).

  • Open the Javascript console. It should show messages like:

Loading Hatch relay content script
...
sending to Hatch: {"key":"eg.workstation.all","action":"get","msgid":1}
...
Hatch responded to message ID 1

Optional: Debugging The Chrome Extension

  • Navigate to chrome://extensions

  • Enable "Developer Mode" along the top right of the page.

  • Click the "Background Page" link to see the extension console.

  • When the extension is loaded (or reloaded), it should show "Connecting to native messaging host: org.evergreen_ils.hatch" in the Background Page console with no errors.

  • Use the "Reload" link to apply local changes made to the extension (e.g. extension.js). (This might only work when installing the extension manually via developer mode tools).

  • See also https://developer.chrome.com/extensions/getstarted