tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsdelf...@apache.org
Subject svn commit: r634573 - /incubator/tuscany/java/sca/modules/binding-feed-atom/src/main/java/org/apache/tuscany/sca/binding/feed/provider/FeedBindingListenerServlet.java
Date Fri, 07 Mar 2008 07:42:53 GMT
Author: jsdelfino
Date: Thu Mar  6 23:42:53 2008
New Revision: 634573

URL: http://svn.apache.org/viewvc?rev=634573&view=rev
Log:
Added support for ATOM 'alternate' links.

Modified:
    incubator/tuscany/java/sca/modules/binding-feed-atom/src/main/java/org/apache/tuscany/sca/binding/feed/provider/FeedBindingListenerServlet.java

Modified: incubator/tuscany/java/sca/modules/binding-feed-atom/src/main/java/org/apache/tuscany/sca/binding/feed/provider/FeedBindingListenerServlet.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-feed-atom/src/main/java/org/apache/tuscany/sca/binding/feed/provider/FeedBindingListenerServlet.java?rev=634573&r1=634572&r2=634573&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-feed-atom/src/main/java/org/apache/tuscany/sca/binding/feed/provider/FeedBindingListenerServlet.java
(original)
+++ incubator/tuscany/java/sca/modules/binding-feed-atom/src/main/java/org/apache/tuscany/sca/binding/feed/provider/FeedBindingListenerServlet.java
Thu Mar  6 23:42:53 2008
@@ -328,13 +328,15 @@
             }
 
             if (href != null) {
-                feedEntry.addLink(href, "edit");
-                feedEntry.addLink(href,"alternate");
+                feedEntry.addLink(href);
             }
-                
             String related = item.getRelated();
             if (related != null) {
-                feedEntry.addLink(href, "related");
+                feedEntry.addLink(related, "related");
+            }
+            String alternate = item.getAlternate();
+            if (related != null) {
+                feedEntry.addLink(alternate, "alternate");
             }
                 
             Date date = item.getDate();
@@ -383,16 +385,14 @@
                 item.setContents(feedEntry.getContent());
                 
                 for (Link link : feedEntry.getLinks()) {
-                    if (link.getRel() == null || "edit".equals(link.getRel())) {
+                    if (link.getRel() == null || "self".equals(link.getRel())) {
                         if (item.getLink() == null) {
-                            String href = link.getHref().toString();
-                            item.setLink(href);
+                            item.setLink(link.getHref().toString());
                         }
                     } else if ("related".equals(link.getRel())) {
-                        if (item.getRelated() == null) {
-                            String related = link.getHref().toString();
-                            item.setRelated(related);
-                        }
+                        item.setRelated(link.getHref().toString());
+                    } else if ("alternate".equals(link.getRel())) {
+                        item.setAlternate(link.getHref().toString());
                     }
                 }
                 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message