merge in 1.0.1 branch
This commit is contained in:
@@ -6,6 +6,7 @@ See VERSIONING (https://github.com/openMF/mifosx/blob/master/VERSIONING.md) for
|
|||||||
Releases
|
Releases
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
1. 08 May 2013 - 1.0.1.RELEASE
|
||||||
1. 07 May 2013 - 1.0.0.RELEASE
|
1. 07 May 2013 - 1.0.0.RELEASE
|
||||||
1. 30 April 2013 - 0.12.1.beta
|
1. 30 April 2013 - 0.12.1.beta
|
||||||
2. 30 April 2013 - 0.11.4.beta
|
2. 30 April 2013 - 0.11.4.beta
|
||||||
@@ -15,6 +16,11 @@ Releases
|
|||||||
1. 05 April 2013 - 0.11.1.beta
|
1. 05 April 2013 - 0.11.1.beta
|
||||||
1. 05 April 2013 - 0.11.0.beta
|
1. 05 April 2013 - 0.11.0.beta
|
||||||
|
|
||||||
|
1.0.1.RELEASE
|
||||||
|
=============
|
||||||
|
Bug Release
|
||||||
|
- MIFOSX-343 - When viewing Audit details, integer values (rather than string values) for officeId and clientId cause exception
|
||||||
|
|
||||||
1.0.0.RELEASE
|
1.0.0.RELEASE
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ The mifos-platform (project named 'Mifos X') has reached <b>public release versi
|
|||||||
|
|
||||||
That means there is a published and stable API. This API is documented in the api-docs under <b>Full API Matrix</b>.
|
That means there is a published and stable API. This API is documented in the api-docs under <b>Full API Matrix</b>.
|
||||||
|
|
||||||
Latest stable release: <a target="_blank" href="https://github.com/openMF/mifosx/tree/mifosplatform-1.0.0" title="mifosplatform-1.0.0">mifosplatform-1.0.0</a>
|
Latest stable release: <a target="_blank" href="https://github.com/openMF/mifosx/tree/mifosplatform-1.0.1" title="mifosplatform-1.0.1">mifosplatform-1.0.1</a>
|
||||||
|
|
||||||
License
|
License
|
||||||
=============
|
=============
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="page-wrapper">
|
<div id="page-wrapper">
|
||||||
<div id="flybar">
|
<div id="flybar">
|
||||||
<div id="nav-logo">1.0.0.RELEASE API</div>
|
<div id="nav-logo">1.0.1.RELEASE API</div>
|
||||||
<div class="flybar-nav">
|
<div class="flybar-nav">
|
||||||
<h2 class="flybar-button">Overview</h2>
|
<h2 class="flybar-button">Overview</h2>
|
||||||
<div class="flybar-menu-overview">
|
<div class="flybar-menu-overview">
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
releaseVersion=1.1.0.RELEASE
|
releaseVersion=1.1.0.RELEASE
|
||||||
|
|||||||
+29
-24
@@ -36,7 +36,9 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|||||||
import org.springframework.jdbc.core.RowMapper;
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.common.reflect.TypeToken;
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
||||||
@@ -182,51 +184,54 @@ public class AuditReadPlatformServiceImpl implements AuditReadPlatformService {
|
|||||||
@Override
|
@Override
|
||||||
public AuditData retrieveAuditEntry(final Long auditId) {
|
public AuditData retrieveAuditEntry(final Long auditId) {
|
||||||
|
|
||||||
AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = context.authenticatedUser();
|
||||||
String hierarchy = currentUser.getOffice().getHierarchy();
|
final String hierarchy = currentUser.getOffice().getHierarchy();
|
||||||
|
|
||||||
final AuditMapper rm = new AuditMapper();
|
final AuditMapper rm = new AuditMapper();
|
||||||
|
|
||||||
String sql = "select " + rm.schema(true, hierarchy);
|
final String sql = "select " + rm.schema(true, hierarchy) + " where aud.id = " + auditId;
|
||||||
sql += " where aud.id = " + auditId;
|
|
||||||
|
|
||||||
AuditData auditResult = this.jdbcTemplate.queryForObject(sql, rm, new Object[] {});
|
final AuditData auditResult = this.jdbcTemplate.queryForObject(sql, rm, new Object[] {});
|
||||||
|
|
||||||
|
return replaceIdsOnAuditData(auditResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AuditData replaceIdsOnAuditData(final AuditData auditResult) {
|
||||||
|
|
||||||
|
final String auditAsJson = auditResult.getCommandAsJson();
|
||||||
|
|
||||||
String auditAsJson = auditResult.getCommandAsJson();
|
|
||||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
|
|
||||||
final Map<String, Object> commandAsJsonMap = this.fromApiJsonHelper.extractObjectMap(typeOfMap, auditAsJson);
|
final Map<String, Object> commandAsJsonMap = this.fromApiJsonHelper.extractObjectMap(typeOfMap, auditAsJson);
|
||||||
|
final JsonElement auditJsonFragment = this.fromApiJsonHelper.parse(auditAsJson);
|
||||||
|
final JsonObject auditObject = auditJsonFragment.getAsJsonObject();
|
||||||
|
|
||||||
if (commandAsJsonMap.containsKey("officeId")) {
|
if (commandAsJsonMap.containsKey("officeId")) {
|
||||||
|
commandAsJsonMap.remove("officeId");
|
||||||
|
|
||||||
final Object officeIdObj = commandAsJsonMap.get("officeId");
|
final Long officeId = auditObject.get("officeId").getAsLong();
|
||||||
if (officeIdObj != null && StringUtils.isNotBlank(officeIdObj.toString())) {
|
if (officeId != null) {
|
||||||
final Long officeId = Long.valueOf(officeIdObj.toString());
|
|
||||||
|
|
||||||
OfficeData office = this.officeReadPlatformService.retrieveOffice(officeId);
|
OfficeData office = this.officeReadPlatformService.retrieveOffice(officeId);
|
||||||
|
|
||||||
commandAsJsonMap.remove("officeId");
|
|
||||||
commandAsJsonMap.put("officeName", office.name());
|
commandAsJsonMap.put("officeName", office.name());
|
||||||
|
} else {
|
||||||
auditAsJson = this.fromApiJsonHelper.toJson(commandAsJsonMap);
|
commandAsJsonMap.put("officeName", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commandAsJsonMap.containsKey("clientId")) {
|
if (commandAsJsonMap.containsKey("clientId")) {
|
||||||
|
commandAsJsonMap.remove("clientId");
|
||||||
|
|
||||||
final Object clientIdObj = commandAsJsonMap.get("clientId");
|
final Long clientId = auditObject.get("officeId").getAsLong();
|
||||||
if (clientIdObj != null && StringUtils.isNotBlank(clientIdObj.toString())) {
|
if (clientId != null) {
|
||||||
final Long clientId = Long.valueOf(clientIdObj.toString());
|
|
||||||
|
|
||||||
ClientData client = this.clientReadPlatformService.retrieveOne(clientId);
|
ClientData client = this.clientReadPlatformService.retrieveOne(clientId);
|
||||||
|
|
||||||
commandAsJsonMap.remove("clientId");
|
|
||||||
commandAsJsonMap.put("clientName", client.displayName());
|
commandAsJsonMap.put("clientName", client.displayName());
|
||||||
|
} else {
|
||||||
auditAsJson = this.fromApiJsonHelper.toJson(commandAsJsonMap);
|
commandAsJsonMap.put("clientName", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auditResult.setCommandAsJson(auditAsJson);
|
final String newAuditAsJson = this.fromApiJsonHelper.toJson(commandAsJsonMap);
|
||||||
|
auditResult.setCommandAsJson(newAuditAsJson);
|
||||||
|
|
||||||
return auditResult;
|
return auditResult;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user