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;
|
return userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Retrieve the list of organizations ids
|
public List<String> getOrganizationsIds(){
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private List<String> getOrganizationsIds(){
|
|
||||||
|
|
||||||
List<String> toReturn = new ArrayList<String>();
|
List<String> toReturn = new ArrayList<String>();
|
||||||
CkanClient client = new CkanClient(CKAN_CATALOGUE_URL);
|
CkanClient client = new CkanClient(CKAN_CATALOGUE_URL);
|
||||||
|
@ -312,6 +309,21 @@ public class CKanUtilsImpl implements CKanUtilsInterface{
|
||||||
|
|
||||||
return toReturn;
|
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
|
@Override
|
||||||
public String getCatalogueUrl() {
|
public String getCatalogueUrl() {
|
||||||
|
|
|
@ -63,6 +63,18 @@ public interface CKanUtilsInterface {
|
||||||
* @return the list of licenses' titles
|
* @return the list of licenses' titles
|
||||||
*/
|
*/
|
||||||
public List<String> getLicenseTitles();
|
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
|
* Finds the id associated to the chosen license
|
||||||
|
|
Loading…
Reference in New Issue