From b4ea5e79c6ffe1258c45c65100e7a70d9fb13dce Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Thu, 27 Apr 2017 15:22:04 +0000 Subject: [PATCH] minor fixes on loading and on number fields validation git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@147230 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 16 +++++++++----- .../client/ui/form/CreateDatasetForm.java | 21 +++++++++--------- .../client/ui/metadata/CategoryPanel.ui.xml | 2 +- .../ui/metadata/MetaDataFieldSkeleton.java | 22 ++++++++++++++----- 4 files changed, 39 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index f5feff9..40fe52b 100644 --- a/pom.xml +++ b/pom.xml @@ -55,11 +55,11 @@ - - - - - + + + + + com.google.gwt gwt-servlet @@ -215,7 +215,11 @@ compile test - + + + + + diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/form/CreateDatasetForm.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/form/CreateDatasetForm.java index a2a9bd0..ac8c599 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/form/CreateDatasetForm.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/form/CreateDatasetForm.java @@ -318,15 +318,18 @@ public class CreateDatasetForm extends Composite{ authorEmailTextbox.setText(bean.getAuthorEmail()); maintainerTextbox.setText(bean.getAuthorSurname() + " " + bean.getAuthorName()); maintainerEmailTextbox.setText(bean.getMaintainerEmail()); - - // retrieve custom fields - Map> customFieldsMap = bean.getCustomFields(); - List vocabularyTags = bean.getTagsVocabulary(); + + setAlertBlock("Retrieving information, please wait...", AlertType.INFO, true); // vocabulary list of tags has preemption + List vocabularyTags = bean.getTagsVocabulary(); tagsPanel.setVocabulary(vocabularyTags); + + // retrieve custom fields + Map> customFieldsMap = bean.getCustomFields(); - if(customFieldsMap != null){ + // TODO Check if these tags are ok for the vocabulary + if(customFieldsMap != null && vocabularyTags == null){ // get the keys and put them as tags Iterator>> iteratorOverCustomField = customFieldsMap.entrySet().iterator(); @@ -382,9 +385,6 @@ public class CreateDatasetForm extends Composite{ } }); - // try to retrieve the profiles - setAlertBlock("Retrieving types, please wait...", AlertType.INFO, true); - // get the name of the organization from the title final String orgName = nameTitleOrganizationMap.get(organizationsListbox.getSelectedItemText()); @@ -397,7 +397,6 @@ public class CreateDatasetForm extends Composite{ tagsPanel.setVocabulary(vocabulary); tagsPanel.setVisible(true); - setAlertBlock("", AlertType.ERROR, false); } @Override @@ -410,6 +409,8 @@ public class CreateDatasetForm extends Composite{ } }); + // try to retrieve the profiles + setAlertBlock("Retrieving types, please wait...", AlertType.INFO, true); // perform remote request of profiles for the selected organization ckanServices.getProfiles(orgName, new AsyncCallback>() { @@ -492,7 +493,7 @@ public class CreateDatasetForm extends Composite{ }); }else{ - setAlertBlock("Error while retrieving licenses, try later", AlertType.ERROR, true); + setAlertBlock("Error while retrieving licenses", AlertType.ERROR, true); } } }); diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/metadata/CategoryPanel.ui.xml b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/metadata/CategoryPanel.ui.xml index 585adfe..68e9845 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/metadata/CategoryPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/metadata/CategoryPanel.ui.xml @@ -2,7 +2,7 @@ - +