13.3 RSS and Atom - Reference Documentation
Authors: Graeme Rocher, Peter Ledbrook, Marc Palmer, Jeff Brown, Luke Daley, Burt Beckwith
Version: null
13.3 RSS and Atom
No direct support is provided for RSS or Atom within Grails. You could construct RSS or ATOM feeds with the render method's XML capability. There is however a Feeds plugin available for Grails that provides a RSS and Atom builder using the popular ROME library. An example of its usage can be seen below:
ในขณะนี้ยังไม่มีการสนับสนุนโดยตรงของ RSS และ Atom ใน Grails คุณจะสามารถสร้าง RSS หรือ ATOM feeds ได้จากการใช้ render XML ออกมา แต่ก็ยังมี ปลั๊กอินที่ชื่อว่า Feeds plugin สำหรับ Grails ที่สนับสนุน RSS และ Atom โดยใช้ ROME library โดยตัวอย่างสามารถดูได้จากด้านล่างdef feed() {
render(feedType: "rss", feedVersion: "2.0") {
title = "My test feed"
link = "http://your.test.server/yourController/feed" for (article in Article.list()) {
entry(article.title) {
link = "http://your.test.server/article/${article.id}"
article.content // return the content
}
}
}
}
