UserPreferences

PatchMotivatingExamples


Abstract

Concrete examples of current AtomPub usage where PATCH would be helpful.

Calendar Invitations

In the Google Calendar AtomPub implementation meeting invitations appear in a collection. A client accepts the invitation by retrieving the entry, updating their status as an attendee and then PUTting the entry back into the collection. Here is an example event entry:

<?xml version='1.0' encoding='utf-8'?>
<entry xmlns='http://www.w3.org/2005/Atom'
    xmlns:batch='http://schemas.google.com/gdata/batch'
    xmlns:gCal='http://schemas.google.com/gCal/2005'
    xmlns:gd='http://schemas.google.com/g/2005'>
  <id>http://www.google.com/calendar/feeds/default/private/full/mlo7cc7i6sd4vpvubervobk3ng</id>
  <published>2008-03-03T21:55:05.000Z</published>
  <updated>2008-03-03T21:55:25.000Z</updated>
  <category scheme='http://schemas.google.com/g/2005#kind'
      term='http://schemas.google.com/g/2005#event' />
  <title type='text'>Test Invitations</title>
  <content type='text' />
  <link rel='alternate' type='text/html'
      href='http://www.google.com/calendar/event?eid=bWxvN2NjN2k2c2Q0dnB2dWJlcnZvYmsvcmlvQG0'
      title='alternate' />
  <link rel='self' type='application/atom+xml'
      href='http://www.google.com/calendar/feeds/default/private/full/mlo7cc7i6sd4vpvuber3ng' />
  <link rel='edit' type='application/atom+xml'
      href='http://www.google.com/calendar/feeds/default/private/full/mlo7cc7i6sd4vpvuber3ng/63340264525' />
  <author>
    <name>Joe Gregorio</name>
    <email>joe.gregorio@gmail.com</email>
  </author>
  <gd:comments>
    <gd:feedLink href='http://www.google.com/calendar/feeds/default/private/full/mlo7cc7ivubervobk3ng/comments' />
  </gd:comments>
  <gd:eventStatus value='http://schemas.google.com/g/2005#event.confirmed' />
  <gd:visibility value='http://schemas.google.com/g/2005#event.default' />
  <gd:transparency value='http://schemas.google.com/g/2005#event.opaque' />
  <gCal:uid value='mlo7cc7i6sd4vpvubervobk3ng@google.com' />
  <gCal:sequence value='0' />
  <gd:when startTime='2008-03-04T14:00:00.000-05:00'
      endTime='2008-03-04T15:00:00.000-05:00'>
    <gd:reminder minutes='10' method='alert' />
  </gd:when>
  <gd:who rel='http://schemas.google.com/g/2005#event.attendee'
      valueString='Fred Flintstone' 
      email='fred@example.com'>
    <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.invited' />
  </gd:who>
  <gd:who rel='http://schemas.google.com/g/2005#event.organizer'
      valueString='Joe Gregorio' 
      email='joe@bitworking.org'>
    <gd:attendeeStatus value='http://schemas.google.com/g/2005#event.accepted' />
  </gd:who>
  <gd:where />
</entry>

The above entry is a representation of a meeting invitation. Note that there could be many more attendees than the two listed above. If Fred wants to accept the invitation to the meeting he changes gd:attendeeStatus/@value and PUTs back the whole entry.

Photo caption update

Mobile devices are usually bandwidth constrained so updating the title for the Media Link Entry below would be much faster if only the updated title could be sent instead of PUTting back the entire entry:

<?xml version='1.0' encoding='utf-8'?>
<entry xmlns='http://www.w3.org/2005/Atom'
    xmlns:exif='http://schemas.google.com/photos/exif/2007'
    xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
    xmlns:gml='http://www.opengis.net/gml'
    xmlns:georss='http://www.georss.org/georss'
    xmlns:photo='http://www.pheed.com/pheed/'
    xmlns:media='http://search.yahoo.com/mrss/'
    xmlns:gphoto='http://schemas.google.com/photos/2007'>
  <id>http://picasaweb.google.com/data/entry/api/user/joe.gregorio/albumid/5092640402774937889/photoid/5092640660472975666</id>
  <published>2007-07-29T15:26:42.000Z</published>
  <updated>2007-07-29T15:26:42.000Z</updated>
  <category scheme='http://schemas.google.com/g/2005#kind'
      term='http://schemas.google.com/photos/2007#photo' />
  <title type='text'>Ares-and-Reilly.jpg</title>
  <summary type='text'></summary>
  <content type='image/jpeg'
      src='http://lh6.google.com/joe.gregorio/RqyxsuAz0TI/AAAAAAAAAB4/cfMy-pOabIY/Ares-and-Reilly.jpg' />
  <link rel='http://schemas.google.com/g/2005#feed'
      type='application/atom+xml'
      href='http://picasaweb.google.com/data/feed/api/user/joe.gregorio/albumid/5092640402774937889/photoid/5092640660472975666' />
  <link rel='alternate' type='text/html'
      href='http://picasaweb.google.com/lh/photo/cZ8S17T728w4r4ZqwNE81Q' />
  <link rel='self' type='application/atom+xml'
      href='http://picasaweb.google.com/data/entry/api/user/joe.gregorio/albumid/5092640402774937889/photoid/5092640660472975666' />
  <link rel='http://schemas.google.com/photos/2007#report'
      type='text/html'
      href='http://picasaweb.google.com/lh/reportAbuse?uname=joe.gregorio&amp;aid=5092640402774937889&amp;iid=5092640660472975666' />
  <gphoto:id>5092640660472975666</gphoto:id>
  <gphoto:version>1185722802507194</gphoto:version>
  <gphoto:albumid>5092640402774937889</gphoto:albumid>
  <gphoto:width>710</gphoto:width>
  <gphoto:height>848</gphoto:height>
  <gphoto:size>366131</gphoto:size>
  <gphoto:client></gphoto:client>
  <gphoto:checksum></gphoto:checksum>
  <gphoto:timestamp>1185707161000</gphoto:timestamp>
  <exif:tags>
    <exif:fstop>2.8</exif:fstop>
    <exif:make>Canon</exif:make>
    <exif:model>Canon PowerShot A630</exif:model>
    <exif:exposure>0.016667</exif:exposure>
    <exif:flash>false</exif:flash>
    <exif:focallength>7.3</exif:focallength>
    <exif:time>1185707161000</exif:time>
    <exif:imageUniqueID>3a861ad65260755c22229eaeec1c92b7</exif:imageUniqueID>
  </exif:tags>
  <gphoto:commentingEnabled>true</gphoto:commentingEnabled>
  <gphoto:commentCount>0</gphoto:commentCount>
  <media:group>
    <media:title type='plain'>Ares-and-Reilly.jpg</media:title>
    <media:description type='plain'></media:description>
    <media:keywords></media:keywords>
    <media:thumbnail url='http://lh6.google.com/joe.gregorio/RqyxsuAz0TI/AAAAAAAAAB4/cfMy-pOabIY/s72/Ares-and-Reilly.jpg'
        height='72' width='60' />
    <media:thumbnail url='http://lh6.google.com/joe.gregorio/RqyxsuAz0TI/AAAAAAAAAB4/cfMy-pOabIY/s144/Ares-and-Reilly.jpg'
        height='144' width='120' />
    <media:thumbnail url='http://lh6.google.com/joe.gregorio/RqyxsuAz0TI/AAAAAAAAAB4/cfMy-pOabIY/s288/Ares-and-Reilly.jpg'
        height='288' width='241' />
    <media:content url='http://lh6.google.com/joe.gregorio/RqyxsuAz0TI/AAAAAAAAAB4/cfMy-pOabIY/Ares-and-Reilly.jpg'
        height='848' width='710' type='image/jpeg' medium='image' />
    <media:credit>Joe</media:credit>
  </media:group>
</entry>

Notes