From: Bill Erickson Date: Thu, 30 Mar 2017 16:21:22 +0000 (-0400) Subject: eg 2017 hatch review doc X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=09d156c6da7ef816578f4b6f180aeeeec36c488b;p=working%2Frandom.git eg 2017 hatch review doc Signed-off-by: Bill Erickson --- diff --git a/hatch-review.adoc b/hatch-review.adoc index 24934f677..76be33353 100644 --- a/hatch-review.adoc +++ b/hatch-review.adoc @@ -7,6 +7,15 @@ :max-width: 45em :deckjs_theme: web-2.0 +== Today's Agenda + +* What is Hatch? +* How Does It Work? +* Install Review +* Debugging +* Browser Client Interfaces +* What's Next? + == Hatch In a Nutshell * Unmediated printing across multiple printers @@ -14,12 +23,75 @@ [small]_"Hatch is the bionic arm of the Evergreen browser client." --Anonymous._ +== Hatch Architecture + +* Browser AngularJS Service (egHatch) + ** Relays commands from the Browser Client to the Hatch Extension +* Browser Extension + ** Relays messages between the browser and Native Application +* Native Application + ** Read files, Writes files, talks to printers. + +== Hatch Message Flow + +image:images/Hatch_Flow_Diagram.png[Hatch Diagram] + +== Native Messaging API + +Sample print message JSON. + +egPrint.print({...}) is translated into: + +[source,js] +--------------------------------------------------------------------------- +{ + "action":"print", + "content":"Hello, World!", + "contentType":"text/html", + "showDialog":true, + "msgid":10, + "from":"page", + "clientid":5319, // set by extension + "origin":"https://eg.example.org", // set by extension + "settings":{"context":"default","printer":"HP-Deskjet-5100", ...} +} +--------------------------------------------------------------------------- + + + == Hatch Install Recap * Install Java runtime 8 or higher. * Install Java code (HatchInstaller.exe) * Register the Chrome extension +== Hatch Configuration Files + +== Hatch Data Files + +Data is stored by default in the ".evergreen" directory in the user's +home directory. + +image:images/hatch_data_dir.png[Hatch Data Dir] + +== Hatch Settings Files + +[source,js] +--------------------------------------------------------------------------- +--------------------------------------------------------------------------- + +== chrome://extensions/ + +image:images/hatch_chrome_ext.png[Hatch Extension] + +== Installed Extension + +image:images/hatch_icon.png[Hatch Diagram] + +== Developer Mode Beware! + +image:images/hatch_ext_warning.png[Hatch Extension Warning] + == Testing the Java Install [source,sh] @@ -41,18 +113,6 @@ C:\Program Files (x86)\Hatch> hatch.bat test ... --------------------------------------------------------------------------- -== chrome://extensions/ - -image:images/hatch_chrome_ext.png[Hatch Extension] - -== Installed Extension - -image:images/hatch_icon.png[Hatch Diagram] - -== Developer Mode Beware! - -image:images/hatch_ext_warning.png[Hatch Extension Warning] - == Hatch UI Recap * Enable Hatch @@ -77,45 +137,6 @@ Administration => Workstation => Printer Settings image:images/hatch_print_config.png[Hatch Print Config] -== Hatch Architecture - -* Browser AngularJS Service -[source,js] ---------------------------------------------------------------------------- -egCore.hatch.setItem('eg.hatch.enable.settings', true); -egCore.hatch.getItem('eg.workstation.default').then( - function(ws) { console.log('default workstation: ' + ws) }); ---------------------------------------------------------------------------- -* Browser Extension - ** Relays messages between the browser and Native Application -* Native Application - ** Writes files, talks to printers. - -== Hatch Message Flow - -image:images/Hatch_Flow_Diagram.png[Hatch Diagram] - -== Native Messaging API - -Sample print message JSON. - -egPrint.print({...}) is translated into: - -[source,js] ---------------------------------------------------------------------------- -{ - "action":"print", - "content":"Hello, World!", - "contentType":"text/html", - "showDialog":true, - "msgid":10, - "from":"page", - "clientid":5319, // set by extension - "origin":"https://eg.example.org", // set by extension - "settings":{"context":"default","printer":"HP-Deskjet-5100", ...} -} ---------------------------------------------------------------------------- - == A Quick Word on Rendering Print HTML * Print template is added to the DOM @@ -130,32 +151,19 @@ egPrint.print({...}) is translated into: ** Hatch adds no JS or CSS. It uses only what's added to or linked in the compiled HTML -== Hatch Configuration Files - -== Hatch Data Files - -Data is stored by default in the ".evergreen" directory in the user's -home directory. - -image:images/hatch_data_dir.png[Hatch Data Dir] +== What's Next? -== Hatch Settings Files + * Publishing Browser Extension + * Firefox Support + * Alternate Native Application Implementations? + ** Read/Write via STDIO + ** Render HTML + ** Communicate with printers -[source,js] ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- - -== What's Next? +== Questions... -== Publish Browser Extension - * Chrome store +Do you have any? -== Alternate Implementations -Hatch native application (Java) could potentially be written in any -languag as long as it can do 3 things: -* Read/Write via STDIO -* Render HTML -* Communicate with printers