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:
parent
1dc787df14
commit
34e075b581
2
pom.xml
2
pom.xml
|
@ -244,7 +244,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.widgets</groupId>
|
<groupId>org.gcube.portlets.widgets</groupId>
|
||||||
<artifactId>workspace-uploader</artifactId>
|
<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>
|
</dependency>
|
||||||
|
|
||||||
<!-- OpenLayer Basic Widget -->
|
<!-- OpenLayer Basic Widget -->
|
||||||
|
|
|
@ -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.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
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.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.shared.GWT;
|
import com.google.gwt.core.shared.GWT;
|
||||||
|
@ -108,20 +108,18 @@ public class FileFld extends AbstractFld {
|
||||||
|
|
||||||
private void init() {
|
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);
|
wselectDialog = new WorkspaceExplorerSelectDialog("Select File", false);
|
||||||
// filterCriteria, selectableTypes);
|
|
||||||
|
|
||||||
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelectedItem(Item item) {
|
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!");
|
UtilsGXT3.info("Attention", "Select a valid file!");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
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.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
|
@ -139,40 +140,18 @@ public class TabItem extends HBoxLayoutContainer {
|
||||||
|
|
||||||
private void initDialog() {
|
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);
|
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
|
||||||
// filterCriteria, selectableTypes);
|
|
||||||
|
|
||||||
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelectedItem(Item item) {
|
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!");
|
UtilsGXT3.info("Attention", "Select a valid csv!");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -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.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
import org.gcube.portlets.widgets.wsexplorer.client.select.WorkspaceExplorerSelectDialog;
|
||||||
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
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.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
@ -129,42 +130,19 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
|
||||||
|
|
||||||
private void init() throws Exception {
|
private void init() throws Exception {
|
||||||
try {
|
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 {
|
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);
|
wselectDialog = new WorkspaceExplorerSelectDialog("Select CSV", false);
|
||||||
// filterCriteria, selectableTypes);
|
|
||||||
|
|
||||||
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
WorskpaceExplorerSelectNotificationListener handler = new WorskpaceExplorerSelectNotificationListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSelectedItem(Item item) {
|
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!");
|
UtilsGXT3.info("Attention", "Select a valid csv!");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -259,28 +237,30 @@ public class TabularFld extends AbstractFld implements HasTabularFldChangeEventH
|
||||||
itemDescriptionSelected = new ItemDescription(item.getId(), item.getName(), item.getOwner(), item.getPath(),
|
itemDescriptionSelected = new ItemDescription(item.getId(), item.getName(), item.getOwner(), item.getPath(),
|
||||||
item.getType().name());
|
item.getType().name());
|
||||||
|
|
||||||
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(itemDescriptionSelected, new AsyncCallback<TableItemSimple>() {
|
DataMinerPortletServiceAsync.INSTANCE.retrieveTableInformation(itemDescriptionSelected,
|
||||||
|
new AsyncCallback<TableItemSimple>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("Error in retrieveTableInformation " + caught.getMessage());
|
Log.error("Error in retrieveTableInformation " + caught.getMessage());
|
||||||
if (caught instanceof SessionExpiredServiceException) {
|
if (caught instanceof SessionExpiredServiceException) {
|
||||||
UtilsGXT3.alert("Error", "Expired Session");
|
UtilsGXT3.alert("Error", "Expired Session");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.alert("Error", "Error retrieving table information: " + caught.getLocalizedMessage());
|
UtilsGXT3.alert("Error",
|
||||||
}
|
"Error retrieving table information: " + caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(TableItemSimple result) {
|
public void onSuccess(TableItemSimple result) {
|
||||||
Log.debug("Retrieved: " + result);
|
Log.debug("Retrieved: " + result);
|
||||||
selectedTableItem = result;
|
selectedTableItem = result;
|
||||||
showFieldWithSelection();
|
showFieldWithSelection();
|
||||||
updateListeners(selectedTableItem);
|
updateListeners(selectedTableItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void downloadFile() {
|
private void downloadFile() {
|
||||||
|
|
Loading…
Reference in New Issue