This commit is contained in:
Francesco Mangiacrapa 2013-02-18 15:47:37 +00:00
parent 96fdfb8de2
commit a3cc98082b
4 changed files with 53 additions and 27 deletions

View File

@ -98,7 +98,7 @@ public class DialogShareFolder extends Dialog {
public void onSuccess(List<InfoContactModel> result) { public void onSuccess(List<InfoContactModel> result) {
for (InfoContactModel infoContactModel : result) { for (InfoContactModel infoContactModel : result) {
suggestPanel.addRecipient(infoContactModel.getLogin()); suggestPanel.addRecipient(infoContactModel.getLogin(),false);
} }
lc.unmask(); lc.unmask();
@ -235,7 +235,7 @@ public class DialogShareFolder extends Dialog {
suggestPanel.resetItemSelected(); suggestPanel.resetItemSelected();
for (InfoContactModel infoContactModel : multiDrag.getTargetListContact()) { for (InfoContactModel infoContactModel : multiDrag.getTargetListContact()) {
suggestPanel.addRecipient(infoContactModel.getLogin()); suggestPanel.addRecipient(infoContactModel.getLogin(),true);
} }
suggestPanel.boxSetFocus(); suggestPanel.boxSetFocus();

View File

@ -222,8 +222,10 @@ public class MultiValuePanel extends Composite {
/** /**
* insert the attachment item view in the flow panel * 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) { if (fullName != null) {
TextBox itemBox = new TextBox(); TextBox itemBox = new TextBox();
@ -233,6 +235,10 @@ public class MultiValuePanel extends Composite {
displayItem.setStyleName("multivalue-panel-token-ws"); displayItem.setStyleName("multivalue-panel-token-ws");
Paragraph p = new Paragraph(fullName); Paragraph p = new Paragraph(fullName);
displayItem.add(p);
if(displayRemoveItem){
displayItem.setStyleName("multivalue-panel-token-ws-notselectable");
Span span = new Span("x"); Span span = new Span("x");
span.addClickHandler(new ClickHandler() { span.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) { public void onClick(ClickEvent clickEvent) {
@ -240,8 +246,10 @@ public class MultiValuePanel extends Composite {
} }
}); });
displayItem.add(p);
displayItem.add(span); displayItem.add(span);
}
else
displayItem.setStyleName("multivalue-panel-token-ws");
GWT.log("Adding selected wp item '" + itemBox.getValue()); GWT.log("Adding selected wp item '" + itemBox.getValue());
itemsSelected.add(itemBox.getValue()); itemsSelected.add(itemBox.getValue());
@ -251,6 +259,7 @@ public class MultiValuePanel extends Composite {
itemBox.setValue(""); itemBox.setValue("");
itemBox.setFocus(true); itemBox.setFocus(true);
} }
} }
public void clearList() { public void clearList() {

View File

@ -47,6 +47,23 @@ li.multivalue-panel-token-ws {
float: left; 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 { .notSelectable-ws {
background-color: #FFF !important; background-color: #FFF !important;
} }

View File

@ -5,11 +5,11 @@ package org.gcube.portlets.user.workspace.server.notifications;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager; import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.applicationsupportlayer.social.NotificationsManager; import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.common.core.scope.GCUBEScope; 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.homelibrary.home.workspace.WorkspaceFolder;
import org.gcube.portlets.user.workspace.client.model.InfoContactModel; import org.gcube.portlets.user.workspace.client.model.InfoContactModel;
import org.gcube.portlets.user.workspace.server.util.Util; 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 { public class NotificationsProducer {
protected Logger logger = Logger.getLogger(NotificationsProducer.class); protected GCUBEClientLog gcubeLogger = new GCUBEClientLog(NotificationsProducer.class);
protected GCUBEScope scope; protected GCUBEScope scope;
protected NotificationsManager notificationsMng; protected NotificationsManager notificationsMng;
@ -66,20 +66,20 @@ public class NotificationsProducer {
for (InfoContactModel infoContactModel : listContacts) { for (InfoContactModel infoContactModel : listContacts) {
try{ try{
//NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER //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 sharing for user "+infoContactModel.getId()); gcubeLogger.trace("Send notify folder sharing for user "+infoContactModel.getId());
boolean notify = notificationsMng.notifyFolderSharing(infoContactModel.getId(), sharedFolder); boolean notify = notificationsMng.notifyFolderSharing(infoContactModel.getId(), sharedFolder);
if(!notify) 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) { }catch (Exception e) {
logger.error("An error occured in notifyFolderSharing ", e); gcubeLogger.error("An error occured in notifyFolderSharing ", e);
e.printStackTrace(); e.printStackTrace();
} }
} }
logger.trace("share notifications is completed"); gcubeLogger.trace("share notifications is completed");
} }
}.start(); }.start();
@ -104,23 +104,23 @@ public class NotificationsProducer {
try{ try{
//NOTIFIES ONLY THE USERS THAT ARE DIFFERENT FROM CURRENT USER //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()); gcubeLogger.trace("Send notify folder un share user "+infoContactModel.getId());
System.out.println("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); boolean notify = notificationsMng.notifyFolderRemovedUser(infoContactModel.getId(), sharedFolder, userId);
if(!notify) 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) { }catch (Exception e) {
logger.error("An error occured in notifyFolderSharing ", e); gcubeLogger.error("An error occured in notifyFolderSharing ", e);
e.printStackTrace(); e.printStackTrace();
} }
} }
logger.trace("un share notifications is completed"); gcubeLogger.trace("un share notifications is completed");
System.out.println("un share folder completed"); System.out.println("un share folder completed");
} }