diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java index a267521..93b2800 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java @@ -1449,8 +1449,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onFailure(Throwable caught) { explorerPanel.getAsycTreePanel().unmask(); - new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR +" adding item. " + ConstantsExplorer.TRY_AGAIN, null); - // explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot(); + new MessageBoxAlert("Error", caught.getMessage(), null); } @Override @@ -1470,8 +1469,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt @Override public void onFailure(Throwable caught) { explorerPanel.getAsycTreePanel().unmask(); - new MessageBoxAlert("Error", ConstantsExplorer.SERVER_ERROR + " creating folder." + ConstantsExplorer.TRY_AGAIN, null); - // explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot(); + new MessageBoxAlert("Error", caught.getMessage(), null); } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png index 4b4149a..d6a57a4 100644 Binary files a/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png and b/src/main/java/org/gcube/portlets/user/workspace/client/resources/icons/vrefolder.png differ diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java index 1ed9f1c..6f395a7 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceBuilder.java @@ -1427,7 +1427,15 @@ public class GWTWorkspaceBuilder { */ public FolderModel buildGXTFolderModelItem(WorkspaceFolder wsFolder, FileModel parent) throws InternalErrorException { - FolderModel folder = new FolderModel(wsFolder.getId(),wsFolder.getName(), parent, true, wsFolder.isShared(), false); + String name = ""; + + if(wsFolder.isShared()){ + WorkspaceSharedFolder shared = (WorkspaceSharedFolder) wsFolder; + name = shared.isVreFolder()?shared.getDisplayName():wsFolder.getName(); + }else + name = wsFolder.getName(); + + FolderModel folder = new FolderModel(wsFolder.getId(), name, parent, true, wsFolder.isShared(), false); folder.setShareable(true); folder.setDescription(wsFolder.getDescription()); // folder.setOwner(wsFolder.getOwner()); diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java index 3ac66b4..9f8c49f 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java @@ -45,7 +45,6 @@ import org.gcube.portlets.user.workspace.client.model.MessageModel; import org.gcube.portlets.user.workspace.client.model.ScopeModel; import org.gcube.portlets.user.workspace.client.model.SmartFolderModel; import org.gcube.portlets.user.workspace.client.model.SubTree; -import org.gcube.portlets.user.workspace.client.resources.Resources; import org.gcube.portlets.user.workspace.client.rpc.GWTWorkspaceService; import org.gcube.portlets.user.workspace.client.workspace.GWTWorkspaceItem; import org.gcube.portlets.user.workspace.server.notifications.NotificationsProducer; @@ -774,7 +773,7 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT return true; } catch (InsufficientPrivilegesException e) { - String error = "An error occurred on renaming item, " +e.getMessage(); + String error = "Insufficient Privileges to rename the item"; workspaceLogger.error(error, e); throw new Exception(error); } catch (ItemAlreadyExistException e) { @@ -814,9 +813,18 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT return builder.buildGXTFolderModelItem(wsFolder, parent); + } catch(InsufficientPrivilegesException e){ + String error = "Insufficient Privileges to create the folder"; + workspaceLogger.error(error, e); + throw new Exception(error); + } catch (ItemAlreadyExistException e) { + String error = "An error occurred on creating folder, " +e.getMessage(); + workspaceLogger.error(error, e); + throw new Exception(error); } catch (Exception e) { - workspaceLogger.error("Error in server create folder", e); - throw new Exception(e.getMessage()); + String error = ConstantsExplorer.SERVER_ERROR + " creating folder. "+ConstantsExplorer.TRY_AGAIN; + workspaceLogger.error(error, e); + throw new Exception(error); } }