Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Atom Publishing Protocol

1,975 views

Published on

Mein Vortrag über AtomPub.


http://twitter.com/rmetzler

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Atom Publishing Protocol

  1. 1. Atom Publishing Protocol RFC 5023
  2. 2. Atom Publishing Protocol <ul><li>Application-Level Protokoll zum Veröffentlichen und Editieren von Web-Resourcen
  3. 3. baut auf HTTP & XML (Atom Format) auf
  4. 4. Ziel: Vereinheitlichung der Verwaltung von Content in Verteilten Systemen </li><ul><li>Ermöglicht Erzeugen, Lesen, Editieren, Löschen von Resourcen </li></ul></ul>
  5. 5. Bedeutung <ul><li>Blogging </li><ul><li>WordPress </li></ul><li>Google Data APIs (GData) </li><ul><li>Youtube, Blogger, Picasa Gallery, Google Docs </li></ul><li>weitere Seiten </li><ul><li>z.B. http://www.feedbooks.com/ </li></ul><li>Joe Gregorio: „APP is a failure“ </li><ul><li>http://bitworking.org/news/425/atompub-is-a-failure
  6. 6. fat client vs. browser </li></ul></ul>
  7. 7. Definitionen <ul><li>Definitionen aus HTTP: </li><ul><li>URI / IRI: Uniform / International Resource Identifier (RFC 3986)
  8. 8. Resource: netzwerk-zugängliches Datenobjekt
  9. 9. Representation: Darstellung des Datenobjekts </li></ul></ul>
  10. 10. Definitionen <ul><li>Collection: Eine Menge an Resourcen. Dargestellt als Atom Feed.
  11. 11. Member Resource: Resource, die in einer Collection mit der Relation „edit“ oder „edit-media“ gelistet ist </li><ul><li>Entry Resource: Repräsentation als Atom Entry
  12. 12. Media Resource: andere Repräsentation
  13. 13. Media Link Entry: eine Entry Resource, die Metadaten über eine Media Resource enthält </li></ul><li>Relation: „rel“ Attribut eines atom:link Elements </li></ul>
  14. 14. Definitionen <ul><li>Service Document: Beschreibung von einer oder mehr Workspaces
  15. 15. Workspace: Gruppe von Collections
  16. 16. Category Document: Beschreibung der erlaubten Kategorien in einer Collection </li></ul>
  17. 17. Service Documents <ul><li>Wie Service Documente gefunden werden ist nicht spezifiziert
  18. 18. Mime Type „application/atomsvc+xml“ </li></ul>
  19. 19. Service Documents <? xml version = &quot;1.0&quot; encoding = 'utf-8' ?> < service xmlns = &quot; http://www.w3.org/2007/app &quot; xmlns:atom = &quot;http://www.w3.org/2005/Atom&quot; > < workspace > < atom:title > Main Site </ atom:title > < collection href = &quot;http://example.org/blog/main&quot; > < atom:title > My Blog Entries </ atom:title > < categories href = &quot;http://example.com/cats/forMain.cats&quot; /> </ collection > < collection href = &quot;http://example.org/blog/pic&quot; > < atom:title > Pictures </ atom:title > < accept > image/png </ accept > < accept > image/jpeg </ accept > < accept > image/gif </ accept > </ collection > </ workspace > </ service >
  20. 20. Service Documents <? xml version = &quot;1.0&quot; encoding = 'utf-8' ?> < service xmlns = &quot; http://www.w3.org/2007/app &quot; xmlns:atom = &quot;http://www.w3.org/2005/Atom&quot; > < workspace > < atom:title > Sidebar Blog </ atom:title > < collection href = &quot;http://example.org/sidebar/list&quot; > < atom:title > Remaindered Links </ atom:title > < accept > application/atom+xml;type=entry </ accept > < categories fixed = &quot;yes&quot; > < atom:category term = &quot;joke&quot; scheme = &quot; http://example.org/extra-cats/ &quot; /> < atom:category term = &quot;serious&quot; scheme = &quot; http://example.org/extra-cats/ &quot; /> </ categories > </ collection > </ workspace > </ service >
  21. 21. Collection lesen <ul><li>Atom Format (RFC 4287)
  22. 22. Menge von Resourcen </li><ul><li>geordnet nach app:edited </li></ul><li>Mime Type application/atom+xml </li></ul>
  23. 23. Collection <? xml version = &quot;1.0&quot; encoding = &quot;utf-8&quot; ?> < feed xmlns = &quot;http://www.w3.org/2005/Atom&quot; > < title > Example Feed </ title > < link href = &quot;http://example.org/&quot; /> < updated > 2003-12-13T18:30:02Z </ updated > < author > < name > John Doe </ na me > </ author > < id > urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6 </ id > < entry > < title > Atom-Powered Robots Run Amok </ title > < link href = &quot;http://example.org/2003/12/13/atom03&quot; /> < id > urn:uuid:1225c695-cfb8-4ebb- aaaa -80da344efa6a </ id > < updated > 2003-12-13T18:30:02Z </ updated > < summary > Some text. </ summary > </ entry > </ feed >
  24. 24. Methoden Operation HTTP Methode create POST read GET update PUT delete DELETE
  25. 25. Anlegen / POST <ul><li>POST der Representation an die URI der Collection </li><ul><li>gewünschter Titel im SLUG HTTP-Header
  26. 26. Falls Representation kein atom:entry, dann Media Entry & Media Link Entry </li></ul><li>Location Header im Response enthält neue URI </li></ul>
  27. 27. Lesen / GET <ul><li>GET auf die Member URI
  28. 28. Representation wird zurückgegeben </li><ul><li>atom:entry falls Entry Member
  29. 29. Sonst andere Representation </li></ul><li>404 File not Found, falls Resource nicht vorhanden </li></ul>
  30. 30. Update / PUT <ul><li>PUT an die Member URI ändert den bisherigen Eintrag </li><ul><li>Client sollte gesamte Representation schicken, nicht nur Änderungen </li></ul></ul>
  31. 31. Löschen / DELETE <ul><li>DELETE auf die URI eines Member Entry löscht diesen </li><ul><li>Löschen eines Media Link Eintrags sollte auch die zugehörige Media Resource löschen </li></ul></ul>
  32. 32. Methoden HTTP Methode URI Returns CREATE POST Collection URI Member Representation 201 Created Location: Member URI READ GET Member URI 200 Ok Member Representation UPDATE PUT Member URI Member Representation 200 Ok DELETE DELETE Member URI 200 Ok
  33. 33. Pagination <ul><li>Zu große Collections kann der Server teilen
  34. 34. Navigation via rel-Attribute </li><ul><li>„next“, „previous“, „first“, „last“ </li></ul></ul>< feed xmlns = &quot;http://www.w3.org/2005/Atom&quot; > < link rel = &quot;first&quot; href = &quot;http://example.org/entries/&quot; /> < link rel = &quot;previous&quot; href = &quot;http://example.org/entries/2&quot; /> < link rel = &quot;next&quot; href = &quot;http://example.org/entries/4&quot; /> < link rel = &quot;last&quot; href = &quot;http://example.org/entries/10&quot; /> <!-- ... --> </ feed >
  35. 35. Category Documents <ul><li>In einer Collection erlaubte Kategorien </li><ul><li>fixed = Liste der Kategorien unveränderbar </li></ul><li>Mime Type = „application/atomcat+xml“ </li></ul><? xml version = &quot;1.0&quot; ?> < app:categories xmlns:app = &quot;http://www.w3.org/2007/app&quot; xmlns:atom = &quot;http://www.w3.org/2005/Atom&quot; fixed = &quot;yes&quot; scheme = &quot;http://example.com/cats/big3&quot; > < atom:category term = &quot;animal&quot; /> < atom:category term = &quot;vegetable&quot; /> < atom:category term = &quot;mineral&quot; /> </ app:categories >

×