ref 13226:StorageHub - Update workspace-sharing-widget to SH
https://support.d4science.org/issues/13226 Updated to StorageHub git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@177233 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
25b3e96391
commit
f3c41d67ac
|
@ -115,13 +115,11 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
void createFolder(String nameFolder, String description, FileModel parent, AsyncCallback<FolderModel> callback);
|
void createFolder(String nameFolder, String description, FileModel parent, AsyncCallback<FolderModel> callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the details file.
|
|
||||||
*
|
*
|
||||||
* @param item
|
* @param item
|
||||||
* the item
|
* the item
|
||||||
* @param callback
|
* @param callback
|
||||||
* the callback
|
* file details model
|
||||||
* @return the details file
|
|
||||||
*/
|
*/
|
||||||
void getDetailsFile(FileModel item, AsyncCallback<FileDetailsModel> callback);
|
void getDetailsFile(FileModel item, AsyncCallback<FileDetailsModel> callback);
|
||||||
|
|
||||||
|
@ -308,8 +306,6 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
*/
|
*/
|
||||||
void getTimeSeriesById(String identifier, AsyncCallback<GWTWorkspaceItem> callback);
|
void getTimeSeriesById(String identifier, AsyncCallback<GWTWorkspaceItem> callback);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the list parents by item identifier.
|
* Gets the list parents by item identifier.
|
||||||
*
|
*
|
||||||
|
@ -514,7 +510,6 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
*/
|
*/
|
||||||
void moveItems(List<String> ids, String destinationId, AsyncCallback<WorkspaceOperationResult> callback);
|
void moveItems(List<String> ids, String destinationId, AsyncCallback<WorkspaceOperationResult> callback);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the my login.
|
* Gets the my login.
|
||||||
*
|
*
|
||||||
|
@ -525,7 +520,6 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
*/
|
*/
|
||||||
void getMyLogin(String currentPortletUrl, AsyncCallback<UserBean> callback);
|
void getMyLogin(String currentPortletUrl, AsyncCallback<UserBean> callback);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the trash content.
|
* Gets the trash content.
|
||||||
*
|
*
|
||||||
|
@ -557,7 +551,6 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
void executeOperationOnTrash(List<String> listTrashItemIds, WorkspaceTrashOperation operation,
|
void executeOperationOnTrash(List<String> listTrashItemIds, WorkspaceTrashOperation operation,
|
||||||
AsyncCallback<TrashOperationContent> callback);
|
AsyncCallback<TrashOperationContent> callback);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the user workspace total items.
|
* Gets the user workspace total items.
|
||||||
*
|
*
|
||||||
|
@ -584,7 +577,6 @@ public interface GWTWorkspaceServiceAsync {
|
||||||
*/
|
*/
|
||||||
void getItemDescriptionById(String identifier, AsyncCallback<String> callback);
|
void getItemDescriptionById(String identifier, AsyncCallback<String> callback);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load gcube item properties.
|
* Load gcube item properties.
|
||||||
*
|
*
|
||||||
|
|
|
@ -37,11 +37,15 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
private boolean isSmartFolderInstanced;
|
private boolean isSmartFolderInstanced;
|
||||||
private boolean isOnlyTreeInstanced;
|
private boolean isOnlyTreeInstanced;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default instance an async tree to navigate user workspace
|
* Default instance an async tree to navigate user workspace
|
||||||
|
*
|
||||||
* @param instancingSmartFolder
|
* @param instancingSmartFolder
|
||||||
|
* instancing smart folder
|
||||||
* @param instancingMessages
|
* @param instancingMessages
|
||||||
|
* instancing messages
|
||||||
|
* @param selectRootItem
|
||||||
|
* select root
|
||||||
*/
|
*/
|
||||||
public ExplorerPanel(boolean instancingSmartFolder, boolean instancingMessages, boolean selectRootItem) {
|
public ExplorerPanel(boolean instancingSmartFolder, boolean instancingMessages, boolean selectRootItem) {
|
||||||
|
|
||||||
|
@ -56,7 +60,6 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
this.expPanel = new ContentPanel();
|
this.expPanel = new ContentPanel();
|
||||||
this.expPanel.setHeaderVisible(false);
|
this.expPanel.setHeaderVisible(false);
|
||||||
|
|
||||||
|
|
||||||
// smartFolderPanel.setVisible(false);
|
// smartFolderPanel.setVisible(false);
|
||||||
// messagesPanel.setVisible(false);
|
// messagesPanel.setVisible(false);
|
||||||
asycTreePanel.setVisible(true);
|
asycTreePanel.setVisible(true);
|
||||||
|
@ -64,8 +67,6 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
// expPanel.add(smartFolderPanel);
|
// expPanel.add(smartFolderPanel);
|
||||||
// expPanel.add(messagesPanel);
|
// expPanel.add(messagesPanel);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// BULK
|
// BULK
|
||||||
// REMOVED 2016-09-15 CHECK SVN
|
// REMOVED 2016-09-15 CHECK SVN
|
||||||
// buttBulk.setIcon(Resources.getIconBulkUpdate());
|
// buttBulk.setIcon(Resources.getIconBulkUpdate());
|
||||||
|
@ -75,10 +76,13 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
add(expPanel);
|
add(expPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instance only tree
|
* Instance only tree
|
||||||
|
*
|
||||||
* @param instancingOnlyTree
|
* @param instancingOnlyTree
|
||||||
|
* only tree
|
||||||
|
* @param selectRootItem
|
||||||
|
* select root item
|
||||||
*/
|
*/
|
||||||
public ExplorerPanel(boolean instancingOnlyTree, boolean selectRootItem) {
|
public ExplorerPanel(boolean instancingOnlyTree, boolean selectRootItem) {
|
||||||
|
|
||||||
|
@ -116,7 +120,6 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
else
|
else
|
||||||
buttBulk.setIcon(Resources.getIconLoading());
|
buttBulk.setIcon(Resources.getIconLoading());
|
||||||
|
|
||||||
|
|
||||||
toolBar.layout();
|
toolBar.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +158,8 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
public void handleEvent(BaseEvent be) {
|
public void handleEvent(BaseEvent be) {
|
||||||
|
|
||||||
Radio selectedRadio = radioGroup.getValue();
|
Radio selectedRadio = radioGroup.getValue();
|
||||||
// System.out.println("radio value:" +selectedRadio.getValueAttribute());
|
// System.out.println("radio value:"
|
||||||
|
// +selectedRadio.getValueAttribute());
|
||||||
// System.out.println("id" + selectedRadio.getId());
|
// System.out.println("id" + selectedRadio.getId());
|
||||||
if (selectedRadio.getValueAttribute().compareTo(ConstantsExplorer.SMARTFOLDER.toString()) == 0)
|
if (selectedRadio.getValueAttribute().compareTo(ConstantsExplorer.SMARTFOLDER.toString()) == 0)
|
||||||
switchView(ViewSwitchType.SmartFolder);
|
switchView(ViewSwitchType.SmartFolder);
|
||||||
|
@ -178,8 +182,6 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
|
|
||||||
if (type.compareTo(ViewSwitchType.Tree) == 0) {
|
if (type.compareTo(ViewSwitchType.Tree) == 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
asycTreePanel.setVisible(true);
|
asycTreePanel.setVisible(true);
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new SwitchViewEvent(ViewSwitchType.Tree));
|
AppControllerExplorer.getEventBus().fireEvent(new SwitchViewEvent(ViewSwitchType.Tree));
|
||||||
// asycTreePanel.setSearch(false);
|
// asycTreePanel.setSearch(false);
|
||||||
|
@ -187,19 +189,14 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
} else if (type.compareTo(ViewSwitchType.SmartFolder) == 0) {
|
} else if (type.compareTo(ViewSwitchType.SmartFolder) == 0) {
|
||||||
asycTreePanel.setVisible(false);
|
asycTreePanel.setVisible(false);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new SwitchViewEvent(ViewSwitchType.SmartFolder));
|
AppControllerExplorer.getEventBus().fireEvent(new SwitchViewEvent(ViewSwitchType.SmartFolder));
|
||||||
|
|
||||||
// this.expPanel.setVisible(shortuctsPanel.getElement(), false);
|
// this.expPanel.setVisible(shortuctsPanel.getElement(), false);
|
||||||
// this.expPanel.setVisible(asycTreePanel.getElement(), true);
|
// this.expPanel.setVisible(asycTreePanel.getElement(), true);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
|
|
||||||
asycTreePanel.setVisible(false);
|
asycTreePanel.setVisible(false);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -208,27 +205,22 @@ public class ExplorerPanel extends LayoutContainer {
|
||||||
return asycTreePanel;
|
return asycTreePanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isSmartFolderInstanced() {
|
public boolean isSmartFolderInstanced() {
|
||||||
return isSmartFolderInstanced;
|
return isSmartFolderInstanced;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setMessagesInstanced(boolean isMessagesInstanced) {
|
public void setMessagesInstanced(boolean isMessagesInstanced) {
|
||||||
this.isMessagesInstanced = isMessagesInstanced;
|
this.isMessagesInstanced = isMessagesInstanced;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setSmartFolderInstanced(boolean isSmartFolderInstanced) {
|
public void setSmartFolderInstanced(boolean isSmartFolderInstanced) {
|
||||||
this.isSmartFolderInstanced = isSmartFolderInstanced;
|
this.isSmartFolderInstanced = isSmartFolderInstanced;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isOnlyTreeInstanced() {
|
public boolean isOnlyTreeInstanced() {
|
||||||
return isOnlyTreeInstanced;
|
return isOnlyTreeInstanced;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setOnlyTreeInstanced(boolean isOnlyTreeInstanced) {
|
public void setOnlyTreeInstanced(boolean isOnlyTreeInstanced) {
|
||||||
this.isOnlyTreeInstanced = isOnlyTreeInstanced;
|
this.isOnlyTreeInstanced = isOnlyTreeInstanced;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,14 +34,10 @@ import com.google.gwt.user.client.ui.Button;
|
||||||
import com.google.gwt.user.client.ui.FlexTable;
|
import com.google.gwt.user.client.ui.FlexTable;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
import com.google.gwt.user.client.ui.Label;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class DialogShareFolder.
|
* The Class DialogShareFolder.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Jul 10, 2017
|
||||||
* Jul 10, 2017
|
|
||||||
*/
|
*/
|
||||||
public class DialogShareFolder extends Dialog {
|
public class DialogShareFolder extends Dialog {
|
||||||
|
|
||||||
|
@ -62,12 +58,17 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Use to modify a shared folder or share an existing folder.
|
* Use to modify a shared folder or share an existing folder.
|
||||||
*
|
*
|
||||||
* @param folderParentName the folder parent name
|
* @param folderParentName
|
||||||
* @param folder the folder
|
* the folder parent name
|
||||||
* @param eventBus the event bus
|
* @param folder
|
||||||
* @param userStore the user store
|
* the folder
|
||||||
|
* @param eventBus
|
||||||
|
* the event bus
|
||||||
|
* @param userStore
|
||||||
|
* the user store
|
||||||
*/
|
*/
|
||||||
public DialogShareFolder(String folderParentName, final FileModel folder, HandlerManager eventBus, UserStore userStore) {
|
public DialogShareFolder(String folderParentName, final FileModel folder, HandlerManager eventBus,
|
||||||
|
UserStore userStore) {
|
||||||
initUserStore(userStore);
|
initUserStore(userStore);
|
||||||
initLayout(folderParentName);
|
initLayout(folderParentName);
|
||||||
this.parentFolder = folder;
|
this.parentFolder = folder;
|
||||||
|
@ -129,7 +130,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
public void onSuccess(List<WorkspaceACL> result) {
|
public void onSuccess(List<WorkspaceACL> result) {
|
||||||
permission = new PanelTogglePermission(result);
|
permission = new PanelTogglePermission(result);
|
||||||
|
|
||||||
//ONLY IF FOLDER IS ALREADY SHARED, LOOADING CURRENT ACL FROM HL
|
// ONLY IF FOLDER IS ALREADY SHARED, LOOADING CURRENT ACL FROM
|
||||||
|
// HL
|
||||||
if (folder.isShared())
|
if (folder.isShared())
|
||||||
selectAclForFolder(folder);
|
selectAclForFolder(folder);
|
||||||
|
|
||||||
|
@ -206,7 +208,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Inits the user store.
|
* Inits the user store.
|
||||||
*
|
*
|
||||||
* @param userStore the user store
|
* @param userStore
|
||||||
|
* the user store
|
||||||
*/
|
*/
|
||||||
private void initUserStore(UserStore userStore) {
|
private void initUserStore(UserStore userStore) {
|
||||||
this.userStore = userStore;
|
this.userStore = userStore;
|
||||||
|
@ -216,7 +219,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Update recipient of share.
|
* Update recipient of share.
|
||||||
*
|
*
|
||||||
* @param listContacts the list contacts
|
* @param listContacts
|
||||||
|
* the list contacts
|
||||||
*/
|
*/
|
||||||
private void updateRecipientOfShare(List<InfoContactModel> listContacts) {
|
private void updateRecipientOfShare(List<InfoContactModel> listContacts) {
|
||||||
suggestPanel.resetItemSelected();
|
suggestPanel.resetItemSelected();
|
||||||
|
@ -225,22 +229,25 @@ public class DialogShareFolder extends Dialog {
|
||||||
if (!isShareOwner(contact)) // skip owner
|
if (!isShareOwner(contact)) // skip owner
|
||||||
suggestPanel.addRecipient(contact.getName(), true);
|
suggestPanel.addRecipient(contact.getName(), true);
|
||||||
else
|
else
|
||||||
suggestPanel.addRecipient(contact.getName(), false); //owner is not deletable
|
suggestPanel.addRecipient(contact.getName(), false); // owner
|
||||||
|
// is
|
||||||
|
// not
|
||||||
|
// deletable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill recipient already shared.
|
* Fill recipient already shared.
|
||||||
*
|
*
|
||||||
* @param folderId the folder id
|
* @param folderId
|
||||||
* @param lc the lc
|
* the folder id
|
||||||
|
* @param lc
|
||||||
|
* the lc
|
||||||
*/
|
*/
|
||||||
private void fillRecipientAlreadyShared(String folderId, final LayoutContainer lc) {
|
private void fillRecipientAlreadyShared(String folderId, final LayoutContainer lc) {
|
||||||
|
|
||||||
userStore.getListSharedUserByFolderId(folderId,
|
userStore.getListSharedUserByFolderId(folderId, new AsyncCallback<List<InfoContactModel>>() {
|
||||||
new AsyncCallback<List<InfoContactModel>>() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<InfoContactModel> listContacts) {
|
public void onSuccess(List<InfoContactModel> listContacts) {
|
||||||
|
@ -263,16 +270,22 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Permission control.
|
* Permission control.
|
||||||
*
|
*
|
||||||
* @param owner the owner
|
* @param owner
|
||||||
* @param showAlert the show alert
|
* the owner
|
||||||
|
* @param showAlert
|
||||||
|
* the show alert
|
||||||
*/
|
*/
|
||||||
private void permissionControl(String owner, boolean showAlert) {
|
private void permissionControl(String owner, boolean showAlert) {
|
||||||
GWT.log("Permission control compare between owner: "+owner +" and my login: "+AppControllerExplorer.myLogin);
|
GWT.log("Permission control compare between owner: " + owner + " and my login: "
|
||||||
|
+ AppControllerExplorer.myLogin);
|
||||||
|
|
||||||
if (AppControllerExplorer.myLogin.compareToIgnoreCase(owner) != 0) {
|
if (AppControllerExplorer.myLogin.compareToIgnoreCase(owner) != 0) {
|
||||||
enableFormDialog(false);
|
enableFormDialog(false);
|
||||||
if (showAlert)
|
if (showAlert)
|
||||||
new MessageBoxAlert("Permission denied", "You have no permissions to change sharing. You are not owner of \""+txtName.getValue()+"\"", null);
|
new MessageBoxAlert("Permission denied",
|
||||||
|
"You have no permissions to change sharing. You are not owner of \"" + txtName.getValue()
|
||||||
|
+ "\"",
|
||||||
|
null);
|
||||||
} else {
|
} else {
|
||||||
enableFormDialog(true);
|
enableFormDialog(true);
|
||||||
}
|
}
|
||||||
|
@ -281,7 +294,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Enable form dialog.
|
* Enable form dialog.
|
||||||
*
|
*
|
||||||
* @param bool the bool
|
* @param bool
|
||||||
|
* the bool
|
||||||
*/
|
*/
|
||||||
private void enableFormDialog(boolean bool) {
|
private void enableFormDialog(boolean bool) {
|
||||||
getButtonById(Dialog.OK).setEnabled(bool);
|
getButtonById(Dialog.OK).setEnabled(bool);
|
||||||
|
@ -304,7 +318,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Inits the layout.
|
* Inits the layout.
|
||||||
*
|
*
|
||||||
* @param folderParentName the folder parent name
|
* @param folderParentName
|
||||||
|
* the folder parent name
|
||||||
*/
|
*/
|
||||||
public void initLayout(String folderParentName) {
|
public void initLayout(String folderParentName) {
|
||||||
FormLayout layout = new FormLayout();
|
FormLayout layout = new FormLayout();
|
||||||
|
@ -324,9 +339,12 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Use to create a new shared folder.
|
* Use to create a new shared folder.
|
||||||
*
|
*
|
||||||
* @param folderParentName the folder parent name
|
* @param folderParentName
|
||||||
* @param eventBus the event bus
|
* the folder parent name
|
||||||
* @param userStore the user store
|
* @param eventBus
|
||||||
|
* the event bus
|
||||||
|
* @param userStore
|
||||||
|
* the user store
|
||||||
*/
|
*/
|
||||||
public DialogShareFolder(String folderParentName, HandlerManager eventBus, UserStore userStore) {
|
public DialogShareFolder(String folderParentName, HandlerManager eventBus, UserStore userStore) {
|
||||||
initUserStore(userStore);
|
initUserStore(userStore);
|
||||||
|
@ -404,7 +422,6 @@ public class DialogShareFolder extends Dialog {
|
||||||
this.show();
|
this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the shared list users.
|
* Gets the shared list users.
|
||||||
*
|
*
|
||||||
|
@ -415,7 +432,6 @@ public class DialogShareFolder extends Dialog {
|
||||||
return suggestPanel.getSelectedUser();
|
return suggestPanel.getSelectedUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the listners.
|
* Adds the listners.
|
||||||
*/
|
*/
|
||||||
|
@ -429,7 +445,6 @@ public class DialogShareFolder extends Dialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -446,7 +461,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
final MultiDragContact multiDrag = new MultiDragContact();
|
final MultiDragContact multiDrag = new MultiDragContact();
|
||||||
multiDrag.show();
|
multiDrag.show();
|
||||||
|
|
||||||
List<InfoContactModel> exclusiveContacts = userStore.getExclusiveContactsFromAllContact(suggestPanel.getSelectedUser());
|
List<InfoContactModel> exclusiveContacts = userStore
|
||||||
|
.getExclusiveContactsFromAllContact(suggestPanel.getSelectedUser());
|
||||||
multiDrag.addSourceContacts(exclusiveContacts);
|
multiDrag.addSourceContacts(exclusiveContacts);
|
||||||
|
|
||||||
for (InfoContactModel infoContactModel : suggestPanel.getSelectedUser()) {
|
for (InfoContactModel infoContactModel : suggestPanel.getSelectedUser()) {
|
||||||
|
@ -478,26 +494,27 @@ public class DialogShareFolder extends Dialog {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is share owner.
|
* Checks if is share owner.
|
||||||
*
|
*
|
||||||
* @param infoContactModel the info contact model
|
* @param infoContactModel
|
||||||
|
* the info contact model
|
||||||
* @return true, if is share owner
|
* @return true, if is share owner
|
||||||
*/
|
*/
|
||||||
public boolean isShareOwner(InfoContactModel infoContactModel) {
|
public boolean isShareOwner(InfoContactModel infoContactModel) {
|
||||||
|
|
||||||
if(infoContactModel!=null && shareOwner!=null && InfoContactModel.COMPARATORLOGINS.compare(infoContactModel, shareOwner)==0)
|
if (infoContactModel != null && shareOwner != null
|
||||||
|
&& InfoContactModel.COMPARATORLOGINS.compare(infoContactModel, shareOwner) == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List already shared contains.
|
* List already shared contains.
|
||||||
*
|
*
|
||||||
* @param contact the contact
|
* @param contact
|
||||||
|
* the contact
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
*/
|
*/
|
||||||
private boolean listAlreadySharedContains(InfoContactModel contact) {
|
private boolean listAlreadySharedContains(InfoContactModel contact) {
|
||||||
|
@ -559,7 +576,8 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Checks if is valid form.
|
* Checks if is valid form.
|
||||||
*
|
*
|
||||||
* @param displayAlert the display alert
|
* @param displayAlert
|
||||||
|
* the display alert
|
||||||
* @return true, if is valid form
|
* @return true, if is valid form
|
||||||
*/
|
*/
|
||||||
public boolean isValidForm(boolean displayAlert) {
|
public boolean isValidForm(boolean displayAlert) {
|
||||||
|
@ -596,11 +614,13 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Select acl for folder.
|
* Select acl for folder.
|
||||||
*
|
*
|
||||||
* @param folder the folder
|
* @param folder
|
||||||
|
* the folder
|
||||||
*/
|
*/
|
||||||
private void selectAclForFolder(FileModel folder) {
|
private void selectAclForFolder(FileModel folder) {
|
||||||
GWT.log("Loading ACL to: " + folder);
|
GWT.log("Loading ACL to: " + folder);
|
||||||
WorkspaceSharingServiceAsync.INSTANCE.getACLsForSharedFolderId(folder.getIdentifier(), new AsyncCallback<WorkspaceACL>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getACLsForSharedFolderId(folder.getIdentifier(),
|
||||||
|
new AsyncCallback<WorkspaceACL>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
|
@ -622,18 +642,23 @@ public class DialogShareFolder extends Dialog {
|
||||||
/**
|
/**
|
||||||
* Gets the users managers.
|
* Gets the users managers.
|
||||||
*
|
*
|
||||||
* @param sharedFolderId the shared folder id
|
*
|
||||||
* @param callback the callback
|
* @param sharedFolderId
|
||||||
* @return the users managers
|
* share folder id
|
||||||
|
* @param callback
|
||||||
|
* list of contacts
|
||||||
*/
|
*/
|
||||||
public void getUsersManagers(final String sharedFolderId, final AsyncCallback<List<InfoContactModel>> callback) {
|
public void getUsersManagers(final String sharedFolderId, final AsyncCallback<List<InfoContactModel>> callback) {
|
||||||
|
|
||||||
WorkspaceSharingServiceAsync.INSTANCE.getAdministratorsByFolderId(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getAdministratorsByFolderId(sharedFolderId,
|
||||||
|
new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
GWT.log("an error occured in getting user managers by Id "+sharedFolderId + " "+arg0.getMessage());
|
GWT.log("an error occured in getting user managers by Id " + sharedFolderId + " "
|
||||||
new MessageBoxAlert("Alert", "Sorry, an error occurred on getting users managers, try again later",null);
|
+ arg0.getMessage());
|
||||||
|
new MessageBoxAlert("Alert",
|
||||||
|
"Sorry, an error occurred on getting users managers, try again later", null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -645,20 +670,23 @@ public class DialogShareFolder extends Dialog {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Permission control.
|
* Permission control.
|
||||||
*
|
*
|
||||||
* @param listManagers the list managers
|
* @param listManagers
|
||||||
* @param showAlert the show alert
|
* the list managers
|
||||||
* @param folder the folder
|
* @param showAlert
|
||||||
|
* the show alert
|
||||||
|
* @param folder
|
||||||
|
* the folder
|
||||||
*/
|
*/
|
||||||
private void permissionControl(List<InfoContactModel> listManagers, boolean showAlert, FileModel folder) {
|
private void permissionControl(List<InfoContactModel> listManagers, boolean showAlert, FileModel folder) {
|
||||||
|
|
||||||
boolean permissionsOk = false;
|
boolean permissionsOk = false;
|
||||||
for (InfoContactModel infoContactModel : listManagers) {
|
for (InfoContactModel infoContactModel : listManagers) {
|
||||||
|
|
||||||
GWT.log("DialogPermission control compare between : "+infoContactModel.getLogin() +" and my login: "+AppControllerExplorer.myLogin);
|
GWT.log("DialogPermission control compare between : " + infoContactModel.getLogin() + " and my login: "
|
||||||
|
+ AppControllerExplorer.myLogin);
|
||||||
if (AppControllerExplorer.myLogin.compareToIgnoreCase(infoContactModel.getLogin()) == 0) {
|
if (AppControllerExplorer.myLogin.compareToIgnoreCase(infoContactModel.getLogin()) == 0) {
|
||||||
permissionsOk = true;
|
permissionsOk = true;
|
||||||
break;
|
break;
|
||||||
|
@ -671,7 +699,10 @@ public class DialogShareFolder extends Dialog {
|
||||||
} else {
|
} else {
|
||||||
enableFormDialog(false);
|
enableFormDialog(false);
|
||||||
if (showAlert)
|
if (showAlert)
|
||||||
new MessageBoxAlert("Permission denied", "You have no permissions to change sharing. You are not manager of \""+folder.getName()+"\"", null);
|
new MessageBoxAlert("Permission denied",
|
||||||
|
"You have no permissions to change sharing. You are not manager of \"" + folder.getName()
|
||||||
|
+ "\"",
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,6 +63,9 @@ public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use to set permission to VRE Folder
|
* Use to set permission to VRE Folder
|
||||||
|
*
|
||||||
|
* @param folder
|
||||||
|
* folder
|
||||||
*/
|
*/
|
||||||
public DialogPermission(FileModel folder) {
|
public DialogPermission(FileModel folder) {
|
||||||
|
|
||||||
|
@ -74,7 +77,6 @@ public class DialogPermission extends Dialog {
|
||||||
hpPermission.setVerticalAlign(VerticalAlignment.MIDDLE);
|
hpPermission.setVerticalAlign(VerticalAlignment.MIDDLE);
|
||||||
hpPermission.mask("Checking authorization");
|
hpPermission.mask("Checking authorization");
|
||||||
|
|
||||||
|
|
||||||
AsyncCallback<List<InfoContactModel>> callback = new AsyncCallback<List<InfoContactModel>>() {
|
AsyncCallback<List<InfoContactModel>> callback = new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -124,8 +126,7 @@ public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
public void addListners() {
|
public void addListners() {
|
||||||
|
|
||||||
this.getButtonById(Dialog.CANCEL).addSelectionListener(
|
this.getButtonById(Dialog.CANCEL).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
new SelectionListener<ButtonEvent>() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
|
@ -133,8 +134,7 @@ public class DialogPermission extends Dialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.getButtonById(Dialog.OK).addSelectionListener(
|
this.getButtonById(Dialog.OK).addSelectionListener(new SelectionListener<ButtonEvent>() {
|
||||||
new SelectionListener<ButtonEvent>() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentSelected(ButtonEvent ce) {
|
public void componentSelected(ButtonEvent ce) {
|
||||||
|
@ -142,7 +142,8 @@ public class DialogPermission extends Dialog {
|
||||||
INSTANCE.mask("Changing permissions");
|
INSTANCE.mask("Changing permissions");
|
||||||
if (folder != null && getSelectedACL().getId() != null) {
|
if (folder != null && getSelectedACL().getId() != null) {
|
||||||
|
|
||||||
WorkspaceSharingServiceAsync.INSTANCE.updateACLForVREbyGroupName(folder.getIdentifier(), getSelectedACL().getId(), new AsyncCallback<Void>() {
|
WorkspaceSharingServiceAsync.INSTANCE.updateACLForVREbyGroupName(folder.getIdentifier(),
|
||||||
|
getSelectedACL().getId(), new AsyncCallback<Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -154,9 +155,11 @@ public class DialogPermission extends Dialog {
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
INSTANCE.unmask();
|
INSTANCE.unmask();
|
||||||
INSTANCE.hide();
|
INSTANCE.hide();
|
||||||
new InfoDisplay("Permission updated", "The permissions have been changed correctly");
|
new InfoDisplay("Permission updated",
|
||||||
|
"The permissions have been changed correctly");
|
||||||
|
|
||||||
AppControllerExplorer.getEventBus().fireEvent(new UpdatedVREPermissionEvent(folder.getIdentifier()));
|
AppControllerExplorer.getEventBus()
|
||||||
|
.fireEvent(new UpdatedVREPermissionEvent(folder.getIdentifier()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -165,13 +168,13 @@ public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void permissionControl(List<InfoContactModel> listManagers, boolean showAlert) {
|
private void permissionControl(List<InfoContactModel> listManagers, boolean showAlert) {
|
||||||
|
|
||||||
boolean permissionsOk = false;
|
boolean permissionsOk = false;
|
||||||
for (InfoContactModel infoContactModel : listManagers) {
|
for (InfoContactModel infoContactModel : listManagers) {
|
||||||
|
|
||||||
GWT.log("DialogPermission control compare between : "+infoContactModel.getLogin() +" and my login: "+AppControllerExplorer.myLogin);
|
GWT.log("DialogPermission control compare between : " + infoContactModel.getLogin() + " and my login: "
|
||||||
|
+ AppControllerExplorer.myLogin);
|
||||||
if (AppControllerExplorer.myLogin.compareToIgnoreCase(infoContactModel.getLogin()) == 0) {
|
if (AppControllerExplorer.myLogin.compareToIgnoreCase(infoContactModel.getLogin()) == 0) {
|
||||||
permissionsOk = true;
|
permissionsOk = true;
|
||||||
break;
|
break;
|
||||||
|
@ -184,7 +187,10 @@ public class DialogPermission extends Dialog {
|
||||||
} else {
|
} else {
|
||||||
enableFormDialog(false);
|
enableFormDialog(false);
|
||||||
if (showAlert)
|
if (showAlert)
|
||||||
new MessageBoxAlert("Permission denied", "You have no permissions to change sharing. You are not manager of \""+folder.getName()+"\"", null);
|
new MessageBoxAlert("Permission denied",
|
||||||
|
"You have no permissions to change sharing. You are not manager of \"" + folder.getName()
|
||||||
|
+ "\"",
|
||||||
|
null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -198,12 +204,15 @@ public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
public void getUsersManagers(final String sharedFolderId, final AsyncCallback<List<InfoContactModel>> callback) {
|
public void getUsersManagers(final String sharedFolderId, final AsyncCallback<List<InfoContactModel>> callback) {
|
||||||
|
|
||||||
WorkspaceSharingServiceAsync.INSTANCE.getAdministratorsByFolderId(sharedFolderId, new AsyncCallback<List<InfoContactModel>>() {
|
WorkspaceSharingServiceAsync.INSTANCE.getAdministratorsByFolderId(sharedFolderId,
|
||||||
|
new AsyncCallback<List<InfoContactModel>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable arg0) {
|
public void onFailure(Throwable arg0) {
|
||||||
GWT.log("an error occured in getting user managers by Id "+sharedFolderId + " "+arg0.getMessage());
|
GWT.log("an error occured in getting user managers by Id " + sharedFolderId + " "
|
||||||
new MessageBoxAlert("Alert", "Sorry, an error occurred on getting users managers, try again later",null);
|
+ arg0.getMessage());
|
||||||
|
new MessageBoxAlert("Alert",
|
||||||
|
"Sorry, an error occurred on getting users managers, try again later", null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
/**
|
/**
|
||||||
* The Class DialogEditProperties.
|
* The Class DialogEditProperties.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Jun 11, 2015
|
||||||
* Jun 11, 2015
|
|
||||||
*/
|
*/
|
||||||
public class DialogEditProperties extends Dialog {
|
public class DialogEditProperties extends Dialog {
|
||||||
|
|
||||||
|
@ -41,8 +40,10 @@ public class DialogEditProperties extends Dialog{
|
||||||
/**
|
/**
|
||||||
* Instantiates a new dialog edit properties.
|
* Instantiates a new dialog edit properties.
|
||||||
*
|
*
|
||||||
* @param itemId
|
* @param item
|
||||||
* the item id
|
* FileModel
|
||||||
|
* @param command
|
||||||
|
* Command
|
||||||
*/
|
*/
|
||||||
public DialogEditProperties(FileModel item, Command command) {
|
public DialogEditProperties(FileModel item, Command command) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
@ -73,8 +74,9 @@ public class DialogEditProperties extends Dialog{
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
/* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see com.extjs.gxt.ui.client.widget.Window#show()
|
* @see com.extjs.gxt.ui.client.widget.Window#show()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -100,7 +102,8 @@ public class DialogEditProperties extends Dialog{
|
||||||
String value = field.getValue() != null ? field.getValue() : "";
|
String value = field.getValue() != null ? field.getValue() : "";
|
||||||
prp.put(field.getFieldLabel(), value);
|
prp.put(field.getFieldLabel(), value);
|
||||||
}
|
}
|
||||||
AppControllerExplorer.rpcWorkspaceService.setGcubeItemProperties(item.getIdentifier(), prp, new AsyncCallback<Void>() {
|
AppControllerExplorer.rpcWorkspaceService.setGcubeItemProperties(item.getIdentifier(), prp,
|
||||||
|
new AsyncCallback<Void>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -118,10 +121,10 @@ public class DialogEditProperties extends Dialog{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void loadGcubeItemProperties() {
|
private void loadGcubeItemProperties() {
|
||||||
// mask("Loading properties...");
|
// mask("Loading properties...");
|
||||||
AppControllerExplorer.rpcWorkspaceService.loadGcubeItemProperties(item.getIdentifier(), new AsyncCallback<Map<String,String>>() {
|
AppControllerExplorer.rpcWorkspaceService.loadGcubeItemProperties(item.getIdentifier(),
|
||||||
|
new AsyncCallback<Map<String, String>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Map<String, String> result) {
|
public void onSuccess(Map<String, String> result) {
|
||||||
|
|
|
@ -12,12 +12,14 @@ public class InfoDisplay extends Info{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param title
|
* @param title
|
||||||
|
* title
|
||||||
* @param text
|
* @param text
|
||||||
* @param milliseconds - The time in milliseconds to display a message (defaults to 2500).
|
* text
|
||||||
|
* @param milliseconds
|
||||||
|
* milliseconds
|
||||||
*/
|
*/
|
||||||
public InfoDisplay(String title, String text, int milliseconds) {
|
public InfoDisplay(String title, String text, int milliseconds) {
|
||||||
|
|
||||||
|
|
||||||
InfoConfig config = new InfoConfig(title, text);
|
InfoConfig config = new InfoConfig(title, text);
|
||||||
|
|
||||||
config.display = milliseconds;
|
config.display = milliseconds;
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
package org.gcube.portlets.user.workspace.client.view.windows;
|
package org.gcube.portlets.user.workspace.client.view.windows;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it
|
* @author Francesco Mangiacrapa francesco.mangiacrapaATisti.cnr.it Jun 25, 2013
|
||||||
* Jun 25, 2013
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class InfoDisplayMessage extends InfoDisplay {
|
public class InfoDisplayMessage extends InfoDisplay {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param title
|
* @param title
|
||||||
|
* message title
|
||||||
* @param text
|
* @param text
|
||||||
|
* message text
|
||||||
*/
|
*/
|
||||||
public InfoDisplayMessage(String title, String text) {
|
public InfoDisplayMessage(String title, String text) {
|
||||||
super(title, text);
|
super(title, text);
|
||||||
|
@ -21,7 +19,9 @@ public class InfoDisplayMessage extends InfoDisplay{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param title
|
* @param title
|
||||||
|
* message title
|
||||||
* @param text
|
* @param text
|
||||||
|
* message text
|
||||||
*/
|
*/
|
||||||
public InfoDisplayMessage(String title, String text, int milliseconds) {
|
public InfoDisplayMessage(String title, String text, int milliseconds) {
|
||||||
super(title, text, milliseconds);
|
super(title, text, milliseconds);
|
||||||
|
|
Loading…
Reference in New Issue