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 CSVWorkSpaceSelectionCard thisCard;
|
||||
protected TextField fileName;
|
||||
protected TextField fileDescription;
|
||||
|
||||
protected Item item;
|
||||
protected VerticalLayoutContainer p;
|
||||
|
@ -60,6 +61,13 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
|||
p.add(new FieldLabel(fileName, "File Name"), new VerticalLayoutData(-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");
|
||||
wpanel = new WorkspacePanel();
|
||||
wpanel.setSpWidth("410px");
|
||||
|
@ -110,18 +118,31 @@ public class CSVWorkSpaceSelectionCard extends WizardCard {
|
|||
};
|
||||
if (fileName.getCurrentValue() != null
|
||||
&& !fileName.getCurrentValue().isEmpty() && fileName.validate()) {
|
||||
if (fileDescription.getCurrentValue() != null
|
||||
&& !fileDescription.getCurrentValue().isEmpty()
|
||||
&& fileDescription.validate()) {
|
||||
|
||||
if (exportSession.getItemId() != null) {
|
||||
exportSession.setFileName(fileName.getCurrentValue());
|
||||
exportSession.setFileDescription(fileDescription.getCurrentValue());
|
||||
getFileFromWorkspace();
|
||||
} else {
|
||||
d = new AlertMessageBox("AttecheckExportDatantion", "No folder selected");
|
||||
d = new AlertMessageBox("AttecheckExportDatantion",
|
||||
"No folder selected");
|
||||
d.addHideHandler(hideHandler);
|
||||
d.setModal(false);
|
||||
d.show();
|
||||
|
||||
}
|
||||
} else {
|
||||
d = new AlertMessageBox("Attention",
|
||||
"No valid file description");
|
||||
d.addHideHandler(hideHandler);
|
||||
d.setModal(false);
|
||||
d.show();
|
||||
|
||||
}
|
||||
} else {
|
||||
d = new AlertMessageBox("Attention", "No valid file name");
|
||||
d.addHideHandler(hideHandler);
|
||||
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.sencha.gxt.widget.core.client.ProgressBar;
|
||||
|
||||
|
@ -36,7 +34,7 @@ public class CSVExportProgressBarUpdater implements CSVExportProgressListener {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void operationComplete(TRId trId) {
|
||||
public void operationComplete() {
|
||||
Log.info("Export completed");
|
||||
progressBar.updateProgress(1, "Export completed.");
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
*/
|
||||
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.
|
||||
*/
|
||||
public void operationComplete(TRId trId);
|
||||
public void operationComplete();
|
||||
|
||||
/**
|
||||
* Called when the operation is failed.
|
||||
|
|
|
@ -6,8 +6,7 @@ package org.gcube.portlets.user.td.csvexportwidget.client.progress;
|
|||
import java.util.ArrayList;
|
||||
|
||||
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.CSVImportMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportMonitor;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.Timer;
|
||||
|
@ -34,7 +33,7 @@ public class CSVExportProgressUpdater extends Timer {
|
|||
public void run() {
|
||||
Log.debug("requesting operation progress");
|
||||
TDGWTServiceAsync.INSTANCE
|
||||
.getCSVImportMonitor(new AsyncCallback<CSVImportMonitor>() {
|
||||
.getCSVExportMonitor(new AsyncCallback<CSVExportMonitor>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
@ -47,7 +46,7 @@ public class CSVExportProgressUpdater extends Timer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(CSVImportMonitor result) {
|
||||
public void onSuccess(CSVExportMonitor result) {
|
||||
Log.info("retrieved CSVImportMonitor: "
|
||||
+ result.getStatus());
|
||||
switch (result.getStatus()) {
|
||||
|
@ -68,9 +67,9 @@ public class CSVExportProgressUpdater extends Timer {
|
|||
break;
|
||||
case SUCCEDED:
|
||||
cancel();
|
||||
Log.info("Export fisnish TableId :"
|
||||
+ result.getTrId());
|
||||
fireOperationComplete(result.getTrId());
|
||||
Log.info("Export fisnish ExportMetadata:"
|
||||
+ result.getTrExportMetadata());
|
||||
fireOperationComplete();
|
||||
break;
|
||||
|
||||
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");
|
||||
Throwable th = null;
|
||||
String failure = null;
|
||||
|
@ -131,9 +130,9 @@ public class CSVExportProgressUpdater extends Timer {
|
|||
listener.operationUpdate(elaborated);
|
||||
}
|
||||
|
||||
protected void fireOperationComplete(TRId trId) {
|
||||
protected void fireOperationComplete() {
|
||||
for (CSVExportProgressListener listener : listeners)
|
||||
listener.operationComplete(trId);
|
||||
listener.operationComplete();
|
||||
}
|
||||
|
||||
protected void fireOperationFailed(Throwable caught, String failure,
|
||||
|
|
Loading…
Reference in New Issue