SlideShare una empresa de Scribd logo
1 de 49
Descargar para leer sin conexión
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/

Más contenido relacionado

La actualidad más candente

RIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSRIA - Entwicklung mit Ext JS
RIA - Entwicklung mit Ext JSDominik 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 lightMichael 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 84Mahmoud 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 2021Andrzej 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 journeyHuiyi 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-testingsmontanari
 
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 189Mahmoud Samir Fayed
 
Design patterns
Design patternsDesign patterns
Design patternsBa 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
 

La actualidad más candente (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)
 

Destacado

Sencha Touch meets TYPO3 CMS
Sencha Touch meets TYPO3 CMSSencha Touch meets TYPO3 CMS
Sencha Touch meets TYPO3 CMSNils 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 DocStephen Woods
 
Dgeni documentation generator
Dgeni   documentation generatorDgeni   documentation generator
Dgeni documentation generatorPeter 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 AssessmentSirius
 
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 ManagementSmith Cashion & Orr PLC
 
Good Documentation Practice
Good Documentation PracticeGood Documentation Practice
Good Documentation Practicecr7clark
 

Destacado (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 a 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 - BrazilJSLoiane Groner
 
NodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdfNodeJS and ExpressJS.pdf
NodeJS and ExpressJS.pdfArthyR3
 
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
 
Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Extjsslides 091216224157-phpapp02
Extjsslides 091216224157-phpapp02Charles Ferentchak
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 
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.pdfShaiAlmog1
 
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 SnapshotsKritika 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 - IntroductionABC-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ênciasMarcelo Aymone
 

Similar a 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
 

Más de 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 JSNils 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 dehlNils Dehl
 
Sencha Touch meets TYPO3
Sencha Touch meets TYPO3Sencha Touch meets TYPO3
Sencha Touch meets TYPO3Nils 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 dehlNils Dehl
 
SenchaCon 2011 VGF Showcase
SenchaCon 2011 VGF ShowcaseSenchaCon 2011 VGF Showcase
SenchaCon 2011 VGF ShowcaseNils 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 JSNils Dehl
 

Más de 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
 

Último

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Último (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

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. ???