minor bug fix on association group thread

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@152457 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-08-03 13:24:45 +00:00
parent ce1efcb700
commit af8d789d93
1 changed files with 5 additions and 1 deletions

View File

@ -115,11 +115,15 @@ public class AssociationToGroupAndNotifyThread extends Thread {
if(groupsForceCreation != null){
logger.info("Groups that must be created before association are " + groupsForceCreation);
for (OrganizationBean groupToForce : groupsForceCreation) {
try{
CkanGroup group = catalogue.createGroup(groupToForce.getName(), groupToForce.getTitle(), "");
if(group == null)
logger.warn("Unable to retrieve or create group with name " + group);
logger.error("Unable to retrieve or create group with name " + groupToForce);
else
groups.add(new OrganizationBean(group.getTitle(), group.getName(), false, groupToForce.isPropagateUp()));
}catch(Exception e){
logger.error("Failed to check if a group with this info " + groupToForce + " already exists or can be created");
}
}
}