diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java index 76d8524..9653674 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/CSVExportWizardTD.java @@ -27,7 +27,7 @@ public class CSVExportWizardTD extends WizardWindow { exportSession= new CSVExportSession(); - SourceSelectionCard sourceSelection= new SourceSelectionCard(exportSession); + DestinationSelectionCard sourceSelection= new DestinationSelectionCard(exportSession); addCard(sourceSelection); sourceSelection.setup(); diff --git a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/DestinationSelectionCard.java similarity index 69% rename from src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java rename to src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/DestinationSelectionCard.java index 8ffa7bb..258736d 100644 --- a/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/SourceSelectionCard.java +++ b/src/main/java/org/gcube/portlets/user/td/csvexportwidget/client/DestinationSelectionCard.java @@ -6,8 +6,8 @@ package org.gcube.portlets.user.td.csvexportwidget.client; 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.gwtservice.shared.destination.FileDestination; +import org.gcube.portlets.user.td.gwtservice.shared.destination.WorkspaceDestination; import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import com.allen_sauer.gwt.log.client.Log; @@ -25,44 +25,44 @@ import com.sencha.gxt.widget.core.client.form.Radio; * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it * */ -public class SourceSelectionCard extends WizardCard { +public class DestinationSelectionCard extends WizardCard { protected final CSVExportSession exportSession; - final FileSource fileSource = FileSource.INSTANCE; - final WorkspaceSource workspaceSource = WorkspaceSource.INSTANCE; + final FileDestination fileDestination = FileDestination.INSTANCE; + final WorkspaceDestination workspaceDestination = WorkspaceDestination.INSTANCE; - public SourceSelectionCard(final CSVExportSession exportSession) { + public DestinationSelectionCard(final CSVExportSession exportSession) { super("CSV destination selection", ""); this.exportSession = exportSession; // Default - exportSession.setSource(fileSource); + exportSession.setDestination(fileDestination); - VerticalPanel sourceSelectionPanel = new VerticalPanel(); - sourceSelectionPanel.setStylePrimaryName(res.wizardCSS() + VerticalPanel destinationSelectionPanel = new VerticalPanel(); + destinationSelectionPanel.setStylePrimaryName(res.wizardCSS() .getImportSelectionSources()); Radio radioFileSource = new Radio(); radioFileSource.setBoxLabel("

" - + fileSource.getName() + "
" - + fileSource.getDescription() + "

"); - radioFileSource.setName(fileSource.getName()); + + fileDestination.getName() + "
" + + fileDestination.getDescription() + "

"); + radioFileSource.setName(fileDestination.getName()); radioFileSource.setStylePrimaryName(res.wizardCSS() .getImportSelectionSource()); radioFileSource.setValue(true); Radio radioWorkspaceSource = new Radio(); radioWorkspaceSource.setBoxLabel("

" - + workspaceSource.getName() + "
" - + workspaceSource.getDescription() + "

"); - radioWorkspaceSource.setName(workspaceSource.getName()); + + workspaceDestination.getName() + "
" + + workspaceDestination.getDescription() + "

"); + radioWorkspaceSource.setName(workspaceDestination.getName()); radioWorkspaceSource.setStylePrimaryName(res.wizardCSS() .getImportSelectionSource()); // radioWorkspaceSource.disable(); - sourceSelectionPanel.add(radioFileSource); - sourceSelectionPanel.add(radioWorkspaceSource); + destinationSelectionPanel.add(radioFileSource); + destinationSelectionPanel.add(radioWorkspaceSource); // we can set name on radios or use toggle group ToggleGroup toggle = new ToggleGroup(); @@ -77,11 +77,11 @@ public class SourceSelectionCard extends WizardCard { ToggleGroup group = (ToggleGroup) event.getSource(); Radio radio = (Radio) group.getValue(); Log.info("Source Selected:" + radio.getName()); - if (radio.getName().compareTo(workspaceSource.getName()) == 0) { - exportSession.setSource(workspaceSource); + if (radio.getName().compareTo(workspaceDestination.getName()) == 0) { + exportSession.setDestination(workspaceDestination); } else { - if (radio.getName().compareTo(fileSource.getName()) == 0) { - exportSession.setSource(fileSource); + if (radio.getName().compareTo(fileDestination.getName()) == 0) { + exportSession.setDestination(fileDestination); } else { } @@ -96,7 +96,7 @@ public class SourceSelectionCard extends WizardCard { } }); - setContent(sourceSelectionPanel); + setContent(destinationSelectionPanel); } @@ -106,7 +106,7 @@ public class SourceSelectionCard extends WizardCard { Command sayNextCard = new Command() { public void execute() { try { - String sourceId = exportSession.getSource().getId(); + String sourceId = exportSession.getDestination().getId(); if (sourceId == null || sourceId.isEmpty()) { Log.error("CSV Import Source Id: " + sourceId); } else {