RSS Reader Widget

RSS Reader widget provides a way to implement the rss reader on the web pages. The widget is based on the prototype javascript library.

Features

  • Customized for local share feed and remote share feed on the desktop
  • Can be initialized for third party RSS Feeds

How to show Dekoh network activity RSS Feed on the page

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>

JavaScript code

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.

HTML code

Include the following code where you want to invoke the RSS Reader Widget in page:
<div id=' remoteRssNews '></div>

How to include RSS Feed for my Dekoh desktop activity on the page?

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>

Javascript code

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.

HTML Code

Include this code in the page:
<div id=' localRssNews '></div>

How do I show RSS feed from a different location (example, my blog) on the page?

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>

Javascript code

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.

HTML Code

Include this code in the page:
<div id=' myblogRSSFeed '></div>

Parameters for localRemoteRssReader class

Required parameters

OptionsSinceDescriptionDefault
objectGivenNameV1.0localRemoteRssReader object name given-

Optional parameters

OptionsSinceDescriptionDefault
titleV1.0The title of the feed‘Title’
targetElementIdV1.0The target div element id where the rss feed is going to loadnull
modeV1.0Set value as ‘remote’ and ‘local’ for the remote and local share feedremote
countToShowV1.0The number of entries to show up in the rss reader5
dekohIdV1.0The dekoh id’s of user which you are listening to-

Functions

FunctionParametersDescription
showHeadercount-
getAndPopulateRssFeeds--
showRemoteNews--
showLocalNewstargetElementId, loggedInUser, countToShow-
showCriticalNewstargetMsgBoxObj from countToshow-
removeTheCurrentFeedTitle pudTime from countToshow-
showNextFeedTitle pudTime from countToshow-
showNextOnMsgBoxFrom countToshow-
escapeSpecialAndScriptTagsstring-
displaySharesListtargetDiv, paginationTargetElement, totalCountToshow, pageNumber-
displayPaginationBarpaginationTargetElement, feedTargetElement, countToshow, objsToPaginate, currentPageNumber-
displayListmyDiv, sharesToShowList, totalCountToShow, pageNumber-
getHTMLescapedTruncateStringStr, lengthToShow-
formatRSSXml, buddyName, arrayToPopulate-
sortRssShareObjsobjs-
showRssFeedOnRightPaneltargetElement, totalCountToShow-
moreLesOptionElement, sharesListElementId-
sortRssShareObjsOnBuddyNameobjs-
getValidImageimageURL, nameToSet-

Parameters for rssReader class

Required parameters

OptionsSinceDescriptionDefault
idV1.0Id of the rss reader-

Optional parameters

OptionsSinceDescriptionDefault
urlV1.0The url of the feed‘Title’
refreshTimeV1.0Time in sec5
heightV1.0Height of the rss feed reader200
widthV1.0Width of the rss feed reader200
containerIdV1.0The target div element id where the rss feed is going to load-

Functions

FunctionParametersDescription
getrssReaderurl-
getXMLFromStringrss_url-
rssReaderCallback--
RssContainerContentflag-
moveRssItem--
rssfade--
createRSSItemrssItem flag-
createDescrssItem event-
removeRssDescDivrssItem-
creatrRssDescDivrssItem event-
deleteRssItemrssItem-

DWR Implementation

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>

DWR XML

<!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>

Creators

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.

Methods-functionality

Method NameFunctionality
getURLGets the RSS XML for the given given url
getRssFromCasGets the RSS XML for given buddy from given service URL. Method will take care of authentication
subscribeRssFeedAdds the given URLs to the given feeds type aggreagator subscription list
excludeRssFeedExcludes the given feed item from the given aggregated feed type
unSubscribeRssFeedAdds the given URLs to the given feeds type aggregator un-subscription list. Feed will not be read from the given URLs
getAggregateFeedGets the RSS feed XML for the given feed-type

Availability

Dekoh Portal Ver 0.4.2 or later.

Attachments

rssreader_widget.jpg Info on rssreader_widget.jpg 102359 bytes