Fixed bug on current user
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@141374 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
308fb4cc73
commit
285221c644
|
@ -12,6 +12,7 @@ import org.gcube.portlets.widgets.workspaceuploader.server.util.WsUtil;
|
|||
import org.gcube.portlets.widgets.workspaceuploader.shared.UploadProgress;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.shared.WorkspaceUploaderItem;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.shared.WorkspaceUploaderItem.UPLOAD_STATUS;
|
||||
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -108,8 +109,8 @@ public class WorkspaceUploaderServiceImpl extends RemoteServiceServlet implement
|
|||
Workspace workspace;
|
||||
try {
|
||||
String scopeGroupId = ""+PortalContext.getConfiguration().getCurrentGroupId(getThreadLocalRequest());
|
||||
String currUserId = ""+PortalContext.getConfiguration().getCurrentUser(getThreadLocalRequest());
|
||||
workspace = WsUtil.getWorkspace(getThreadLocalRequest(), scopeGroupId, currUserId);
|
||||
GCubeUser currUser = PortalContext.getConfiguration().getCurrentUser(getThreadLocalRequest());
|
||||
workspace = WsUtil.getWorkspace(getThreadLocalRequest(), scopeGroupId, currUser.getUserId()+"");
|
||||
if(workspace!=null)
|
||||
return workspace.getRoot().getId();
|
||||
} catch (Exception e) {
|
||||
|
@ -130,7 +131,8 @@ public class WorkspaceUploaderServiceImpl extends RemoteServiceServlet implement
|
|||
logger.trace("get itemExistsInWorkpace by parentId: "+parentId);
|
||||
try {
|
||||
String scopeGroupId = ""+PortalContext.getConfiguration().getCurrentGroupId(getThreadLocalRequest());
|
||||
String currUserId = ""+PortalContext.getConfiguration().getCurrentUser(getThreadLocalRequest());
|
||||
GCubeUser currUser = PortalContext.getConfiguration().getCurrentUser(getThreadLocalRequest());
|
||||
String currUserId = currUser!=null?currUser.getUserId()+"":null;
|
||||
Workspace workspace = WsUtil.getWorkspace(getThreadLocalRequest(), scopeGroupId, currUserId);
|
||||
WorkspaceItem wsItem = workspace.getItem(parentId); //GET PARENT
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class NotificationsWorkspaceUploaderProducer {
|
|||
|
||||
protected NotificationsManager notificationsMng;
|
||||
|
||||
protected String userId;
|
||||
protected String username;
|
||||
|
||||
/**
|
||||
* Instantiates a new notifications workspace uploader producer.
|
||||
|
@ -50,7 +50,7 @@ public class NotificationsWorkspaceUploaderProducer {
|
|||
this.notificationsMng = getNotificationManager(scopeGroupId, httpSession, request);
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
GCubeUser currUser = pContext.getCurrentUser(request);
|
||||
this.userId = currUser.getUsername();
|
||||
this.username = currUser.getUsername();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -158,7 +158,7 @@ public class NotificationsWorkspaceUploaderProducer {
|
|||
try{
|
||||
|
||||
//NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER
|
||||
if(infoContactModel.getLogin().compareTo(userId)!=0){
|
||||
if(infoContactModel.getLogin().compareTo(username)!=0){
|
||||
|
||||
logger.info("Sending notification to user "+infoContactModel.getLogin() +" added item "+workspaceItem.getName()+" in shared folder "+sharedFolder.getName());
|
||||
boolean notify = notificationsMng.notifyAddedItem(infoContactModel.getLogin(), workspaceItem, sharedFolder);
|
||||
|
@ -199,7 +199,7 @@ public class NotificationsWorkspaceUploaderProducer {
|
|||
try{
|
||||
|
||||
//NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER
|
||||
if(infoContactModel.getLogin().compareTo(userId)!=0){
|
||||
if(infoContactModel.getLogin().compareTo(username)!=0){
|
||||
|
||||
logger.info("Sending notification to user "+infoContactModel.getLogin() +" updated item "+workspaceItem.getName()+" in shared folder "+sharedFolder.getName());
|
||||
boolean notify = notificationsMng.notifyUpdatedItem(infoContactModel.getLogin(), workspaceItem, sharedFolder);
|
||||
|
|
Loading…
Reference in New Issue