smart refresh implemented (still buggy if a user posts something just in this user News feed)

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@73023 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-04-08 17:20:48 +00:00
parent 6d1be823e7
commit d8d339db27
2 changed files with 14 additions and 3 deletions

View File

@ -251,7 +251,9 @@ public class NewsFeedPanel extends Composite {
break;
}
}
//TODO: finish this
/**
* check for updates
*/
private void checkAllUpdatesFeeds() {
newsService.getAllUpdateUserFeeds(new AsyncCallback<ArrayList<EnhancedFeed>>() {
@Override
@ -509,6 +511,10 @@ public class NewsFeedPanel extends Composite {
};
t.schedule(500);
//insert it also in the model so that the user who created it do not get notified about this new update
allUpdates.add(0, toAdd); //insert in the model
}
private void showLoader() {

View File

@ -11,6 +11,8 @@ import java.util.List;
import java.util.Properties;
import java.util.UUID;
import javax.servlet.ServletContext;
import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
@ -427,7 +429,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
}
}
_log.trace("****** ENHANCED FEEDS TOTAL= " + toReturn.size());
_log.trace("ENHANCED FEEDS TOTAL= " + toReturn.size() + " for user: " + username);
return toReturn;
}
@ -637,13 +639,16 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
*/
private int getFeedsRefreshTimeInMillis() {
//return 20000; //for testing
_log.info("Trying to read custom REFRESH_TIME");
Properties props = new Properties();
int toReturn = 0;
int minutes = 0;
String propertyfile = "";
try {
propertyfile = this.getThreadLocalRequest().getContextPath()+"conf/settings.properties";
ServletContext servletContext = getServletContext();
String contextPath = servletContext.getRealPath(File.separator);
propertyfile = contextPath + "conf" + File.separator + "settings.properties";
File propsFile = new File(propertyfile);
FileInputStream fis = new FileInputStream(propsFile);
props.load( fis);