minor fixes
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@134288 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
529d580629
commit
0212aa0bcd
|
@ -172,9 +172,9 @@ public class DataCatalogueImpl implements DataCatalogue{
|
|||
return bean.apiKey;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
logger.debug("Api key was not in cache or it expired");
|
||||
|
||||
|
||||
// the connection
|
||||
Connection connection = null;
|
||||
String apiToReturn = null;
|
||||
|
@ -1433,27 +1433,28 @@ public class DataCatalogueImpl implements DataCatalogue{
|
|||
// checks
|
||||
checkNotNull(groupName);
|
||||
checkArgument(!groupName.isEmpty());
|
||||
|
||||
Map<RolesCkanGroupOrOrg, List<String>> capacityAndUsers = null;
|
||||
String groupNameToCheck = UtilMethods.fromGroupTitleToName(groupName);
|
||||
|
||||
Map<RolesCkanGroupOrOrg, List<String>> capacityAndUsers = new HashMap<RolesCkanGroupOrOrg, List<String>>();
|
||||
CkanGroup org = client.getGroup(groupNameToCheck);
|
||||
List<CkanUser> users = org.getUsers();
|
||||
for (CkanUser ckanUser : users) {
|
||||
CkanGroup group = client.getGroup(groupNameToCheck);
|
||||
|
||||
if(group != null){
|
||||
capacityAndUsers = new HashMap<RolesCkanGroupOrOrg, List<String>>();
|
||||
List<CkanUser> users = group.getUsers();
|
||||
for (CkanUser ckanUser : users) {
|
||||
List<String> listUsers;
|
||||
if(capacityAndUsers.containsKey(ckanUser.getCapacity())){
|
||||
listUsers = capacityAndUsers.get(ckanUser.getCapacity());
|
||||
}else
|
||||
listUsers = new ArrayList<String>();
|
||||
|
||||
logger.debug(ckanUser.getName());
|
||||
|
||||
List<String> listUsers;
|
||||
if(capacityAndUsers.containsKey(ckanUser.getCapacity())){
|
||||
listUsers = capacityAndUsers.get(ckanUser.getCapacity());
|
||||
}else
|
||||
listUsers = new ArrayList<String>();
|
||||
|
||||
listUsers.add(ckanUser.getName());
|
||||
capacityAndUsers.put(RolesCkanGroupOrOrg.valueOf(ckanUser.getCapacity().toUpperCase()), listUsers);
|
||||
listUsers.add(ckanUser.getName());
|
||||
capacityAndUsers.put(RolesCkanGroupOrOrg.valueOf(ckanUser.getCapacity().toUpperCase()), listUsers);
|
||||
|
||||
}
|
||||
|
||||
logger.info("Returning " + capacityAndUsers);
|
||||
}
|
||||
|
||||
return capacityAndUsers;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue