use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class AuditApp method parseAuditApps.
public static ListResponse<AuditApp> parseAuditApps(JSONObject jsonObject) {
List<AuditApp> groups = 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");
groups.add(parseAuditApp(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<AuditApp> resp = new ListResponse<AuditApp>(paging, groups);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class Comment method parseComments.
public static ListResponse<Comment> parseComments(String nodeId, JSONObject jsonObject) {
List<Comment> comments = new ArrayList<Comment>();
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");
comments.add(Comment.parseComment(nodeId, entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
return new ListResponse<Comment>(paging, comments);
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class Activities method parseActivities.
public static ListResponse<Activity> parseActivities(JSONObject jsonObject) {
List<Activity> activities = new ArrayList<Activity>();
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");
activities.add(Activity.parseActivity(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
return new ListResponse<Activity>(paging, activities);
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class AuditEntry method parseAuditEntries.
public static ListResponse<AuditEntry> parseAuditEntries(JSONObject jsonObject) {
List<AuditEntry> entries = 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");
entries.add(parseAuditEntry(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<AuditEntry> resp = new ListResponse<AuditEntry>(paging, entries);
return resp;
}
use of org.alfresco.rest.api.tests.client.PublicApiClient.ListResponse in project alfresco-remote-api by Alfresco.
the class SiteImpl method parseSites.
public static ListResponse<Site> parseSites(JSONObject jsonObject) {
List<Site> sites = new ArrayList<Site>();
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");
sites.add(parseSite(entry));
}
ExpectedPaging paging = ExpectedPaging.parsePagination(jsonList);
ListResponse<Site> resp = new ListResponse<Site>(paging, sites);
return resp;
}
Aggregations