SlideShare a Scribd company logo
1 of 35
Bringing Data To Lifein the Browser Jenny Han Donnelly YUI Library
   Abstract data retrieval to support the mix-and-match of transports and formats
  101010101010101010101010101010 transport parse normalize
The DataSource is YUI's data retreival abstraction layer.
Data Transports Local Application data External sources
Data Formats Arrays Hashes Markup XML JSON JSONP Delimited text
Using YAHOO.util.DataSource The transport The response format The schema
DataSource provides a consistent, predictable API to the data.
DataSource subclasses LocalDataSource XHRDataSource ScriptNodeDataSource FunctionDataSource
DataSource responseType TYPE_JSARRAY  TYPE_JSON  TYPE_XML TYPE_TEXT  TYPE_HTMLTABLE
{"query":   {"count":"44", "created":"2009-09-10T01:08:04Z",       "lang": "en-US", "updated":"2009-09-10T01:08:04Z",   "results": {     "Result": [       {"id":"28787054",        "Title":"Jinmi Restaurant",        "Address":"1627 Hollenbeck Ave",        "City":"Sunnyvale", State:"CA",        "Latitude":"xyz", "Longitude":"abc",        "Rating":{"AverageRating":"4", "TotalRatings":"5"}        },       {"id":"21323987",        "Title":"Totoro",        "Address":"841 Villa St ",        "City":"Sunnyvale", State:"CA",        "Latitude":"xyz", "Longitude":"abc",        "Rating":{"AverageRating":"5", "TotalRatings":"9"}             },        ...      ]     }   } } {"results":    [   {"Title":"Jinmi Restaurant",    "City":"Sunnyvale",    "Phone":"(408) 481-0709",    "Rating":{"AverageRating":"4"}    },   {"Title":"Totoro",    "City":"Sunnyvale",    "Phone":"(408) 481-0709",    "Rating":{"AverageRating":"5"}         },    ...   ] }
var ds = new YAHOO.util.LocalDataSource(portfolio); ds.responseType = YAHOO.util.DataSource. 	TYPE_JSARRAY; ds.responseSchema = [   fields: ["company", "cost", "shares", "symbol", "value"] ];
DataSources easily interface with AutoCompletes, Charts, and DataTables.
var chart = new YAHOO.widget.Chart   ("chart", ds, {...}); var ac = new YAHOO.widget.AutoComplete("input", "suggestions", ds, {...}); var dt = new YAHOO.widget.DataTable("container", cols, ds, {...});
protocol The data transaction lifecycle datasource cache data widget requestEvent cacheRequestEvent cacheResponseEvent responseEvent doBeforeParseData doBeforeCallback responseEvent
Performance considerations Keep it local Or enable caching ds.maxCacheEntries = 100; Perform cacheable data transformations with doBeforeParseData() or doBeforeCallback() Keep request queries consistent
{"query":   {"count":"44", "created":"2009-09-10T01:08:04Z",       "lang": "en-US", "updated":"2009-09-10T01:08:04Z",   "results": {     "Result": [       {"id":"28787054",        "Title":"Jinmi Restaurant",        "Address":"1627 Hollenbeck Ave", ...        "Rating":{"AverageRating":"4", "TotalRatings":"5"}        },       {"id":"21323987",        "Title":"Totoro",        "Address":"841 Villa St ", ...        "Rating":{"AverageRating":"5", "TotalRatings":"9"}             },        ...      ]     }   } }
var myDS = new YAHOO.util.ScriptNodeDataSource("http://query.yahooapis.com/v1/public/yql?format=json"); myDS.responseType = YAHOO.util.DataSource.TYPE_JSON; myDS.responseSchema = {   resultsList:"query.results.Result",   fields: ["Title", "City", "Phone", "Rating.AverageRating"] };
var columns = [   {key:"Title"},   {key:"City"},   {key:"Phone"},   {key:"Rating.AverageRating"} ]; var myDT = new YAHOO.widget.DataTable("datatable", columns, myDS, {initialRequest: "&q=select * from local.search(0) where query='korean restaurant' and location='sunnyvale, ca'"});
<?xml version="1.0" encoding="UTF-8"?> <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="44" yahoo:created="2009-09-10T06:00:20Z" yahoo:lang="en-US" yahoo:updated="2009-09-10T06:00:20Z">     <results>         <Result xmlns="urn:yahoo:lcl" id="28787054">             <Title>Jinmi Restaurant</Title>             <Address>1627 Hollenbeck Ave</Address>             ...             <Rating>                 <AverageRating>4</AverageRating>                 <TotalRatings>5</TotalRatings>              </Rating>          </Result>         <Result xmlns="urn:yahoo:lcl" id="21323987">             <Title>Totoro</Title>             <Address>841 Villa St</Address>             ...             <Rating>                 <AverageRating>5</AverageRating>                 <TotalRatings>10</TotalRatings>              </Rating>         </Result>         ...     </results> </query>
var myDS = new YAHOO.util.ScriptNodeDataSource("http://query.yahooapis.com/v1/public/yql?format=xml"); myDS.responseType = YAHOO.util.DataSource.TYPE_XML; myDS.responseSchema = { resultNode:"Result",   fields: ["Title", "City", "Phone", "Rating.AverageRating"] };
{"results":    [   {"Title":"Jinmi Restaurant",    "City":"Sunnyvale",    "Phone":"(408) 481-0709",    "Rating":{"AverageRating":"4"}    },   {"Title":"Totoro",    "City":"Sunnyvale",    "Phone":"(408) 481-0709",    "Rating":{"AverageRating":"5"}         },    ...   ] }
Jinmi Restaurant|1627 Hollenbeck Ave|Sunnyvale|...      Totoro|841 Villa St|Mountain View|... ...
var myDS = new YAHOO.util.ScriptNodeDataSource("http://query.yahooapis.com/v1/public/yql?format=text"); myDS.responseType = YAHOO.util.DataSource.TYPE_TEXT; myDS.responseSchema = { recordDelim : "
",   fieldDelim : "|",   fields: ["Title", "City", "Phone"] };
{"results":    [   {"Title":"Jinmi Restaurant",    "City":"Sunnyvale",    "Phone":"(408) 481-0709"}    },   {"Title":"Totoro",    "City":"Sunnyvale",    "Phone":"(408) 481-0709"}         },    ...   ] }
  101010101010101010101010101010 transport parse normalize
YUI 3 http://developer.yahoo.com/yui/theater/
Image Credits http://www.flickr.com/photos/dan4th/301092024/ http://www.sxc.hu/photo/465451 http://www.sxc.hu/photo/548373 http://www.flickr.com/photos/wilhei/109403331/ http://www.flickr.com/photos/wilhei/109403357/ http://www.yuiblog.com/blog/2009/08/10/in-the-wild-for-august-10-2009/ http://yuiblog.com/blog/2009/04/23/wild-20090423 http://www.yuiblog.com/blog/2009/07/31/implementation-focus-short-reckonings/ http://www.yuiblog.com/blog/2009/05/26/in-the-wild-for-may-26-2009/
Thanks!

More Related Content

Viewers also liked

INFORME DE AUDITORIA GUBERNAMENTAL
INFORME DE  AUDITORIA GUBERNAMENTALINFORME DE  AUDITORIA GUBERNAMENTAL
INFORME DE AUDITORIA GUBERNAMENTAL
malbertorh
ย 
JULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de NegociosJULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de Negocios
Julio Pari
ย 
Cรกpsula 1. estudios de mercado
Cรกpsula 1. estudios de mercadoCรกpsula 1. estudios de mercado
Cรกpsula 1. estudios de mercado
Audias Torres Coronel
ย 

Viewers also liked (20)

INFORME DE AUDITORIA GUBERNAMENTAL
INFORME DE  AUDITORIA GUBERNAMENTALINFORME DE  AUDITORIA GUBERNAMENTAL
INFORME DE AUDITORIA GUBERNAMENTAL
ย 
"Protecciรณn de la salud mental luego del terremoto y tsunami del 27 de febrer...
"Protecciรณn de la salud mental luego del terremoto y tsunami del 27 de febrer..."Protecciรณn de la salud mental luego del terremoto y tsunami del 27 de febrer...
"Protecciรณn de la salud mental luego del terremoto y tsunami del 27 de febrer...
ย 
JULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de NegociosJULIOPARI - Elaborando un Plan de Negocios
JULIOPARI - Elaborando un Plan de Negocios
ย 
El emprendedor y el empresario profesional cert
El emprendedor y el empresario profesional certEl emprendedor y el empresario profesional cert
El emprendedor y el empresario profesional cert
ย 
PMP Sonora Saludable 2010 2015
PMP Sonora Saludable 2010   2015  PMP Sonora Saludable 2010   2015
PMP Sonora Saludable 2010 2015
ย 
Onderzoeksrapport acrs v3.0_definitief
Onderzoeksrapport acrs v3.0_definitiefOnderzoeksrapport acrs v3.0_definitief
Onderzoeksrapport acrs v3.0_definitief
ย 
Como hacer un plan de negocios
Como hacer un plan de negociosComo hacer un plan de negocios
Como hacer un plan de negocios
ย 
Rodriguez alvarez
Rodriguez alvarezRodriguez alvarez
Rodriguez alvarez
ย 
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
Evidence: Describing my kitchen. ENGLISH DOT WORKS 2. SENA.
ย 
Estrategias competitivas bรกsicas
Estrategias competitivas bรกsicasEstrategias competitivas bรกsicas
Estrategias competitivas bรกsicas
ย 
Cรกpsula 1. estudios de mercado
Cรกpsula 1. estudios de mercadoCรกpsula 1. estudios de mercado
Cรกpsula 1. estudios de mercado
ย 
2. describing cities and places. ENGLISH DOT WORKS 2. SENA. semana 4 acitivda...
2. describing cities and places. ENGLISH DOT WORKS 2. SENA. semana 4 acitivda...2. describing cities and places. ENGLISH DOT WORKS 2. SENA. semana 4 acitivda...
2. describing cities and places. ENGLISH DOT WORKS 2. SENA. semana 4 acitivda...
ย 
3.Evidence: Getting to Bogota.ENGLISH DOT WORKS 2. SENA.semana 4 actividad 3.
3.Evidence: Getting to Bogota.ENGLISH DOT WORKS 2. SENA.semana 4 actividad 3.3.Evidence: Getting to Bogota.ENGLISH DOT WORKS 2. SENA.semana 4 actividad 3.
3.Evidence: Getting to Bogota.ENGLISH DOT WORKS 2. SENA.semana 4 actividad 3.
ย 
Evidence: Going to the restaurant . ENGLISH DOT WORKS 2. SENA.
Evidence: Going to the restaurant . ENGLISH DOT WORKS 2. SENA.Evidence: Going to the restaurant . ENGLISH DOT WORKS 2. SENA.
Evidence: Going to the restaurant . ENGLISH DOT WORKS 2. SENA.
ย 
Evidence: I canโ€™t believe it.ENGLISH DOT WORKS 2. semana 3 actividad 1.SENA.
Evidence: I canโ€™t believe it.ENGLISH DOT WORKS 2. semana 3 actividad 1.SENA.Evidence: I canโ€™t believe it.ENGLISH DOT WORKS 2. semana 3 actividad 1.SENA.
Evidence: I canโ€™t believe it.ENGLISH DOT WORKS 2. semana 3 actividad 1.SENA.
ย 
Evidence: Memorable moments.ENGLISH DOT WORKS 2. SENA. semana 2 actividad 2.
Evidence: Memorable moments.ENGLISH DOT WORKS 2. SENA. semana 2 actividad 2.Evidence: Memorable moments.ENGLISH DOT WORKS 2. SENA. semana 2 actividad 2.
Evidence: Memorable moments.ENGLISH DOT WORKS 2. SENA. semana 2 actividad 2.
ย 
Evidence: Planning my trip. ENGLISH DOT WORKS 2. SENA. semana 4 actividad 1.
Evidence: Planning my trip. ENGLISH DOT WORKS 2. SENA. semana 4 actividad 1.Evidence: Planning my trip. ENGLISH DOT WORKS 2. SENA. semana 4 actividad 1.
Evidence: Planning my trip. ENGLISH DOT WORKS 2. SENA. semana 4 actividad 1.
ย 
Libro de-mantenimiento-industrial
Libro de-mantenimiento-industrialLibro de-mantenimiento-industrial
Libro de-mantenimiento-industrial
ย 
De Reis van de Heldin Nederland Februari 2015
De Reis van de Heldin Nederland Februari 2015 De Reis van de Heldin Nederland Februari 2015
De Reis van de Heldin Nederland Februari 2015
ย 
Unidad 3. toma de decisiones y soluciรณn
Unidad 3. toma de decisiones y soluciรณnUnidad 3. toma de decisiones y soluciรณn
Unidad 3. toma de decisiones y soluciรณn
ย 

Similar to Jenny Donnelly

Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
Atlassian
ย 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
mussawir20
ย 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
mussawir20
ย 
Hacking with YUI
Hacking with YUIHacking with YUI
Hacking with YUI
elliando dias
ย 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
Doncho Minkov
ย 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
google
ย 
Supersize me
Supersize meSupersize me
Supersize me
dominion
ย 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
Nikhil Jain
ย 

Similar to Jenny Donnelly (20)

Getting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial GadgetsGetting the Most Out of OpenSocial Gadgets
Getting the Most Out of OpenSocial Gadgets
ย 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
ย 
Zend framework 05 - ajax, json and j query
Zend framework 05 - ajax, json and j queryZend framework 05 - ajax, json and j query
Zend framework 05 - ajax, json and j query
ย 
Php Crash Course
Php Crash CoursePhp Crash Course
Php Crash Course
ย 
Hacking with YUI
Hacking with YUIHacking with YUI
Hacking with YUI
ย 
External Data Access with jQuery
External Data Access with jQueryExternal Data Access with jQuery
External Data Access with jQuery
ย 
HTML5 Web Forms
HTML5 Web FormsHTML5 Web Forms
HTML5 Web Forms
ย 
YQL talk at OHD Jakarta
YQL talk at OHD JakartaYQL talk at OHD Jakarta
YQL talk at OHD Jakarta
ย 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
ย 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
ย 
Freebasing for Fun and Enhancement
Freebasing for Fun and EnhancementFreebasing for Fun and Enhancement
Freebasing for Fun and Enhancement
ย 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
ย 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
ย 
Working with Web Services
Working with Web ServicesWorking with Web Services
Working with Web Services
ย 
From "Username and Password" to InfoCard
From "Username and Password" to InfoCardFrom "Username and Password" to InfoCard
From "Username and Password" to InfoCard
ย 
Supersize me
Supersize meSupersize me
Supersize me
ย 
DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8DevDays09 Internet Explorer 8
DevDays09 Internet Explorer 8
ย 
PHP Presentation
PHP PresentationPHP Presentation
PHP Presentation
ย 
Javascript2839
Javascript2839Javascript2839
Javascript2839
ย 
Json
JsonJson
Json
ย 

More from Ajax Experience 2009

Adam Peller Interoperable Ajax Tools And Mashups
Adam Peller Interoperable Ajax Tools And MashupsAdam Peller Interoperable Ajax Tools And Mashups
Adam Peller Interoperable Ajax Tools And Mashups
Ajax Experience 2009
ย 
Eric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing ConsiderationsEric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing Considerations
Ajax Experience 2009
ย 
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling PagecacheChanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Ajax Experience 2009
ย 
Jason.O Keefe.Genuitec.Presentation.Final
Jason.O Keefe.Genuitec.Presentation.FinalJason.O Keefe.Genuitec.Presentation.Final
Jason.O Keefe.Genuitec.Presentation.Final
Ajax Experience 2009
ย 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]
Ajax Experience 2009
ย 
Scott Isaacs Presentationajaxexperience (Final)
Scott Isaacs Presentationajaxexperience (Final)Scott Isaacs Presentationajaxexperience (Final)
Scott Isaacs Presentationajaxexperience (Final)
Ajax Experience 2009
ย 
Sergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample SdkSergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample Sdk
Ajax Experience 2009
ย 
Chris Williams Presentation Dissident
Chris Williams Presentation DissidentChris Williams Presentation Dissident
Chris Williams Presentation Dissident
Ajax Experience 2009
ย 
Andrew Sutherland Presentation
Andrew Sutherland PresentationAndrew Sutherland Presentation
Andrew Sutherland Presentation
Ajax Experience 2009
ย 
Ted Husted Presentation Testing Ajax Applications Ae2009
Ted Husted Presentation Testing Ajax Applications Ae2009Ted Husted Presentation Testing Ajax Applications Ae2009
Ted Husted Presentation Testing Ajax Applications Ae2009
Ajax Experience 2009
ย 
Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009
Ajax Experience 2009
ย 
Patrick Lightbody Presentation Tae Slides
Patrick Lightbody Presentation Tae SlidesPatrick Lightbody Presentation Tae Slides
Patrick Lightbody Presentation Tae Slides
Ajax Experience 2009
ย 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
Ajax Experience 2009
ย 
Jon Trelfa Presentation From Desktop To Web โ€“ Getting It Right
Jon Trelfa Presentation From Desktop To Web โ€“ Getting It RightJon Trelfa Presentation From Desktop To Web โ€“ Getting It Right
Jon Trelfa Presentation From Desktop To Web โ€“ Getting It Right
Ajax Experience 2009
ย 
Joe Mc Cann Tae Aria Presentation
Joe Mc Cann Tae Aria PresentationJoe Mc Cann Tae Aria Presentation
Joe Mc Cann Tae Aria Presentation
Ajax Experience 2009
ย 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
ย 
Douglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaDouglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation Jsonsaga
Ajax Experience 2009
ย 
David Wei And Changhao Jiang Presentation
David Wei And Changhao Jiang PresentationDavid Wei And Changhao Jiang Presentation
David Wei And Changhao Jiang Presentation
Ajax Experience 2009
ย 
Brian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone GapBrian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone Gap
Ajax Experience 2009
ย 

More from Ajax Experience 2009 (20)

Adam Peller Interoperable Ajax Tools And Mashups
Adam Peller Interoperable Ajax Tools And MashupsAdam Peller Interoperable Ajax Tools And Mashups
Adam Peller Interoperable Ajax Tools And Mashups
ย 
Eric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing ConsiderationsEric Beland Ajax Load Testing Considerations
Eric Beland Ajax Load Testing Considerations
ย 
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling PagecacheChanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling Pagecache
ย 
Jason.O Keefe.Genuitec.Presentation.Final
Jason.O Keefe.Genuitec.Presentation.FinalJason.O Keefe.Genuitec.Presentation.Final
Jason.O Keefe.Genuitec.Presentation.Final
ย 
Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]Colin Clark Accessible U Is With J Query And Infusion[1]
Colin Clark Accessible U Is With J Query And Infusion[1]
ย 
Scott Isaacs Presentationajaxexperience (Final)
Scott Isaacs Presentationajaxexperience (Final)Scott Isaacs Presentationajaxexperience (Final)
Scott Isaacs Presentationajaxexperience (Final)
ย 
Sergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample SdkSergey Ilinsky Presentation Ample Sdk
Sergey Ilinsky Presentation Ample Sdk
ย 
Chris Williams Presentation Dissident
Chris Williams Presentation DissidentChris Williams Presentation Dissident
Chris Williams Presentation Dissident
ย 
Andrew Sutherland Presentation
Andrew Sutherland PresentationAndrew Sutherland Presentation
Andrew Sutherland Presentation
ย 
Bill Scott Presentation
Bill Scott PresentationBill Scott Presentation
Bill Scott Presentation
ย 
Ted Husted Presentation Testing Ajax Applications Ae2009
Ted Husted Presentation Testing Ajax Applications Ae2009Ted Husted Presentation Testing Ajax Applications Ae2009
Ted Husted Presentation Testing Ajax Applications Ae2009
ย 
Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009Ted Husted Api Doc Smackdown Ae2009
Ted Husted Api Doc Smackdown Ae2009
ย 
Patrick Lightbody Presentation Tae Slides
Patrick Lightbody Presentation Tae SlidesPatrick Lightbody Presentation Tae Slides
Patrick Lightbody Presentation Tae Slides
ย 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
ย 
Jon Trelfa Presentation From Desktop To Web โ€“ Getting It Right
Jon Trelfa Presentation From Desktop To Web โ€“ Getting It RightJon Trelfa Presentation From Desktop To Web โ€“ Getting It Right
Jon Trelfa Presentation From Desktop To Web โ€“ Getting It Right
ย 
Joe Mc Cann Tae Aria Presentation
Joe Mc Cann Tae Aria PresentationJoe Mc Cann Tae Aria Presentation
Joe Mc Cann Tae Aria Presentation
ย 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
ย 
Douglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaDouglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation Jsonsaga
ย 
David Wei And Changhao Jiang Presentation
David Wei And Changhao Jiang PresentationDavid Wei And Changhao Jiang Presentation
David Wei And Changhao Jiang Presentation
ย 
Brian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone GapBrian Le Roux Presentation Introducing Phone Gap
Brian Le Roux Presentation Introducing Phone Gap
ย 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
ย 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
ย 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
ย 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
ย 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
ย 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
ย 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
ย 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
ย 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
ย 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
ย 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
ย 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
ย 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
ย 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
ย 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
ย 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
ย 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
ย 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
ย 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
ย 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
ย 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
ย 

Jenny Donnelly

  • 1. Bringing Data To Lifein the Browser Jenny Han Donnelly YUI Library
  • 2.
  • 3.
  • 4. Abstract data retrieval to support the mix-and-match of transports and formats
  • 5. 101010101010101010101010101010 transport parse normalize
  • 6. The DataSource is YUI's data retreival abstraction layer.
  • 7. Data Transports Local Application data External sources
  • 8. Data Formats Arrays Hashes Markup XML JSON JSONP Delimited text
  • 9.
  • 10. Using YAHOO.util.DataSource The transport The response format The schema
  • 11. DataSource provides a consistent, predictable API to the data.
  • 12. DataSource subclasses LocalDataSource XHRDataSource ScriptNodeDataSource FunctionDataSource
  • 13. DataSource responseType TYPE_JSARRAY TYPE_JSON TYPE_XML TYPE_TEXT TYPE_HTMLTABLE
  • 14. {"query": {"count":"44", "created":"2009-09-10T01:08:04Z", "lang": "en-US", "updated":"2009-09-10T01:08:04Z", "results": { "Result": [ {"id":"28787054", "Title":"Jinmi Restaurant", "Address":"1627 Hollenbeck Ave", "City":"Sunnyvale", State:"CA", "Latitude":"xyz", "Longitude":"abc", "Rating":{"AverageRating":"4", "TotalRatings":"5"} }, {"id":"21323987", "Title":"Totoro", "Address":"841 Villa St ", "City":"Sunnyvale", State:"CA", "Latitude":"xyz", "Longitude":"abc", "Rating":{"AverageRating":"5", "TotalRatings":"9"} }, ... ] } } } {"results": [ {"Title":"Jinmi Restaurant", "City":"Sunnyvale", "Phone":"(408) 481-0709", "Rating":{"AverageRating":"4"} }, {"Title":"Totoro", "City":"Sunnyvale", "Phone":"(408) 481-0709", "Rating":{"AverageRating":"5"} }, ... ] }
  • 15. var ds = new YAHOO.util.LocalDataSource(portfolio); ds.responseType = YAHOO.util.DataSource. TYPE_JSARRAY; ds.responseSchema = [ fields: ["company", "cost", "shares", "symbol", "value"] ];
  • 16. DataSources easily interface with AutoCompletes, Charts, and DataTables.
  • 17. var chart = new YAHOO.widget.Chart ("chart", ds, {...}); var ac = new YAHOO.widget.AutoComplete("input", "suggestions", ds, {...}); var dt = new YAHOO.widget.DataTable("container", cols, ds, {...});
  • 18. protocol The data transaction lifecycle datasource cache data widget requestEvent cacheRequestEvent cacheResponseEvent responseEvent doBeforeParseData doBeforeCallback responseEvent
  • 19. Performance considerations Keep it local Or enable caching ds.maxCacheEntries = 100; Perform cacheable data transformations with doBeforeParseData() or doBeforeCallback() Keep request queries consistent
  • 20.
  • 21. {"query": {"count":"44", "created":"2009-09-10T01:08:04Z", "lang": "en-US", "updated":"2009-09-10T01:08:04Z", "results": { "Result": [ {"id":"28787054", "Title":"Jinmi Restaurant", "Address":"1627 Hollenbeck Ave", ... "Rating":{"AverageRating":"4", "TotalRatings":"5"} }, {"id":"21323987", "Title":"Totoro", "Address":"841 Villa St ", ... "Rating":{"AverageRating":"5", "TotalRatings":"9"} }, ... ] } } }
  • 22. var myDS = new YAHOO.util.ScriptNodeDataSource("http://query.yahooapis.com/v1/public/yql?format=json"); myDS.responseType = YAHOO.util.DataSource.TYPE_JSON; myDS.responseSchema = { resultsList:"query.results.Result", fields: ["Title", "City", "Phone", "Rating.AverageRating"] };
  • 23. var columns = [ {key:"Title"}, {key:"City"}, {key:"Phone"}, {key:"Rating.AverageRating"} ]; var myDT = new YAHOO.widget.DataTable("datatable", columns, myDS, {initialRequest: "&q=select * from local.search(0) where query='korean restaurant' and location='sunnyvale, ca'"});
  • 24.
  • 25. <?xml version="1.0" encoding="UTF-8"?> <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="44" yahoo:created="2009-09-10T06:00:20Z" yahoo:lang="en-US" yahoo:updated="2009-09-10T06:00:20Z"> <results> <Result xmlns="urn:yahoo:lcl" id="28787054"> <Title>Jinmi Restaurant</Title> <Address>1627 Hollenbeck Ave</Address> ... <Rating> <AverageRating>4</AverageRating> <TotalRatings>5</TotalRatings> </Rating> </Result> <Result xmlns="urn:yahoo:lcl" id="21323987"> <Title>Totoro</Title> <Address>841 Villa St</Address> ... <Rating> <AverageRating>5</AverageRating> <TotalRatings>10</TotalRatings> </Rating> </Result> ... </results> </query>
  • 26. var myDS = new YAHOO.util.ScriptNodeDataSource("http://query.yahooapis.com/v1/public/yql?format=xml"); myDS.responseType = YAHOO.util.DataSource.TYPE_XML; myDS.responseSchema = { resultNode:"Result", fields: ["Title", "City", "Phone", "Rating.AverageRating"] };
  • 27. {"results": [ {"Title":"Jinmi Restaurant", "City":"Sunnyvale", "Phone":"(408) 481-0709", "Rating":{"AverageRating":"4"} }, {"Title":"Totoro", "City":"Sunnyvale", "Phone":"(408) 481-0709", "Rating":{"AverageRating":"5"} }, ... ] }
  • 28. Jinmi Restaurant|1627 Hollenbeck Ave|Sunnyvale|... Totoro|841 Villa St|Mountain View|... ...
  • 29. var myDS = new YAHOO.util.ScriptNodeDataSource("http://query.yahooapis.com/v1/public/yql?format=text"); myDS.responseType = YAHOO.util.DataSource.TYPE_TEXT; myDS.responseSchema = { recordDelim : " ", fieldDelim : "|", fields: ["Title", "City", "Phone"] };
  • 30. {"results": [ {"Title":"Jinmi Restaurant", "City":"Sunnyvale", "Phone":"(408) 481-0709"} }, {"Title":"Totoro", "City":"Sunnyvale", "Phone":"(408) 481-0709"} }, ... ] }
  • 31. 101010101010101010101010101010 transport parse normalize
  • 33.
  • 34. Image Credits http://www.flickr.com/photos/dan4th/301092024/ http://www.sxc.hu/photo/465451 http://www.sxc.hu/photo/548373 http://www.flickr.com/photos/wilhei/109403331/ http://www.flickr.com/photos/wilhei/109403357/ http://www.yuiblog.com/blog/2009/08/10/in-the-wild-for-august-10-2009/ http://yuiblog.com/blog/2009/04/23/wild-20090423 http://www.yuiblog.com/blog/2009/07/31/implementation-focus-short-reckonings/ http://www.yuiblog.com/blog/2009/05/26/in-the-wild-for-may-26-2009/