--- /dev/null
+jdk*
+jetty*
+lib/
+
Hatch - Java Print / Storage / Etc Service
-TODO: more info
+** ROUGH SETUP NOTES **
+
+Install Hatch on your desktop -- Linux edition:
+
+% wget http://download.eclipse.org/jetty/stable-9/dist/jetty-distribution-9.2.5.v20141112.tar.gz
+% tar -zxf jetty-distribution-9.2.5.v20141112.tar.gz
+% ln -s jetty-distribution-9.2.5.v20141112 jetty
+
+# download jdk1.8 (requires license agreement) -- haven't tested on openjdk yet.
+# http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
+# and extract in the same directory
+% ln -s jdk1.8.0_25 jdk1.8
+
+% mkdir lib
+% wget -O lib/jetty-util-ajax-9.2.5.v20141112.jar \
+ 'http://central.maven.org/maven2/org/eclipse/jetty/jetty-util-ajax/9.2.5.v20141112/jetty-util-ajax-9.2.5.v20141112.jar'
+
+# compile
+% ./run.sh
+
+# compile + run
+% ./run.sh 1
+
+# open https://localhost:8443/ in Chrome and click through the security warning.
+# Then open the browser client.
+# Set "This workstation uses a remote print / storage service ("Hatch")?" under Admin -> Workstation
+# optionally configure / test printing
https://<hostname>:8443/ and confirm the cert is trusted -->
<New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
<!-- TODO: make this better -->
- <Set name="KeyStorePath"><Property name="jetty.home" default="." />/jetty-distribution-9.1.4.v20140401/etc/keystore</Set>
+ <Set name="KeyStorePath"><Property name="jetty.home" default="." />/jetty/etc/keystore</Set>
<Set name="KeyStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
<Set name="KeyManagerPassword">OBF:1u2u1wml1z7s1z7a1wnl1u2g</Set>
- <Set name="TrustStorePath"><Property name="jetty.home" default="." />/jetty-distribution-9.1.4.v20140401/etc/keystore</Set>
+ <Set name="TrustStorePath"><Property name="jetty.home" default="." />/jetty/etc/keystore</Set>
<Set name="TrustStorePassword">OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4</Set>
</New>
-JAVA_HOME=jdk1.8.0
-JETTY_HOME=jetty-distribution-9.1.4.v20140401
+JAVA_HOME=jdk1.8
+JETTY_HOME=jetty
# compile
$JAVA_HOME/bin/javac \
String content = (String) params.get("content");
String contentType = (String) params.get("contentType");
+ if (content == null) {
+ logger.warn("handlePrint() called with no content");
+ return;
+ }
+
browser = new BrowserView();
Scene scene = new Scene(browser);
primaryStage.setScene(scene);
HashMap<String, Object> printerMap = new HashMap<String, Object>();
printerMaps.add(printerMap);
printerMap.put("name", printer.getName());
- if (printer.getName().equals(defaultPrinter.getName())) {
+ if (defaultPrinter != null &&
+ printer.getName().equals(defaultPrinter.getName())) {
printerMap.put("is-default", new Boolean(true));
}
logger.info("found printer " + printer.getName());