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) {
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();

View File

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

View File

@ -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;
}

View File

@ -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");
}