Download presentation
Presentation is loading. Please wait.
Published byPamela Mason Modified over 9 years ago
1
Google Data Protocol Guy Mark Lifshitz
2
Motivation Google’s Mission: – Organize the world’s information – Make information universally accessible – Provide tools to access your information Avoid limitations on contexts: – Not limited to Google – Not limited to browsers
3
Foundation REST AtomPub JSON RSS
4
REST “Representational state transfer”
5
REST Simple Lightweight Scalable Maps well to representing and exposing data
6
REST 1. Client sends a request to server 2. Server process the request 3. Server returns a response
7
AtomPub “Atom Publishing Protocol” (RFC 5023)
8
AtomPub Originally created for blogs Feed based Feeds are found at a specific URI An Atom Reader looks for entries in a feed
9
AtomPub Create Retrieve Update Delete
10
AtomPub Create – PUT Retrieve – GET Update – GET, modify feed, PUT Delete – DELETE
11
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
12
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
13
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
14
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
15
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
16
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
17
Calendar Atom Feed http://www.google.com/calendar/feeds/default/settings Google Calendar 2009-03-05T10:46:25.244Z Coach's's personal settings 1 Coach user@gmail.com http://www.google.com/calendar/feeds/default/settings/... 2009-03-05T10:46:25.245Z
18
JSON “ JavaScript Object notation”
19
JSON Properties – Lightweight data interchange format – Widespread use among web developers – Easy to read and write – Can parse JSON using any language – JSON structures map directly to data structures used in most programming languages Within the Google Data Protocol, JSON objects simply mirror the Atom representation.
20
JSON vs. XML "firstName": "John", "lastName": "Smith", "age": 25, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021“ }, "phoneNumbers": [ { "type": "home“, "number": "212 555-1234"}, { "type": "fax", "number": "646 555-4567" } ], "newSubscription": false, "companyName": null
21
JSON vs. XML 25 21 2nd Street New York NY 10021 555 1234 646 555-4567 false
22
GData
23
Additional Features Authentication Queries Concurrency Common Elements Batch Processing
24
Authentication ClientLogin – Desktop applications – Uses text input in application myService.setUserCredentials("jo@gmail.com", "mypassword"); AuthSub – 3 rd party websites – Directs you to Google’s website.
25
Query Add query to the URL Basic: http://www.google.com/calendar/feeds/default/private/full Events before February 11 th 2010, ordered by date http://www.google.com/calendar/feeds/default/private/full ?start-max=2010-02-11&orderby=starttime
26
Query Use the API to build queries CalendarQuery myQuery = new CalendarQuery(feedUrl); myQuery.setMinimumStartTime(DateTime.parseDateTime("2006-03-16T00:00:00")); myQuery.setMaximumStartTime(DateTime.parseDateTime("2006-03-24T23:59:59"));... CalendarEventFeed resultFeed = myService.query(myQuery, Feed.class);
27
Additional Features Authentication Queries Concurrency Common Elements Batch Processing
28
Additional Features Authentication Queries Concurrency Common Elements – “Kines” Batch Processing
29
Additional Features Authentication Queries Concurrency Common Elements Batch Processing
30
APIs
31
Libraries Java.NET PHP Python JavaScript Obj-C
32
API Library
33
Links http://code.google.com/apis/gdata/
36
Example public class CalendarTest { public static void main(String[] args) { CalendarService myService = new CalendarService("exampleCo-exampleApp-1.0"); myService.setUserCredentials("root@gmail.com", "pa$$word"); URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/allcalendars/full"); CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class); System.out.println("Your calendars:"); System.out.println(); for (int i = 0; i < resultFeed.getEntries().size(); i++) { CalendarEntry entry = resultFeed.getEntries().get(i); System.out.println("\t" + entry.getTitle().getPlainText()); }
37
Request GET PUT DELETEE HEAD POST – All Methods – POST not safe or idempotent Intermediaries can be added in between – Proxies and Gateways – Can add performance
38
Protocol Client Server Stateless – Requests are independent (don’t know what other interactions are doing) Layered – HTTP intermdiaries can be added without changing behaviour Cacheable
39
REST Architectural Style Architecture of the web HTTP (protocol) Request Response. Client requests from server, and server responds.
40
Extends Atom 1.0 RSS 2.0 Atom Publishing Protocol (APP). Google Data protocol extends those standards in various ways, using the extension mechanisms built into the standards. Feeds conform to either the Atom or RSS syndication formats. The publishing model conforms to the Atom Publishing Protocol.
41
AtomPub “Atom Publishing Protocol” (RFC 5023) Web syndication is an effective and popular method for providing and aggregating content. It also lets you send data to Google and update data that Google maintains.
42
Benefits Efficiency – Caches Scalability – Large set of origin servers Performance to user – Partial rendering of html and such.
43
Calendar Feed <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gCal="http://schemas.google.com/gCal/2005" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"Ck8FQ3Y4cCp7I2A9WxVVEkU.""> http://www.google.com/calendar/feeds/default/settings 2009-03-05T10:46:25.244Z Coach's's personal settings Coach user@gmail.com Google Calendar 1 http://www.google.com/calendar/feeds/default/settings/alternateCalendar 2009-03-05T10:46:25.245Z http://www.google.com/calendar/feeds/default/settings/country 2009-03-05T10:46:25.245Z
44
Calendar Feed <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gCal="http://schemas.google.com/gCal/2005" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"Ck8FQ3Y4cCp7I2A9WxVVEkU.""> http://www.google.com/calendar/feeds/default/settings 2009-03-05T10:46:25.244Z Coach's's personal settings Coach user@gmail.com Google Calendar 1 http://www.google.com/calendar/feeds/default/settings/alternateCalendar 2009-03-05T10:46:25.245Z http://www.google.com/calendar/feeds/default/settings/country 2009-03-05T10:46:25.245Z
45
Calendar Feed <feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:gCal="http://schemas.google.com/gCal/2005" xmlns:gd="http://schemas.google.com/g/2005" gd:etag="W/"Ck8FQ3Y4cCp7I2A9WxVVEkU.""> http://www.google.com/calendar/feeds/default/settings 2009-03-05T10:46:25.244Z Coach's's personal settings Coach user@gmail.com Google Calendar 1 http://www.google.com/calendar/feeds/default/settings/alternateCalendar 2009-03-05T10:46:25.245Z http://www.google.com/calendar/feeds/default/settings/country 2009-03-05T10:46:25.245Z
46
Calendar Feed http://www.google.com/calendar/feeds/default/settings/alternateCalendar 2009-03-05T10:46:25.245Z
47
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
48
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
49
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
50
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
51
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
52
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
53
Atom Feeds Example Feed A subtitle. urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6 2003-1213T18:30:02Z John Doe johndoe@example.com Atom-Powered Robots Run Amok urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a 2003-12-13T18:30:02Z Some text.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.