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;
break;
}
}//TESTED (4, 5)
if (null == shareToUpdate) { //create a new share...
putResult.found = false;
SharePojo addedShare = _driver.addShareJSON(command, "Added by infinit.e.records.server", "kibana-int-" + mode, dash.dashboard, responseObj);
if (null != addedShare) {
for (String commIdStr: communityIds) {
_driver.addShareToCommunity(addedShare.get_id().toString(), "Added by infinit.e.records.server", commIdStr, responseObj);
}
}
}//TESTED (4, 5)
else { // update an existing share
putResult.found = true;