Hi ,
We would like to generate an RSS feed for the content in VCM like Articles etc. Is there any out of the box solution available or customizations . Any thoughts on how to implement it optimally would be really helpful.
Regards
Kishore
Vignette Portal 7.4 and later ships with RSS Feed reader portlet that can surface documents from VignetteBusiness Collaboration Server 7.1 and later, as well as any generic RSS feed. Refer to your application serverdocumentation for information on deploying this JSR Web application (it will generally be deployed in the sameway as any other .war file). Additional information, including guidance on setting the cross-context value forthis portlet, can be found in the readme.txt located in the following directory:portalinstalldir/system/jsrportlets/FeedReaderYou can find that information in Portal 74 install guide located here:https://knowledge.opentext.com/knowledge/llisapi.dll/fetch/2001/3551166/16714881/16714575/16744990/16679522/Vignette_Portal_7.4_Installation_Guide.pdf?nodeid=16679542&vernum=-2
The FeedReader portlet serves as a consumer. If you need the provider capability in VCM, there isnot one available out of the box.
The way I generate an RSS feed is to create a template (we use jsp) that is basically contains a template region as such:
<templating:contentRegion name="RSSFeeds" scope="page" displayInContextEdit="true" jsp="/vgn-ext-templating/templates/create_rss_feed.jsp" />
where create_rss_feed.jsp generates the xml for the feed file by taking the data and wrapping with the requisite xml tags and then writing the resulting xml into a file.
For example:
<% RequestContext reqContext = null; reqContext = PageUtil.getCurrentRequestContext(pageContext); StringBuffer xmlout = new StringBuffer(); xmlout.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); xmlout.append("<rss version=\"0.91\">"); xmlout.append("<channel>"); xmlout.append("<title>").append("YOUR TITLE").append("</title>"); xmlout.append("<link>YOUR LINK</link>"); xmlout.append("<description>").append("YOUR DESCRIPTION").append("</description>"); QueryContentComponent qc = (QueryContentComponent)reqContext.getRenderedManagedObject(); if(qc != null){ List<Object> results = qc.getResults(reqContext); System.out.println("List size = "+results.size()); if(results.size() > 0){ Iterator<Object> prit = results.iterator(); while(prit.hasNext()){ ContentInstance ci = (ContentInstance)prit.next(); ManagedObjectVCMRef VignVCMId = ci.getContentManagementId(); LinkSpec spec = new LinkSpec(); spec.setOid(VignVCMId.toString()); String linkUri = LinkBuilder.buildLink(spec, reqContext, true, false); xmlout.append("<item>"); xmlout.append("<title>").append(ci.getAttribute("<YOUR DATA>").getValue().toString()).append("</title>"); xmlout.append("<link>").append(prefix).append(linkUri).append("</link>"); xmlout.append("<description>").append(ci.getAttributeValue("<YOUR DATA>").toString()).append("</description>"); xmlout.append("</item>"); } } } xmlout.append("</channel>"); xmlout.append("</rss>"); %> <%=xmlout.toString() %>
<% PrintWriter pw = null; try { pw = new PrintWriter(new FileWriter("/opentext/rss/rss.xml")); pw.println(xmlout.toString()); pw.flush(); pw.close(); } catch (IOException ioe) { ioe.printStackTrace(); } finally { if(pw != null) { pw.flush(); pw.close(); } } %>
Any time you hit that page's url, the feed will get updated. We use smart lists to generate the content items to iterate through.
Hope this helps.
Thanks Howell,
We are contemplating something similar. We may also generate the xml feed using some scheduled cron jobs .
Thank you.
I was looking for provider capability out of the box.