From 1cfb02adb85adc2fb8e355db865ad91c8ad944c5 Mon Sep 17 00:00:00 2001 From: Costantino Perciante Date: Tue, 15 Nov 2016 09:40:13 +0000 Subject: [PATCH] minor fixes git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@134161 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 1 - pom.xml | 1 - .../client/ui/CreateDatasetForm.java | 15 +++++---------- .../client/ui/utils/InfoIconsLabels.java | 2 +- .../server/CKANPublisherServicesImpl.java | 6 ++---- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.classpath b/.classpath index 3e9559a..57c104b 100644 --- a/.classpath +++ b/.classpath @@ -20,7 +20,6 @@ - diff --git a/pom.xml b/pom.xml index 8981c2c..d2354e2 100644 --- a/pom.xml +++ b/pom.xml @@ -270,5 +270,4 @@ - war diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/CreateDatasetForm.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/CreateDatasetForm.java index 836b17e..a718216 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/CreateDatasetForm.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/CreateDatasetForm.java @@ -266,17 +266,9 @@ public class CreateDatasetForm extends Composite{ private void createDatasetFormBody(final boolean isWorkspaceRequest, String idFolderWorkspace, final HandlerManager eventBus){ initWidget(uiBinder.createAndBindUi(this)); - - // save event bus this.eventBus = eventBus; - - // workspace request this.isWorkspaceRequest = isWorkspaceRequest; - - // bind on events bind(); - - // prepare info icons prepareInfoIcons(); // disable continue button @@ -430,6 +422,9 @@ public class CreateDatasetForm extends Composite{ // set the url of the license, if any showLicenseUrl(); + // try to retrieve the licenses + setAlertBlock("Retrieving groups, please wait...", AlertType.INFO, true); + // request groups ckanServices.getUserGroups(new AsyncCallback>() { @@ -768,9 +763,9 @@ public class CreateDatasetForm extends Composite{ break; } } - + List groups = new ArrayList(); - + // get groups, if any int items = groupsListbox.getItemCount(); for (int i = 0; i < items; i++) { diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/utils/InfoIconsLabels.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/utils/InfoIconsLabels.java index 3a21060..1fec732 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/utils/InfoIconsLabels.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/ui/utils/InfoIconsLabels.java @@ -83,7 +83,7 @@ public class InfoIconsLabels { // GROUPS public static final String GROUPS_INFO_ID_POPUP = "groups-popup-panel-info"; - public static final String GROUPS_INFO_TEXT = "Associate this product to groups"; + public static final String GROUPS_INFO_TEXT = "Associate this product to groups. A group is a view of products belonging to one or more organization."; public static final String GROUPS_INFO_CAPTION = "Product Groups"; /** diff --git a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java index 646771b..a5fa036 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/server/CKANPublisherServicesImpl.java @@ -382,7 +382,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C toCreate.setSource(datasetUrl); // start a thread that will associate this dataset with the group - if(toCreate.getChosenProfile() != null){ + if(toCreate.getChosenProfile() != null || toCreate.getGroups() != null){ AssociationToGroupThread threadAssociationToGroup = new AssociationToGroupThread( @@ -610,7 +610,6 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C List toReturn = new ArrayList(); if(isWithinPortal()){ - String username = session.getUsername(); if(username.equals(TEST_USER)){ logger.warn("Session expired"); @@ -625,7 +624,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C DataCatalogue catalogue = getCatalogue(scope); List ckanGroups = catalogue.getGroups(); - // TODO + // TODO check role for (CkanGroup ckanGroup : ckanGroups) { toReturn.add(new GroupBean(ckanGroup.getTitle(), ckanGroup.getName())); @@ -636,7 +635,6 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C logger.warn("Dev mode detected"); toReturn = Arrays.asList(new GroupBean("Group title", "aaa")); } - return toReturn; } } \ No newline at end of file