SlideShare a Scribd company logo
Sencha Touch 2 and Sencha.io
how to use cloud services in your app


Nils Dehl, Senior Developer (@nilsdehl)
Nils Dehl


 Senior Developer
 Trainer
 Meetup Frankfurt
 Conference Talks
 Sencha Forum: mrsunshine
 Conference Photographer
flickr.co
         m/photo
                s/nils-de
                            hl
dkd Internet Service GmbH


 owner-managed full-service internet agency
 Frankfurt Germany
 development, communication & design
 specialized in TYPO3
   Ruby on Rails
   Sencha Touch / ExtJS
 42 employees
 + 350 projects
Customer-Portfolio
Sencha Touch 2
Sencha.io
Sencha.io
Services
Login
Data
Messaging
Deployment
Src
Login


 Sencha.io
 Sencha Forum
 Facebook
 Twitter
Data


 sync local data in the cloud
 access from multi devices
 offline handling
Messaging


 send messages
 receive messages
 one to one
 one to many
Deployment


 version management
 management tools
 usergroup management
 app delivery through the Sencha app repository
 myapp.senchafy.com
Src


 src.sencha.io
 resize images
   altering sizes
   percentage sizing
 data URLs
 domain sharding
Demo App
How to use Sencha.io
Sencha.io
settings
How to implement the
Sencha.io in your app

x
Setup
Load Sencha.io in app.js

  Ext.Loader.setPath({
  'Ext': 'sdk/src',
  ...
  'Ext.io': 'libs/sencha-io-0.1.0/src/io',
  'Ext.cf': 'libs/sencha-io-0.1.0/src/cf',
    ...
});
Ext.application({
    requires: [
       'Ext.io.Io',
       'Ext.io.data.Proxy',
    ],
Init / Setup

ioSetup: function() {
     // Calling this method is optional. It assumes the defaults if not called.
     Ext.io.Io.setup({
          // app id string configured on http://developer.sencha.io/apps
          appId: this.getIoAppId(),
          // the server URL. Defaults to http://msg.sencha.io
          url: 'http://msg.sencha.io',
          // logging level. Should be one of "none", "debug",
           // "info", "warn" or "error". Defaults to "error".
          logLevel: 'error',
          // the transport type to use for communicating with the server.
           // Should be one of "polling" (HTTP polling) or "socket"
           // (SocketIO). Defaults to "polling".
          transportName: 'socket'
     });
},
ioInit: function() {
     Ext.io.Io.init();
},
Login
Get app .io usergroup

/**
 * get the app usergroup object from the server
 */
ioGetGroup: function() {
     Ext.io.Io.getGroup({
          id: this.getIoGroupId(),
          success: this.ioSetGroup,
          failure: function() {
               console.log("PHODO IO get group failure");
          },
          scope: this
     });
},
/**
 * set the io group object reference in auth module
 */
ioSetGroup: function(group, options) {
     this.setIoGroup(group);
},
Login / Authenticate

doLogin: function() {
    var formValues = this.getLoginView().getValues();

     // the io usergroup object contains the authenticate method
     this.getIoGroup().authenticate({
          params: {
               username: formValues.username ? formValues.username : '',
               password: formValues.password ? formValues.password : ''
          },
          callback: function(opts, isAuth, user) {
               if (isAuth) {
                     this.setIoUser(user);
                     this.loginSuccess();
               } else {
                     this.loginFailure('Login Failure');
               }
          },
          scope: this
     });
},
Share data between
user devices
Use proxy type syncstorage in the
model
Ext.define('Photos.model.Photo', {
     extend: 'Ext.data.Model',
     config: {
         fields: [
               {
                   name: 'title'
               },
               ...
         ],

          proxy: {
              type: 'syncstorage',
              id: 'photos'
          }
      }
});
Add to store and sync

addPhoto: function(button) {
    var form = button.up('formpanel'),
         values = form.getValues(),
         store = Ext.getStore('photos');
    store.add(values);
    store.sync();
    // send message to all devices of the user to sync stores there as well
    Ext.io.Io.getCurrentUser({
         callback: function(cb, isAuth, user) {
            if (isAuth) {
                    user.send({
                          message: {
                               event: 'photo-added'
                          },
                          callback: function() {}
                    });
                }
         }
    });
},
Listen on user messages

addUserMessageReceiver: function() {
   Ext.io.Io.getCurrentUser({
        callback: function(cb, isAuth, user) {
             if (!isAuth) {
                    console.log("no user, we need to auth.", user);
                    this.redirectTo('login');

               } else {
                     // Listen on user messages
                    user.receive({
                           callback: this.onUserReceivedMessage,
                           scope: this
                    });
               }
           },
           scope: this
     });
},
Listen on user messages

onUserReceivedMessage: function(cb, bool, sender, message) {
   var store = null,
        view = this.getDataView();

    if (message.event === 'photo-added') {
         store = Ext.getStore('photos') ;
         store.load();
         store.sort();
         store.sync();
    }
}
Share between users
of usergroup
publish to message queue

shareInTheCloud: function(data, user) {
     Ext.io.Io.getQueue({
          params: {
               name: 'share'
          },
          callback: function(options, success, queue) {
               queue.publish({
                    message: {
                         event: 'share',
                         content: data,
                         fromMailHash: Ext.cf.util.Md5.hash(user.data.email)
                    },
                    callback: function() {},
                    scope: this
               });
          }
    });
},
Subscribe to message queue

onLoginStatusChanged: function(status) {
    if (status) {
          Ext.io.Io.getQueue({
               params: {
                    name: 'share'
               },
               callback: function(options, success, queue) {
                    queue.subscribe({
                         callback: this.onUserReceivedMessage,
                         scope: this
                    });
               },
               scope: this
          });
    }
},
handle received data

onUserReceivedMessage: function(cb, bool, sender, message) {
   var store = Ext.getStore('shareditems'),
       record = {
             from: message.fromMailHash,
             imageurl: message.content.url,
             date: Ext.Date.format(new Date(), 'U')
        };
        store.add(record);
        store.sort();
        store.sync();
},
Manipulate images
with Src
Sencha.io Src

Ext.define('Photos.view.Photo', {
    extend: 'Ext.Container',
    xtype: 'photodetail',
    config: {
        cls: 'bg photodetail',
        scrollable: true,
        styleHtmlContent: true,

          tpl: '<div class="image">' +
                 '<img src="http://src.sencha.io/280/{url}" />' +
               '</div>'
      }
});
dkd
     development
     kommunikation
     design




thank you.
???
@nilsdehl


flickr.com/photos/nils-dehl/

More Related Content

What's hot

RIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSRIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JS
Dominik Jungowski
 
Data binding в массы! (1.2)
Data binding в массы! (1.2)Data binding в массы! (1.2)
Data binding в массы! (1.2)
Yurii Kotov
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-entechbed
 
Anton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightAnton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 light
Michael Pustovit
 
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84
Mahmoud Samir Fayed
 
Capability Driven Design - Andrzej Jóźwiak - TomTom Dev Day 2021
Capability Driven Design - Andrzej Jóźwiak  - TomTom Dev Day 2021Capability Driven Design - Andrzej Jóźwiak  - TomTom Dev Day 2021
Capability Driven Design - Andrzej Jóźwiak - TomTom Dev Day 2021
Andrzej Jóźwiak
 
jQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journeyjQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journey
Huiyi Yan
 
Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)
Howard Lewis Ship
 
앱스프레소를 이용한 모바일 앱 개발(2)
앱스프레소를 이용한 모바일 앱 개발(2)앱스프레소를 이용한 모바일 앱 개발(2)
앱스프레소를 이용한 모바일 앱 개발(2)
mosaicnet
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
smontanari
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189
Mahmoud Samir Fayed
 
Design patterns
Design patternsDesign patterns
Design patterns
Ba Tran
 
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Howard Lewis Ship
 

What's hot (20)

RIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSRIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JS
 
Data binding в массы! (1.2)
Data binding в массы! (1.2)Data binding в массы! (1.2)
Data binding в массы! (1.2)
 
First java-server-faces-tutorial-en
First java-server-faces-tutorial-enFirst java-server-faces-tutorial-en
First java-server-faces-tutorial-en
 
Anton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 lightAnton Minashkin Dagger 2 light
Anton Minashkin Dagger 2 light
 
Bacbkone js
Bacbkone jsBacbkone js
Bacbkone js
 
The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84The Ring programming language version 1.2 book - Part 32 of 84
The Ring programming language version 1.2 book - Part 32 of 84
 
Capability Driven Design - Andrzej Jóźwiak - TomTom Dev Day 2021
Capability Driven Design - Andrzej Jóźwiak  - TomTom Dev Day 2021Capability Driven Design - Andrzej Jóźwiak  - TomTom Dev Day 2021
Capability Driven Design - Andrzej Jóźwiak - TomTom Dev Day 2021
 
jQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journeyjQuery Data Manipulate API - A source code dissecting journey
jQuery Data Manipulate API - A source code dissecting journey
 
iBATIS
iBATISiBATIS
iBATIS
 
Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)Clojure: Functional Concurrency for the JVM (presented at OSCON)
Clojure: Functional Concurrency for the JVM (presented at OSCON)
 
앱스프레소를 이용한 모바일 앱 개발(2)
앱스프레소를 이용한 모바일 앱 개발(2)앱스프레소를 이용한 모바일 앱 개발(2)
앱스프레소를 이용한 모바일 앱 개발(2)
 
Single page webapps & javascript-testing
Single page webapps & javascript-testingSingle page webapps & javascript-testing
Single page webapps & javascript-testing
 
Metaworks3
Metaworks3Metaworks3
Metaworks3
 
The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189The Ring programming language version 1.6 book - Part 46 of 189
The Ring programming language version 1.6 book - Part 46 of 189
 
Separation of concerns - DPC12
Separation of concerns - DPC12Separation of concerns - DPC12
Separation of concerns - DPC12
 
Banquet 52
Banquet 52Banquet 52
Banquet 52
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
Design patterns
Design patternsDesign patterns
Design patterns
 
Pengenalan blaast platform sdk
Pengenalan blaast platform sdkPengenalan blaast platform sdk
Pengenalan blaast platform sdk
 
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
Clojure: Functional Concurrency for the JVM (presented at Open Source Bridge)
 

Viewers also liked

Sencha Touch meets TYPO3 CMS
Sencha Touch meets TYPO3 CMSSencha Touch meets TYPO3 CMS
Sencha Touch meets TYPO3 CMS
Nils Dehl
 
HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.
Stephen Woods
 
Beautiful Documentation with YUI Doc
Beautiful Documentation with YUI DocBeautiful Documentation with YUI Doc
Beautiful Documentation with YUI Doc
Stephen Woods
 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generator
Peter Darwin
 
Eight Steps to an Effective Vulnerability Assessment
Eight Steps to an Effective Vulnerability AssessmentEight Steps to an Effective Vulnerability Assessment
Eight Steps to an Effective Vulnerability Assessment
Sirius
 
Best Practices: Project Documentation and Construction Management
Best Practices: Project Documentation and Construction ManagementBest Practices: Project Documentation and Construction Management
Best Practices: Project Documentation and Construction Management
Smith Cashion & Orr PLC
 
Good Documentation Practice
Good Documentation PracticeGood Documentation Practice
Good Documentation Practice
cr7clark
 

Viewers also liked (7)

Sencha Touch meets TYPO3 CMS
Sencha Touch meets TYPO3 CMSSencha Touch meets TYPO3 CMS
Sencha Touch meets TYPO3 CMS
 
HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.HTML5 Touch Interfaces: SXSW extended version.
HTML5 Touch Interfaces: SXSW extended version.
 
Beautiful Documentation with YUI Doc
Beautiful Documentation with YUI DocBeautiful Documentation with YUI Doc
Beautiful Documentation with YUI Doc
 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generator
 
Eight Steps to an Effective Vulnerability Assessment
Eight Steps to an Effective Vulnerability AssessmentEight Steps to an Effective Vulnerability Assessment
Eight Steps to an Effective Vulnerability Assessment
 
Best Practices: Project Documentation and Construction Management
Best Practices: Project Documentation and Construction ManagementBest Practices: Project Documentation and Construction Management
Best Practices: Project Documentation and Construction Management
 
Good Documentation Practice
Good Documentation PracticeGood Documentation Practice
Good Documentation Practice
 

Similar to SenchaTouch 2 and Sencha.io

Aprimorando sua Aplicação com Ext JS 4 - BrazilJS
Aprimorando sua Aplicação com Ext JS 4 - BrazilJSAprimorando sua Aplicação com Ext JS 4 - BrazilJS
Aprimorando sua Aplicação com Ext JS 4 - BrazilJS
Loiane Groner
 
NodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdf
ArthyR3
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datosphilogb
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSphilogb
 
node.js practical guide to serverside javascript
node.js practical guide to serverside javascriptnode.js practical guide to serverside javascript
node.js practical guide to serverside javascriptEldar Djafarov
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
Ignacio Coloma
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
Bruno Scopelliti
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02
Charles Ferentchak
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 
Express JS
Express JSExpress JS
Express JS
Alok Guha
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of usOSCON Byrum
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
Creating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdfCreating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdf
ShaiAlmog1
 
Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots
DeepAnshu Sharma
 
Dpilot - Source Code with Snapshots
Dpilot - Source Code with SnapshotsDpilot - Source Code with Snapshots
Dpilot - Source Code with Snapshots
Kritika Phulli
 
Source Code for Dpilot
Source Code for Dpilot Source Code for Dpilot
Source Code for Dpilot
Nidhi Chauhan
 
服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScriptQiangning Hong
 
Sencha Touch - Introduction
Sencha Touch - IntroductionSencha Touch - Introduction
Sencha Touch - Introduction
ABC-GROEP.BE
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependências
Marcelo Aymone
 

Similar to SenchaTouch 2 and Sencha.io (20)

Aprimorando sua Aplicação com Ext JS 4 - BrazilJS
Aprimorando sua Aplicação com Ext JS 4 - BrazilJSAprimorando sua Aplicação com Ext JS 4 - BrazilJS
Aprimorando sua Aplicação com Ext JS 4 - BrazilJS
 
NodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdf
 
JavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de DatosJavaScript para Graficos y Visualizacion de Datos
JavaScript para Graficos y Visualizacion de Datos
 
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJSJavaScript para Graficos y Visualizacion de Datos - BogotaJS
JavaScript para Graficos y Visualizacion de Datos - BogotaJS
 
node.js practical guide to serverside javascript
node.js practical guide to serverside javascriptnode.js practical guide to serverside javascript
node.js practical guide to serverside javascript
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02
 
ExtJS framework
ExtJS frameworkExtJS framework
ExtJS framework
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 
Express JS
Express JSExpress JS
Express JS
 
Big Data for each one of us
Big Data for each one of usBig Data for each one of us
Big Data for each one of us
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
Creating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdfCreating an Uber Clone - Part XXXX.pdf
Creating an Uber Clone - Part XXXX.pdf
 
Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots Dpilot Source Code With ScreenShots
Dpilot Source Code With ScreenShots
 
Dpilot - Source Code with Snapshots
Dpilot - Source Code with SnapshotsDpilot - Source Code with Snapshots
Dpilot - Source Code with Snapshots
 
Source Code for Dpilot
Source Code for Dpilot Source Code for Dpilot
Source Code for Dpilot
 
服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript服务框架: Thrift & PasteScript
服务框架: Thrift & PasteScript
 
Sencha Touch - Introduction
Sencha Touch - IntroductionSencha Touch - Introduction
Sencha Touch - Introduction
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependências
 

More from Nils Dehl

Dynamic package loading 
and routing with Ext JS
Dynamic package loading 
and routing with Ext JSDynamic package loading 
and routing with Ext JS
Dynamic package loading 
and routing with Ext JS
Nils Dehl
 
jsday.it - develop and test custom components for sencha touch by nils dehl
jsday.it - develop and test custom components for sencha touch by nils dehljsday.it - develop and test custom components for sencha touch by nils dehl
jsday.it - develop and test custom components for sencha touch by nils dehl
Nils Dehl
 
Sencha Touch meets TYPO3
Sencha Touch meets TYPO3Sencha Touch meets TYPO3
Sencha Touch meets TYPO3
Nils Dehl
 
Workshop getting started with sencha touch 2 - nils dehl
Workshop   getting started with sencha touch 2 - nils dehlWorkshop   getting started with sencha touch 2 - nils dehl
Workshop getting started with sencha touch 2 - nils dehl
Nils Dehl
 
SenchaCon 2011 VGF Showcase
SenchaCon 2011 VGF ShowcaseSenchaCon 2011 VGF Showcase
SenchaCon 2011 VGF Showcase
Nils Dehl
 
Development of the TYPO3 Phoenix User Interface with Ext JS
Development of the TYPO3 Phoenix User Interface with Ext JSDevelopment of the TYPO3 Phoenix User Interface with Ext JS
Development of the TYPO3 Phoenix User Interface with Ext JS
Nils Dehl
 

More from Nils Dehl (6)

Dynamic package loading 
and routing with Ext JS
Dynamic package loading 
and routing with Ext JSDynamic package loading 
and routing with Ext JS
Dynamic package loading 
and routing with Ext JS
 
jsday.it - develop and test custom components for sencha touch by nils dehl
jsday.it - develop and test custom components for sencha touch by nils dehljsday.it - develop and test custom components for sencha touch by nils dehl
jsday.it - develop and test custom components for sencha touch by nils dehl
 
Sencha Touch meets TYPO3
Sencha Touch meets TYPO3Sencha Touch meets TYPO3
Sencha Touch meets TYPO3
 
Workshop getting started with sencha touch 2 - nils dehl
Workshop   getting started with sencha touch 2 - nils dehlWorkshop   getting started with sencha touch 2 - nils dehl
Workshop getting started with sencha touch 2 - nils dehl
 
SenchaCon 2011 VGF Showcase
SenchaCon 2011 VGF ShowcaseSenchaCon 2011 VGF Showcase
SenchaCon 2011 VGF Showcase
 
Development of the TYPO3 Phoenix User Interface with Ext JS
Development of the TYPO3 Phoenix User Interface with Ext JSDevelopment of the TYPO3 Phoenix User Interface with Ext JS
Development of the TYPO3 Phoenix User Interface with Ext JS
 

Recently uploaded

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 

Recently uploaded (20)

LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 

SenchaTouch 2 and Sencha.io

  • 1. Sencha Touch 2 and Sencha.io how to use cloud services in your app Nils Dehl, Senior Developer (@nilsdehl)
  • 2. Nils Dehl Senior Developer Trainer Meetup Frankfurt Conference Talks Sencha Forum: mrsunshine Conference Photographer
  • 3. flickr.co m/photo s/nils-de hl
  • 4. dkd Internet Service GmbH owner-managed full-service internet agency Frankfurt Germany development, communication & design specialized in TYPO3 Ruby on Rails Sencha Touch / ExtJS 42 employees + 350 projects
  • 7.
  • 8.
  • 9.
  • 10.
  • 13. Login Sencha.io Sencha Forum Facebook Twitter
  • 14. Data sync local data in the cloud access from multi devices offline handling
  • 15. Messaging send messages receive messages one to one one to many
  • 16. Deployment version management management tools usergroup management app delivery through the Sencha app repository myapp.senchafy.com
  • 17. Src src.sencha.io resize images altering sizes percentage sizing data URLs domain sharding
  • 19.
  • 20. How to use Sencha.io
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. How to implement the Sencha.io in your app x
  • 27. Setup
  • 28. Load Sencha.io in app.js Ext.Loader.setPath({ 'Ext': 'sdk/src', ... 'Ext.io': 'libs/sencha-io-0.1.0/src/io', 'Ext.cf': 'libs/sencha-io-0.1.0/src/cf', ... }); Ext.application({ requires: [ 'Ext.io.Io', 'Ext.io.data.Proxy', ],
  • 29. Init / Setup ioSetup: function() { // Calling this method is optional. It assumes the defaults if not called. Ext.io.Io.setup({ // app id string configured on http://developer.sencha.io/apps appId: this.getIoAppId(), // the server URL. Defaults to http://msg.sencha.io url: 'http://msg.sencha.io', // logging level. Should be one of "none", "debug", // "info", "warn" or "error". Defaults to "error". logLevel: 'error', // the transport type to use for communicating with the server. // Should be one of "polling" (HTTP polling) or "socket" // (SocketIO). Defaults to "polling". transportName: 'socket' }); }, ioInit: function() { Ext.io.Io.init(); },
  • 30. Login
  • 31. Get app .io usergroup /** * get the app usergroup object from the server */ ioGetGroup: function() { Ext.io.Io.getGroup({ id: this.getIoGroupId(), success: this.ioSetGroup, failure: function() { console.log("PHODO IO get group failure"); }, scope: this }); }, /** * set the io group object reference in auth module */ ioSetGroup: function(group, options) { this.setIoGroup(group); },
  • 32.
  • 33. Login / Authenticate doLogin: function() { var formValues = this.getLoginView().getValues(); // the io usergroup object contains the authenticate method this.getIoGroup().authenticate({ params: { username: formValues.username ? formValues.username : '', password: formValues.password ? formValues.password : '' }, callback: function(opts, isAuth, user) { if (isAuth) { this.setIoUser(user); this.loginSuccess(); } else { this.loginFailure('Login Failure'); } }, scope: this }); },
  • 35.
  • 36. Use proxy type syncstorage in the model Ext.define('Photos.model.Photo', { extend: 'Ext.data.Model', config: { fields: [ { name: 'title' }, ... ], proxy: { type: 'syncstorage', id: 'photos' } } });
  • 37. Add to store and sync addPhoto: function(button) { var form = button.up('formpanel'), values = form.getValues(), store = Ext.getStore('photos'); store.add(values); store.sync(); // send message to all devices of the user to sync stores there as well Ext.io.Io.getCurrentUser({ callback: function(cb, isAuth, user) { if (isAuth) { user.send({ message: { event: 'photo-added' }, callback: function() {} }); } } }); },
  • 38. Listen on user messages addUserMessageReceiver: function() { Ext.io.Io.getCurrentUser({ callback: function(cb, isAuth, user) { if (!isAuth) { console.log("no user, we need to auth.", user); this.redirectTo('login'); } else { // Listen on user messages user.receive({ callback: this.onUserReceivedMessage, scope: this }); } }, scope: this }); },
  • 39. Listen on user messages onUserReceivedMessage: function(cb, bool, sender, message) { var store = null, view = this.getDataView(); if (message.event === 'photo-added') { store = Ext.getStore('photos') ; store.load(); store.sort(); store.sync(); } }
  • 41.
  • 42. publish to message queue shareInTheCloud: function(data, user) { Ext.io.Io.getQueue({ params: { name: 'share' }, callback: function(options, success, queue) { queue.publish({ message: { event: 'share', content: data, fromMailHash: Ext.cf.util.Md5.hash(user.data.email) }, callback: function() {}, scope: this }); } }); },
  • 43. Subscribe to message queue onLoginStatusChanged: function(status) { if (status) { Ext.io.Io.getQueue({ params: { name: 'share' }, callback: function(options, success, queue) { queue.subscribe({ callback: this.onUserReceivedMessage, scope: this }); }, scope: this }); } },
  • 44. handle received data onUserReceivedMessage: function(cb, bool, sender, message) { var store = Ext.getStore('shareditems'), record = { from: message.fromMailHash, imageurl: message.content.url, date: Ext.Date.format(new Date(), 'U') }; store.add(record); store.sort(); store.sync(); },
  • 46. Sencha.io Src Ext.define('Photos.view.Photo', { extend: 'Ext.Container', xtype: 'photodetail', config: { cls: 'bg photodetail', scrollable: true, styleHtmlContent: true, tpl: '<div class="image">' + '<img src="http://src.sencha.io/280/{url}" />' + '</div>' } });
  • 47. dkd development kommunikation design thank you.
  • 48. ???