minor label fix for the space used information and fix for the username whose quota must be retrieved when profile page is shown

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@142496 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-02-13 13:50:12 +00:00
parent 57baa7a957
commit 51fdce6b35
2 changed files with 4 additions and 7 deletions

View File

@ -376,7 +376,7 @@ public class StatisticsPanel extends Composite {
Button quotaStorageValue = new Button();
quotaStorageValue.setType(ButtonType.LINK);
quotaStorageValue.setText(decimalFormat + "%");
quotaStorageValue.setTitle("You are currently using " + NumberFormat.getFormat("#.##").format(current) + "MB out of " + max + "MB in the Infrastructure Storage");
quotaStorageValue.setTitle("Currently using " + NumberFormat.getFormat("#.##").format(current) + "MB of " + max + "MB assigned in the Infrastructure Storage");
storage.appendToPanel(quotaStorageValue);
}

View File

@ -85,23 +85,20 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
if(quotaServiceBaseUrl != null){
userName = ServerUtils.getCurrentUser(this.getThreadLocalRequest()).getUsername();
// do not show quota info to other users
quotaOfUser = userName;
// check the user's quota to be shown
if(userid != null && !userid.equals(userName))
quotaOfUser = userid;
quotaOfUser = userName;
logger.debug("Fetching info for quota of user " + quotaOfUser);
try{
UserInfrastructureQuotaStorageCache cache = UserInfrastructureQuotaStorageCache.getCacheInstance();
if(cache.get(quotaOfUser) != null)
toReturn = cache.get(quotaOfUser);
else{
// ask the service ...
PortalContext pContext = PortalContext.getConfiguration();
String rootContextToken = pContext.getCurrentUserToken("/" + pContext.getInfrastructureName(), quotaOfUser);
URL request = new URL(quotaServiceBaseUrl + "?timeinterval=FOREVER&gcube-token=" + rootContextToken);