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
This commit is contained in:
Giancarlo Panichi 2019-07-30 14:57:52 +00:00
parent 504227ca30
commit c97443dbc5
1 changed files with 23 additions and 25 deletions

View File

@ -158,8 +158,7 @@ public class DialogShareFolder extends Dialog {
lc.mask(); lc.mask();
// TODO
//TODO
userStore.getOwner(folder.getIdentifier(), new AsyncCallback<InfoContactModel>() { userStore.getOwner(folder.getIdentifier(), new AsyncCallback<InfoContactModel>() {
@Override @Override
@ -230,15 +229,14 @@ public class DialogShareFolder extends Dialog {
*/ */
private void updateRecipientOfShare(List<InfoContactModel> listContacts) { private void updateRecipientOfShare(List<InfoContactModel> listContacts) {
suggestPanel.resetItemSelected(); suggestPanel.resetItemSelected();
if (shareOwner != null) {
suggestPanel.addRecipient(shareOwner, false);
}
for (InfoContactModel contact : listContacts) { for (InfoContactModel contact : listContacts) {
if (contact != null && contact.getName() != null) { if (contact != null && contact.getName() != null) {
if (!isShareOwner(contact)) // skip owner if (!isShareOwner(contact)) {// skip owner
suggestPanel.addRecipient(contact, true); suggestPanel.addRecipient(contact, true);
else }
suggestPanel.addRecipient(contact, false); // owner
// is
// not
// deletable
} }
} }
} }
@ -464,7 +462,8 @@ public class DialogShareFolder extends Dialog {
@Override @Override
public void onClick(ClickEvent event) { 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<ButtonEvent>() { dialogMultiDrag.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
@ -472,10 +471,11 @@ public class DialogShareFolder extends Dialog {
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
// initSuggestContacts(); // initSuggestContacts();
suggestPanel.resetItemSelected(); suggestPanel.resetItemSelected();
if(shareOwner!=null){ if (shareOwner != null) {
suggestPanel.addRecipient(shareOwner, false); suggestPanel.addRecipient(shareOwner, false);
} }
for (InfoContactModel infoContactModel : dialogMultiDrag.getMultiDrag().getTargetListContact()) { for (InfoContactModel infoContactModel : dialogMultiDrag.getMultiDrag()
.getTargetListContact()) {
suggestPanel.addRecipient(infoContactModel, true); suggestPanel.addRecipient(infoContactModel, true);
} }
suggestPanel.boxSetFocus(); suggestPanel.boxSetFocus();
@ -509,19 +509,17 @@ public class DialogShareFolder extends Dialog {
* @param contact * @param contact
* the contact * the contact
* @return true, if successful * @return true, if successful
*
private boolean listAlreadySharedContains(InfoContactModel contact) { * private boolean listAlreadySharedContains(InfoContactModel
* contact) {
if (contact == null) *
return false; * if (contact == null) return false;
*
for (InfoContactModel ct : listAlreadyShared) { * for (InfoContactModel ct : listAlreadyShared) { if
if (InfoContactModel.COMPARATORLOGINS.compare(ct, contact) == 0) * (InfoContactModel.COMPARATORLOGINS.compare(ct, contact) == 0) //
// if(ct.getLogin().compareTo(contact.getLogin())==0) * if(ct.getLogin().compareTo(contact.getLogin())==0) return true; }
return true; * return false; }
} */
return false;
} */
// DEBUG // DEBUG
/** /**