incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdic...@apache.org
Subject svn commit: r991988 - in /incubator/esme/trunk/server/src/main/scala/org/apache/esme/external: AtomFeed.scala Feed.scala RssFeed.scala
Date Thu, 02 Sep 2010 15:39:19 GMT
Author: vdichev
Date: Thu Sep  2 15:39:19 2010
New Revision: 991988

URL: http://svn.apache.org/viewvc?rev=991988&view=rev
Log:
ESME-266 Fix broken feed

Modified:
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/AtomFeed.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala
    incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/AtomFeed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/AtomFeed.scala?rev=991988&r1=991987&r2=991988&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/AtomFeed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/AtomFeed.scala Thu
Sep  2 15:39:19 2010
@@ -37,7 +37,7 @@ class AtomFeed(user: User, atomURL: Stri
   
   override def dateFormats = AtomFeed.dateFormats
   
-  override def getEntries(xml: Elem) = xml \ "entry"
+  override def getEntries(xml: NodeSeq) = xml \ "entry"
   
   override def getText(node: Node) = {
     // a title element is mandatory

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala?rev=991988&r1=991987&r2=991988&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/Feed.scala Thu Sep
 2 15:39:19 2010
@@ -43,24 +43,22 @@ abstract class Feed(val user: User, val 
 
   override def apply() = {
     
-    ( for {
-           xml <- PCDataXmlParser(responseString).toList
-           node <- xml.flatMap{ case e: Elem => List(e) case _ => Nil}
-         }
-        yield UserCreatedMessage(
-          if (user != null) {user.id} else 0,
-          getText(node) + " " + getLink(node),
-          tags,
-          getDate(node),
-          Empty,
-          source,
-          Empty,
-          None
-        )
-    ).toList
+    for {
+         xml <- PCDataXmlParser(responseString).toList
+         node <- getEntries(xml)
+    } yield UserCreatedMessage(
+      if (user != null) {user.id} else 0,
+      getText(node) + " " + getLink(node),
+      tags,
+      getDate(node),
+      Empty,
+      source,
+      Empty,
+      None
+    )
   }
   
-  protected def getEntries(xml: Elem): NodeSeq
+  protected def getEntries(xml: NodeSeq): NodeSeq
   
   protected def getText(xml: Node): String
   

Modified: incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala?rev=991988&r1=991987&r2=991988&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/org/apache/esme/external/RssFeed.scala Thu
Sep  2 15:39:19 2010
@@ -38,7 +38,7 @@ class RssFeed(user: User, rssURL: String
 
   override def dateFormats = RssFeed.dateFormats
   
-  override def getEntries(xml: Elem) = xml \\ "item"
+  override def getEntries(xml: NodeSeq) = xml \\ "item"
   
   override def getText(node: Node) = {
     // if there's no title, get description



Mime
View raw message