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