Minor updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-csv-export-widget@85615 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-11-18 13:36:43 +00:00
parent 4250f9a858
commit 1a41ddcc6e
2 changed files with 15 additions and 15 deletions

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.user.td.csvexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
@ -13,7 +13,7 @@ import org.gcube.portlets.user.td.wizardwidget.client.WizardWindow;
*/
public class CSVExportWizardTD extends WizardWindow {
protected CSVImportSession importSession;
protected CSVExportSession exportSession;
/**
@ -24,10 +24,10 @@ public class CSVExportWizardTD extends WizardWindow {
public CSVExportWizardTD(String title) {
super(title);
importSession= new CSVImportSession();
exportSession= new CSVExportSession();
SourceSelectionCard sourceSelection= new SourceSelectionCard(importSession);
SourceSelectionCard sourceSelection= new SourceSelectionCard(exportSession);
addCard(sourceSelection);
sourceSelection.setup();

View File

@ -5,7 +5,7 @@ package org.gcube.portlets.user.td.csvexportwidget.client;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.source.FileSource;
import org.gcube.portlets.user.td.gwtservice.shared.source.WorkspaceSource;
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
@ -27,17 +27,17 @@ import com.sencha.gxt.widget.core.client.form.Radio;
*/
public class SourceSelectionCard extends WizardCard {
protected final CSVImportSession importSession;
protected final CSVExportSession exportSession;
final FileSource fileSource = FileSource.INSTANCE;
final WorkspaceSource workspaceSource = WorkspaceSource.INSTANCE;
public SourceSelectionCard(final CSVImportSession importSession) {
public SourceSelectionCard(final CSVExportSession exportSession) {
super("CSV destination selection", "");
this.importSession = importSession;
this.exportSession = exportSession;
// Default
importSession.setSource(fileSource);
exportSession.setSource(fileSource);
VerticalPanel sourceSelectionPanel = new VerticalPanel();
sourceSelectionPanel.setStylePrimaryName(res.wizardCSS()
@ -78,10 +78,10 @@ public class SourceSelectionCard extends WizardCard {
Radio radio = (Radio) group.getValue();
Log.info("Source Selected:" + radio.getName());
if (radio.getName().compareTo(workspaceSource.getName()) == 0) {
importSession.setSource(workspaceSource);
exportSession.setSource(workspaceSource);
} else {
if (radio.getName().compareTo(fileSource.getName()) == 0) {
importSession.setSource(fileSource);
exportSession.setSource(fileSource);
} else {
}
@ -106,15 +106,15 @@ public class SourceSelectionCard extends WizardCard {
Command sayNextCard = new Command() {
public void execute() {
try {
String sourceId = importSession.getSource().getId();
String sourceId = exportSession.getSource().getId();
if (sourceId == null || sourceId.isEmpty()) {
Log.error("CSV Import Source Id: " + sourceId);
} else {
if (sourceId.compareTo("File") == 0) {
Log.info("NextCard CSVUploadFileCard");
/*CSVUploadFileCard csvUploadFileCard = new CSVUploadFileCard(
importSession);
getWizardWindow().addCard(csvUploadFileCard);*/
DownloadFileCard downloadFileCard = new DownloadFileCard(
exportSession);
getWizardWindow().addCard(downloadFileCard);
getWizardWindow().nextCard();
} else {
if (sourceId.compareTo("Workspace") == 0) {