From c97443dbc590d2fbddbb50d5c8898bc37e9e5ec4 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 30 Jul 2019 14:57:52 +0000 Subject: [PATCH] ref 17169: Selection of users in the Sharing panel https://support.d4science.org/issues/17169 Added support to workspace users discovery by VREs git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@181360 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../view/sharing/DialogShareFolder.java | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) 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 49233ef..0c0afe3 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 @@ -157,9 +157,8 @@ public class DialogShareFolder extends Dialog { lc.add(hpPermission); lc.mask(); - - - //TODO + + // TODO userStore.getOwner(folder.getIdentifier(), new AsyncCallback() { @Override @@ -230,15 +229,14 @@ public class DialogShareFolder extends Dialog { */ private void updateRecipientOfShare(List listContacts) { suggestPanel.resetItemSelected(); + if (shareOwner != null) { + suggestPanel.addRecipient(shareOwner, false); + } for (InfoContactModel contact : listContacts) { if (contact != null && contact.getName() != null) { - if (!isShareOwner(contact)) // skip owner + if (!isShareOwner(contact)) {// skip owner suggestPanel.addRecipient(contact, true); - else - suggestPanel.addRecipient(contact, false); // owner - // is - // not - // deletable + } } } } @@ -464,7 +462,8 @@ public class DialogShareFolder extends Dialog { @Override public void onClick(ClickEvent event) { - final DialogMultiDragWorkspaceContacts dialogMultiDrag = new DialogMultiDragWorkspaceContacts(shareOwner,suggestPanel.getSelectedUser()); + final DialogMultiDragWorkspaceContacts dialogMultiDrag = new DialogMultiDragWorkspaceContacts( + shareOwner, suggestPanel.getSelectedUser()); dialogMultiDrag.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener() { @@ -472,10 +471,11 @@ public class DialogShareFolder extends Dialog { public void componentSelected(ButtonEvent ce) { // initSuggestContacts(); suggestPanel.resetItemSelected(); - if(shareOwner!=null){ + if (shareOwner != null) { suggestPanel.addRecipient(shareOwner, false); } - for (InfoContactModel infoContactModel : dialogMultiDrag.getMultiDrag().getTargetListContact()) { + for (InfoContactModel infoContactModel : dialogMultiDrag.getMultiDrag() + .getTargetListContact()) { suggestPanel.addRecipient(infoContactModel, true); } suggestPanel.boxSetFocus(); @@ -509,19 +509,17 @@ public class DialogShareFolder extends Dialog { * @param contact * the contact * @return true, if successful - - private boolean listAlreadySharedContains(InfoContactModel contact) { - - if (contact == null) - return false; - - for (InfoContactModel ct : listAlreadyShared) { - if (InfoContactModel.COMPARATORLOGINS.compare(ct, contact) == 0) - // if(ct.getLogin().compareTo(contact.getLogin())==0) - return true; - } - return false; - } */ + * + * private boolean listAlreadySharedContains(InfoContactModel + * contact) { + * + * if (contact == null) return false; + * + * for (InfoContactModel ct : listAlreadyShared) { if + * (InfoContactModel.COMPARATORLOGINS.compare(ct, contact) == 0) // + * if(ct.getLogin().compareTo(contact.getLogin())==0) return true; } + * return false; } + */ // DEBUG /**