Feature #10192 allow to sort feeds per recent comments bug fix
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@165135 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ef450ff5e8
commit
1e9892342b
|
@ -1040,9 +1040,13 @@ public class NewsFeedPanel extends Composite {
|
|||
* @param quantity
|
||||
*/
|
||||
public void loadMorePosts(final int quantity, boolean isSortingByLastCommentedposts) {
|
||||
if (isSortingByLastCommentedposts)
|
||||
showLoader();
|
||||
int from = (fromStartingPoint == null) ? allUpdates.size()+1 : fromStartingPoint;
|
||||
if (isSortingByLastCommentedposts) {
|
||||
showLoader();
|
||||
if ((from == 0))
|
||||
from = 1;
|
||||
}
|
||||
|
||||
GWT.log("StartingPoint = " + from);
|
||||
newsService.getMoreFeeds(from, quantity, new AsyncCallback<MoreFeedsBean>() {
|
||||
@Override
|
||||
|
|
|
@ -51,7 +51,7 @@ public class FilterPanel extends Composite {
|
|||
allUpdatesLink.setActive(false);
|
||||
recentCommentsLink.setActive(true);
|
||||
caller.setCurrentFilter(FilterType.RECENT_COMMENTS);
|
||||
int loadedPostsInView = caller.getAllUpdatesSize();
|
||||
int loadedPostsInView = caller.getAllUpdatesSize() + 1;
|
||||
int quantity = loadedPostsInView < 100 ? 100 - loadedPostsInView : loadedPostsInView;
|
||||
caller.loadMorePosts(quantity, true);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
private ElasticSearchClient escl;
|
||||
|
||||
private final static int MAX_POSTS_NO = 30;
|
||||
|
||||
|
||||
public void init() {
|
||||
store = new DBCassandraAstyanaxImpl();
|
||||
try {
|
||||
|
@ -494,9 +494,11 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
|||
try {
|
||||
rangeFeeds = store.getRecentFeedsByVREAndRange(vreid, start, quantity);
|
||||
organizationFeeds = rangeFeeds.getFeeds();
|
||||
for (Feed feed : organizationFeeds) {
|
||||
feedsMap.put(feed.getKey(), feed);
|
||||
//System.out.println("->\n"+feed.getDescription());
|
||||
if (organizationFeeds != null) {
|
||||
for (Feed feed : organizationFeeds) {
|
||||
feedsMap.put(feed.getKey(), feed);
|
||||
//System.out.println("->\n"+feed.getDescription());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue