<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Boundary Conditions &#187; GData</title>
	<atom:link href="http://67central.com/bc/tag/gdata/feed/" rel="self" type="application/rss+xml" />
	<link>http://67central.com/bc</link>
	<description>Exploring Calendars, Time Lines, Timekeeping and Scheduling Tools</description>
	<lastBuildDate>Thu, 25 Nov 2010 15:56:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Link Elements in GCalendar Event Feeds</title>
		<link>http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/</link>
		<comments>http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 06:14:40 +0000</pubDate>
		<dc:creator>Ray Baxter</dc:creator>
				<category><![CDATA[Calendar]]></category>
		<category><![CDATA[GCalendar]]></category>
		<category><![CDATA[GData]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[feeds]]></category>
		<category><![CDATA[googlecalendar]]></category>

		<guid isPermaLink="false">http://cornercases.67central.com/?p=7</guid>
		<description><![CDATA[A question from the for the Google Calendar Data API Developer Forum. Hi all, for (CalendarEventEntry event : calEventList) { for (Link link : event.getLinks()) { System.out.println(link.getHref()); } above code fragment prints three types of links, what these are meant for? What these links signify in the feed. &#8211; Regards, Vijay This is a question [...]]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://groups.google.com/group/google-calendar-help-dataapi/browse_thread/thread/a9e11afdb73ee3dd">question</a> from the for the Google Calendar Data API <a href="http://groups.google.com/group/google-calendar-help-dataapi">Developer Forum</a>.</p>
<blockquote><p>Hi all, </p>
<pre><code>
for (CalendarEventEntry event : calEventList) {
    for (Link link : event.getLinks()) {
        System.out.println(link.getHref());
}
</code></pre>
<p>above code fragment prints three types of links, what these are meant for?<br />
What these links signify in the feed.<br />
&#8211;<br />
Regards,<br />
Vijay
</p></blockquote>
<p>This is a question that I had been meaning to address, but I was planning to get to it after I addressed all the different urls that are used in the GCalendar API. Actually this question is easier and more straight-forward to answer, so it makes sense to  answer this first. I&#8217;ll defer the larger questions of GCalendar event feeds and generic Atom feeds for a later post.</p>
<p>Here&#8217;s a complete entry feed (as formated with <code>tidy -xml -indent</code>):</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">'1.0'</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">'utf-8'</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;entry</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">'http://www.w3.org/2005/Atom'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:batch</span>=<span style="color: #ff0000;">'http://schemas.google.com/gdata/batch'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:gCal</span>=<span style="color: #ff0000;">'http://schemas.google.com/gCal/2005'</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:gd</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-04-21T22:36:07.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/published<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2008-04-21T22:36:07.000Z<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/updated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">scheme</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#kind'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">term</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Tennis with Beth<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;content</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Meet for a quick lesson.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/content<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/event?eid=ZzBwZHNqbDE4ZW05dGNkYXU2YmFxZ2F0a2sgdGQzczMyZTZrMWliN3BrZ2liaTd2NmprdGdAZw'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">title</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;"> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'edit'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span>  <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk/63344500567'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Ray Baxter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>me@gmail.com<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/email<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/author<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:comments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:feedLink</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk/comments'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/gd:comments<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:eventStatus</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.confirmed'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:visibility</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.default'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:transparency</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.opaque'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:uid</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'g0pdsjl18em9tcdau6baqgatkk@google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gCal:sequence</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">'0'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:when</span> <span style="color: #000066;">startTime</span>=<span style="color: #ff0000;">'2008-04-17T08:00:00.000-07:00'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">endTime</span>=<span style="color: #ff0000;">'2008-04-17T10:00:00.000-07:00'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:who</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'http://schemas.google.com/g/2005#event.organizer'</span></span>
<span style="color: #009900;">  <span style="color: #000066;">valueString</span>=<span style="color: #ff0000;">''</span></span>
<span style="color: #009900;">  <span style="color: #000066;">email</span>=<span style="color: #ff0000;">'td3s32e6k1ib7pkgibi7v6jktg@group.calendar.google.com'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;gd:where</span> <span style="color: #000066;">valueString</span>=<span style="color: #ff0000;">'Rolling Lawn Courts'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/entry<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Coming to Vijay&#8217;s question, there are three <code>
<link></code> elements in this feed. They are:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'text/html'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/event?eid=ZzBwZHNqbDE4ZW05dGNkYXU2YmFxZ2F0a2sgdGQzczMyZTZrMWliN3BrZ2liaTd2NmprdGdAZw'</span> <span style="color: #000066;">title</span>=<span style="color: #ff0000;">'alternate'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'edit'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk/63344500567'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The links are named for their relations, i.e. the values of their <code>rel</code> attributes.</p>
<p>The first link is the alternate link, so called because it is an alternative version of the content of this event. In this case the alternate version in html format as you can see by the <code>type='text/html'</code> attribute. Because this calendar is public, you can click on that link and see the event in your browser. <a target="_blank" href="http://www.google.com/calendar/event?eid=ZzBwZHNqbDE4ZW05dGNkYXU2YmFxZ2F0a2sgdGQzczMyZTZrMWliN3BrZ2liaTd2NmprdGdAZw" onclick="link_popup(this); return false">Try it</a>. </p>
<p>The second link is a self link. That is the the xml feed for this event, and can repull the event from this feed (in the event that Google&#8217;s servers are working, which they don&#8217;t appear to be currently.) Notice that the http attribute of the self link is exactly the same URL as the <code><id></code>.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">'self'</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">'application/atom+xml'</span></span>
<span style="color: #009900;"> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">'http://www.google.com/calendar/feeds/td3s32e6k1ib7pkgibi7v6jktg%40group.calendar.google.com/private/full/g0pdsjl18em9tcdau6baqgatkk'</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>The self link may not have been the location from <em>you</em> pulled the event. You might have pulled an entire calendar of events (which would have it&#8217;s own, distinct, self link) or you might have made a query for events matching some pattern and retrieved a number of events for that feed (which would ought have it&#8217;s own self link, but I haven&#8217;t verified).</p>
<p>Finally there is the edit link. This is the URL that you use to make changes to the event. Sending a DELETE request to this URL will delete the event. Sending a PUT request will replace event&#8217;s data with the data that you send.</p>
<p>For reference, the self and alternate link relations are specified as part of the Atom Syndication Format (<a href="http://www.rfc-editor.org/rfc/rfc4287.txt">RFC4287</a>) and the edit relation is specified as part of the Atom Publication Protocol (<a href="http://www.rfc-editor.org/rfc/rfc5023.txt">RFC5023</a>). A convenient table of all the Atom link relations is <a href="http://www.iana.org/assignments/link-relations.html">here</a>. That table will come in handy as we examine the other link relations in GCalendar feeds.</p>
<hr />
Any other questions? Leave them in the comments and I&#8217;ll get to them as I can.</p>
]]></content:encoded>
			<wfw:commentRss>http://67central.com/bc/2008/04/27/link-elements-in-gcalendar-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

