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:
parent
210aea809f
commit
fa22e6f116
|
@ -196,20 +196,6 @@ public class StatisticsPanel extends Composite {
|
||||||
else
|
else
|
||||||
userImage.addStyleName("user-image-margin-right-vre");
|
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
|
// add image to mainPanel
|
||||||
mainPanel.add(userImage);
|
mainPanel.add(userImage);
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
*/
|
*/
|
||||||
public String getDevelopmentUser() {
|
public String getDevelopmentUser() {
|
||||||
String user = userid;
|
String user = userid;
|
||||||
// user = "massimiliano.assante";
|
// user = "massimiliano.assante";
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,19 +140,19 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
|
|
||||||
_log.debug("Found " + userName + " returning nothing");
|
_log.debug("Found " + userName + " returning nothing");
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
_log.debug("Getting " + userName + " amount of workspace in use.");
|
_log.debug("Getting " + userName + " amount of workspace in use.");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
long init = System.currentTimeMillis();
|
long init = System.currentTimeMillis();
|
||||||
|
|
||||||
Workspace workspace = HomeLibrary.getUserWorkspace(userName);
|
Workspace workspace = HomeLibrary.getUserWorkspace(userName);
|
||||||
long storage = workspace.getDiskUsage();
|
long storage = workspace.getDiskUsage();
|
||||||
storageInUse = formatFileSize(storage);
|
storageInUse = formatFileSize(storage);
|
||||||
|
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
_log.debug("[USER-STATISTICS] time taken to retrieve user space is " + (end - init) + "ms");
|
_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;
|
boolean avatarPresent = session.getUserAvatarId() != null;
|
||||||
|
|
||||||
long init = System.currentTimeMillis();
|
long init = System.currentTimeMillis();
|
||||||
|
|
||||||
User user = UserLocalServiceUtil.getUserByScreenName(SiteManagerUtil.getCompany().getCompanyId(), session.getUsername());
|
User user = UserLocalServiceUtil.getUserByScreenName(SiteManagerUtil.getCompany().getCompanyId(), session.getUsername());
|
||||||
profileStrenght = evaluateProfileStrenght(user, avatarPresent);
|
profileStrenght = evaluateProfileStrenght(user, avatarPresent);
|
||||||
|
|
||||||
long end = System.currentTimeMillis();
|
long end = System.currentTimeMillis();
|
||||||
_log.debug("[USER-STATISTICS] time taken to evaluate user profile strenght is " + (end - init) + "ms");
|
_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
|
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre);
|
||||||
String accountURL = null;
|
|
||||||
_log.debug("Account url for " + userName + " is " + accountURL);
|
|
||||||
|
|
||||||
return new UserInformation(isInfrastructure, thumbnailURL, userName, actualVre, accountURL);
|
|
||||||
}
|
}
|
||||||
else return new UserInformation(false, null, userName, vreID, null);
|
else return new UserInformation(false, null, userName, vreID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public PostsStatsBean getPostsStats(){
|
public PostsStatsBean getPostsStats(){
|
||||||
|
|
||||||
// get the session
|
// get the session
|
||||||
ASLSession session = getASLSession();
|
ASLSession session = getASLSession();
|
||||||
|
|
||||||
|
@ -314,7 +310,7 @@ public class UserStatisticsServiceImpl extends RemoteServiceServlet implements U
|
||||||
}
|
}
|
||||||
|
|
||||||
long end = System.currentTimeMillis();
|
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("[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 feeds (after time filtering) of " + userName + " is " + totalFeeds);
|
||||||
_log.debug("Total number of likes (after time filtering) for " + userName + " is " + totalLikes);
|
_log.debug("Total number of likes (after time filtering) for " + userName + " is " + totalLikes);
|
||||||
|
|
|
@ -18,20 +18,18 @@ public class UserInformation implements Serializable {
|
||||||
private String urlAvatar;
|
private String urlAvatar;
|
||||||
private String displayName;
|
private String displayName;
|
||||||
private String actualVre;
|
private String actualVre;
|
||||||
private String accountURL;
|
|
||||||
|
|
||||||
public UserInformation(){
|
public UserInformation(){
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserInformation(boolean isRoot, String urlAvatar,
|
public UserInformation(boolean isRoot, String urlAvatar,
|
||||||
String displayName, String actualVre, String accountURL) {
|
String displayName, String actualVre) {
|
||||||
super();
|
super();
|
||||||
this.isRoot = isRoot;
|
this.isRoot = isRoot;
|
||||||
this.urlAvatar = urlAvatar;
|
this.urlAvatar = urlAvatar;
|
||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
this.actualVre = actualVre;
|
this.actualVre = actualVre;
|
||||||
this.accountURL = accountURL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,26 +71,12 @@ public class UserInformation implements Serializable {
|
||||||
public void setActualVre(String actualVre) {
|
public void setActualVre(String actualVre) {
|
||||||
this.actualVre = actualVre;
|
this.actualVre = actualVre;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String getAccountURL() {
|
|
||||||
return accountURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setAccountURL(String accountURL) {
|
|
||||||
this.accountURL = accountURL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "UserInformation [isRoot=" + isRoot + ", urlAvatar=" + urlAvatar
|
return "UserInformation [isRoot=" + isRoot + ", urlAvatar=" + urlAvatar
|
||||||
+ ", displayName=" + displayName + ", actualVre=" + actualVre
|
+ ", displayName=" + displayName + ", actualVre=" + actualVre
|
||||||
+ ", accountURL=" + accountURL + "]";
|
+ "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue