use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class Person method parsePeople.
public static ListResponse<Person> parsePeople(JSONObject jsonObject) {
List<Person> people = new ArrayList<Person>();
JSONObject jsonList = (JSONObject) jsonObject.get("list");
assertNotNull(jsonList);
JSONArray jsonEntries = (JSONArray) jsonList.get("entries");
assertNotNull(jsonEntries);
for (int i = 0; i < jsonEntries.size(); i++) {
JSONObject jsonEntry = (JSONObject) jsonEntries.get(i);
JSONObject entry = (JSONObject) jsonEntry.get("entry");
people.add(parsePerson(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<Person> resp = new ListResponse<Person>(paging, people);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class SiteContainer method parseSiteContainers.
public static ListResponse<SiteContainer> parseSiteContainers(JSONObject jsonObject) {
List<SiteContainer> siteContainers = new ArrayList<SiteContainer>();
JSONObject jsonList = (JSONObject) jsonObject.get("list");
assertNotNull(jsonList);
JSONArray jsonEntries = (JSONArray) jsonList.get("entries");
assertNotNull(jsonEntries);
for (int i = 0; i < jsonEntries.size(); i++) {
JSONObject jsonEntry = (JSONObject) jsonEntries.get(i);
JSONObject entry = (JSONObject) jsonEntry.get("entry");
siteContainers.add(SiteContainer.parseSiteContainer(null, entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<SiteContainer> resp = new ListResponse<SiteContainer>(paging, siteContainers);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class SiteMember method parseSiteMembers.
public static ListResponse<SiteMember> parseSiteMembers(String siteId, JSONObject jsonObject) {
List<SiteMember> siteMembers = new ArrayList<SiteMember>();
JSONObject jsonList = (JSONObject) jsonObject.get("list");
assertNotNull(jsonList);
JSONArray jsonEntries = (JSONArray) jsonList.get("entries");
assertNotNull(jsonEntries);
for (int i = 0; i < jsonEntries.size(); i++) {
JSONObject jsonEntry = (JSONObject) jsonEntries.get(i);
JSONObject entry = (JSONObject) jsonEntry.get("entry");
siteMembers.add(parseSiteMember(siteId, entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<SiteMember> resp = new ListResponse<SiteMember>(paging, siteMembers);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class Tag method parseTags.
public static ListResponse<Tag> parseTags(String nodeId, JSONObject jsonObject) {
List<Tag> tags = new ArrayList<Tag>();
JSONObject jsonList = (JSONObject) jsonObject.get("list");
assertNotNull(jsonList);
JSONArray jsonEntries = (JSONArray) jsonList.get("entries");
assertNotNull(jsonEntries);
for (int i = 0; i < jsonEntries.size(); i++) {
JSONObject jsonEntry = (JSONObject) jsonEntries.get(i);
JSONObject entry = (JSONObject) jsonEntry.get("entry");
tags.add(parseTag(nodeId, entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<Tag> resp = new ListResponse<Tag>(paging, tags);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class FavouriteSite method parseFavouriteSites.
public static ListResponse<FavouriteSite> parseFavouriteSites(JSONObject jsonObject) {
JSONObject jsonList = (JSONObject) jsonObject.get("list");
List<FavouriteSite> favouriteSites = new ArrayList<FavouriteSite>(jsonList.size());
if (jsonList != null) {
JSONArray jsonEntries = (JSONArray) jsonList.get("entries");
if (jsonEntries != null) {
for (int i = 0; i < jsonEntries.size(); i++) {
JSONObject jsonEntry = (JSONObject) jsonEntries.get(i);
JSONObject entry = (JSONObject) jsonEntry.get("entry");
favouriteSites.add(parseFavouriteSite(entry));
}
}
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
return new ListResponse<FavouriteSite>(paging, favouriteSites);
}
Aggregations