SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
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/

Contenu connexe

Tendances

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
 

Tendances (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)
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus 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
 

Plus 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
 

Dernier

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 

Dernier (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 

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