minor fix for user statistics retrieval at server side
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@130993 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4b3cd43ef4
commit
38ed5f1570
|
@ -1142,8 +1142,6 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
ArrayList<EnhancedFeed> toReturn = new ArrayList<EnhancedFeed>();
|
|
||||||
|
|
||||||
// get reference time
|
// get reference time
|
||||||
Calendar oneYearAgo = Calendar.getInstance();
|
Calendar oneYearAgo = Calendar.getInstance();
|
||||||
oneYearAgo.set(Calendar.YEAR, oneYearAgo.get(Calendar.YEAR) - 1);
|
oneYearAgo.set(Calendar.YEAR, oneYearAgo.get(Calendar.YEAR) - 1);
|
||||||
|
@ -1178,7 +1176,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
feedsIteratorComments.remove();
|
feedsIteratorComments.remove();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default : return toReturn;
|
default : return new ArrayList<EnhancedFeed>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// filter the feeds according the current context
|
// filter the feeds according the current context
|
||||||
|
@ -1197,6 +1195,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
}
|
}
|
||||||
|
|
||||||
// enhance retrieved feeds
|
// enhance retrieved feeds
|
||||||
|
int upperIndex = (from + quantity) >= feeds.size() ? feeds.size() - 1 : from + quantity;
|
||||||
|
feeds = (ArrayList<Feed>) feeds.subList(from, upperIndex);
|
||||||
Collections.sort(feeds, Collections.reverseOrder());
|
Collections.sort(feeds, Collections.reverseOrder());
|
||||||
return enhanceFeeds(feeds, -1);
|
return enhanceFeeds(feeds, -1);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue