RSS Reader widget provides a way to implement the rss reader on the web pages. The widget is based on the prototype javascript library.
- Customized for local share feed and remote share feed on the desktop
- Can be initialized for third party RSS Feeds
Add this code to the head section of the page:
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>'>
</script>
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","rssReader","sharesRssReader.js")%>'>
</script>
The basic syntax to initialize the Dialog widget is
<script type="text/javascript">
//<![CDATA[
var remoteRssFeed = new localRemoteRssReader('remoteRssFeed', {title:"REMOTE SHARES FOR ME", targetElementId:'remoteRssNews', countToShow:5, dekohId:'USER_ID'}, {callback:updateFunction});
remoteRssFeed.getAndPopulateRssFeeds();
//]]>
</script>
Note: Put the javascript code after the div element in the page so that the element gets registered in the dom.
Include the following code where you want to invoke the RSS Reader Widget in page:
<div id=' remoteRssNews '></div>
Add this code to the head section of the page:
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>'>
</script>
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","rssReader","sharesRssReader.js")%>'>
</script>
The basic syntax to initialize the Dialog widget is
<script type="text/javascript">
//<![CDATA[
var remoteRssFeed = new localRemoteRssReader('localRssFeed', {title:"REMOTE SHARES FOR ME", targetElementId:'remoteRssNews', countToShow:5, dekohId:'USER_ID'}, {callback:updateFunction});
remoteRssFeed.getAndPopulateRssFeeds();
//]]>
</script>
Note: Put the javascript code after the div element in the page so that the element gets registered in the dom.
Include this code in the page:
<div id=' localRssNews '></div>
Add this code to the head section of the page:
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "common",null,"JSlibrary.jsp")%>'>
</script>
<script type='text/javascript' src='<%=dekoh.portal.util.StaticFilesURLGenerator.generateStaticFileURL(request, "widget","rssReader","rssReader.js")%>'>
</script>
The basic syntax to initialize the Dialog widget is
<script type="text/javascript">
//<![CDATA[
var myRssFeed = new rssReader(‘myrssfeed’,{url: http://www.dekoh.com/blog/news/feed/entries/rss’, refreshTime:’5’, height:200,width:200, containerId :’myblogRSSFeed’})
//]]>
</script>
Note: Put the javascript code after the div element in the page so that the element gets registered in the dom.
Include this code in the page:
<div id=' myblogRSSFeed '></div>
| Options | Since | Description | Default |
| objectGivenName | V1.0 | localRemoteRssReader object name given | - |
| Options | Since | Description | Default |
| title | V1.0 | The title of the feed | ‘Title’ |
| targetElementId | V1.0 | The target div element id where the rss feed is going to load | null |
| mode | V1.0 | Set value as ‘remote’ and ‘local’ for the remote and local share feed | remote |
| countToShow | V1.0 | The number of entries to show up in the rss reader | 5 |
| dekohId | V1.0 | The dekoh id’s of user which you are listening to | - |
| Function | Parameters | Description |
| showHeader | count | - |
| getAndPopulateRssFeeds | - | - |
| showRemoteNews | - | - |
| showLocalNews | targetElementId, loggedInUser, countToShow | - |
| showCriticalNews | targetMsgBoxObj from countToshow | - |
| removeTheCurrentFeed | Title pudTime from countToshow | - |
| showNextFeed | Title pudTime from countToshow | - |
| showNextOnMsgBox | From countToshow | - |
| escapeSpecialAndScriptTags | string | - |
| displaySharesList | targetDiv, paginationTargetElement, totalCountToshow, pageNumber | - |
| displayPaginationBar | paginationTargetElement, feedTargetElement, countToshow, objsToPaginate, currentPageNumber | - |
| displayList | myDiv, sharesToShowList, totalCountToShow, pageNumber | - |
| getHTMLescapedTruncateString | Str, lengthToShow | - |
| formatRSS | Xml, buddyName, arrayToPopulate | - |
| sortRssShareObjs | objs | - |
| showRssFeedOnRightPanel | targetElement, totalCountToShow | - |
| moreLesOption | Element, sharesListElementId | - |
| sortRssShareObjsOnBuddyName | objs | - |
| getValidImage | imageURL, nameToSet | - |
| Options | Since | Description | Default |
| id | V1.0 | Id of the rss reader | - |
| Options | Since | Description | Default |
| url | V1.0 | The url of the feed | ‘Title’ |
| refreshTime | V1.0 | Time in sec | 5 |
| height | V1.0 | Height of the rss feed reader | 200 |
| width | V1.0 | Width of the rss feed reader | 200 |
| containerId | V1.0 | The target div element id where the rss feed is going to load | - |
| Function | Parameters | Description |
| getrssReader | url | - |
| getXMLFromString | rss_url | - |
| rssReaderCallback | - | - |
| RssContainerContent | flag | - |
| moveRssItem | - | - |
| rssfade | - | - |
| createRSSItem | rssItem flag | - |
| createDesc | rssItem event | - |
| removeRssDescDiv | rssItem | - |
| creatrRssDescDiv | rssItem event | - |
| deleteRssItem | rssItem | - |
Reference in web.xml
The DWR method mapping XML is given in web.xml as
<init-param>
<param-name>config-rssReader</param-name>
<param-value>widgets/rssReader/dwr-rssreader.xml</param-value>
</init-param>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
"http://www.getahead.ltd.uk/dwr/dwr10.dtd">
<dwr>
<allow>
<create creator="new" javascript="rssreader">
<param name="class" value="dekoh.portal.widget.rssreader.RSSReader"/>
<include method="getURL"/>
<include method="getRssFromCas"/>
<include method="getRemoteAggregateRSSFeed"/>
<include method="subscribeRssFeed"/>
<include method="unSubscribeRssFeed"/>
<include method="getAggregateFeed"/>
<include method="excludeRssFeed"/>
</create>
</allow>
</dwr>
Each class on which we execute methods, needs a <create ...> entry. There are several types of creator. The most common ones use either the 'new' keyword or the Spring framework. For more information, see the Creator documentation.
- ClassName : dekoh.portal.widget.rssreader.RSSReader
- Description : Class will provide the functionality to get the rss from subscribed feeds.
| Method Name | Functionality |
| getURL | Gets the RSS XML for the given given url |
| getRssFromCas | Gets the RSS XML for given buddy from given service URL. Method will take care of authentication |
| subscribeRssFeed | Adds the given URLs to the given feeds type aggreagator subscription list |
| excludeRssFeed | Excludes the given feed item from the given aggregated feed type |
| unSubscribeRssFeed | Adds the given URLs to the given feeds type aggregator un-subscription list. Feed will not be read from the given URLs |
| getAggregateFeed | Gets the RSS feed XML for the given feed-type |
Dekoh Portal Ver 0.4.2 or later.