use of org.alfresco.rest.api.tests.client.PublicApiClient.ExpectedPaging in project alfresco-remote-api by Alfresco.
the class GroupMember method parseGroupMembers.
public static ListResponse<GroupMember> parseGroupMembers(JSONObject jsonObject) {
List<GroupMember> groupMembers = new ArrayList<>();
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");
groupMembers.add(parseGroupMember(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<GroupMember> resp = new ListResponse<>(paging, groupMembers);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ExpectedPaging 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.ExpectedPaging 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.ExpectedPaging 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.ExpectedPaging 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;
}
Aggregations