domino to go introduction

7
YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0 Lotusphere 2012 YouAtNotes Domino To Go: native iOS Apps for Domino made easy

Upload: julianbuss

Post on 26-Jan-2017

10.023 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

YouAtNotes Domino To Go:native iOS Apps for Domino

made easy

Page 2: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

„Make an App for this Notes database!“

• Web-App with XPages tricky for bigger Apps, no offline, users will complain about slow App because of network

• Native Appfast, good look & feel, all possibilities, works offline huge learning curve for Objective-C and Apple‘s XCode development environmenthow to get data from and to Notes?

• Native App with YouAtNotes Domino To Gofast, good look & feel, all possibilities, works offlineeasy to learn (works with JavaScript), fast resultsinstant access to Notes data, offline ready

These are your options:

Page 3: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

Web-App

• Device needs network.Always.

• Network has to be fast. Or users will complain.

• Slower than native Apps.• Dev need to learn different programming

model than normal XPages applications. • Not all device features usable (camera,

microphone, gestures...)• No distribution over Appstore.• More load on Domino server. • If Domino server is not available, App

does not work anymore.

• XPages are familiar to most devs.• Ready-to-use controls on OpenNTF.• Easy access to Domino data. • Distribution via web.

• Works everywhere. Online and offline.• Doesn‘t care about network quality.• Native App. Fast and all device

features usable. • Only minor load increase on Domino.• If Domino is available or not, the App

always works.• Easy access to Domino data. • Distribution in house or via Appstore. • End-user Apps can make money

through the Appstore.• Familiar to XPages devs (JavaScript). • Rich API to get things done fast.

• Other development environment (Titanium instead of Domino Designer, but both Eclipse based).

Domino To Go App

Page 4: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

Four things to get started.

A Mac.(can‘t do iOS development on Windows, sorry)

Apple‘s iOS SDK (free)

Titanium development environment (free).

YouAtNotes Domino To Go.

Page 5: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

With or without Domino To Gotry {

if(!Ti.Network.online) {// no networknotesSession.log("ynReadView: no network.");return;}self.updateInProgress = true;var xhr = ynHTTP.getClient();if (!xhr) { self.updateInProgress = false; if(failmessage) failmessage = failmessage.replace(/%s/, ynL("view_3")); notesSession.alert(( failmessage ? failmessage : "Cannot read view: " + parent.viewname + " (error: " + ynL("view_3") + ")"), "", silent); if(callback) callback(false, null); return;} var parent = self; var updateTime = new Date(); updateTime = updateTime.getTime(); xhr.onload = function() { try { // notesSession.log("ynreadview 1 for " + parent.viewname); if(!this.responseText || this.responseText.substr(0, 1) != "{") { // no JSON data, most probably authentification failure notesSession.log("NotesView.ynReadView: no JSON data, first chars of data: " + this.responseText.substr(0, 200)); if(!silent) { if(failmessage) failmessage = failmessage.replace(/%s/, ynL("view_1", parent.viewname)); notesSession.alert((failmessage ? failmessage : ynL("view_1", parent.viewname))); } if(callback) callback(false); return; } var columnTitles = null; if(parent.notesdb.useDominoCommands) { var data = this.responseText; if(notesSession.DEBUG) YN.log("useDominoCommands=true"); data = JSON.parse(data); var entry = data.viewentry[0]; // get columns columnTitles = []; var s = ""; for(var i = 0; i < entry.entrydata.length; i++) { columnTitles.push(entry.entrydata[i]["@name"].replace(/\$/, '_')); } } else { var xhrData = this.responseText.split("\n"); if(!xhrData) { notesSession.log("NotesView.ynReadView: cannot split JSON data: " + this.responseText.substr(0, 100)); if(!silent) notesSession.alert(ynL("view_1", parent.viewname)); return; } // first element of data array contains errorcode or information about the view var data = JSON.parse(xhrData[0]); if(data.returncode == "error") { notesSession.log("NotesView.ynReadView: xhr error: " + data.returnmsg); notesSession.alert("Problem reading data: " + data.returnmsg); return; } columnTitles = data.columnnames; if(notesSession.DEBUG) notesSession.log("NotesView: readView for: " + parent.viewname + " items returned: " + (xhrData.length - 1)); } var db = new YNDatabase(parent.notesdb.localdbname); var dbRows = null; var sql = ""; var v = null; // create table if not exist var columns = []; columns.push({ name : 'id', type : 'VARCHAR(16)'}); for(var j = 0; j < columnTitles.length; j++) { columnTitles[j] = columnTitles[j].replace(/\$/g, '_');// if(columnTitles[j].indexOf("$") >= 0) {// notesSession.alert("View " + parent.viewname + " contains column name with $, which is not allowed. Check the programatic name of your columns, please.");// return;// } columns.push({ name : columnTitles[j], type : 'TEXT COLLATE NOCASE' }); } db.createTable(parent.dbtablename, columns); if(notesSession.DEBUG) YN.log("ynReadview before loop, items.length=" + (parent.notesdb.useDominoCommands ? data.viewentry.length - 1 : xhrData.length - 1)); if(parent.notesdb.useDominoCommands) {

var db = new NotesDatabase(App.baseURL, "contacts");var view = db.getView("People");view.update();

Without

With Domino To Go

Page 6: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

Demo: Contacts App for a Personal Notes Address Book

• From zero to a working App in 10 minutes. • App reads the People view of a Notes address book and displays name and mail

addresses of contacts in a table view. • Tap on a contact shows more details. • App includes a basic „about“ page. • Actual code to get data out of Notes takes < 10 lines.

See the video at youatnotes.com/dtgvideo

Page 7: Domino To Go Introduction

YouAtNotes, www.youatnotes.com, +49-40 - 840 557 0

Lotusphere 2012

More about Domino To Go.

See youatnotes.com/dominotogo

Watch Julian‘s Blog at julianbuss.net

Drop a note at [email protected]