Minor updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@86434 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
347bb154b0
commit
e4d4535e7b
|
@ -37,6 +37,7 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
protected CSVExportSession exportSession;
|
protected CSVExportSession exportSession;
|
||||||
protected CSVWorkSpaceSelectionCard thisCard;
|
protected CSVWorkSpaceSelectionCard thisCard;
|
||||||
protected TextField fileName;
|
protected TextField fileName;
|
||||||
|
protected TextField fileDescription;
|
||||||
|
|
||||||
protected Item item;
|
protected Item item;
|
||||||
protected VerticalLayoutContainer p;
|
protected VerticalLayoutContainer p;
|
||||||
|
@ -60,6 +61,13 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
p.add(new FieldLabel(fileName, "File Name"), new VerticalLayoutData(-1,
|
p.add(new FieldLabel(fileName, "File Name"), new VerticalLayoutData(-1,
|
||||||
-1));
|
-1));
|
||||||
|
|
||||||
|
fileDescription = new TextField();
|
||||||
|
fileDescription.setAllowBlank(false);
|
||||||
|
fileDescription.setWidth("410px");
|
||||||
|
fileDescription.setValue("csv");
|
||||||
|
p.add(new FieldLabel(fileDescription, "File Description"),
|
||||||
|
new VerticalLayoutData(-1, -1));
|
||||||
|
|
||||||
Log.debug("Set Workspace Panel");
|
Log.debug("Set Workspace Panel");
|
||||||
wpanel = new WorkspacePanel();
|
wpanel = new WorkspacePanel();
|
||||||
wpanel.setSpWidth("410px");
|
wpanel.setSpWidth("410px");
|
||||||
|
@ -110,18 +118,31 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
||||||
};
|
};
|
||||||
if (fileName.getCurrentValue() != null
|
if (fileName.getCurrentValue() != null
|
||||||
&& !fileName.getCurrentValue().isEmpty() && fileName.validate()) {
|
&& !fileName.getCurrentValue().isEmpty() && fileName.validate()) {
|
||||||
if (exportSession.getItemId() != null) {
|
if (fileDescription.getCurrentValue() != null
|
||||||
exportSession.setFileName(fileName.getCurrentValue());
|
&& !fileDescription.getCurrentValue().isEmpty()
|
||||||
getFileFromWorkspace();
|
&& fileDescription.validate()) {
|
||||||
|
|
||||||
|
if (exportSession.getItemId() != null) {
|
||||||
|
exportSession.setFileName(fileName.getCurrentValue());
|
||||||
|
exportSession.setFileDescription(fileDescription.getCurrentValue());
|
||||||
|
getFileFromWorkspace();
|
||||||
|
} else {
|
||||||
|
d = new AlertMessageBox("AttecheckExportDatantion",
|
||||||
|
"No folder selected");
|
||||||
|
d.addHideHandler(hideHandler);
|
||||||
|
d.setModal(false);
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
d = new AlertMessageBox("AttecheckExportDatantion", "No folder selected");
|
d = new AlertMessageBox("Attention",
|
||||||
|
"No valid file description");
|
||||||
d.addHideHandler(hideHandler);
|
d.addHideHandler(hideHandler);
|
||||||
d.setModal(false);
|
d.setModal(false);
|
||||||
d.show();
|
d.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
d = new AlertMessageBox("Attention", "No valid file name");
|
d = new AlertMessageBox("Attention", "No valid file name");
|
||||||
d.addHideHandler(hideHandler);
|
d.addHideHandler(hideHandler);
|
||||||
d.setModal(false);
|
d.setModal(false);
|
||||||
|
|
|
@ -6,8 +6,6 @@ package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||||
|
|
||||||
|
@ -36,7 +34,7 @@ public class CSVExportProgressBarUpdater implements CSVExportProgressListener {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void operationComplete(TRId trId) {
|
public void operationComplete() {
|
||||||
Log.info("Export completed");
|
Log.info("Export completed");
|
||||||
progressBar.updateProgress(1, "Export completed.");
|
progressBar.updateProgress(1, "Export completed.");
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
*/
|
*/
|
||||||
package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,7 +30,7 @@ public interface CSVExportProgressListener {
|
||||||
/**
|
/**
|
||||||
* Called when the operation is complete.
|
* Called when the operation is complete.
|
||||||
*/
|
*/
|
||||||
public void operationComplete(TRId trId);
|
public void operationComplete();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the operation is failed.
|
* Called when the operation is failed.
|
||||||
|
|
|
@ -6,8 +6,7 @@ package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId;
|
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportMonitor;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportMonitor;
|
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.user.client.Timer;
|
import com.google.gwt.user.client.Timer;
|
||||||
|
@ -34,7 +33,7 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
public void run() {
|
public void run() {
|
||||||
Log.debug("requesting operation progress");
|
Log.debug("requesting operation progress");
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
|
.getCSVExportMonitor(new AsyncCallback<CSVExportMonitor>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -47,7 +46,7 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(CSVImportMonitor result) {
|
public void onSuccess(CSVExportMonitor result) {
|
||||||
Log.info("retrieved CSVImportMonitor: "
|
Log.info("retrieved CSVImportMonitor: "
|
||||||
+ result.getStatus());
|
+ result.getStatus());
|
||||||
switch (result.getStatus()) {
|
switch (result.getStatus()) {
|
||||||
|
@ -68,9 +67,9 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
break;
|
break;
|
||||||
case SUCCEDED:
|
case SUCCEDED:
|
||||||
cancel();
|
cancel();
|
||||||
Log.info("Export fisnish TableId :"
|
Log.info("Export fisnish ExportMetadata:"
|
||||||
+ result.getTrId());
|
+ result.getTrExportMetadata());
|
||||||
fireOperationComplete(result.getTrId());
|
fireOperationComplete();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -84,7 +83,7 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void errorMessage(CSVImportMonitor result) {
|
protected void errorMessage(CSVExportMonitor result) {
|
||||||
Log.info("CSV Export Failed");
|
Log.info("CSV Export Failed");
|
||||||
Throwable th = null;
|
Throwable th = null;
|
||||||
String failure = null;
|
String failure = null;
|
||||||
|
@ -131,9 +130,9 @@ public class CSVExportProgressUpdater extends Timer {
|
||||||
listener.operationUpdate(elaborated);
|
listener.operationUpdate(elaborated);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fireOperationComplete(TRId trId) {
|
protected void fireOperationComplete() {
|
||||||
for (CSVExportProgressListener listener : listeners)
|
for (CSVExportProgressListener listener : listeners)
|
||||||
listener.operationComplete(trId);
|
listener.operationComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void fireOperationFailed(Throwable caught, String failure,
|
protected void fireOperationFailed(Throwable caught, String failure,
|
||||||
|
|
Loading…
Reference in New Issue