fixed association thread
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@139936 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
7ea5014870
commit
031896c371
|
@ -68,6 +68,9 @@ public class AssociationToGroupAndNotifyThread extends Thread {
|
||||||
|
|
||||||
logger.info("Association thread started to put the dataset with id = "+ datasetId + " into group with title " + groupTitle + " for user " + username);
|
logger.info("Association thread started to put the dataset with id = "+ datasetId + " into group with title " + groupTitle + " for user " + username);
|
||||||
|
|
||||||
|
if(groupTitle != null){
|
||||||
|
try{
|
||||||
|
|
||||||
// create the group
|
// create the group
|
||||||
CkanGroup group = catalogue.createGroup(groupTitle, groupTitle, "");
|
CkanGroup group = catalogue.createGroup(groupTitle, groupTitle, "");
|
||||||
|
|
||||||
|
@ -99,8 +102,13 @@ public class AssociationToGroupAndNotifyThread extends Thread {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.warn("Something went wrong when tried to add the group " + groupTitle, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
logger.info("Other groups to which the product should be associate are " + groups);
|
logger.info("Other groups to which the product should be associate are " + groups);
|
||||||
|
|
||||||
|
if(groups != null)
|
||||||
for (GroupBean groupBean : groups) {
|
for (GroupBean groupBean : groups) {
|
||||||
boolean putIntoGroup = catalogue.assignDatasetToGroup(groupBean.getGroupTitle(), datasetId, catalogue.getApiKeyFromUsername(username));
|
boolean putIntoGroup = catalogue.assignDatasetToGroup(groupBean.getGroupTitle(), datasetId, catalogue.getApiKeyFromUsername(username));
|
||||||
logger.info("Was product put into group" + groupBean.getGroupTitle() + "? " + putIntoGroup);
|
logger.info("Was product put into group" + groupBean.getGroupTitle() + "? " + putIntoGroup);
|
||||||
|
|
Loading…
Reference in New Issue