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
This commit is contained in:
Giancarlo Panichi 2019-02-26 16:07:56 +00:00
parent 043e0cfc66
commit 0a2ee31c72
4 changed files with 23 additions and 18 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/statistical-algorithms-importer-1.13.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/statistical-algorithms-importer-1.13.2-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/statistical-algorithms-importer-1.13.1-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/statistical-algorithms-importer-1.13.2-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -45,5 +45,5 @@
</classpathentry>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA.jar" sourcepath="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="lib" path="/home/giancarlo/gwt/gwt-2.6.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="output" path="target/statistical-algorithms-importer-1.13.1-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/statistical-algorithms-importer-1.13.2-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,4 +1,9 @@
<ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-13-2" date="2019-02-26">
<Change>Updated resource selection how workaround for
WorkspaceExplorer widget [ticket #16157]
</Change>
</Changeset>
<Changeset component="${groupId}.${artifactId}.1-13-1" date="2018-12-06">
<Change>Added the project folder path update in the open operation
[ticket #12977]

View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>statistical-algorithms-importer</artifactId>
<version>1.13.1-SNAPSHOT</version>
<version>1.13.2-SNAPSHOT</version>
<packaging>war</packaging>

View File

@ -206,30 +206,30 @@ public class ProjectManager {
}
public void addResource() {
List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
/*
* List<ItemType> selectableTypes = new ArrayList<ItemType>();
* selectableTypes.add(ItemType.EXTERNAL_FILE);
*
* List<ItemType> showableTypes = new ArrayList<ItemType>();
* showableTypes.addAll(Arrays.asList(ItemType.values()));
*/
List<ItemType> showableTypes = new ArrayList<ItemType>();
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();
}