From d38abe29595d9e4d5af4086b50309a121fd5655e Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Fri, 3 Mar 2017 15:58:35 +0000 Subject: [PATCH] Fixed SDMX Export now use agency id git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-sdmx-export-widget@144645 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/AgenciesSelectionPanel.java | 4 +- .../client/SDMXOperationInProgressCard.java | 4 +- .../client/SDMXTableDetailCard.java | 42 +++++++++---------- .../client/properties/AgenciesProperties.java | 2 +- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/AgenciesSelectionPanel.java b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/AgenciesSelectionPanel.java index 8a88a4d..cb54d26 100644 --- a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/AgenciesSelectionPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/AgenciesSelectionPanel.java @@ -64,6 +64,8 @@ public class AgenciesSelectionPanel extends ContentPanel implements private static final AgenciesProperties properties = GWT .create(AgenciesProperties.class); + protected static final ColumnConfig idColumn = new ColumnConfig( + properties.id(), 50, "Id"); protected static final ColumnConfig nameColumn = new ColumnConfig( properties.name(), 50, "Name"); protected static final ColumnConfig descriptionColumn = new ColumnConfig( @@ -80,7 +82,7 @@ public class AgenciesSelectionPanel extends ContentPanel implements setHeaderVisible(false); //new Resizable(this, Dir.E, Dir.SE, Dir.S); buildPanel(properties.key(), Arrays.> asList( - nameColumn, descriptionColumn), nameColumn); + idColumn, nameColumn, descriptionColumn), idColumn); } protected void buildPanel(ModelKeyProvider keyProvider, diff --git a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXOperationInProgressCard.java index 61e3e6c..871644b 100644 --- a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXOperationInProgressCard.java +++ b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXOperationInProgressCard.java @@ -74,8 +74,8 @@ public class SDMXOperationInProgressCard extends WizardCard implements description.setText(1, 1, exportSession.getId()); description.setHTML(2, 0, - "Agency: "); - description.setText(2, 1, exportSession.getAgencyName()); + "Agency Id: "); + description.setText(2, 1, exportSession.getAgencyId()); description.setHTML(3, 0, "Registry: "); diff --git a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXTableDetailCard.java b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXTableDetailCard.java index 0e4323f..ff39435 100644 --- a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXTableDetailCard.java +++ b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/SDMXTableDetailCard.java @@ -40,7 +40,7 @@ public class SDMXTableDetailCard extends WizardCard { private VerticalPanel tableDetailPanel; private TextField id; - private TextField agencyName; + private TextField agencyId; private TextField registryBaseUrl; private TextField version; private TextField measureColumn; @@ -94,17 +94,17 @@ public class SDMXTableDetailCard extends WizardCard { id.setValue(Constants.SDMX_DATASET_EXPORT_DEFAULT_ID); p.add(new FieldLabel(id, "Id"), new VerticalLayoutData(1, -1)); - agencyName = new TextField(); - agencyName.setVisible(true); - agencyName.setEmptyText("Enter Agency..."); - if (exportSession.getAgency().getName() == null - || exportSession.getAgency().getName().isEmpty()) { - agencyName.setValue(Constants.SDMX_DATASET_EXPORT_DEFAULT_AGENCY); + agencyId = new TextField(); + agencyId.setVisible(true); + agencyId.setEmptyText("Enter Agency Id..."); + if (exportSession.getAgency().getId() == null + || exportSession.getAgency().getId().isEmpty()) { + agencyId.setValue(Constants.SDMX_DATASET_EXPORT_DEFAULT_AGENCY_ID); } else { - agencyName.setValue(exportSession.getAgency().getName()); + agencyId.setValue(exportSession.getAgency().getId()); } - FieldLabel agencyNameLabel = new FieldLabel(agencyName, "Agency"); + FieldLabel agencyNameLabel = new FieldLabel(agencyId, "Agency Id"); p.add(agencyNameLabel, new VerticalLayoutData(1, -1)); registryBaseUrl = new TextField(); @@ -142,16 +142,16 @@ public class SDMXTableDetailCard extends WizardCard { id.setValue(Constants.SDMX_CODELIST_EXPORT_DEFAULT_ID); p.add(new FieldLabel(id, "Id"), new VerticalLayoutData(1, -1)); - agencyName = new TextField(); - agencyName.setVisible(true); - agencyName.setEmptyText("Enter Agency..."); - if (exportSession.getAgency().getName() == null - || exportSession.getAgency().getName().isEmpty()) { - agencyName.setValue(Constants.SDMX_CODELIST_EXPORT_DEFAULT_AGENCY); + agencyId = new TextField(); + agencyId.setVisible(true); + agencyId.setEmptyText("Enter Agency..."); + if (exportSession.getAgency().getId() == null + || exportSession.getAgency().getId().isEmpty()) { + agencyId.setValue(Constants.SDMX_CODELIST_EXPORT_DEFAULT_AGENCY_ID); } else { - agencyName.setValue(exportSession.getAgency().getName()); + agencyId.setValue(exportSession.getAgency().getId()); } - FieldLabel agencyNameLabel = new FieldLabel(agencyName, "Agency"); + FieldLabel agencyNameLabel = new FieldLabel(agencyId, "Agency Id"); p.add(agencyNameLabel, new VerticalLayoutData(1, -1)); registryBaseUrl = new TextField(); @@ -220,8 +220,8 @@ public class SDMXTableDetailCard extends WizardCard { if (id.getValue() == null || id.getValue().isEmpty() || !id.isValid() || version.getValue() == null || version.getValue().isEmpty() - || !version.isValid() || agencyName.getValue() == null - || agencyName.getValue().isEmpty() || !agencyName.isValid()) { + || !version.isValid() || agencyId.getValue() == null + || agencyId.getValue().isEmpty() || !agencyId.isValid()) { d = new AlertMessageBox("Attention!", "Fill in all fields"); d.addHideHandler(hideHandler); @@ -236,7 +236,7 @@ public class SDMXTableDetailCard extends WizardCard { id.setReadOnly(true); registryBaseUrl.setReadOnly(true); version.setReadOnly(true); - agencyName.setReadOnly(true); + agencyId.setReadOnly(true); goNext(); } } @@ -246,7 +246,7 @@ public class SDMXTableDetailCard extends WizardCard { protected void goNext() { try { exportSession.setId(id.getCurrentValue()); - exportSession.setAgencyName(agencyName.getCurrentValue()); + exportSession.setAgencyId(agencyId.getCurrentValue()); exportSession.setVersion(version.getCurrentValue()); exportSession.setRegistryBaseUrl(registryBaseUrl.getCurrentValue()); SDMXOperationInProgressCard sdmxOperationInProgressCard = new SDMXOperationInProgressCard( diff --git a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/properties/AgenciesProperties.java b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/properties/AgenciesProperties.java index f4bb783..7def52e 100644 --- a/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/properties/AgenciesProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/sdmxexportwidget/client/properties/AgenciesProperties.java @@ -23,9 +23,9 @@ public interface AgenciesProperties extends PropertyAccess { @Path("id") ModelKeyProvider key(); - LabelProvider nameLabel(); + ValueProvider id(); ValueProvider name(); ValueProvider description();