From 0feb1f5eada8100960b8ed8ed7bed4160372420b Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Tue, 30 Apr 2019 10:06:04 +0000 Subject: [PATCH] [Task #12910] completed git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@179190 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 4 +- .../client/AppControllerExplorer.java | 30 +++++++++----- .../client/view/windows/DialogGetLink.java | 12 +++++- .../server/GWTWorkspaceServiceImpl.java | 39 ++++++++++++++----- .../SHUBOperationNotAllowedException.java | 35 +++++++++++++++++ 5 files changed, 100 insertions(+), 20 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/workspace/shared/SHUBOperationNotAllowedException.java diff --git a/distro/changelog.xml b/distro/changelog.xml index ad08958..ae18e67 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,9 +1,11 @@ + date="${buildDate}"> Updated to StorageHub [ticket: #13226] [Support #16430] fixed + [Task #12910] Rename and delete operations on shared folder + should be managed by dedicated message on WS-side listSharedContact = new ArrayList(); @@ -3379,9 +3393,16 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT workspaceLogger.error(error, e2); throw new Exception(error); } catch (Exception e) { - String error = ConstantsExplorer.SERVER_ERROR + " renaming item. " + ConstantsExplorer.TRY_AGAIN; - workspaceLogger.error(error, e); - throw new Exception(error); + workspaceLogger.error("Renaming item error:", e); + StringBuilder error = new StringBuilder(); + if(sourceItemIsShared) { + error.append("Ops! This operation is not allowed, we're working hard to make this possible soon."); + throw new SHUBOperationNotAllowedException(error.toString()); + }else { + error.append("Ops an error occurred renaming the item! Either you have not the permission to rename it or a server error occurred. Please, refresh and try again"); + throw new Exception(error.toString()); + } + } } diff --git a/src/main/java/org/gcube/portlets/user/workspace/shared/SHUBOperationNotAllowedException.java b/src/main/java/org/gcube/portlets/user/workspace/shared/SHUBOperationNotAllowedException.java new file mode 100644 index 0000000..191852f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/workspace/shared/SHUBOperationNotAllowedException.java @@ -0,0 +1,35 @@ +package org.gcube.portlets.user.workspace.shared; + + + +/** + * The Class SHUBOperationNotAllowedException. + * + * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) + * + * Apr 30, 2019 + */ +public class SHUBOperationNotAllowedException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 378541477623075645L; + + /** + * Instantiates a new SHUB operation not allowed. + */ + public SHUBOperationNotAllowedException() { + super(); + } + + /** + * Instantiates a new SHUB operation not allowed. + * + * @param arg0 the arg 0 + */ + public SHUBOperationNotAllowedException(String arg0){ + super(arg0); + } + +}