Hello,
I have a private xwiki with authentication and I need to share a public RSS feed to avoid authentication stuff.
The way I try is to share a public space (read for non authenticate user) and generate periodicely a flat RSS page.
I customize velocity code of Main.Rss page, my Rss client (thunderbird) didn’t manage to refresh rss feed entries.
If I check my flat RSS page with Feed Validation Service (?xpage=plain&outputSyntax=plain), the HTML code is escaped!!!:
<p><?xml version="1.0" encoding="UTF-8"?><br/><rss xmlns:dc="<span class="wikiexternallink"><a class="wikimodel-freestanding" href="http://purl.org/dc/elements/1.1/"><span class="wikigeneratedlinkcontent">http://purl.org/dc/elements/1.1/</span></a></span>" version="2.0"><br/> <channel><br/> <title>Flux RSS des documents modifiés</title><br/> <link><span class="wikiexternallink"><a class="wikimodel-freestanding" href="https://xxxxxxxxxxxx/bin/view/Main/"><span class="wikigeneratedlinkcontent">
My velocity script to generate my RSS feed page ending with:
## =====================
## Execute query and generate feed
## =====================
#set ($feed = $xwiki.feed.getWebFeed($queryObject.execute()))
#set ($feedURI = $xwiki.getDocument('Main.WebHome')
...
#set ($discard = $feed.setCopyright($xwiki.getXWikiPreference('copyright')))
#set ($MyFeed = $xwiki.feed.getFeedOutput($feed, $xwiki.getXWikiPreference('feed_type', 'rss_2.0')))
##enregistre le feed RSS dans la page
#set($MyPublicRSS = $xwiki.getDocument($MyPublicRSSDocName))
#set ($discard=$MyPublicRSS.setContentType('application/rss+xml'))
#set ($discard=$MyPublicRSS.setContent($MyFeed))
#set ($discard=$MyPublicRSS.save())
I think that .setContent escaping html code of <?xml version="1.0" encoding="UTF-8"?>
I tried to avoid html escaping with $xwiki.feed.getFeedOutput but without success.
How can I store raw data (html code) in a page ?
My last way I suppose is to store the HashMap $feed in a page and read it with $xwiki.feed.getFeedOutput … but how can I store $feed in a page? with $jsontool.serialize may be but how to reinject it in a hashmap variable?
Thxs for any help.
Pascal B