Re: Implement RSS feeds in WebObjects application
Ashok Vemuri <[email protected]>
| Newsgroups | gmane.comp.web.webobjects.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks to you all for responding to my emails on this over the last few
days. I finally managed to implement RSS 2.0 feeds in my WebObjects
application.
I basically created a direct action that returns a WOComponent. The html
file of this component ontains just one WOString. I then bound the value of
this WOString to a method in the component's Java file that returns an XML
string as below:
public String displayXmlString() {
StringBuffer xmlString = new StringBuffer();
xmlString.append("<?xml version=\"1.0\" ?>\n");
xmlString.append("<rss version=\"2.0\">\n");
xmlString.append("<channel>\n");
xmlString.append("<title>Executive Status Report</title>\n");
xmlString.append("<link>http://foo.bar.com/</link>\n");
xmlString.append("<description>This web page provides Executive
Status Report as RSS feeds.</description>\n");
xmlString.append("<item>\n");
xmlString.append("<title>" + projectCodeName() + "</title>\n");
xmlString.append("<description>" + projectStatus() +
"</description>\n");
xmlString.append("<author>" + authorName() + "</author>\n");
xmlString.append("</item>\n");
xmlString.append("</channel>\n");
xmlString.append("</rss>\n");
return xmlString.toString();
}
There's probably other ways of doing it as well, but the above works fine
for my application. And when I run the app and access the direct action in
my browser (Safari), I see the RSS feed displayed in it. Took me a while to
figure this out, but I'm glad it worked! Thanks a bunch for all your
suggestions.
- Ashok
On 1/11/06, Ashok Vemuri <[email protected]> wrote:
>
> Hi,
>
> I have a direct action in my application that returns a WOComponent with
> some content in it (project status information, for example). I need to
> provide this as an RSS feed to the users. Does anyone have some ideas on how
> to implement this?
>
> Regards,
> Ashok
>
>
>
_______________________________________________
WebObjects-dev mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/webobjects-dev