added fix to unshare user

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@120318 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-11-19 14:53:55 +00:00
parent c6389a1660
commit 4d08fddfd1
2 changed files with 14 additions and 5 deletions

View File

@ -1710,8 +1710,17 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
if(listLogin.size()>0){
if(!isNewFolder){
sharedFolder = workspace.shareFolder(listLogin, folder.getIdentifier());
sharedFolder.setDescription(folder.getDescription()); //SET NEW DESCRIPTION
//USER REMOVED FROM SHARE
DiffereceBeetweenInfoContactModel diff2 = new DiffereceBeetweenInfoContactModel(listSharedContact, listContacts);
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
for (InfoContactModel userRemoved : listRemovedUsersFromShare) {
workspaceLogger.info("Unsharing user: "+userRemoved.getLogin());
sharedFolder.unShare(userRemoved.getLogin());
}
}
else{
FileModel parent = folder.getParentFileModel();

View File

@ -93,10 +93,10 @@ public class NotificationsProducer {
//NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER
if(infoContactModel.getLogin().compareTo(userId)!=0){
logger.trace("Sending notification new share folder "+sharedFolder.getName()+" for user "+infoContactModel.getLogin());
logger.debug("Sending notification new share folder "+sharedFolder.getName()+" for user "+infoContactModel.getLogin());
//DEBUG
System.out.println("Sending notification new share folder "+sharedFolder.getName()+" for user "+infoContactModel.getLogin());
// System.out.println("Sending notification new share folder "+sharedFolder.getName()+" for user "+infoContactModel.getLogin());
boolean notify = notificationsMng.notifyFolderSharing(infoContactModel.getLogin(), sharedFolder);
@ -245,7 +245,7 @@ public class NotificationsProducer {
List<InfoContactModel> listNewContactsShared = diff.getDifferentsContacts();
logger.trace("list new contacts shared: "+listNewContactsShared.size());
logger.info("list new contacts shared: "+listNewContactsShared.size());
if(listNewContactsShared.size()>0){
@ -311,7 +311,7 @@ public class NotificationsProducer {
List<InfoContactModel> listRemovedUsersFromShare = diff2.getDifferentsContacts();
logger.trace("list removed contacts from share: "+listNewContactsShared.size());
logger.info("list removed contacts from share: "+listRemovedUsersFromShare.size());
if(listRemovedUsersFromShare.size()>0){
@ -393,7 +393,7 @@ public class NotificationsProducer {
//NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER
if(userUnShared.getLogin().compareTo(userId)!=0){
logger.trace("Sending notification to user "+userUnShared.getLogin() +" unshared from folder "+shareFolder.getName());
logger.debug("Sending notification to user "+userUnShared.getLogin() +" unshared from folder "+shareFolder.getName());
boolean notify = notificationsMng.notifyFolderRemovedUser(userUnShared.getLogin(), (WorkspaceSharedFolder) shareFolder);
if(!notify)