Reactivate, refresh RSS feeds can been done several time.

cusax-fix
Vincent Lucas 18 years ago
parent 726e7f0e9e
commit 03df0ec997

@ -249,6 +249,7 @@ private String findFavIconFromSiteIndex(ContactRssImpl contact)
private byte[] getFavIconFromSiteRoot(ContactRssImpl contact)
{
Image selectedIcon;
URL location = null;
// we use these to get the best possible icon in case our favicon is a
// multi-page icon.
@ -265,7 +266,7 @@ private byte[] getFavIconFromSiteRoot(ContactRssImpl contact)
{
URL feedLocation = new URL(contact.getRssFeedReader().getURL());
URL location = new URL(feedLocation.getProtocol() + "://"
location = new URL(feedLocation.getProtocol() + "://"
+ feedLocation.getHost() + "/favicon.ico");
ICOFile favicon = new ICOFile(location);
@ -323,7 +324,8 @@ private byte[] getFavIconFromSiteRoot(ContactRssImpl contact)
}
catch (Exception ex)
{
logger.warn("Unknown error on favicon retrieval. " + ex, ex);
logger.warn("Unknown error on favicon retrieval. " + ex +
". Error for location: " + location, ex);
logger.debug("", ex);
}

@ -129,8 +129,8 @@ private void submitRssQuery(ContactRssImpl rssContact,
RssFeedReader rssFeed = rssContact.getRssFeedReader();
//try
//{
try
{
//we create the message containing the new items retrieved
news = rssFeed.getNewFeeds();
@ -143,8 +143,8 @@ private void submitRssQuery(ContactRssImpl rssContact,
rssContact, RssStatusEnum.ONLINE);
}
//}
/*catch (FileNotFoundException ex)
}
catch (FileNotFoundException ex)
{
//RSS flow no longer exists - ask user to remove;
handleFileNotFoundException(rssContact, ex);
@ -153,14 +153,14 @@ private void submitRssQuery(ContactRssImpl rssContact,
+ ex.getMessage());
logger.debug(ex);
return;
}*/
/*catch (OperationFailedException ex)
}
catch (OperationFailedException ex)
{
logger.error("Failed to retrieve RSS flow. Error was: "
+ ex.getMessage()
, ex);
return;
}*/
}
if(news != null)
{

@ -146,7 +146,7 @@ private void retrieveFlow()
/*for(int i=0; i < items.length; ++i)
{
System.out.println("CHENZO item_list[" + i + "] URI: " + items[i].getUri()
+ ", Date: " + items[i].getUpdatedDate() + ", Title: " +
+ ", Date: " + items[i].getPublishedDate() + ", Title: " +
items[i].getTitle());
}*/
@ -175,12 +175,16 @@ private void retrieveFlow()
* @return textual representation of the feed items.
*/
public synchronized String getNewFeeds()
throws OperationFailedException, FileNotFoundException
{
String newsAbstract = null;
StringBuffer printedFeed = new StringBuffer();
int i;
boolean hasSomeNews = false;
// Try to retrieve the feed and to complete this instanciation.
this.retrieveFlow();
// TODO move this message in a resources file.
if (items.length == 0)
@ -209,6 +213,10 @@ public synchronized String getNewFeeds()
return null;
}
lastItemKey = new RssItemKey(items[items.length - 1]);
/*System.out.println("CHENZO LAST_ITEM_KEY link: " +
items[items.length - 1].getLink() +
" Date: " +
items[items.length - 1].getPublishedDate());*/
printedFeed
.append ("<em>Send anything to refresh this feed...</em><br>\n");
return printedFeed.toString();

Loading…
Cancel
Save