DashboardProxyResultPojo getResult = new DashboardProxyResultPojo();
getResult._id = command;
for (SharePojo result: results) {
if (command.equals(result.getTitle())) {
getResult.found = true;
getResult._source = new DashboardPojo("guest", "guest");
getResult._source.title = command;
getResult._source.dashboard = result.getShare();
return new StringRepresentation(getResult.toApi(), MediaType.APPLICATION_JSON);
}
}
getResult.found = false;
return new StringRepresentation(getResult.toApi(), MediaType.APPLICATION_JSON);
}//TESTED (6)
else { // We're overwriting the existing share with a new JSON file...
DashboardProxyResultPojo putResult = new DashboardProxyResultPojo();
putResult._id = command;
// Extract dashboard from JSON:
DashboardPojo dash = DashboardPojo.fromApi(_postData, DashboardPojo.class);
SharePojo shareToUpdate = null;
for (SharePojo result: results) {
if (command.equals(result.getTitle())) {
shareToUpdate = result;