From 0a2ee31c7224e3d809c0aeabf41a213fb37f47e4 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 26 Feb 2019 16:07:56 +0000 Subject: [PATCH] ref 16157: Select button does not seem to work in SAI - Select a Resource window https://support.d4science.org/issues/16157 Created a workaround to fix WorkspaceExplorer files support git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@177309 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 6 ++-- distro/changelog.xml | 5 ++++ pom.xml | 2 +- .../client/project/ProjectManager.java | 28 +++++++++---------- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.classpath b/.classpath index 2252298..071c964 100644 --- a/.classpath +++ b/.classpath @@ -1,12 +1,12 @@ - + - + @@ -45,5 +45,5 @@ - + diff --git a/distro/changelog.xml b/distro/changelog.xml index 784929a..3c6fc56 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,4 +1,9 @@ + + Updated resource selection how workaround for + WorkspaceExplorer widget [ticket #16157] + + Added the project folder path update in the open operation [ticket #12977] diff --git a/pom.xml b/pom.xml index 139ed63..4ea397a 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 4.0.0 org.gcube.portlets.user statistical-algorithms-importer - 1.13.1-SNAPSHOT + 1.13.2-SNAPSHOT war diff --git a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/project/ProjectManager.java b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/project/ProjectManager.java index de135d2..c24c05d 100644 --- a/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/project/ProjectManager.java +++ b/src/main/java/org/gcube/portlets/user/statisticalalgorithmsimporter/client/project/ProjectManager.java @@ -206,30 +206,30 @@ public class ProjectManager { } public void addResource() { - List selectableTypes = new ArrayList(); - selectableTypes.add(ItemType.EXTERNAL_FILE); + /* + * List selectableTypes = new ArrayList(); + * selectableTypes.add(ItemType.EXTERNAL_FILE); + * + * List showableTypes = new ArrayList(); + * showableTypes.addAll(Arrays.asList(ItemType.values())); + */ - List showableTypes = new ArrayList(); - showableTypes.addAll(Arrays.asList(ItemType.values())); - - WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog("Select a Resource", - selectableTypes, showableTypes); + WorkspaceExplorerSelectDialog wselectDialog = new WorkspaceExplorerSelectDialog("Select a file resource", false); WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() { @Override public void onSelectedItem(Item item) { - if (item.getType() != ItemType.FOLDER && item.getType() != ItemType.PRIVATE_FOLDER - && item.getType() != ItemType.SHARED_FOLDER && item.getType() != ItemType.VRE_FOLDER) { + if (item == null || item.getType() == ItemType.FOLDER || item.getType() == ItemType.PRIVATE_FOLDER + || item.getType() == ItemType.SHARED_FOLDER || item.getType() == ItemType.VRE_FOLDER) { + UtilsGXT3.info("Attention", "Select a valid file resource!"); + } else { String filename = item.getName(); if (filename != null && !filename.isEmpty()) { addResourceToProject(item); } else { - UtilsGXT3.info("Attention", "Select a valid resource!"); + UtilsGXT3.info("Attention", "Select a valid file resource!"); } - - } else { - UtilsGXT3.info("Attention", "Select a valid resource!"); } } @@ -393,7 +393,7 @@ public class ProjectManager { Log.error("Session Expired"); eventBus.fireEvent(new SessionExpiredEvent(SessionExpiredType.EXPIREDONSERVER)); } else { - Log.error("Error in create software: " + caught.getLocalizedMessage(),caught); + Log.error("Error in create software: " + caught.getLocalizedMessage(), caught); UtilsGXT3.alert("Error", caught.getLocalizedMessage()); fireProjectStatusExplorerRefreshEvent(); }