SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
BUILDING AN AJAX
INTERFACE WITH ZF
By Wil Sinclair, Zend Framework Development Manager
   Matthew Weier O’Phinney, Zend Framework Software Architect




                                                Copyright © 2007, Zend Technologies Inc.
We’ll be covering. . .

  • The nature of the Zend Framework and Dojo
    Toolkit collaboration
  • How- and where- to build integration points in to
    ZF for any JavaScript toolkit
  • How to use these integration points to make
    building your next AJAX user interface easier




                                           Name of this section | 19-Jun-08 | 2
Zend and Dojo

  • Partnering to deliver the best out-of-box AJAX
    experience available in any server-side framework
  • Non-exclusive partnership
  • While Dojo was the right choice for Zend to partner
    with, it may not be the right choice for you
      Different JavaScript toolkits have different strength and
       weaknesses
      Both JavaScript toolkits and the requirements of applications
       that use them are complex; may be best to go with what you
       know
      It may not be your choice!



                                                      Name of this section | 19-Jun-08 | 3
Zend and ?

  • Zend Framework has been built with extensibility
    in mind; this come in handy when integrating with
    other web application technologies, including
    JavaScript toolkits
  • Zend Framework developers have already written
    applications using several popular JavaScript
    toolkits
        Prototype/Scriptaculous
        YUI
        jQuery
        ?


                                          Name of this section | 19-Jun-08 | 4
Integration Points in ZF

  • Protocol support (eg, JSON-RPC)
  • View Helper for setting up the client-side
      environment
  •   Components for library-specific data envelopes
      (e.g., dojo.data, YUI DataSource)‫‏‬
  •   AJAX-enabled Form Elements




                                            Name of this section | 19-Jun-08 | 5
Protocol Support

  • RPC protocols in JavaScript toolkits make client
    creation easier, Zend Framework can make server
    creation easier
  • For‫‏‬Zend‫‏‬Framework‫‏6.1‏‬we’ll‫‏‬be‫‏‬implementing‫‏‬a‫‏‬
    JSON-RPC server
  • Other possibilities include JSONP-RPC, Bayeux
    Protocol, etc. servers




                                          Name of this section | 19-Jun-08 | 6
View Helper for Setting Up Client-Side Env

  • Not as simple as it sounds
  • Different libraries and stylesheets must be
      included, download location may be need to be
      specified, themes may need to be specified, etc.
  •   Much of this is done to optimize page load times
  •   Many options that are set for the entire page may
      be set here, such as specifying a theme




                                            Name of this section | 19-Jun-08 | 7
Components for Data Envelopes

  • Each library typically has its own data envelope
  • Examples include dojo.data and YUI DataSource,
      but hardly end there
  •   ZF can make dealing with these different kinds of
      data envelopes simpler by providing an interface
      to package data payloads using these library-
      specific data envelopes
  •   One interface to rule them all?




                                            Name of this section | 19-Jun-08 | 8
AJAX-enabled Form Elements

 • Common AJAX-enabled form elements include
     those with auto-completion and immediate
     validation
 •   Widgets from the JS toolkits should be easy to use
     with Zend_Form
 •   In some cases existing form elements may simply
     be decorated with AJAX functionality
 •   New form elements can be created to specifically
     model behavior made possible by AJAX/DHTML
 •   There is literally no end to the possibilities here


                                           Name of this section | 19-Jun-08 | 9
PROTOCOL SUPPORT:
JSON-RPC


“
    JSON-RPC is a lightweight
    RPC utilizing JSON for its
    message payloads.




                                 Name of this section | 19-Jun-08 | 10
Why JSON-RPC?

 • Lightweight protocol
 • Seamless mapping of remote methods to local
     javascript objects‫‏‬
 •   Easy handling of results and errors




                                                                  | Jun 17,
                                           Name of this section          | 11
                                                                      2008
JSON-RPC Server in ZF
Returning a Service Mapping Description

  • Service Mapping Description tells JSON-RPC client
    what methods and arguments are available
Handling the request

  • JSON-RPC server follows the SoapServer API;
    handle() will create its request and response by
    default and emit it – though this behavior is
    configurable.
SETTING UP THE
JAVASCRIPT
ENVIRONMENT


“
    Setting things up is half
    the battle when
    integrating Javascript in
    your applications.




                                Name of this section | 19-Jun-08 | 15
Without view helpers

  • Without view helpers, setting up your javascript
    includes can be painful:
With view helpers

  • Creating view helpers makes things easier:
Data Envelopes
    A good Javascript toolkit
    has data abstraction;
    supporting this on the
    server side allows easy
    integration.




                                                       | Jun 17,
                                Name of this section          | 18
                                                           2008
DATA ENVELOPES


“
    A good JavaScript toolkit
    has data abstraction;
    supporting this on the
    server side allows easy
    integration.




                                Name of this section | 19-Jun-08 | 19
What do data envelopes do?

  • Abstracts data result sets
  • Provides standard accessors to data
  • Allows switching data stores on the server
    seamlessly
Use cases for data envelopes

  • Grid components
  • Filtering selects (utilizing id/label pairs)‫‏‬
  • Trees
Potential data envelope interface
AJAX-ENABLED
FORM ELEMENTS


“
    Automate creation of
    AJAX form widgets




                           Name of this section | 19-Jun-08 | 23
How?

 • Create targetted Zend_Form_Element
   implementations for your Javascript toolkit
 • Have the decorators call on the view helpers for
   your Javascript toolkit, thus setting up the
   Javascript environment
 • Benefit from a better UI
Potential elements

  •   Date/Time selectors
  •   Autocompleting combo and select boxes
  •   Currency input
  •   Range sliders
  •   Color selectors
  •   Dialogs and tooltips
  •   Grids
  •   Layout elements (tabs, panes, etc) (used for sub
      forms, display groups, etc.)‫‏‬
Form examples
AJAX-ENABLING
ZF MVC APPLICATIONS


“
    Putting it all together




                              Name of this section | 19-Jun-08 | 27
How?

 •   Use Zend_Form
 •   Use Autocomplete action helpers
 •   Use AjaxContext action helper
 •   Create actions that handle JSON-RPC requests
Adding JSON-RPC functionality

  • All GET requests return SMD descriptions
  • All POST requests are handled as JSON-RPC
Setup the JSON-RPC server
Create a JSON-RPC action
Setting up an AutoComplete element
An AutoComplete action
Let’s look at an example. . .




                                Name of this section | 19-Jun-08 | 34

Mais conteúdo relacionado

Mais procurados

2010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v22010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v2alvaro alcocer sotil
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersNiko Neugebauer
 
The power of datomic
The power of datomicThe power of datomic
The power of datomicKonrad Szydlo
 
Session 35 - Design Patterns
Session 35 - Design PatternsSession 35 - Design Patterns
Session 35 - Design PatternsPawanMM
 
Whats new in Columnstore Indexes for SQL Server 2017
Whats new in Columnstore Indexes for SQL Server 2017Whats new in Columnstore Indexes for SQL Server 2017
Whats new in Columnstore Indexes for SQL Server 2017Niko Neugebauer
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationWebStackAcademy
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBApaichon Punopas
 
Deawsj 7 ppt-1_b
Deawsj 7 ppt-1_bDeawsj 7 ppt-1_b
Deawsj 7 ppt-1_bNiit Care
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Niko Neugebauer
 
GateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web AppsGateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web AppsWesley Hales
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayWesley Hales
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewBrett Meyer
 
RESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services FrameworkRESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services Frameworkgoodfriday
 
Session 34 - JDBC Best Practices, Introduction to Design Patterns
Session 34 - JDBC Best Practices, Introduction to Design PatternsSession 34 - JDBC Best Practices, Introduction to Design Patterns
Session 34 - JDBC Best Practices, Introduction to Design PatternsPawanMM
 
OSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - EnterpriseOSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - Enterprisemfrancis
 
Java Web services
Java Web servicesJava Web services
Java Web servicesSujit Kumar
 
Overhauling a database engine in 2 months
Overhauling a database engine in 2 monthsOverhauling a database engine in 2 months
Overhauling a database engine in 2 monthsMax Neunhöffer
 
JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...
JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...
JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...JBossArchitectForum
 

Mais procurados (20)

2010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v22010 05-21, object-relational mapping using hibernate v2
2010 05-21, object-relational mapping using hibernate v2
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
 
The power of datomic
The power of datomicThe power of datomic
The power of datomic
 
Session 35 - Design Patterns
Session 35 - Design PatternsSession 35 - Design Patterns
Session 35 - Design Patterns
 
Whats new in Columnstore Indexes for SQL Server 2017
Whats new in Columnstore Indexes for SQL Server 2017Whats new in Columnstore Indexes for SQL Server 2017
Whats new in Columnstore Indexes for SQL Server 2017
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDB
 
Deawsj 7 ppt-1_b
Deawsj 7 ppt-1_bDeawsj 7 ppt-1_b
Deawsj 7 ppt-1_b
 
Hibernate
HibernateHibernate
Hibernate
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016
 
GateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web AppsGateIn - The Solution for Managing and Building Enterprise Web Apps
GateIn - The Solution for Managing and Building Enterprise Web Apps
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
RESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services FrameworkRESTful Data Services with the ADO.NET Data Services Framework
RESTful Data Services with the ADO.NET Data Services Framework
 
Session 34 - JDBC Best Practices, Introduction to Design Patterns
Session 34 - JDBC Best Practices, Introduction to Design PatternsSession 34 - JDBC Best Practices, Introduction to Design Patterns
Session 34 - JDBC Best Practices, Introduction to Design Patterns
 
OSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - EnterpriseOSGi Working Group Technical Progress Report 2007 - Enterprise
OSGi Working Group Technical Progress Report 2007 - Enterprise
 
Java Web services
Java Web servicesJava Web services
Java Web services
 
Overhauling a database engine in 2 months
Overhauling a database engine in 2 monthsOverhauling a database engine in 2 months
Overhauling a database engine in 2 months
 
JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...
JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...
JBoss Architect Meetup - December 2013 - JBoss Fuse in Vodafone’s Global Inte...
 
[2015/2016] Backbone JS
[2015/2016] Backbone JS[2015/2016] Backbone JS
[2015/2016] Backbone JS
 

Destaque

Documentaion
DocumentaionDocumentaion
Documentaionarshadka
 
Index July
Index JulyIndex July
Index Julyarshadka
 
The cruise industry a leader in europe’s economic recovery
The cruise industry a leader in europe’s economic recoveryThe cruise industry a leader in europe’s economic recovery
The cruise industry a leader in europe’s economic recoveryMarinet Ltd
 
Asia Days 2013 - China, rongsheng nor shipping presentation
Asia Days 2013 - China, rongsheng nor shipping presentationAsia Days 2013 - China, rongsheng nor shipping presentation
Asia Days 2013 - China, rongsheng nor shipping presentationInnovation Norway
 
SEA Europe: Overview of the world shipbuilding capacity situation
SEA Europe: Overview of the world shipbuilding capacity situationSEA Europe: Overview of the world shipbuilding capacity situation
SEA Europe: Overview of the world shipbuilding capacity situationinnovationoecd
 

Destaque (7)

Documentaion
DocumentaionDocumentaion
Documentaion
 
ssa
ssassa
ssa
 
Index July
Index JulyIndex July
Index July
 
s
ss
s
 
The cruise industry a leader in europe’s economic recovery
The cruise industry a leader in europe’s economic recoveryThe cruise industry a leader in europe’s economic recovery
The cruise industry a leader in europe’s economic recovery
 
Asia Days 2013 - China, rongsheng nor shipping presentation
Asia Days 2013 - China, rongsheng nor shipping presentationAsia Days 2013 - China, rongsheng nor shipping presentation
Asia Days 2013 - China, rongsheng nor shipping presentation
 
SEA Europe: Overview of the world shipbuilding capacity situation
SEA Europe: Overview of the world shipbuilding capacity situationSEA Europe: Overview of the world shipbuilding capacity situation
SEA Europe: Overview of the world shipbuilding capacity situation
 

Semelhante a Ajax Zf

Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2
Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2
Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2Richard Esplin
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsAndrew Ferrier
 
Dojo and Zend Framework
Dojo and Zend  FrameworkDojo and Zend  Framework
Dojo and Zend FrameworkKuldeep Singh
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptxssuser35fdf2
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to strutsAnup72
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music storeADEEBANADEEM
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)Igor Talevski
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierMiroslav Resetar
 
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScriptEnhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScriptJeremy Grelle
 
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...Esri Nederland
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETAlan Hecht
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC frameworkMohit Gupta
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1asim78
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS Ganesh Kondal
 

Semelhante a Ajax Zf (20)

Java Spring
Java SpringJava Spring
Java Spring
 
Javascript frameworks
Javascript frameworksJavascript frameworks
Javascript frameworks
 
Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2
Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2
Alfresco Tech Talk Live (Episode 70): Customizing Alfresco Share 4.2
 
Building Real-World Dojo Web Applications
Building Real-World Dojo Web ApplicationsBuilding Real-World Dojo Web Applications
Building Real-World Dojo Web Applications
 
Servlet programming
Servlet programmingServlet programming
Servlet programming
 
Dojo and Zend Framework
Dojo and Zend  FrameworkDojo and Zend  Framework
Dojo and Zend Framework
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
 
Ppt for Online music store
Ppt for Online music storePpt for Online music store
Ppt for Online music store
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
 
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScriptEnhancing Spring MVC Web Applications Progressively with Spring JavaScript
Enhancing Spring MVC Web Applications Progressively with Spring JavaScript
 
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
Getting Started with the ArcGIS API for JavaScript, Esri, Julie Powell, Antoo...
 
Evolution of java script libraries
Evolution of java script librariesEvolution of java script libraries
Evolution of java script libraries
 
Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1Asp.Net 3 5 Part 1
Asp.Net 3 5 Part 1
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
NodeJS - Server Side JS
NodeJS - Server Side JS NodeJS - Server Side JS
NodeJS - Server Side JS
 
Spring
SpringSpring
Spring
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Ajax Zf

  • 1. BUILDING AN AJAX INTERFACE WITH ZF By Wil Sinclair, Zend Framework Development Manager Matthew Weier O’Phinney, Zend Framework Software Architect Copyright © 2007, Zend Technologies Inc.
  • 2. We’ll be covering. . . • The nature of the Zend Framework and Dojo Toolkit collaboration • How- and where- to build integration points in to ZF for any JavaScript toolkit • How to use these integration points to make building your next AJAX user interface easier Name of this section | 19-Jun-08 | 2
  • 3. Zend and Dojo • Partnering to deliver the best out-of-box AJAX experience available in any server-side framework • Non-exclusive partnership • While Dojo was the right choice for Zend to partner with, it may not be the right choice for you  Different JavaScript toolkits have different strength and weaknesses  Both JavaScript toolkits and the requirements of applications that use them are complex; may be best to go with what you know  It may not be your choice! Name of this section | 19-Jun-08 | 3
  • 4. Zend and ? • Zend Framework has been built with extensibility in mind; this come in handy when integrating with other web application technologies, including JavaScript toolkits • Zend Framework developers have already written applications using several popular JavaScript toolkits  Prototype/Scriptaculous  YUI  jQuery  ? Name of this section | 19-Jun-08 | 4
  • 5. Integration Points in ZF • Protocol support (eg, JSON-RPC) • View Helper for setting up the client-side environment • Components for library-specific data envelopes (e.g., dojo.data, YUI DataSource)‫‏‬ • AJAX-enabled Form Elements Name of this section | 19-Jun-08 | 5
  • 6. Protocol Support • RPC protocols in JavaScript toolkits make client creation easier, Zend Framework can make server creation easier • For‫‏‬Zend‫‏‬Framework‫‏6.1‏‬we’ll‫‏‬be‫‏‬implementing‫‏‬a‫‏‬ JSON-RPC server • Other possibilities include JSONP-RPC, Bayeux Protocol, etc. servers Name of this section | 19-Jun-08 | 6
  • 7. View Helper for Setting Up Client-Side Env • Not as simple as it sounds • Different libraries and stylesheets must be included, download location may be need to be specified, themes may need to be specified, etc. • Much of this is done to optimize page load times • Many options that are set for the entire page may be set here, such as specifying a theme Name of this section | 19-Jun-08 | 7
  • 8. Components for Data Envelopes • Each library typically has its own data envelope • Examples include dojo.data and YUI DataSource, but hardly end there • ZF can make dealing with these different kinds of data envelopes simpler by providing an interface to package data payloads using these library- specific data envelopes • One interface to rule them all? Name of this section | 19-Jun-08 | 8
  • 9. AJAX-enabled Form Elements • Common AJAX-enabled form elements include those with auto-completion and immediate validation • Widgets from the JS toolkits should be easy to use with Zend_Form • In some cases existing form elements may simply be decorated with AJAX functionality • New form elements can be created to specifically model behavior made possible by AJAX/DHTML • There is literally no end to the possibilities here Name of this section | 19-Jun-08 | 9
  • 10. PROTOCOL SUPPORT: JSON-RPC “ JSON-RPC is a lightweight RPC utilizing JSON for its message payloads. Name of this section | 19-Jun-08 | 10
  • 11. Why JSON-RPC? • Lightweight protocol • Seamless mapping of remote methods to local javascript objects‫‏‬ • Easy handling of results and errors | Jun 17, Name of this section | 11 2008
  • 13. Returning a Service Mapping Description • Service Mapping Description tells JSON-RPC client what methods and arguments are available
  • 14. Handling the request • JSON-RPC server follows the SoapServer API; handle() will create its request and response by default and emit it – though this behavior is configurable.
  • 15. SETTING UP THE JAVASCRIPT ENVIRONMENT “ Setting things up is half the battle when integrating Javascript in your applications. Name of this section | 19-Jun-08 | 15
  • 16. Without view helpers • Without view helpers, setting up your javascript includes can be painful:
  • 17. With view helpers • Creating view helpers makes things easier:
  • 18. Data Envelopes A good Javascript toolkit has data abstraction; supporting this on the server side allows easy integration. | Jun 17, Name of this section | 18 2008
  • 19. DATA ENVELOPES “ A good JavaScript toolkit has data abstraction; supporting this on the server side allows easy integration. Name of this section | 19-Jun-08 | 19
  • 20. What do data envelopes do? • Abstracts data result sets • Provides standard accessors to data • Allows switching data stores on the server seamlessly
  • 21. Use cases for data envelopes • Grid components • Filtering selects (utilizing id/label pairs)‫‏‬ • Trees
  • 23. AJAX-ENABLED FORM ELEMENTS “ Automate creation of AJAX form widgets Name of this section | 19-Jun-08 | 23
  • 24. How? • Create targetted Zend_Form_Element implementations for your Javascript toolkit • Have the decorators call on the view helpers for your Javascript toolkit, thus setting up the Javascript environment • Benefit from a better UI
  • 25. Potential elements • Date/Time selectors • Autocompleting combo and select boxes • Currency input • Range sliders • Color selectors • Dialogs and tooltips • Grids • Layout elements (tabs, panes, etc) (used for sub forms, display groups, etc.)‫‏‬
  • 27. AJAX-ENABLING ZF MVC APPLICATIONS “ Putting it all together Name of this section | 19-Jun-08 | 27
  • 28. How? • Use Zend_Form • Use Autocomplete action helpers • Use AjaxContext action helper • Create actions that handle JSON-RPC requests
  • 29. Adding JSON-RPC functionality • All GET requests return SMD descriptions • All POST requests are handled as JSON-RPC
  • 32. Setting up an AutoComplete element
  • 34. Let’s look at an example. . . Name of this section | 19-Jun-08 | 34