public static void getBackupSummary(String id, String bkpId) throws Exception { SalesforceOrg org = dbUtils.findOrganizationById(id); for (Backup bkp : dbUtils.backupsForOrg(org.getOrgId())) { if (bkpId.equalsIgnoreCase((bkp.getId()))) { JedisPool pool = null; Jedis jedis = null; try { pool = poolFactory.getPool(); jedis = pool.getResource(); response.setContentTypeIfNotSet("application/json"); ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setSerializationInclusion(Inclusion.NON_NULL); renderJSON( objectMapper.writeValueAsString( DifferenceUtils.summarizeDifferences( jedis.hget(bkp.getGitVersion(), "changes")))); } finally { if (pool != null && jedis != null) { pool.returnResource(jedis); } } break; } } renderJSON("{}"); }
public static void getBackup(String id) throws Exception { SalesforceOrg org = dbUtils.findOrganizationById(id); User usr = dbUtils.findUserById(org.getDotVersionOwner()); renderArgs.put("metadataElements", metadataElements); List<Backup> backups = dbUtils.backupsForOrg(org.getOrgId()); renderTemplate("Salesforce/backup.html", usr, org, backups, metadataElements); }