Release gCube 4.8

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@158452 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2017-11-14 15:47:07 +00:00
parent dc60b5a056
commit 83bdf26878
2 changed files with 62 additions and 69 deletions

View File

@ -67,7 +67,8 @@ public class FileFld extends AbstractFld {
private TextButton netcdfButton;
/**
* @param parameter parameter
* @param parameter
* parameter
*/
public FileFld(Parameter parameter) {
super(parameter);
@ -85,14 +86,20 @@ public class FileFld extends AbstractFld {
HtmlLayoutContainer descr;
if (fileParameter.getDescription() == null) {
if (fileParameter.getDescription() == null || fileParameter.getDescription().isEmpty()) {
descr = new HtmlLayoutContainer("<p style='margin-left:5px !important;'></p>");
descr.addStyleName("workflow-fieldDescription");
} else {
descr = new HtmlLayoutContainer("<p style='margin-left:5px !important;'>"
+ fileParameter.getDescription() + "</p>");
if (fileParameter.isNetcdf()) {
String des = fileParameter.getDescription().replaceFirst("\\[NETCDF\\]", "");
descr = new HtmlLayoutContainer("<p style='margin-left:5px !important;'>" + des + "</p>");
descr.addStyleName("workflow-fieldDescription");
} else {
descr = new HtmlLayoutContainer(
"<p style='margin-left:5px !important;'>" + fileParameter.getDescription() + "</p>");
descr.addStyleName("workflow-fieldDescription");
}
}
horiz.add(tabContainer, new BoxLayoutData(new Margins()));
@ -129,8 +136,7 @@ public class FileFld extends AbstractFld {
@Override
public void onFailed(Throwable throwable) {
Log.error("Error in create project: "
+ throwable.getLocalizedMessage());
Log.error("Error in create project: " + throwable.getLocalizedMessage());
UtilsGXT3.alert("Error", throwable.getLocalizedMessage());
throwable.printStackTrace();
}
@ -207,24 +213,19 @@ public class FileFld extends AbstractFld {
private void retrieveFileInformation(final Item item) {
Log.debug("Retrieved: " + item);
final ItemDescription itemDescription = new ItemDescription(
item.getId(), item.getName(), item.getOwner(), item.getPath(),
item.getType().name());
final ItemDescription itemDescription = new ItemDescription(item.getId(), item.getName(), item.getOwner(),
item.getPath(), item.getType().name());
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(itemDescription,
new AsyncCallback<String>() {
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(itemDescription, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
Log.error("Error in retrieveFileInformation: "
+ caught.getMessage());
Log.error("Error in retrieveFileInformation: " + caught.getMessage());
if (caught instanceof SessionExpiredServiceException) {
UtilsGXT3.alert("Error", "Expired Session");
} else {
UtilsGXT3.alert("Error",
"Error retrieving file informations: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error", "Error retrieving file informations: " + caught.getLocalizedMessage());
}
}
@ -243,19 +244,15 @@ public class FileFld extends AbstractFld {
private void downloadFile() {
if (selectedFileItem != null) {
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(
selectedFileItem, new AsyncCallback<String>() {
DataMinerPortletServiceAsync.INSTANCE.getPublicLink(selectedFileItem, new AsyncCallback<String>() {
@Override
public void onFailure(Throwable caught) {
if (caught instanceof SessionExpiredServiceException) {
EventBusProvider.INSTANCE
.fireEvent(new SessionExpiredEvent());
EventBusProvider.INSTANCE.fireEvent(new SessionExpiredEvent());
} else {
Log.error("Error downloading file: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
caught.getLocalizedMessage());
Log.error("Error downloading file: " + caught.getLocalizedMessage());
UtilsGXT3.alert("Error", caught.getLocalizedMessage());
}
caught.printStackTrace();
@ -344,8 +341,7 @@ public class FileFld extends AbstractFld {
@Override
public String getValue() {
return (selectedFileItem == null) ? null : selectedFileItem
.getPublicLink();
return (selectedFileItem == null) ? null : selectedFileItem.getPublicLink();
}
}

View File

@ -298,7 +298,6 @@ public class WPS2DM {
} else {
if (title.contains("[a http link to a file")) {
if (title.contains("[NETCDF]")) {
title.replaceFirst("[NETCDF]", "");
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, true);
} else {
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
@ -323,7 +322,6 @@ public class WPS2DM {
supportedMimeTypes);
} else {
if (title.contains("[NETCDF]")) {
title.replaceFirst("[NETCDF]", "");
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, true);
} else {
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
@ -331,7 +329,6 @@ public class WPS2DM {
}
} else {
if (title.contains("[NETCDF]")) {
title.replaceFirst("[NETCDF]", "");
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, true);
} else {
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);