Added a method to retrieve all organizations' names
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/ckan-util-library@129155 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9ea6242cf0
commit
3a2ab0b8c1
|
@ -295,11 +295,8 @@ public class CKanUtilsImpl implements CKanUtilsInterface{
|
|||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the list of organizations ids
|
||||
* @return
|
||||
*/
|
||||
private List<String> getOrganizationsIds(){
|
||||
@Override
|
||||
public List<String> getOrganizationsIds(){
|
||||
|
||||
List<String> toReturn = new ArrayList<String>();
|
||||
CkanClient client = new CkanClient(CKAN_CATALOGUE_URL);
|
||||
|
@ -313,6 +310,21 @@ public class CKanUtilsImpl implements CKanUtilsInterface{
|
|||
return toReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getOrganizationsNames(){
|
||||
|
||||
List<String> toReturn = new ArrayList<String>();
|
||||
CkanClient client = new CkanClient(CKAN_CATALOGUE_URL);
|
||||
List<CkanOrganization> orgs = client.getOrganizationList();
|
||||
|
||||
for (CkanOrganization ckanOrganization : orgs) {
|
||||
logger.debug("Retrieved org " + ckanOrganization.getName());
|
||||
toReturn.add(ckanOrganization.getName());
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCatalogueUrl() {
|
||||
return CKAN_CATALOGUE_URL;
|
||||
|
|
|
@ -64,6 +64,18 @@ public interface CKanUtilsInterface {
|
|||
*/
|
||||
public List<String> getLicenseTitles();
|
||||
|
||||
/**
|
||||
* Retrieve the list of organizations ids
|
||||
* @return
|
||||
*/
|
||||
public List<String> getOrganizationsIds();
|
||||
|
||||
/**
|
||||
* Retrieve the list of organizations names
|
||||
* @return
|
||||
*/
|
||||
public List<String> getOrganizationsNames();
|
||||
|
||||
/**
|
||||
* Finds the id associated to the chosen license
|
||||
* @param chosenLicense
|
||||
|
|
Loading…
Reference in New Issue