hi guys,
I'm looking for a way to generate an rss feed with lift, I'm working
on something like this (from lift-book):

object OwnRssFeed extends XMLApiHelper {
  def dispatch: LiftRules.DispatchPF = {
    case Req("rss" ::   Nil, "", GetRequest) => () => showArticles()
    case Req("rss" :: _ :: Nil, "",  _) => failure _
  }


    def failure() : LiftResponse = {
      val ret: Box[NodeSeq] = Full(<op id="FAILURE"></op>)
      NotFoundResponse()
    }

    def createTag(in: NodeSeq) = {
      println("[CreateTag] " + in)
      <rss version="2.0">
          <channel>
              <title>title</title>
              <link>http://example.org</link>
              <description>Example.org</description>
              <language>en-us</language>

              <generator>Lift WebFramework</generator>
                  {in}
          </channel>
      </rss>
    }


    def showArticles(): LiftResponse = {
      val a: Box[NodeSeq] = for(a <- Article.find(By
(Article.published, true))) yield {
         a.toXML
      }
      a
    }
}

obviously the yield into the definition of showArticles method break
the cycle to the first one.

Could you suggest me what I can do? I am evaluating lift and scala
just in a while.
Thanks for your attention.
w.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to