There is no longer the chance to change avatar by clicking on the actual avatar shown by this portlet.

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@126809 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-04-06 13:42:41 +00:00
parent 210aea809f
commit fa22e6f116
3 changed files with 14 additions and 48 deletions

View File

@ -196,20 +196,6 @@ public class StatisticsPanel extends Composite {
else
userImage.addStyleName("user-image-margin-right-vre");
// set url to change avatar
final String urlAccount = information.getAccountURL();
if(urlAccount != null){
userImage.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent ev) {
Window.Location.assign(urlAccount);
}
});
userImage.setTitle("Edit your avatar");
userImage.addStyleName("user-image-editable");
}
// add image to mainPanel
mainPanel.add(userImage);

View File

@ -118,7 +118,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
*/
public String getDevelopmentUser() {
String user = userid;
// user = "massimiliano.assante";
// user = "massimiliano.assante";
return user;
}
@ -140,19 +140,19 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
_log.debug("Found " + userName + " returning nothing");
return null;
}else{
_log.debug("Getting " + userName + " amount of workspace in use.");
try{
long init = System.currentTimeMillis();
Workspace workspace = HomeLibrary.getUserWorkspace(userName);
long storage = workspace.getDiskUsage();
storageInUse = formatFileSize(storage);
long end = System.currentTimeMillis();
_log.debug("[USER-STATISTICS] time taken to retrieve user space is " + (end - init) + "ms");
@ -193,10 +193,10 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
boolean avatarPresent = session.getUserAvatarId() != null;
long init = System.currentTimeMillis();
User user = UserLocalServiceUtil.getUserByScreenName(SiteManagerUtil.getCompany().getCompanyId(), session.getUsername());
profileStrenght = evaluateProfileStrenght(user, avatarPresent);
long end = System.currentTimeMillis();
_log.debug("[USER-STATISTICS] time taken to evaluate user profile strenght is " + (end - init) + "ms");
@ -247,19 +247,15 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
}
// url account to change the avatar
String accountURL = null;
_log.debug("Account url for " + userName + " is " + accountURL);
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, accountURL);
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre);
}
else return new UserInformation(false, null, userName, vreID, null);
else return new UserInformation(false, null, userName, vreID);
}
@SuppressWarnings("deprecation")
@Override
public PostsStatsBean getPostsStats(){
// get the session
ASLSession session = getASLSession();
@ -314,7 +310,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
}
long end = System.currentTimeMillis();
_log.debug("[USER-STATISTICS] time taken to retrieve and filter user feeds, get likes and replies got is " + (end - init) + "ms");
_log.debug("Total number of feeds (after time filtering) of " + userName + " is " + totalFeeds);
_log.debug("Total number of likes (after time filtering) for " + userName + " is " + totalLikes);

View File

@ -18,20 +18,18 @@ public class UserInformation implements Serializable {
private String urlAvatar;
private String displayName;
private String actualVre;
private String accountURL;
public UserInformation(){
super();
}
public UserInformation(boolean isRoot, String urlAvatar,
String displayName, String actualVre, String accountURL) {
String displayName, String actualVre) {
super();
this.isRoot = isRoot;
this.urlAvatar = urlAvatar;
this.displayName = displayName;
this.actualVre = actualVre;
this.accountURL = accountURL;
}
@ -73,26 +71,12 @@ public class UserInformation implements Serializable {
public void setActualVre(String actualVre) {
this.actualVre = actualVre;
}
public String getAccountURL() {
return accountURL;
}
public void setAccountURL(String accountURL) {
this.accountURL = accountURL;
}
@Override
public String toString() {
return "UserInformation [isRoot=" + isRoot + ", urlAvatar=" + urlAvatar
+ ", displayName=" + displayName + ", actualVre=" + actualVre
+ ", accountURL=" + accountURL + "]";
+ "]";
}
}