diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java index fbdc9d2..13bf7c1 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/services/GrsfPublisherStockService.java @@ -373,7 +373,7 @@ public class GrsfPublisherStockService { @Path("update-product") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - public Response updateFishery( + public Response updateStock( @NotNull(message="record cannot be null") @Valid StockRecord record, @PathParam("source") String source) diff --git a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/utils/threads/AssociationToGroupThread.java b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/utils/threads/AssociationToGroupThread.java index 553d711..7b1d440 100644 --- a/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/utils/threads/AssociationToGroupThread.java +++ b/src/main/java/org/gcube/data_catalogue/grsf_publish_ws/utils/threads/AssociationToGroupThread.java @@ -69,17 +69,20 @@ public class AssociationToGroupThread extends Thread { role = RolesCkanGroupOrOrg.MEMBER; // decrease the role to member if it is not an admin for (String groupTitle : uniqueGroups) { + try{ + logger.debug("Setting role " + role + " into group " + groupTitle + " to user " + username); + boolean assigned = catalogue.checkRoleIntoGroup(username, groupTitle, role); - logger.debug("Setting role " + role + " into group " + groupTitle + " to user " + username); - boolean assigned = catalogue.checkRoleIntoGroup(username, groupTitle, role); - - if(!assigned){ - logger.warn("The user " + username + " has not enough privileges to associate the dataset into group OR the group " + groupTitle + " doesn't exist "); - continue; - } - else{ - boolean putIntoGroup = catalogue.assignDatasetToGroup(groupTitle, datasetId, apiKey); - logger.info("Was product put into group " + groupTitle + "? " + putIntoGroup); + if(!assigned){ + logger.warn("The user " + username + " has not enough privileges to associate the dataset into group OR the group " + groupTitle + " doesn't exist "); + continue; + } + else{ + boolean putIntoGroup = catalogue.assignDatasetToGroup(groupTitle, datasetId, apiKey); + logger.info("Was product put into group " + groupTitle + "? " + putIntoGroup); + } + }catch(Exception e){ + logger.error("Something failed while adding product to group " + groupTitle, e); } } logger.info("The Association Group thread ended correctly");