Elementary! Incorporating BlueMix, Node-RED and Watson in Domino applications

Similar documents
IBM Bluemix Node-RED Watson Starter

Lab 4: create a Facebook Messenger bot and connect it to the Watson Conversation service

Break out of The Box Integrate existing Domino data with modern websites. Karl-Henry Martinsson, Deep South Insurance

IBM Image-Analysis Node.js

Defining New Node-RED Nodes

User Interaction: jquery

A Closer Look at XPages in IBM Lotus Domino Designer 8.5 Ray Chan Advisory I/T Specialist Lotus, IBM Software Group

Using Dropbox with Node-RED

Create Swift mobile apps with IBM Watson services IBM Corporation

To Kill a Monolith: Slaying the Demons of a Monolith with Node.js Microservices on CloudFoundry. Tony Erwin,

introduction to using Watson Services with Java on Bluemix

Vance Morris Stefania L Kaczmarczyk Neeraja Ganesan Oliver Rodriduez Colin Mccabe

ENRICHING PRIMO RECORDS WITH INFORMATION FROM WORDPRESS. Karsten Kryger Hansen Aalborg University Library

What is Node.js? Tim Davis Director, The Turtle Partnership Ltd

IBM / ST SensorTile Watson IoT Workshop

Asema IoT Central Integration and migration. English

IN Development in Platform Ecosystems Lecture 3: json, ajax, APIs

Using Node-RED to build the internet of things

Using XML and RDBMS Data Sources in XPages Paul T. Calhoun NetNotes Solutions Unlimited, Inc

This project will use an API from to retrieve a list of movie posters to display on screen.

Creating Organization Charts for IBM Connections using JavaScript and Google Charts

NODE-RED An event based toolkit for devices and robots

TIPS AND TRICKS: DOMINO AND JAVASCRIPT DEVELOPMENT MASTERCLASS

C. The system is equally reliable for classifying any one of the eight logo types 78% of the time.

Lab 1: Getting Started with IBM Worklight Lab Exercise

ACCUZIP EDDM UI REST API CALLS. 100% Cloud Based EDDM List Creation. Abstract EDDM UI to select Carrier Route Boundaries throughout the United States

Profound.js. Future of open source development on IBM i. Alex Roytman Profound Logic

Connect and Transform Your Digital Business with IBM

XPages development practices: developing a common Tree View Cust...

COURSE OUTLINE MOC 20480: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

Development of Web Applications

Modern Web Application Development. Sam Hogarth

Putting A Spark in Web Apps

Professional Course in Web Designing & Development 5-6 Months

AD 102 Break out of the box Integrate existing Domino data with modern websites. Karl-Henry Martinsson Deep South Insurance

KonaKart Shopping Widgets. 3rd January DS Data Systems (UK) Ltd., 9 Little Meadow Loughton, Milton Keynes Bucks MK5 8EH UK

Jquery.ajax Call Returns Status Code Of 200 But Fires Jquery Error

Etanova Enterprise Solutions

Connecting Max to the Internet

AJAX. Lab. de Bases de Dados e Aplicações Web MIEIC, FEUP 2010/11. Sérgio Nunes

Tutorials Php Y Jquery Mysql Database Without Refreshing Code

React(.js) the Domino Way High-Performance Client for Domino. Knut Herrmann

Mul$media im Netz (Online Mul$media) Wintersemester 2014/15. Übung 06 (Haup-ach)

IBM Bluemix compute capabilities IBM Corporation

Creating a REST API which exposes an existing SOAP Service with IBM API Management

API s in a hybrid world. Date 28 September 2017

All samples, demos, slides & recording will be available later today for download at blogs.infragistics.com

Enhancing applications with Cognitive APIs IBM Corporation

PROCE55 Mobile: Web API App. Web API.

Il Mainframe e il paradigma dell enterprise mobility. Carlo Ferrarini zsystems Hybrid Cloud

Jquery Ajax Json Php Mysql Data Entry Example

AWS Connect Pindrop Integration Guide

Serverless in the Java ecosystem

Discovery data feed for Eid 2.0

AJAX: From the Client-side with JavaScript, Back to the Server

Tutorial. Building Composite Applications for IBM Lotus Notes 8. For use with the IBM Lotus Notes 8 Beta 2 client

Enhancing The Customer Chat Experience Using CCE 11.6 Enterprise Chat &

IBM Watson Content Hub. Architecture Overview

! The final is at 10:30 am, Sat 6/4, in this room. ! Open book, open notes. ! No electronic devices. ! No food. ! Assignment 7 due 10pm tomorrow

Networking & The Web. HCID 520 User Interface Software & Technology

IBM Lotus Quickr Customization

Contents. Demos folder: Demos\14-Ajax. 1. Overview of Ajax. 2. Using Ajax directly. 3. jquery and Ajax. 4. Consuming RESTful services

Networking & The Web. HCID 520 User Interface Software & Technology

Static Webpage Development

Boostrap Autocomplete Documentation

The decoupled CMS in financial services. Preston So 8 Nov 2017 Open Source Strategy Forum 2017

AT&T Smart Cities With M2X & Flow Designer

welcome to BOILERCAMP HOW TO WEB DEV

High Level Interoperability Testing

Integrating the Progress Rollbase Portal into OpenEdge Applications. Mike Fechner, Director, Consultingwerk Ltd.

IoT-Studio User Manual

Copyright Descriptor Systems, Course materials may not be reproduced in whole or in part without prior written consent of Joel Barnum

Overview and Demonstration

Composite Application Tutorial I: NSF Components

DECOUPLING PATTERNS, SERVICES AND CREATING AN ENTERPRISE LEVEL EDITORIAL EXPERIENCE

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

CSE 115. Introduction to Computer Science I

Reading Writing Speaking Reading Writing Speaking. English Intermediate Intermediate Elementary Intermediate Intermediate Elementary

Adventures with BaseX and web applications. Andy Feb 2013

Terratype Umbraco Multi map provider

COURSE 20480B: PROGRAMMING IN HTML5 WITH JAVASCRIPT AND CSS3

MASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M

Microsoft Developing ASP.NET MVC 4 Web Applications. Download Full Version :

EXTENDING YOUR HCM CLOUD SELF SERVICE IS AS SIMPLE AS

User manual Scilab Cloud API

Serverless Computing: Customer Adoption Insights & Patterns

Converting Your Web App to Tizen. Cheng Luo

Artificial Intelligence-asa-Service. Watson. For developers. Roman Boiko, Clemence Lebrun May, IBM Cloud

Project Part 2 (of 2) - Movie Poster And Actor! - Lookup

jquery in Domino apps

FRED: A Hosted Data Flow Platform for the IoT built using Node-RED

Programming in HTML5 with JavaScript and CSS3

VidyoEngage for Genesys Widgets

IBM LOT-408. IBM Notes and Domino 9.0 Social Edition Application Development Updat.

Paul Withers Intec Systems Ltd By Kind Permission of Matt White and Tim Clark

IBM Bluemix platform as a service (PaaS)

IBM Domino App.Next - New Possibilities

Creating a REST API which exposes an existing SOAP Service with IBM API Management

Transcription:

Elementary! Incorporating BlueMix, Node-RED and Watson in Domino applications

Our Amazing Sponsors MWLUG 2017

Karl-Henry Martinsson CEO, Demand Better Solutions, LLC In the IT industry for 29 years Full time programmer since 1991 Worked with Notes and Domino since 1994 Web development since 1995 IBM Champion since 2014 Worked as IT journalist for 5 years

Focus on user experience and interface Make the software easy to use To the user the UI is the application! Development for Notes and browser New development, both Notes client and browser Modernization of existing applications Application migration from and to IBM Domino Take advantage of modern tools and technology jquery, Bootstrap, jquery Mobile, BlueMix, etc

Agenda What is IBM BlueMix? What is Node-RED? Watson Services Translation (English to Spanish) Text-to-Speech Integrate into your own solutions Notes client Web application

What is IBM BlueMix? Platform as a Service (PaaS) Based on Cloud Foundry Open source, multi cloud platform Running on SoftLayer infrastructure Supports multiple tools and services Node-RED Watson API

What is Node-RED? Flow-based programming for IoT Wire together services, APIs and hardware One-click deployment Built on Node.js Event driven, non-blocking (asyncronous) Light-weight runtime, can run on Raspberry Pi Available as Docker container and on BlueMix

Node-RED Editor Browser based editor Click-and-drag of components (nodes) Input and output nodes (interface) http, web sockets, email, twitter Function nodes switch, split, join, change Javascript used to modify payload

Many Available Node MWLUG 2017

IBM Watson Services Conversation (bots and virtual agents) Document Conversion Natural Language Classifier Visual Recognition Language Translator Speech to Text / Text to Speech And many more

Where Do We Start? Create a BlueMix account free for 30 days Setup a Node-RED instance Add some Watson Services Language Translator Text to Speech

Create Translation Flow Create and configure main nodes http input Watson Translate http response Nodes to manipulate JSON msg object Process incoming JSON for translation Create JSONP for output Connect nodes

Process Incoming JSON // Get Set language payload to to text translate to translate from (default is English) if(msg.payload.from = msg.payload.message; === null msg.payload.from == '') { // Pass msg.srclang object to = the "en-us"; next node } return else { msg; msg.srclang = msg.payload.from;} // Get language to translate to (default is Spanish) if(msg.payload.to === null msg.payload.to == '') { msg.destlang = "es"; } else { msg.destlang = msg.payload.to; } // Set payload to text to translate msg.payload = msg.payload.message; // Pass object to the next node return msg;

Create JSONP to Return // Wrap payload in callback function msg.payload = "translated({'translated':'" + msg.payload + "'})"; // Pass object to final node, to return to browser return msg;

Call Flow From Web Page HTML: <input type="text" id="text" placeholder="enter text to translate here"> <button id="btntranslate" class="btn btn-primary">translate</button> <div id="translated"></div> jquery: $("#btntranslate").on("click", function (e) { e.preventdefault(); // Store values to pass to flow in a JSON object var json = { "message":$("#text").val(), "from":"en", "to":"es" } // Call Node-RED flow using Ajax $.ajax({ url: "https://texasswedenodered.mybluemix.net/translate", datatype: "jsonp", data: json }); }); // Call-back function for translation function translated(data) { $("#translated").html(data.translated); }

Demo MWLUG 2017

Call Flow From Notes Simple form Two fields Computed text One button Lotusscript to call URL and parse JSON Using my HTTP retrieval class Using MSXML2.ServerXMLHTTP Windows only Code available on my blog

Lotusscript Code Use "class.remotehttp" Sub Click(Source As Button) Dim ws As New NotesUIWorkspace Dim uidoc As NotesUIDocument Dim http As New RemoteHTTP() Dim textenglish As String Dim textspanish As String Dim url As String Dim response As String Set uidoc = ws.currentdocument textenglish = uidoc.fieldgettext("inputtext") url = "https://texasswedenodered.mybluemix.net/translate" url = url + "?message=" url = url + Replace(textEnglish, " ", "+") response = http.gethttp(url) textspanish = parsejson(response, "translated") Call uidoc.fieldsettext("outputtext", textspanish) Call uidoc.refresh() End Sub

Demo MWLUG 2017

Improvements Select source and destination languages Add two dropdowns to form Pass languages as arguments Just a few more lines of code

Lotusscript Code Use "class.remotehttp" Sub Click(Source As Button) Dim ws As New NotesUIWorkspace Dim uidoc As NotesUIDocument Dim http As New RemoteHTTP() Dim langfrom textenglish As String As String Dim langto textspanish As String As String Dim textenglish url As StringAs String Dim textspanish response As As String String Dim Set url uidoc As= String ws.currentdocument Dim textenglish response = Asuidoc.FieldGetText("InputText") String Set url uidoc = "https://texasswedenodered.mybluemix.net/translate" = ws.currentdocument textenglish url = url + = "?"from="+uidoc.document.getitemvalue("langfrom")(0)+"&to="+ uidoc.fieldgettext("inputtext") _ langfrom uidoc.document.getitemvalue("langto")(0)+"message=" = uidoc.document.getitemvalue("langfrom")(0) langto url = url = uidoc.document.getitemvalue("langto")(0) + Replace(textEnglish, " ", "+") url response = "https://texasswedenodered.mybluemix.net/translate" = http.gethttp(url) url textspanish = url + "?from="+langfrom+"&to="+langto+"&message=" = parsejson(response, "translated") url Call= uidoc.fieldsettext("outputtext", url + Replace(textEnglish, " ", "+") textspanish) response Call uidoc.refresh() = http.gethttp(url) End textspanish Sub = parsejson(response, "translated") Call uidoc.fieldsettext("outputtext", textspanish) Call uidoc.refresh() End Sub

Demo MWLUG 2017

Text-to-Speech Flow MWLUG 2017

Process Incoming Request // Set the payload for the next node to the text we want Watson to speak msg.payload = msg.payload.text; // Pass object to the next node (text-to-speech) return msg;

Modify Response // Set the payload for the response to the audio file // created and passed to us in msg.speech msg.payload = msg.speech; // Pass the updated object to the HTTP Response node return msg;

Call Node From Web HTML: <input type="text" id="text" placeholder="enter text here"> <button id="btnspeak" class="btn btn-primary"><i class="fa fa-volume-up"></i>play</button> <div id="iframehost"></div> jquery: $("#btnspeak").on("click", function(e) { e.preventdefault(); // Remove any existing iframe $("#iframehost").html(""); // Set the location of Node-RED flow to use var baseurl = "https://texasswedenodered.mybluemix.net/speak"; // Get text to convert to speech var text = $("#text").val(); // Calculate the URL of speech file to insert into iframe var url = baseurl+"?text=" + text; // Create iframe element in memory var iframe = $('<iframe id="audioframe" src="'+url+'" frameborder="1" width="10px" height="10px" style="display:none;"></iframe>'); // Insert iframe element into div on page $("#iframehost").append(iframe); });

Demo MWLUG 2017

Bonus Demo MWLUG 2017

Conclusion BlueMix Easy to setup Convenient to use Pay-as-you-go Node-RED Click-and-drag of nodes Javascript to manipulate Integration in web pages and Notes client

Questions? MWLUG 2017

Thank You Karl-Henry Martinsson karl-henry@demandbettersolutions.com @texasswede @texasswede http://www.demandbettersolutions.com http://www.texasswede.com http://blog.texasswede.com