Welcome!

Search





Page: Rome08Atom10Patch


Details a patch (for Atom 1.0 support) that I submitted to the ROME dev list -- DaveJohnson

I've got my Atom Protocol client (~BlogClient) and server (Roller) working with Atom Format 1.0. My protocol client/server pair implements the most recent version of the APP spec and supports get/post/put of entries, categories and resources. I had to modify ROME to make this happen and now I'd like to figure out how to contribute these mods back to ROME.

I have attached a unified diff format file rome-atom-1.0.patch(info) with my changes against ROME CVS from Sep 17, 2005 for your evaluation. I've also included below a short demo program, its output and a summary of the changes included in the patch. The code still needs work, but I think it is a good starting point for Atom 1.0 support in ROME and it shouldn't disrupt the existing Atom 0.3 code.

I've also attached a copy of the patched rome-0.8-dave.jar(info)

Demo program: testparse.gy#

To test out my ROME mods I wrote a little Groovy program that parses Tim Bray's Atom 1.0 feed and prints out entry title, published date, updated date, links, content type, summary and categories. Tim 's feed is a good test case because he uses xml:base and relative URLs in his links. The code looks like this:

import com.sun.syndication.feed.*;
import com.sun.syndication.io.*;
import java.net.URL;

feedUrl = new URL("http://tbray.org/ongoing/ongoing.atom");

input = new SyndFeedInput();
feed = input.build(new XmlReader(feedUrl));
for (e in feed.entries) {
   println "Title:        " + e.title;
   println "Published:    " + e.publishedDate;
   println "Updated:      " + e.updatedDate;
   println "Link:         " + e.link;
   if (e.description) println "Content type: " + e.description.type;
   if (e.summary) println "Summary: " + e.summary.value;
   if (e.links != null) {
      println "Links collection: "
      e.links.each { println "   ${it.href} rel=${it.rel}" }
   }
   if (e.categories != null) {
      println "Categories collection: "
      e.categories.each { println "   ${it.name} scheme=${it.taxonomyUri}" }
   }
   println "";
}

Demo program output#

And here's what the output of testparse.gy looks like:

Title:        The Important Things in Life
Published:    Sat Sep 17 17:00:00 EDT 2005
Updated:      Sat Sep 17 17:57:22 EDT 2005
Link:         http://www.tbray.org/ongoing/ongoing.atom/When/200x/2005/09/17/Semicolons
Content type: xhtml
Links collection:
   http://www.tbray.org/ongoing/ongoing.atom/When/200x/2005/09/17/Semicolons rel=alternate
Categories collection:
   Language scheme=http://www.tbray.org/ongoing/What/
   Language scheme=http://www.tbray.org/ongoing/What/

Title:        NetBeans 5
Published:    Fri Sep 16 17:00:00 EDT 2005
Updated:      Sat Sep 17 11:34:34 EDT 2005
Link:         http://www.tbray.org/ongoing/ongoing.atom/When/200x/2005/09/16/Netbeans-5
Content type: xhtml
Summary: <div xmlns="http://www.w3.org/1999/xhtml">I?ve been running the  <a href="http://www.netbeans.org/community/releases/50/index.html">NetBeans 5.0</a> pre-beta for a week or two now, and I thought I?d post some real-time notes for what I turn up. Summary: some really neat stuff, fewer bugs than you?d think, one major disappointment. <i>[Update: Alt-P is gone, good.]</i></div>
Links collection:
   http://www.tbray.org/ongoing/ongoing.atom/When/200x/2005/09/16/Netbeans-5 rel=alternate
Categories collection:
   Technology/Coding/Java scheme=http://www.tbray.org/ongoing/What/
   Technology scheme=http://www.tbray.org/ongoing/What/
   Coding scheme=http://www.tbray.org/ongoing/What/
   Java scheme=http://www.tbray.org/ongoing/What/

. . . etc. etc. . . .

Summary of changes in patch#

Here is a summary of the change that are included in the patch.

  • 1.0 - In com.sun.syndication
    • 1.1 - Modified rome.properties to add in new Atom 1.0 classes
  • 2.0 - In com.sun.syndication.feed.atom
    • 2.1 - I added new Atom 1.0 fields to Content, Entry, Feed, Link and Person. To ensure that the old Atom 0.3 parser/generator will continue to work I kept the old Atom 0.3 field in place, even if they have been deprecated in Atom 1.0. Those that have been deprecated, I marked as @deprecated.
    • 2.2 - I also added Category.java
  • 3.0 - In com.sun.syndication.synd
    • 3.1 - Added ~SyndLink and ~SyndLinkImpl with same properties as Atom Link.
    • 3.2 - Modified ~SyndFeed and ~SyndFeedImpl to add property called links.
    • 3.3 - Modified ~SyndFeed to add property categories
    • 3.4 - Added ~SyndPerson and ~SyndPersonImpl with same properties as Atom Person.
    • 3.5 - Modified ~SyndFeed and ~SyndEntry to support multiple authors (getAuthors() returns a List)
    • 3.4 - Modified ~SyndEntry and ~SyndEntryImpl to add property called links. Entries now have a "link" which and a collection of links to model Atom links (could be used to model enclosures too).
    • 3.5 - Added to ~SyndEntry: summary, updatedDate.
  • 4.0 - In com.sun.syndication.synd.impl
    • 4.1 - Added ~ConverterForAtom10.java
  • 5.0 - In com.sun.syndication.synd.impl
    • 5.1 - Added ~Atom10Parser.java
    • 5.2 - Added ~Atom10Generator.java
  • 6.0 - In com.sun.syndication.unittest
    • 6.1 - Added ~TestOpsAtom10.java
    • 6.2 - Added ~TestSyndFeedAtom10.java

Status of patch#

Submitted to ROME Nov. 6th, 2005

Fix a bug and updated the attachments to this page on Nov. 11, 2005

Add new attachment

In order to upload a new attachment to this page, please use the following box to find the file, then click on “Upload”.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
jar
rome-0.8-dave.jar 190.4 kB 3 11-Nov-2005 21:44 DaveJohnson
patch
rome-atom-1.0.patch 71.6 kB 3 11-Nov-2005 21:45 DaveJohnson
« This page (revision-1) was last changed on 11-Nov-2005 21:53 by UnknownAuthor