use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class Favourite method parseFavourites.
public static ListResponse<Favourite> parseFavourites(JSONObject jsonObject) throws ParseException {
List<Favourite> favourites = new ArrayList<Favourite>();
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");
favourites.add(Favourite.parseFavourite(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
return new ListResponse<Favourite>(paging, favourites);
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class SiteMembershipRequest method parseSiteMembershipRequests.
public static ListResponse<SiteMembershipRequest> parseSiteMembershipRequests(JSONObject jsonObject) throws ParseException {
List<SiteMembershipRequest> siteMembershipRequests = new ArrayList<SiteMembershipRequest>();
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");
siteMembershipRequests.add(SiteMembershipRequest.parseSiteMembershipRequest(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
return new ListResponse<>(paging, siteMembershipRequests);
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class NodeRating method parseNodeRatings.
public static ListResponse<NodeRating> parseNodeRatings(String nodeId, JSONObject jsonObject) {
List<NodeRating> nodeRatings = new ArrayList<NodeRating>();
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");
nodeRatings.add(NodeRating.parseNodeRating(nodeId, entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<NodeRating> resp = new ListResponse<NodeRating>(paging, nodeRatings);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class Preference method parsePreferences.
public static ListResponse<Preference> parsePreferences(JSONObject jsonObject) {
List<Preference> preferences = new ArrayList<Preference>();
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");
preferences.add(Preference.parsePreference(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<Preference> resp = new ListResponse<Preference>(paging, preferences);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class PersonNetwork method parseNetworkMembers.
public static ListResponse<PersonNetwork> parseNetworkMembers(JSONObject jsonObject) {
List<PersonNetwork> networkMembers = new ArrayList<PersonNetwork>();
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");
networkMembers.add(PersonNetwork.parseNetworkMember(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<PersonNetwork> resp = new ListResponse<PersonNetwork>(paging, networkMembers);
return resp;
}
Aggregations