ref 11720: DataMiner - Update to StorageHUB

https://support.d4science.org/issues/11720

Updated to StorageHub 

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@169615 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-07-02 14:11:02 +00:00
parent 1dc787df14
commit 34e075b581
4 changed files with 40 additions and 83 deletions

View File

@ -244,7 +244,7 @@
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>workspace-uploader</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<version>[1.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
</dependency>
<!-- OpenLayer Basic Widget -->

View File

@ -18,7 +18,7 @@ import org.gcube.portlets.widgets.netcdfbasicwidgets.client.widgets.NetCDFPrevie
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.shared.GWT;
@ -108,20 +108,18 @@ public class FileFld extends AbstractFld {
private void init() {
/*List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values()));
*/
wselectDialog = new WorkspaceExplorerSelectDialog("Select File", false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@Override
public void onSelectedItem(Item item) {
if (item.isFolder() || item.isRoot()) {
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!");
} else {

View File

@ -12,6 +12,7 @@ import org.gcube.portlets.user.dataminermanager.shared.exception.SessionExpiredS
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.Window;
@ -139,40 +140,18 @@ public class TabItem extends HBoxLayoutContainer {
private void initDialog() {
/*List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values()));*/
/*
* "application/zip", "application/x-zip",
* "application/x-zip-compressed", "application/octet-stream",
* "application/x-compress", "application/x-compressed",
* "multipart/x-zip"
*/
// List<String> allowedMimeTypes =
// Arrays.asList("text/csv","text/plain","text/plain;
// charset=ISO-8859-1");
/**
* "zip"
*/
/*
* List<String> allowedFileExtensions = Arrays.asList("csv");
*
* FilterCriteria filterCriteria = new FilterCriteria(allowedMimeTypes,
* allowedFileExtensions, new HashMap<String, String>());
*/
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@Override
public void onSelectedItem(Item item) {
if (item.isFolder() || item.isRoot()) {
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 csv!");
} else {

View File

@ -21,6 +21,7 @@ import org.gcube.portlets.user.dataminermanager.shared.exception.SessionExpiredS
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.event.shared.GwtEvent;
@ -129,42 +130,19 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
private void init() throws Exception {
try {
/*List<ItemType> selectableTypes = new ArrayList<ItemType>();
selectableTypes.add(ItemType.EXTERNAL_FILE);
List<ItemType> showableTypes = new ArrayList<ItemType>();
showableTypes.addAll(Arrays.asList(ItemType.values()));*/
try {
/*
* "application/zip", "application/x-zip",
* "application/x-zip-compressed", "application/octet-stream",
* "application/x-compress", "application/x-compressed",
* "multipart/x-zip"
*/
// List<String> allowedMimeTypes =
// Arrays.asList("text/csv","text/plain","text/plain;
// charset=ISO-8859-1");
/**
* "zip"
*/
/*
* List<String> allowedFileExtensions = Arrays.asList("csv");
*
* FilterCriteria filterCriteria = new
* FilterCriteria(allowedMimeTypes, allowedFileExtensions, new
* HashMap<String, String>());
*/
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
// filterCriteria, selectableTypes);
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
@Override
public void onSelectedItem(Item item) {
if (item.isFolder() || item.isRoot()) {
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 csv!");
} else {
@ -259,28 +237,30 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
itemDescriptionSelected = new ItemDescription(item.getId(), item.getName(), item.getOwner(), item.getPath(),
item.getType().name());
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(itemDescriptionSelected, new AsyncCallback<TableItemSimple>() {
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(itemDescriptionSelected,
new AsyncCallback<TableItemSimple>() {
@Override
public void onFailure(Throwable caught) {
Log.error("Error in retrieveTableInformation " + caught.getMessage());
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
@Override
public void onFailure(Throwable caught) {
Log.error("Error in retrieveTableInformation " + caught.getMessage());
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
} else {
UtilsGXT3.alert("Error", "Error retrieving table information: " + caught.getLocalizedMessage());
}
} else {
UtilsGXT3.alert("Error",
"Error retrieving table information: " + caught.getLocalizedMessage());
}
}
}
@Override
public void onSuccess(TableItemSimple result) {
Log.debug("Retrieved: " + result);
selectedTableItem = result;
showFieldWithSelection();
updateListeners(selectedTableItem);
}
});
@Override
public void onSuccess(TableItemSimple result) {
Log.debug("Retrieved: " + result);
selectedTableItem = result;
showFieldWithSelection();
updateListeners(selectedTableItem);
}
});
}
private void downloadFile() {