ROME various bugfixes patch

View: New views
6 Messages — Rating Filter:   Alert me  

ROME various bugfixes patch

by Vadim Spivak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've discovered and fixed several bugs in ROME due in part to Google's use of the library in the AJAX Feed API. The following is a list of the changes and the patch is attached. I ran the tests and they all pass.

  • Atom 0.3 Parser/Generator
  • Atom 1.0 Generator
    • changed feed title/subtitle and entry title to be treated as Content constructs. (Parser had this implemented already.)
    • added title attribute to links. (Parser had this implemented already.)
    • fixed content parsing for some XML content types. e.g. (application/xhtml+xml)
  • Atom 0.3 Converter
    • fixed link parsing code to parse all links (not just the first alternate link) and added enclosure support via link rel="enclosure".
    • changed title conversion to use Content instead of plain text.
  • Atom 1.0 Converter
    • added SyndEnclosure to atom:link rel=enclosure conversion.
  • RSS 1.0 Generator
  • Fixed some javadoc comments for SyndEntry.

Thanks,
Vadim

[rome.patch]

? rome.patch
Index: java/com/sun/syndication/feed/synd/SyndEntry.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/feed/synd/SyndEntry.java,v
retrieving revision 1.15
diff -u -u -w -r1.15 SyndEntry.java
--- java/com/sun/syndication/feed/synd/SyndEntry.java 3 Aug 2007 23:33:08 -0000 1.15
+++ java/com/sun/syndication/feed/synd/SyndEntry.java 14 Mar 2008 07:00:28 -0000
@@ -204,7 +204,7 @@
     /**
      * Sets the entry updated date.
      * <p>
-     * @param publishedDate the entry updated date to set, <b>null</b> if none.
+     * @param updatedDate the entry updated date to set, <b>null</b> if none.
      *
      */
     void setUpdatedDate(Date updatedDate);
@@ -228,7 +228,7 @@
      * objects, for RSS feeds this method is a convenience method, it maps
      * to the Dublin Core module creator.
      * <p>
-     * @param author the feed author to set, <b>null</b> if none.
+     * @param authors the feed author to set, <b>null</b> if none.
      *
      */
     void setAuthors(List authors);
@@ -268,11 +268,11 @@
     List getContributors();
 
     /**
-     * Sets the feed author.
+     * Sets the feed contributors.
      * <p>
      * Returns contributors as a list of SyndPerson objects.
      * <p>
-     * @param author the feed author to set, <b>null</b> if none.
+     * @param contributors the feed contributors to set, <b>null</b> if none.
      *
      */
     void setContributors(List contributors);
Index: java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java,v
retrieving revision 1.19
diff -u -u -w -r1.19 ConverterForAtom03.java
--- java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java 16 Nov 2006 15:25:41 -0000 1.19
+++ java/com/sun/syndication/feed/synd/impl/ConverterForAtom03.java 14 Mar 2008 07:00:28 -0000
@@ -25,10 +25,14 @@
 import com.sun.syndication.feed.module.impl.ModuleUtils;
 import com.sun.syndication.feed.synd.SyndFeed;
 import com.sun.syndication.feed.synd.Converter;
+import com.sun.syndication.feed.synd.SyndEnclosure;
+import com.sun.syndication.feed.synd.SyndEnclosureImpl;
 import com.sun.syndication.feed.synd.SyndEntry;
 import com.sun.syndication.feed.synd.SyndContentImpl;
 import com.sun.syndication.feed.synd.SyndEntryImpl;
 import com.sun.syndication.feed.synd.SyndContent;
+import com.sun.syndication.feed.synd.SyndLink;
+import com.sun.syndication.feed.synd.SyndLinkImpl;
 import com.sun.syndication.feed.synd.SyndPerson;
 import com.sun.syndication.feed.synd.SyndPersonImpl;
 
@@ -69,11 +73,23 @@
 
         syndFeed.setTitle(aFeed.getTitle());
 
-        String linkHref = null;
-        if (aFeed.getAlternateLinks().size() > 0) {
-            linkHref = ((Link) aFeed.getAlternateLinks().get(0)).getHref();
+        // use first alternate links as THE link
+        if (aFeed.getAlternateLinks() != null
+                && aFeed.getAlternateLinks().size() > 0) {
+            Link theLink = (Link)aFeed.getAlternateLinks().get(0);
+            syndFeed.setLink(theLink.getHrefResolved());
+        }
+        // lump alternate and other links together
+        List syndLinks = new ArrayList();
+        if (aFeed.getAlternateLinks() != null
+                && aFeed.getAlternateLinks().size() > 0) {
+            syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks()));
+        }
+        if (aFeed.getOtherLinks() != null
+                && aFeed.getOtherLinks().size() > 0) {
+            syndLinks.addAll(createSyndLinks(aFeed.getOtherLinks()));
         }
-        syndFeed.setLink(linkHref);
+        syndFeed.setLinks(syndLinks);
 
         Content tagline = aFeed.getTagline();
         if (tagline!=null) {
@@ -111,6 +127,27 @@
 
     }
 
+    protected List createSyndLinks(List aLinks) {
+        ArrayList sLinks = new ArrayList();
+        for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
+            Link link = (Link)iter.next();
+            if (!link.getRel().equals("enclosure")) {
+                SyndLink sLink = createSyndLink(link);
+                sLinks.add(sLink);
+            }
+        }
+        return sLinks;
+    }
+
+    public SyndLink createSyndLink(Link link) {
+        SyndLink syndLink = new SyndLinkImpl();
+        syndLink.setRel(     link.getRel());
+        syndLink.setType(    link.getType());
+        syndLink.setHref(    link.getHrefResolved());
+        syndLink.setTitle(   link.getTitle());
+        return syndLink;
+    }
+
     protected List createSyndEntries(List atomEntries) {
         List syndEntries = new ArrayList();
         for (int i=0;i<atomEntries.size();i++) {
@@ -129,11 +166,36 @@
 
         syndEntry.setTitle(entry.getTitle());
 
-        String linkHref = null;
-        if (entry.getAlternateLinks().size() > 0) {
-            linkHref = ((Link) entry.getAlternateLinks().get(0)).getHref();
+        // if there is exactly one alternate link, use that as THE link
+        if (entry.getAlternateLinks() != null
+ && entry.getAlternateLinks().size() == 1) {
+            Link theLink = (Link)entry.getAlternateLinks().get(0);
+            syndEntry.setLink(theLink.getHrefResolved());
+        }
+
+        // Create synd enclosures from enclosure links
+        List syndEnclosures = new ArrayList();
+        if (entry.getOtherLinks() != null && entry.getOtherLinks().size() > 0) {
+            List oLinks = entry.getOtherLinks();
+            for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) {
+                Link thisLink = (Link)iter.next();
+                if ("enclosure".equals(thisLink.getRel()))
+                    syndEnclosures.add(createSyndEnclosure(entry, thisLink));
+            }
+        }
+        syndEntry.setEnclosures(syndEnclosures);
+
+        // lump alternate and other links together
+        List syndLinks = new ArrayList();
+        if (entry.getAlternateLinks() != null
+                && entry.getAlternateLinks().size() > 0) {
+            syndLinks.addAll(createSyndLinks(entry.getAlternateLinks()));
+        }
+        if (entry.getOtherLinks() != null
+                && entry.getOtherLinks().size() > 0) {
+            syndLinks.addAll(createSyndLinks(entry.getOtherLinks()));
         }
-        syndEntry.setLink(linkHref);
+        syndEntry.setLinks(syndLinks);
 
 
         String id = entry.getId();
@@ -193,6 +255,14 @@
         return syndEntry;
     }
 
+    public SyndEnclosure createSyndEnclosure(Entry entry, Link link) {
+        SyndEnclosure syndEncl = new SyndEnclosureImpl();
+        syndEncl.setUrl(link.getHrefResolved());
+        syndEncl.setType(link.getType());
+        syndEncl.setLength(link.getLength());
+        return syndEncl;
+    }
+
     public WireFeed createRealFeed(SyndFeed syndFeed) {
         Feed aFeed = new Feed(getType());
         aFeed.setModules(ModuleUtils.cloneModules(syndFeed.getModules()));
@@ -201,18 +271,49 @@
 
         aFeed.setId(syndFeed.getUri());
 
-        aFeed.setTitle(syndFeed.getTitle());
+        SyndContent sTitle = syndFeed.getTitleEx();
+        if (sTitle != null) {
+            Content title = new Content();
+            if (sTitle.getType() != null) {
+                title.setType(sTitle.getType());
+            }
+
+            if (sTitle.getMode() != null) {
+                title.setMode(sTitle.getMode());
+            }
+
+            title.setValue(sTitle.getValue());
+            aFeed.setTitleEx(title);
+        }
 
-        String sLink = syndFeed.getLink();
-        if (sLink!=null) {
+        // separate SyndEntry's links collection into alternate and other links
+        List alternateLinks = new ArrayList();
+        List otherLinks = new ArrayList();
+        List slinks = syndFeed.getLinks();
+        if (slinks != null) {
+            for (Iterator iter=slinks.iterator(); iter.hasNext();) {
+                SyndLink syndLink = (SyndLink)iter.next();
+                Link link = createAtomLink(syndLink);
+                if (link.getRel() == null ||
+                        "".equals(link.getRel().trim()) ||
+                        "alternate".equals(link.getRel())) {
+                    alternateLinks.add(link);
+                } else {
+                    otherLinks.add(link);
+                }
+            }
+        }
+        // no alternate link? then use THE link if there is one
+        if (alternateLinks.size() == 0 && syndFeed.getLink() != null) {
             Link link = new Link();
             link.setRel("alternate");
-            link.setHref(sLink);
-            List list = new ArrayList();
-            list.add(link);
-            aFeed.setAlternateLinks(list);
+            link.setHref(syndFeed.getLink());
+            alternateLinks.add(link);
         }
 
+        if (alternateLinks.size() > 0) aFeed.setAlternateLinks(alternateLinks);
+        if (otherLinks.size() > 0) aFeed.setOtherLinks(otherLinks);
+
         String sDesc = syndFeed.getDescription();
         if (sDesc!=null) {
             Content tagline = new Content();
@@ -279,18 +380,59 @@
 
         aEntry.setId(sEntry.getUri());
 
-        aEntry.setTitle(sEntry.getTitle());
+        SyndContent sTitle = sEntry.getTitleEx();
+        if (sTitle!=null) {
+            Content title = new Content();
+            if (sTitle.getType() != null) {
+                title.setType(sTitle.getType());
+            }
+
+            if (sTitle.getMode() != null) {
+                title.setMode(sTitle.getMode());
+            }
+
+            title.setValue(sTitle.getValue());
+            aEntry.setTitleEx(title);
+        }
 
-        String sLink = sEntry.getLink();
-        if (sLink!=null) {
+        // separate SyndEntry's links collection into alternate and other links
+        List alternateLinks = new ArrayList();
+        List otherLinks = new ArrayList();
+        List slinks = sEntry.getLinks();
+        if (slinks != null) {
+            for (Iterator iter=slinks.iterator(); iter.hasNext();) {
+                SyndLink syndLink = (SyndLink)iter.next();
+                Link link = createAtomLink(syndLink);
+                if (link.getRel() == null ||
+                        "".equals(link.getRel().trim()) ||
+                        "alternate".equals(link.getRel())) {
+                    alternateLinks.add(link);
+                } else {
+                    otherLinks.add(link);
+                }
+            }
+        }
+        // no alternate link? then use THE link if there is one
+        if (alternateLinks.size() == 0 && sEntry.getLink() != null) {
             Link link = new Link();
             link.setRel("alternate");
-            link.setHref(sLink);
-            List list = new ArrayList();
-            list.add(link);
-            aEntry.setAlternateLinks(list);
+            link.setHref(sEntry.getLink());
+            alternateLinks.add(link);
+        }
+
+        List sEnclosures = sEntry.getEnclosures();
+        if (sEnclosures != null) {
+            for (Iterator iter=sEnclosures.iterator(); iter.hasNext();) {
+                SyndEnclosure syndEnclosure = (SyndEnclosure) iter.next();
+                Link link = createAtomEnclosure(syndEnclosure);
+                otherLinks.add(link);
+            }
         }
 
+        if (alternateLinks.size() > 0) aEntry.setAlternateLinks(alternateLinks);
+        if (otherLinks.size() > 0) aEntry.setOtherLinks(otherLinks);
+
+
         SyndContent sContent = sEntry.getDescription();
         if (sContent!=null) {
             Content content = new Content();
@@ -332,4 +474,22 @@
         return aEntry;
     }
 
+    public Link createAtomLink(SyndLink syndLink) {
+        Link link = new Link();
+        link.setRel(     syndLink.getRel());
+        link.setType(    syndLink.getType());
+        link.setHref(    syndLink.getHref());
+        link.setTitle(   syndLink.getTitle());
+        return link;
+    }
+
+    public Link createAtomEnclosure(SyndEnclosure syndEnclosure) {
+      Link link = new Link();
+      link.setRel(     "enclosure");
+      link.setType(    syndEnclosure.getType());
+      link.setHref(    syndEnclosure.getUrl());
+      link.setLength(  syndEnclosure.getLength());
+      return link;
+    }
+
 }
Index: java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java,v
retrieving revision 1.15
diff -u -u -w -r1.15 ConverterForAtom10.java
--- java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java 30 Aug 2007 22:00:44 -0000 1.15
+++ java/com/sun/syndication/feed/synd/impl/ConverterForAtom10.java 14 Mar 2008 07:00:28 -0000
@@ -272,6 +272,15 @@
         return syndEncl;
     }
     
+    public Link createAtomEnclosure(SyndEnclosure syndEnclosure) {
+      Link link = new Link();
+      link.setRel(     "enclosure");
+      link.setType(    syndEnclosure.getType());
+      link.setHref(    syndEnclosure.getUrl());
+      link.setLength(  syndEnclosure.getLength());
+      return link;
+    }
+
     public SyndLink createSyndLink(Link link) {
         SyndLink syndLink = new SyndLinkImpl();
         syndLink.setRel(     link.getRel());
@@ -279,6 +288,7 @@
         syndLink.setHref(    link.getHrefResolved());
         syndLink.setHreflang(link.getHreflang());
         syndLink.setLength(  link.getLength());
+        syndLink.setTitle(   link.getTitle());
         return syndLink;
     }
     
@@ -289,6 +299,7 @@
         link.setHref(    syndLink.getHref());
         link.setHreflang(syndLink.getHreflang());
         link.setLength(  syndLink.getLength());
+        link.setTitle(   syndLink.getTitle());
         return link;
     }
     
@@ -438,12 +449,7 @@
         if (slinks != null) {
             for (Iterator iter=slinks.iterator(); iter.hasNext();) {      
                 SyndLink syndLink = (SyndLink)iter.next();                
-                Link link = new Link();
-                link.setRel(syndLink.getRel());
-                link.setHref(syndLink.getHref());
-                link.setHreflang(syndLink.getHreflang());
-                link.setLength(syndLink.getLength());                
-                link.setType(syndLink.getType());
+                Link link = createAtomLink(syndLink);
                 // Set this flag if there's a link of rel = enclosure so that
                 // enclosures won't be duplicated when pulled from
                 // SyndEntry.getEnclosures()
@@ -472,11 +478,7 @@
         if (enclosures != null && linkRelEnclosureExists == false) {
             for (Iterator iter=enclosures.iterator(); iter.hasNext();) {
                 SyndEnclosure syndEncl = (SyndEnclosure)iter.next();
-                Link link = new Link();
-                link.setRel("enclosure");
-                link.setHref(syndEncl.getUrl());
-                link.setType(syndEncl.getType());
-                link.setLength(syndEncl.getLength());
+                Link link = createAtomEnclosure(syndEncl);
                 otherLinks.add(link);
             }
         }
Index: java/com/sun/syndication/io/impl/Atom03Generator.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/io/impl/Atom03Generator.java,v
retrieving revision 1.12
diff -u -u -w -r1.12 Atom03Generator.java
--- java/com/sun/syndication/io/impl/Atom03Generator.java 16 Nov 2006 15:25:41 -0000 1.12
+++ java/com/sun/syndication/io/impl/Atom03Generator.java 14 Mar 2008 07:00:28 -0000
@@ -18,7 +18,6 @@
 
 import com.sun.syndication.feed.WireFeed;
 import com.sun.syndication.feed.atom.*;
-import com.sun.syndication.feed.synd.SyndPerson;
 import com.sun.syndication.io.FeedException;
 import org.jdom.Attribute;
 import org.jdom.Document;
@@ -110,8 +109,10 @@
     }
 
     protected void populateFeedHeader(Feed feed, Element eFeed) throws FeedException {
-        if (feed.getTitle() != null) {
-            eFeed.addContent(generateSimpleElement("title", feed.getTitle()));
+        if (feed.getTitleEx() != null) {
+            Element titleElement = new Element("title", getFeedNamespace());
+            fillContentElement(titleElement, feed.getTitleEx());
+            eFeed.addContent(titleElement);
         }
 
         List links = feed.getAlternateLinks();
@@ -168,8 +169,10 @@
     }
 
     protected void populateEntry(Entry entry, Element eEntry) throws FeedException {
-        if (entry.getTitle() != null) {
-            eEntry.addContent(generateSimpleElement("title", entry.getTitle()));
+        if (entry.getTitleEx() != null) {
+            Element titleElement = new Element("title", getFeedNamespace());
+            fillContentElement(titleElement, entry.getTitleEx());
+            eEntry.addContent(titleElement);
         }
         List links = entry.getAlternateLinks();
         for (int i = 0; i < links.size(); i++) {
Index: java/com/sun/syndication/io/impl/Atom03Parser.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/io/impl/Atom03Parser.java,v
retrieving revision 1.18
diff -u -u -w -r1.18 Atom03Parser.java
--- java/com/sun/syndication/io/impl/Atom03Parser.java 14 Aug 2007 11:21:56 -0000 1.18
+++ java/com/sun/syndication/io/impl/Atom03Parser.java 14 Mar 2008 07:00:28 -0000
@@ -73,7 +73,7 @@
 
         Element e = eFeed.getChild("title",getAtomNamespace());
         if (e!=null) {
-            feed.setTitle(e.getText());
+            feed.setTitleEx(parseContent(e));
         }
 
         List eList = eFeed.getChildren("link",getAtomNamespace());
@@ -274,7 +274,7 @@
 
         Element e = eEntry.getChild("title",getAtomNamespace());
         if (e!=null) {
-            entry.setTitle(e.getText());
+            entry.setTitleEx(parseContent(e));
         }
 
         List eList = eEntry.getChildren("link",getAtomNamespace());
Index: java/com/sun/syndication/io/impl/Atom10Generator.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/io/impl/Atom10Generator.java,v
retrieving revision 1.15
diff -u -u -w -r1.15 Atom10Generator.java
--- java/com/sun/syndication/io/impl/Atom10Generator.java 14 Aug 2007 04:03:30 -0000 1.15
+++ java/com/sun/syndication/io/impl/Atom10Generator.java 14 Mar 2008 07:00:28 -0000
@@ -37,7 +37,6 @@
 import com.sun.syndication.io.FeedException;
 import com.sun.syndication.io.WireFeedOutput;
 import java.io.IOException;
-import java.io.StringWriter;
 import java.io.Writer;
 import java.util.ArrayList;
 import org.jdom.output.XMLOutputter;
@@ -131,8 +130,10 @@
     }
 
     protected void populateFeedHeader(Feed feed,Element eFeed) throws FeedException {
-        if (feed.getTitle() != null) {
-            eFeed.addContent(generateSimpleElement("title", feed.getTitle()));
+        if (feed.getTitleEx() != null) {
+            Element titleElement = new Element("title", getFeedNamespace());
+            fillContentElement(titleElement, feed.getTitleEx());
+            eFeed.addContent(titleElement);
         }
 
         List links = feed.getAlternateLinks();
@@ -168,21 +169,9 @@
         }
 
         if (feed.getSubtitle() != null) {
-            eFeed.addContent(generateSimpleElement("subtitle", feed.getSubtitle().getValue()));
-            Content subtitle = feed.getSubtitle();
-
-            if (subtitle.getType() != null) {
-                Element subtitleElement =
-                        new Element("subtitle", getFeedNamespace());
-                Attribute subtitleType =
-                        new Attribute("type", subtitle.getType());
-                subtitleElement.setAttribute(subtitleType);
-                subtitleElement.addContent(subtitle.getValue());
+          Element subtitleElement = new Element("subtitle", getFeedNamespace());
+          fillContentElement(subtitleElement, feed.getSubtitle());
                 eFeed.addContent(subtitleElement);
-            } else {
-                eFeed.addContent(
-                        generateSimpleElement("subtitle", subtitle.getValue()));
-            }
         }
 
         if (feed.getId() != null) {
@@ -213,8 +202,10 @@
     }
 
     protected void populateEntry(Entry entry, Element eEntry) throws FeedException {
-        if (entry.getTitle() != null) {
-            eEntry.addContent(generateSimpleElement("title", entry.getTitle()));
+        if (entry.getTitleEx() != null) {
+            Element titleElement = new Element("title", getFeedNamespace());
+            fillContentElement(titleElement, entry.getTitleEx());
+            eEntry.addContent(titleElement);
         }
         List links = entry.getAlternateLinks();
         if (links != null) {
@@ -323,7 +314,7 @@
         Element linkElement = new Element("link", getFeedNamespace());
 
         if (link.getRel() != null) {
-            Attribute relAttribute = new Attribute("rel", link.getRel().toString());
+            Attribute relAttribute = new Attribute("rel", link.getRel());
             linkElement.setAttribute(relAttribute);
         }
 
@@ -384,14 +375,13 @@
         throws FeedException {
 
         String type = content.getType();
-        if (type != null) {
             String atomType = type;
-            
+        if (type != null) {
             // Fix for issue #39 "Atom 1.0 Text Types Not Set Correctly"
             // we're not sure who set this value, so ensure Atom types are used
-            if ("text/plain".equals(type)) atomType = "text";
-            else if ("text/html".equals(type)) atomType = "html";
-            else if ("application/xhtml+xml".equals(type)) atomType = "xhtml";
+            if ("text/plain".equals(type)) atomType = Content.TEXT;
+            else if ("text/html".equals(type)) atomType = Content.HTML;
+            else if ("application/xhtml+xml".equals(type)) atomType = Content.XHTML;
             
             Attribute typeAttribute = new Attribute("type", atomType);
             contentElement.setAttribute(typeAttribute);
@@ -402,7 +392,9 @@
             contentElement.setAttribute(srcAttribute);
         }
         if (content.getValue() != null) {
-            if (type != null && (type.equals(Content.XHTML) || (type.indexOf("/xml")) != -1)) {
+            if (atomType != null && (atomType.equals(Content.XHTML) || (atomType.indexOf("/xml")) != -1 ||
+                (atomType.indexOf("+xml")) != -1)) {
+
                 StringBuffer tmpDocString = new StringBuffer("<tmpdoc>");
                 tmpDocString.append(content.getValue());
                 tmpDocString.append("</tmpdoc>");
Index: java/com/sun/syndication/io/impl/RSS10Generator.java
===================================================================
RCS file: /cvs/rome/src/java/com/sun/syndication/io/impl/RSS10Generator.java,v
retrieving revision 1.10
diff -u -u -w -r1.10 RSS10Generator.java
--- java/com/sun/syndication/io/impl/RSS10Generator.java 4 Dec 2006 19:48:20 -0000 1.10
+++ java/com/sun/syndication/io/impl/RSS10Generator.java 14 Mar 2008 07:00:28 -0000
@@ -62,9 +62,9 @@
             for (int i=0;i<items.size();i++) {
                 Item item = (Item) items.get(i);
                 Element eLi = new Element("li",getRDFNamespace());
-                String link = item.getLink();
-                if (link!=null) {
-                    eLi.setAttribute("resource",link);
+                String uri = item.getUri();
+                if (uri!=null) {
+                    eLi.setAttribute("resource",uri,getRDFNamespace());
                 }
                 eSeq.addContent(eLi);
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

Re: ROME various bugfixes patch

by Patrick Chanezon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My colleague Vadim just posted a patch proposal for ROME.
I can see it in the archive
https://rome.dev.java.net/servlets/ReadMsg?list=dev&msgNo=2522
But it ended up in my gmail spam folder.

Hoping that resending it will trigger a response from ROME developers.
Dave, Alejandro, ROME commiters, does the patch look OK to you?
Vadim, sorry for the delay, and thanks for the patch.

P@

On Fri, Mar 14, 2008 at 1:10 AM, Vadim Spivak <vadims@...> wrote:
Hi,

I've discovered and fixed several bugs in ROME due in part to Google's use of the library in the AJAX Feed API. The following is a list of the changes and the patch is attached. I ran the tests and they all pass.

  • Atom 0.3 Parser/Generator
  • Atom 1.0 Generator
    • changed feed title/subtitle and entry title to be treated as Content constructs. (Parser had this implemented already.)
    • added title attribute to links. (Parser had this implemented already.)
    • fixed content parsing for some XML content types. e.g. (application/xhtml+xml)
  • Atom 0.3 Converter
    • fixed link parsing code to parse all links (not just the first alternate link) and added enclosure support via link rel="enclosure".
    • changed title conversion to use Content instead of plain text.
  • Atom 1.0 Converter
    • added SyndEnclosure to atom:link rel=enclosure conversion.
  • RSS 1.0 Generator
  • Fixed some javadoc comments for SyndEntry.

Thanks,
Vadim

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...



--
Patrick Chanezon, Google Developer Advocate
http://wordpress.chanezon.com/
http://code.google.com/apis/

Re: ROME various bugfixes patch

by Alejandro Abdelnur-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Vadim, the change descriptions look good to me, although the
patch did not make it with P@'s email.

A

On Tue, Mar 25, 2008 at 1:24 AM, Patrick Chanezon <chanezon@...> wrote:

> My colleague Vadim just posted a patch proposal for ROME.
>  I can see it in the archive
>  https://rome.dev.java.net/servlets/ReadMsg?list=dev&msgNo=2522
> But it ended up in my gmail spam folder.
>
> Hoping that resending it will trigger a response from ROME developers.
>  Dave, Alejandro, ROME commiters, does the patch look OK to you?
> Vadim, sorry for the delay, and thanks for the patch.
>
> P@
>
> On Fri, Mar 14, 2008 at 1:10 AM, Vadim Spivak <vadims@...> wrote:
>
> > Hi,
> >
> > I've discovered and fixed several bugs in ROME due in part to Google's use
> of the library in the AJAX Feed API. The following is a list of the changes
> and the patch is attached. I ran the tests and they all pass.
> >
> >
> >
> > Atom 0.3 Parser/Generator
> >
> >
> > changed title to be treated as a Content construct.
> (http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.3)
> >
> >
> > Atom 1.0 Generator
> >
> >
> > changed feed title/subtitle and entry title to be treated as Content
> constructs. (Parser had this implemented already.)
> >
> >
> >
> > added title attribute to links. (Parser had this implemented already.)
> >
> >
> > fixed content parsing for some XML content types. e.g.
> (application/xhtml+xml)
> >
> >
> > Atom 0.3 Converter
> >
> >
> > fixed link parsing code to parse all links (not just the first alternate
> link) and added enclosure support via link rel="enclosure".
> >
> >
> >
> > changed title conversion to use Content instead of plain text.
> >
> > Atom 1.0 Converter
> >
> >
> > added SyndEnclosure to atom:link rel=enclosure conversion.
> >
> > RSS 1.0 Generator
> >
> >
> > channel/items/Seq/li/@resource now get's the item URI instead of the Link.
> (http://web.resource.org/rss/1.0/spec#s5.3.5)
> >
> >
> > Fixed some javadoc comments for SyndEntry.
> >
> > Thanks,
> > Vadim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@...
> > For additional commands, e-mail: dev-help@...
> >
>
>
>
> --
> Patrick Chanezon, Google Developer Advocate
> http://wordpress.chanezon.com/
>  http://code.google.com/apis/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: ROME various bugfixes patch

by Patrick Chanezon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Alejandro.
The patch is attached in the rome arhcive
https://rome.dev.java.net/servlets/GetAttachment?list=dev&msgId=1506875&attachId=1

P@

On Tue, Mar 25, 2008 at 3:58 AM, Alejandro Abdelnur <tucu00@...> wrote:
Thanks Vadim, the change descriptions look good to me, although the
patch did not make it with P@'s email.

A

On Tue, Mar 25, 2008 at 1:24 AM, Patrick Chanezon <chanezon@...> wrote:
> My colleague Vadim just posted a patch proposal for ROME.
>  I can see it in the archive
>  https://rome.dev.java.net/servlets/ReadMsg?list=dev&msgNo=2522
> But it ended up in my gmail spam folder.
>
> Hoping that resending it will trigger a response from ROME developers.
>  Dave, Alejandro, ROME commiters, does the patch look OK to you?
> Vadim, sorry for the delay, and thanks for the patch.
>
> P@
>
> On Fri, Mar 14, 2008 at 1:10 AM, Vadim Spivak <vadims@...> wrote:
>
> > Hi,
> >
> > I've discovered and fixed several bugs in ROME due in part to Google's use
> of the library in the AJAX Feed API. The following is a list of the changes
> and the patch is attached. I ran the tests and they all pass.
> >
> >
> >
> > Atom 0.3 Parser/Generator
> >
> >
> > changed title to be treated as a Content construct.
> (http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.3)
> >
> >
> > Atom 1.0 Generator
> >
> >
> > changed feed title/subtitle and entry title to be treated as Content
> constructs. (Parser had this implemented already.)
> >
> >
> >
> > added title attribute to links. (Parser had this implemented already.)
> >
> >
> > fixed content parsing for some XML content types. e.g.
> (application/xhtml+xml)
> >
> >
> > Atom 0.3 Converter
> >
> >
> > fixed link parsing code to parse all links (not just the first alternate
> link) and added enclosure support via link rel="enclosure".
> >
> >
> >
> > changed title conversion to use Content instead of plain text.
> >
> > Atom 1.0 Converter
> >
> >
> > added SyndEnclosure to atom:link rel=enclosure conversion.
> >
> > RSS 1.0 Generator
> >
> >
> > channel/items/Seq/li/@resource now get's the item URI instead of the Link.
> (http://web.resource.org/rss/1.0/spec#s5.3.5)
> >
> >
> > Fixed some javadoc comments for SyndEntry.
> >
> > Thanks,
> > Vadim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@...
> > For additional commands, e-mail: dev-help@...
> >
>
>
>
> --
> Patrick Chanezon, Google Developer Advocate
> http://wordpress.chanezon.com/
>  http://code.google.com/apis/



--
Patrick Chanezon, Google Developer Advocate
http://wordpress.chanezon.com/
http://code.google.com/apis/

Re: ROME various bugfixes patch

by Alejandro Abdelnur-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Vadim,

Thanks for the fixes. I've just went over them and applied to the CVS head.

Regards.

A

On Tue, Mar 25, 2008 at 1:24 AM, Patrick Chanezon <chanezon@...> wrote:

> My colleague Vadim just posted a patch proposal for ROME.
>  I can see it in the archive
>  https://rome.dev.java.net/servlets/ReadMsg?list=dev&msgNo=2522
> But it ended up in my gmail spam folder.
>
> Hoping that resending it will trigger a response from ROME developers.
>  Dave, Alejandro, ROME commiters, does the patch look OK to you?
> Vadim, sorry for the delay, and thanks for the patch.
>
> P@
>
> On Fri, Mar 14, 2008 at 1:10 AM, Vadim Spivak <vadims@...> wrote:
>
> > Hi,
> >
> > I've discovered and fixed several bugs in ROME due in part to Google's use
> of the library in the AJAX Feed API. The following is a list of the changes
> and the patch is attached. I ran the tests and they all pass.
> >
> >
> >
> > Atom 0.3 Parser/Generator
> >
> >
> > changed title to be treated as a Content construct.
> (http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.3)
> >
> >
> > Atom 1.0 Generator
> >
> >
> > changed feed title/subtitle and entry title to be treated as Content
> constructs. (Parser had this implemented already.)
> >
> >
> >
> > added title attribute to links. (Parser had this implemented already.)
> >
> >
> > fixed content parsing for some XML content types. e.g.
> (application/xhtml+xml)
> >
> >
> > Atom 0.3 Converter
> >
> >
> > fixed link parsing code to parse all links (not just the first alternate
> link) and added enclosure support via link rel="enclosure".
> >
> >
> >
> > changed title conversion to use Content instead of plain text.
> >
> > Atom 1.0 Converter
> >
> >
> > added SyndEnclosure to atom:link rel=enclosure conversion.
> >
> > RSS 1.0 Generator
> >
> >
> > channel/items/Seq/li/@resource now get's the item URI instead of the Link.
> (http://web.resource.org/rss/1.0/spec#s5.3.5)
> >
> >
> > Fixed some javadoc comments for SyndEntry.
> >
> > Thanks,
> > Vadim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@...
> > For additional commands, e-mail: dev-help@...
> >
>
>
>
> --
> Patrick Chanezon, Google Developer Advocate
> http://wordpress.chanezon.com/
>  http://code.google.com/apis/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: ROME various bugfixes patch

by Vadim Spivak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Alejandro!

Vadim

On Tue, Apr 1, 2008 at 10:41 AM, Alejandro Abdelnur <tucu00@...> wrote:
Vadim,

Thanks for the fixes. I've just went over them and applied to the CVS head.

Regards.

A

On Tue, Mar 25, 2008 at 1:24 AM, Patrick Chanezon <chanezon@...> wrote:
> My colleague Vadim just posted a patch proposal for ROME.
>  I can see it in the archive
>  https://rome.dev.java.net/servlets/ReadMsg?list=dev&msgNo=2522
> But it ended up in my gmail spam folder.
>
> Hoping that resending it will trigger a response from ROME developers.
>  Dave, Alejandro, ROME commiters, does the patch look OK to you?
> Vadim, sorry for the delay, and thanks for the patch.
>
> P@
>
> On Fri, Mar 14, 2008 at 1:10 AM, Vadim Spivak <vadims@...> wrote:
>
> > Hi,
> >
> > I've discovered and fixed several bugs in ROME due in part to Google's use
> of the library in the AJAX Feed API. The following is a list of the changes
> and the patch is attached. I ran the tests and they all pass.
> >
> >
> >
> > Atom 0.3 Parser/Generator
> >
> >
> > changed title to be treated as a Content construct.
> (http://www.mnot.net/drafts/draft-nottingham-atom-format-02.html#rfc.section.4.3)
> >
> >
> > Atom 1.0 Generator
> >
> >
> > changed feed title/subtitle and entry title to be treated as Content
> constructs. (Parser had this implemented already.)
> >
> >
> >
> > added title attribute to links. (Parser had this implemented already.)
> >
> >
> > fixed content parsing for some XML content types. e.g.
> (application/xhtml+xml)
> >
> >
> > Atom 0.3 Converter
> >
> >
> > fixed link parsing code to parse all links (not just the first alternate
> link) and added enclosure support via link rel="enclosure".
> >
> >
> >
> > changed title conversion to use Content instead of plain text.
> >
> > Atom 1.0 Converter
> >
> >
> > added SyndEnclosure to atom:link rel=enclosure conversion.
> >
> > RSS 1.0 Generator
> >
> >
> > channel/items/Seq/li/@resource now get's the item URI instead of the Link.
> (http://web.resource.org/rss/1.0/spec#s5.3.5)
> >
> >
> > Fixed some javadoc comments for SyndEntry.
> >
> > Thanks,
> > Vadim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@...
> > For additional commands, e-mail: dev-help@...
> >
>
>
>
> --
> Patrick Chanezon, Google Developer Advocate
> http://wordpress.chanezon.com/
>  http://code.google.com/apis/

LightInTheBox - Buy quality products at wholesale price