diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java index b0903dc..4b65248 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/DialogShareFolder.java @@ -98,7 +98,7 @@ public class DialogShareFolder extends Dialog { public void onSuccess(List result) { for (InfoContactModel infoContactModel : result) { - suggestPanel.addRecipient(infoContactModel.getLogin()); + suggestPanel.addRecipient(infoContactModel.getLogin(),false); } lc.unmask(); @@ -235,7 +235,7 @@ public class DialogShareFolder extends Dialog { suggestPanel.resetItemSelected(); for (InfoContactModel infoContactModel : multiDrag.getTargetListContact()) { - suggestPanel.addRecipient(infoContactModel.getLogin()); + suggestPanel.addRecipient(infoContactModel.getLogin(),true); } suggestPanel.boxSetFocus(); diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/multisuggest/MultiValuePanel.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/multisuggest/MultiValuePanel.java index 3ed8de5..d04c662 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/multisuggest/MultiValuePanel.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/sharing/multisuggest/MultiValuePanel.java @@ -222,8 +222,10 @@ public class MultiValuePanel extends Composite { /** * insert the attachment item view in the flow panel + * @param fullName + * @param displayRemoveItem */ - public void addRecipient(String fullName) { + public void addRecipient(String fullName, boolean displayRemoveItem) { if (fullName != null) { TextBox itemBox = new TextBox(); @@ -233,16 +235,22 @@ public class MultiValuePanel extends Composite { displayItem.setStyleName("multivalue-panel-token-ws"); Paragraph p = new Paragraph(fullName); - Span span = new Span("x"); - span.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent clickEvent) { - removeListItem(displayItem, listBullet); - } - }); - displayItem.add(p); - displayItem.add(span); - + + if(displayRemoveItem){ + displayItem.setStyleName("multivalue-panel-token-ws-notselectable"); + Span span = new Span("x"); + span.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent clickEvent) { + removeListItem(displayItem, listBullet); + } + }); + + displayItem.add(span); + } + else + displayItem.setStyleName("multivalue-panel-token-ws"); + GWT.log("Adding selected wp item '" + itemBox.getValue()); itemsSelected.add(itemBox.getValue()); GWT.log("Total: " + itemsSelected); @@ -251,6 +259,7 @@ public class MultiValuePanel extends Composite { itemBox.setValue(""); itemBox.setFocus(true); } + } public void clearList() { diff --git a/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css b/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css index 95ab299..0226ead 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css +++ b/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css @@ -47,6 +47,23 @@ li.multivalue-panel-token-ws { float: left; } +li.multivalue-panel-token-ws-notselectable { + overflow: hidden; + height: auto !important; + height: 1%; + margin: 3px; + padding: 1px 3px; + background-color: white; + border: 1px solid #9DACCC; + color: white; + cursor: default; + font-size: 11px; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + float: left; +} + .notSelectable-ws { background-color: #FFF !important; } diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/notifications/NotificationsProducer.java b/src/main/java/org/gcube/portlets/user/workspace/server/notifications/NotificationsProducer.java index 9fcb59a..b2f8978 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/notifications/NotificationsProducer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/notifications/NotificationsProducer.java @@ -5,11 +5,11 @@ package org.gcube.portlets.user.workspace.server.notifications; import java.util.List; -import org.apache.log4j.Logger; import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.SessionManager; import org.gcube.applicationsupportlayer.social.NotificationsManager; import org.gcube.common.core.scope.GCUBEScope; +import org.gcube.common.core.utils.logging.GCUBEClientLog; import org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder; import org.gcube.portlets.user.workspace.client.model.InfoContactModel; import org.gcube.portlets.user.workspace.server.util.Util; @@ -21,7 +21,7 @@ import org.gcube.portlets.user.workspace.server.util.Util; */ public class NotificationsProducer { - protected Logger logger = Logger.getLogger(NotificationsProducer.class); + protected GCUBEClientLog gcubeLogger = new GCUBEClientLog(NotificationsProducer.class); protected GCUBEScope scope; protected NotificationsManager notificationsMng; @@ -66,20 +66,20 @@ public class NotificationsProducer { for (InfoContactModel infoContactModel : listContacts) { try{ //NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER -// if(infoContactModel.getId().compareTo(userId)!=0){ - logger.trace("Send notify folder sharing for user "+infoContactModel.getId()); + if(infoContactModel.getId().compareTo(userId)!=0){ + gcubeLogger.trace("Send notify folder sharing for user "+infoContactModel.getId()); boolean notify = notificationsMng.notifyFolderSharing(infoContactModel.getId(), sharedFolder); if(!notify) - logger.error("An error occured when notify user: "+infoContactModel.getId()); -// } + gcubeLogger.error("An error occured when notify user: "+infoContactModel.getId()); + } }catch (Exception e) { - logger.error("An error occured in notifyFolderSharing ", e); + gcubeLogger.error("An error occured in notifyFolderSharing ", e); e.printStackTrace(); } } - logger.trace("share notifications is completed"); + gcubeLogger.trace("share notifications is completed"); } }.start(); @@ -104,23 +104,23 @@ public class NotificationsProducer { try{ //NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER -// if(infoContactModel.getId().compareTo(userId)!=0){ + if(infoContactModel.getId().compareTo(userId)!=0){ - logger.trace("Send notify folder un share user "+infoContactModel.getId()); - System.out.println("Send notify folder un share user "+infoContactModel.getId()); + gcubeLogger.trace("Send notify folder un share user "+infoContactModel.getId()); +// System.out.println("Send notify folder un share user "+infoContactModel.getId()); boolean notify = notificationsMng.notifyFolderRemovedUser(infoContactModel.getId(), sharedFolder, userId); if(!notify) - logger.error("An error occured when notify user: "+infoContactModel.getId()); -// } + gcubeLogger.error("An error occured when notify user: "+infoContactModel.getId()); + } }catch (Exception e) { - logger.error("An error occured in notifyFolderSharing ", e); + gcubeLogger.error("An error occured in notifyFolderSharing ", e); e.printStackTrace(); } } - logger.trace("un share notifications is completed"); + gcubeLogger.trace("un share notifications is completed"); System.out.println("un share folder completed"); }