diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm
index 486da1890..829bc7968 100644
--- a/api-docs/apiLive.htm
+++ b/api-docs/apiLive.htm
@@ -299,6 +299,14 @@
Delete a Center |
+ |
+ centers/{centerId}?command=activate |
+ Activate a Center |
+ |
+ |
+ |
+
+
| Group |
groups |
Create a Group |
@@ -306,7 +314,7 @@
|
|
-
+
|
groups/{group} |
|
@@ -314,6 +322,14 @@
Update a Group |
Delete a Group |
+
+ |
+ groups/{groupId}?command=activate |
+ Activate a Group |
+ |
+ |
+ |
+
@@ -1901,7 +1917,7 @@ Request Body:
Activate a Client
-
Clients can be created in a Pending state if configuration is enabled. This API exists to enable client activation (for when a client becomes approved member of microfinance institue.
+
Clients can be created in a Pending state. This API exists to enable client activation (for when a client becomes approved member of microfinance institue).
If the client happens to be alrady active this API will result in an error.
@@ -2926,6 +2942,34 @@ Content-Type: application/json Request Body:
+
+
+
+
Activate a Center
+
Centers can be created in a Pending state. This API exists to enable center activation.
+
If the center happens to be already active this API will result in an error.
+
+
+ POST https://Domain Name/api/v1/centers/{centerId}?command=activate
+ POST centers/1?command=activate
+Content-Type: application/json
+Request Body:
+{
+ "locale": "en",
+ "dateFormat": "dd MMMM yyyy",
+ "activationDate": "01 March 2011"
+}
+
+
+{
+ "officeId": 1,
+ "groupId": 1,
+ "resourceId": 1
+}
+
+
+
+
@@ -3322,6 +3366,34 @@ Content-Type: application/json Request Body:
+
+
+
+
Activate a Group
+
Groups can be created in a Pending state. This API exists to enable group activation.
+
If the group happens to be already active this API will result in an error.
+
+
+ POST https://Domain Name/api/v1/groups/{groupId}?command=activate
+ POST groups/1?command=activate
+Content-Type: application/json
+Request Body:
+{
+ "locale": "en",
+ "dateFormat": "dd MMMM yyyy",
+ "activationDate": "01 March 2011"
+}
+
+
+{
+ "officeId": 1,
+ "groupId": 1,
+ "resourceId": 1
+}
+
+
+
+
@@ -13163,6 +13235,14 @@ GET https://DomainName/api/v1/search?query=000000111
Delete a Center |
+ |
+ centers/{centerId}?command=activate |
+ Activate a Center |
+ |
+ |
+ |
+
+
| Group |
groups |
Create a Group |
@@ -13170,7 +13250,7 @@ GET https://DomainName/api/v1/search?query=000000111
|
|
-
+
|
groups/{group} |
|
@@ -13178,6 +13258,14 @@ GET https://DomainName/api/v1/search?query=000000111
Update a Group |
Delete a Group |
+
+ |
+ groups/{groupId}?command=activate |
+ Activate a Group |
+ |
+ |
+ |
+
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/api/GLClosuresApiResource.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/api/GLClosuresApiResource.java
index b71d79e4b..68d8b7d48 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/api/GLClosuresApiResource.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/api/GLClosuresApiResource.java
@@ -5,7 +5,6 @@
*/
package org.mifosplatform.accounting.closure.api;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -34,7 +33,6 @@ import org.mifosplatform.infrastructure.core.data.CommandProcessingResult;
import org.mifosplatform.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
import org.mifosplatform.infrastructure.core.serialization.DefaultToApiJsonSerializer;
import org.mifosplatform.infrastructure.security.service.PlatformSecurityContext;
-import org.mifosplatform.organisation.office.data.OfficeLookup;
import org.mifosplatform.organisation.office.service.OfficeReadPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
@@ -95,7 +93,7 @@ public class GLClosuresApiResource {
final GLClosureData glClosureData = this.glClosureReadPlatformService.retrieveGLClosureById(glClosureId);
if (settings.isTemplate()) {
- glClosureData.setAllowedOffices(new ArrayList(this.officeReadPlatformService.retrieveAllOfficesForLookup()));
+ glClosureData.setAllowedOffices(this.officeReadPlatformService.retrieveAllOfficesForDropdown());
}
return this.apiJsonSerializerService.serialize(settings, glClosureData, RESPONSE_DATA_PARAMETERS);
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/data/GLClosureData.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/data/GLClosureData.java
index 400f56bdb..ee4bad1d7 100755
--- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/data/GLClosureData.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/closure/data/GLClosureData.java
@@ -6,10 +6,10 @@
package org.mifosplatform.accounting.closure.data;
import java.util.ArrayList;
-import java.util.List;
+import java.util.Collection;
import org.joda.time.LocalDate;
-import org.mifosplatform.organisation.office.data.OfficeLookup;
+import org.mifosplatform.organisation.office.data.OfficeData;
/**
* Immutable object representing a General Ledger Account
@@ -44,7 +44,7 @@ public class GLClosureData {
@SuppressWarnings("unused")
private final String comments;
- private List allowedOffices = new ArrayList();
+ private Collection allowedOffices = new ArrayList();
public GLClosureData(final Long id, final Long officeId, final String officeName, final LocalDate closingDate, final boolean deleted,
final LocalDate createdDate, final LocalDate lastUpdatedDate, final Long createdByUserId, final String createdByUsername,
@@ -64,11 +64,11 @@ public class GLClosureData {
this.allowedOffices = null;
}
- public List getAllowedOffices() {
+ public final Collection getAllowedOffices() {
return this.allowedOffices;
}
- public void setAllowedOffices(final List allowedOffices) {
+ public void setAllowedOffices(final Collection allowedOffices) {
this.allowedOffices = allowedOffices;
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/commands/data/CommandSourceData.java b/mifosng-provider/src/main/java/org/mifosplatform/commands/data/CommandSourceData.java
deleted file mode 100644
index 402a60cd2..000000000
--- a/mifosng-provider/src/main/java/org/mifosplatform/commands/data/CommandSourceData.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-package org.mifosplatform.commands.data;
-
-import org.joda.time.LocalDate;
-
-/**
- * Immutable data object representing maker-checker entry
- */
-@Deprecated
-final public class CommandSourceData {
-
- @SuppressWarnings("unused")
- private final Long id;
- @SuppressWarnings("unused")
- private final String actionName;
- @SuppressWarnings("unused")
- private final String entityName;
- @SuppressWarnings("unused")
- private final Long entityId;
- @SuppressWarnings("unused")
- private final String entityHref;
- private final String commandJson;
- @SuppressWarnings("unused")
- private final LocalDate madeOnDate;
-
- public CommandSourceData(final Long id, final String actionName, final String entityName, final Long entityId, final String entityHref,
- final String commandJson, final LocalDate madeOnDate) {
- this.id = id;
- this.actionName = actionName;
- this.entityName = entityName;
- this.entityId = entityId;
- this.entityHref = entityHref;
- this.commandJson = commandJson;
- this.madeOnDate = madeOnDate;
- }
-
- public String json() {
- return this.commandJson;
- }
-}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/GenericResultsetData.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/GenericResultsetData.java
index 034d60fe8..5b70bace9 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/GenericResultsetData.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/GenericResultsetData.java
@@ -7,7 +7,6 @@ package org.mifosplatform.infrastructure.dataqueries.data;
import java.util.List;
-
/**
* Immutable data object for generic resultset data.
*/
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportData.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportData.java
index 0b8ac8927..47b8d13e2 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportData.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportData.java
@@ -11,79 +11,76 @@ import java.util.List;
final public class ReportData {
- @SuppressWarnings("unused")
- private final Long id;
- @SuppressWarnings("unused")
- private final String reportName;
- @SuppressWarnings("unused")
- private final String reportType;
- @SuppressWarnings("unused")
- private final String reportSubType;
- @SuppressWarnings("unused")
- private final String reportCategory;
- @SuppressWarnings("unused")
- private final String description;
- @SuppressWarnings("unused")
- private final String reportSql;
- @SuppressWarnings("unused")
- private final Boolean coreReport;
- @SuppressWarnings("unused")
- private final Boolean useReport;
- @SuppressWarnings("unused")
- private final Collection reportParameters;
+ @SuppressWarnings("unused")
+ private final Long id;
+ @SuppressWarnings("unused")
+ private final String reportName;
+ @SuppressWarnings("unused")
+ private final String reportType;
+ @SuppressWarnings("unused")
+ private final String reportSubType;
+ @SuppressWarnings("unused")
+ private final String reportCategory;
+ @SuppressWarnings("unused")
+ private final String description;
+ @SuppressWarnings("unused")
+ private final String reportSql;
+ @SuppressWarnings("unused")
+ private final Boolean coreReport;
+ @SuppressWarnings("unused")
+ private final Boolean useReport;
+ @SuppressWarnings("unused")
+ private final Collection reportParameters;
- @SuppressWarnings("unused")
- private List allowedReportTypes;
- @SuppressWarnings("unused")
- private List allowedReportSubTypes;
+ @SuppressWarnings("unused")
+ private List allowedReportTypes;
+ @SuppressWarnings("unused")
+ private List allowedReportSubTypes;
- public ReportData(final Long id, final String reportName,
- final String reportType, final String reportSubType,
- final String reportCategory, final String description,
- final String reportSql, final Boolean coreReport,
- final Boolean useReport,
- final Collection reportParameters) {
- this.id = id;
- this.reportName = reportName;
- this.reportType = reportType;
- this.reportSubType = reportSubType;
- this.reportCategory = reportCategory;
- this.description = description;
- this.reportParameters = reportParameters;
- this.reportSql = reportSql;
- this.coreReport = coreReport;
- this.useReport = useReport;
- this.allowedReportTypes = null;
- this.allowedReportSubTypes = null;
- }
+ public ReportData(final Long id, final String reportName, final String reportType, final String reportSubType,
+ final String reportCategory, final String description, final String reportSql, final Boolean coreReport,
+ final Boolean useReport, final Collection reportParameters) {
+ this.id = id;
+ this.reportName = reportName;
+ this.reportType = reportType;
+ this.reportSubType = reportSubType;
+ this.reportCategory = reportCategory;
+ this.description = description;
+ this.reportParameters = reportParameters;
+ this.reportSql = reportSql;
+ this.coreReport = coreReport;
+ this.useReport = useReport;
+ this.allowedReportTypes = null;
+ this.allowedReportSubTypes = null;
+ }
- public ReportData() {
- this.id = null;
- this.reportName = null;
- this.reportType = null;
- this.reportSubType = null;
- this.reportCategory = null;
- this.description = null;
- this.reportParameters = null;
- this.reportSql = null;
- this.coreReport = null;
- this.useReport = null;
- this.allowedReportTypes = null;
- this.allowedReportSubTypes = null;
- }
+ public ReportData() {
+ this.id = null;
+ this.reportName = null;
+ this.reportType = null;
+ this.reportSubType = null;
+ this.reportCategory = null;
+ this.description = null;
+ this.reportParameters = null;
+ this.reportSql = null;
+ this.coreReport = null;
+ this.useReport = null;
+ this.allowedReportTypes = null;
+ this.allowedReportSubTypes = null;
+ }
- public void appendedTemplate() {
+ public void appendedTemplate() {
- List reportTypes = new ArrayList();
- reportTypes.add("Table");
- reportTypes.add("Pentaho");
- reportTypes.add("Chart");
- this.allowedReportTypes = reportTypes;
+ List reportTypes = new ArrayList();
+ reportTypes.add("Table");
+ reportTypes.add("Pentaho");
+ reportTypes.add("Chart");
+ this.allowedReportTypes = reportTypes;
- List reportSubTypes = new ArrayList();
- reportSubTypes.add("Bar");
- reportSubTypes.add("Pie");
- this.allowedReportSubTypes = reportSubTypes;
- }
+ List reportSubTypes = new ArrayList();
+ reportSubTypes.add("Bar");
+ reportSubTypes.add("Pie");
+ this.allowedReportSubTypes = reportSubTypes;
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterData.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterData.java
index 449ff5f3a..55676dcd5 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterData.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterData.java
@@ -7,18 +7,16 @@ package org.mifosplatform.infrastructure.dataqueries.data;
final public class ReportParameterData {
- @SuppressWarnings("unused")
- private final Long id;
- @SuppressWarnings("unused")
- private final String reportParameterName;
- @SuppressWarnings("unused")
- private final String parameterName;
-
- public ReportParameterData(final Long id,
- final String reportParameterName, final String parameterName) {
- this.id = id;
- this.reportParameterName = reportParameterName;
- this.parameterName = parameterName;
- }
+ @SuppressWarnings("unused")
+ private final Long id;
+ @SuppressWarnings("unused")
+ private final String reportParameterName;
+ @SuppressWarnings("unused")
+ private final String parameterName;
+ public ReportParameterData(final Long id, final String reportParameterName, final String parameterName) {
+ this.id = id;
+ this.reportParameterName = reportParameterName;
+ this.parameterName = parameterName;
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterJoinData.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterJoinData.java
index 3b3fb3937..7bc93e2f3 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterJoinData.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/data/ReportParameterJoinData.java
@@ -7,86 +7,82 @@ package org.mifosplatform.infrastructure.dataqueries.data;
final public class ReportParameterJoinData {
- private final Long reportId;
- private final String reportName;
- private final String reportType;
- private final String reportSubType;
- private final String reportCategory;
- private final String description;
- private final String reportSql;
- private final Boolean coreReport;
- private final Boolean useReport;
+ private final Long reportId;
+ private final String reportName;
+ private final String reportType;
+ private final String reportSubType;
+ private final String reportCategory;
+ private final String description;
+ private final String reportSql;
+ private final Boolean coreReport;
+ private final Boolean useReport;
- private final Long reportParameterId;
- private final String reportParameterName;
- private final String parameterName;
+ private final Long reportParameterId;
+ private final String reportParameterName;
+ private final String parameterName;
- public ReportParameterJoinData(final Long reportId,
- final String reportName, final String reportType,
- final String reportSubType, final String reportCategory, final String description,
- final String reportSql, final Boolean coreReport,
- final Boolean useReport, final Long reportParameterId,
- final String reportParameterName, final String parameterName) {
- this.reportId = reportId;
- this.reportName = reportName;
- this.reportType = reportType;
- this.reportSubType = reportSubType;
- this.reportCategory = reportCategory;
- this.description = description;
- this.reportSql = reportSql;
- this.coreReport = coreReport;
- this.useReport = useReport;
- this.reportParameterId = reportParameterId;
- this.reportParameterName = reportParameterName;
- this.parameterName = parameterName;
- }
+ public ReportParameterJoinData(final Long reportId, final String reportName, final String reportType, final String reportSubType,
+ final String reportCategory, final String description, final String reportSql, final Boolean coreReport,
+ final Boolean useReport, final Long reportParameterId, final String reportParameterName, final String parameterName) {
+ this.reportId = reportId;
+ this.reportName = reportName;
+ this.reportType = reportType;
+ this.reportSubType = reportSubType;
+ this.reportCategory = reportCategory;
+ this.description = description;
+ this.reportSql = reportSql;
+ this.coreReport = coreReport;
+ this.useReport = useReport;
+ this.reportParameterId = reportParameterId;
+ this.reportParameterName = reportParameterName;
+ this.parameterName = parameterName;
+ }
- public Long getReportId() {
- return reportId;
- }
+ public Long getReportId() {
+ return reportId;
+ }
- public String getReportName() {
- return reportName;
- }
+ public String getReportName() {
+ return reportName;
+ }
- public String getReportType() {
- return reportType;
- }
+ public String getReportType() {
+ return reportType;
+ }
- public String getReportSubType() {
- return reportSubType;
- }
+ public String getReportSubType() {
+ return reportSubType;
+ }
- public String getReportCategory() {
- return reportCategory;
- }
+ public String getReportCategory() {
+ return reportCategory;
+ }
- public String getReportSql() {
- return reportSql;
- }
+ public String getReportSql() {
+ return reportSql;
+ }
- public Boolean getCoreReport() {
- return coreReport;
- }
+ public Boolean getCoreReport() {
+ return coreReport;
+ }
- public Boolean getUseReport() {
- return useReport;
- }
+ public Boolean getUseReport() {
+ return useReport;
+ }
- public Long getReportParameterId() {
- return reportParameterId;
- }
+ public Long getReportParameterId() {
+ return reportParameterId;
+ }
- public String getReportParameterName() {
- return reportParameterName;
- }
+ public String getReportParameterName() {
+ return reportParameterName;
+ }
- public String getParameterName() {
- return parameterName;
- }
-
- public String getDescription() {
- return description;
- }
+ public String getParameterName() {
+ return parameterName;
+ }
+ public String getDescription() {
+ return description;
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/Report.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/Report.java
index 8804fed8c..e86c77d65 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/Report.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/Report.java
@@ -27,233 +27,180 @@ import org.springframework.data.jpa.domain.AbstractPersistable;
@Table(name = "stretchy_report", uniqueConstraints = { @UniqueConstraint(columnNames = { "report_name" }, name = "unq_report_name") })
public class Report extends AbstractPersistable {
- @Column(name = "report_name", nullable = false, unique = true)
- private String reportName;
+ @Column(name = "report_name", nullable = false, unique = true)
+ private String reportName;
- @Column(name = "report_type", nullable = false)
- private String reportType;
+ @Column(name = "report_type", nullable = false)
+ private String reportType;
- @Column(name = "report_subtype")
- private String reportSubType;
+ @Column(name = "report_subtype")
+ private String reportSubType;
- @Column(name = "report_category")
- private String reportCategory;
+ @Column(name = "report_category")
+ private String reportCategory;
- @Column(name = "description")
- private String description;
+ @Column(name = "description")
+ private String description;
- @Column(name = "core_report", nullable = false)
- private boolean coreReport;
+ @Column(name = "core_report", nullable = false)
+ private boolean coreReport;
- // only defines if report should appear in reference app UI List
- @Column(name = "use_report", nullable = false)
- private boolean useReport;
+ // only defines if report should appear in reference app UI List
+ @Column(name = "use_report", nullable = false)
+ private boolean useReport;
- @Column(name = "report_sql")
- private String reportSql;
+ @Column(name = "report_sql")
+ private String reportSql;
- /*
- * @ManyToMany
- *
- * @JoinTable(name = "stretchy_report_parameter", joinColumns =
- *
- * @JoinColumn(name = "reportn_id"), inverseJoinColumns = @JoinColumn(name =
- * "parameter_id")) private List charges;
- */
+ /*
+ * @ManyToMany
+ *
+ * @JoinTable(name = "stretchy_report_parameter", joinColumns =
+ *
+ * @JoinColumn(name = "reportn_id"), inverseJoinColumns = @JoinColumn(name =
+ * "parameter_id")) private List charges;
+ */
- public static Report fromJson(final JsonCommand command) {
+ public static Report fromJson(final JsonCommand command) {
- final String reportName = command
- .stringValueOfParameterNamed("reportName");
- final String reportType = command
- .stringValueOfParameterNamed("reportType");
- final String reportSubType = command
- .stringValueOfParameterNamed("reportSubType");
- final String reportCategory = command
- .stringValueOfParameterNamed("reportCategory");
- final String description = command
- .stringValueOfParameterNamed("description");
- final boolean useReport = command
- .booleanPrimitiveValueOfParameterNamed("useReport");
- final String reportSql = command
- .stringValueOfParameterNamed("reportSql");
+ final String reportName = command.stringValueOfParameterNamed("reportName");
+ final String reportType = command.stringValueOfParameterNamed("reportType");
+ final String reportSubType = command.stringValueOfParameterNamed("reportSubType");
+ final String reportCategory = command.stringValueOfParameterNamed("reportCategory");
+ final String description = command.stringValueOfParameterNamed("description");
+ final boolean useReport = command.booleanPrimitiveValueOfParameterNamed("useReport");
+ final String reportSql = command.stringValueOfParameterNamed("reportSql");
- return new Report(reportName, reportType, reportSubType,
- reportCategory, description, useReport, reportSql);
- }
+ return new Report(reportName, reportType, reportSubType, reportCategory, description, useReport, reportSql);
+ }
- protected Report() {
- //
- }
+ protected Report() {
+ //
+ }
- public Report(final String reportName, final String reportType,
- final String reportSubType, final String reportCategory,
- final String description, final boolean useReport,
- final String reportSql) {
- this.reportName = reportName;
- this.reportType = reportType;
- this.reportSubType = reportSubType;
- this.reportCategory = reportCategory;
- this.description = description;
- this.coreReport = false;
- this.useReport = useReport;
- this.reportSql = reportSql;
- validate();
- }
+ public Report(final String reportName, final String reportType, final String reportSubType, final String reportCategory,
+ final String description, final boolean useReport, final String reportSql) {
+ this.reportName = reportName;
+ this.reportType = reportType;
+ this.reportSubType = reportSubType;
+ this.reportCategory = reportCategory;
+ this.description = description;
+ this.coreReport = false;
+ this.useReport = useReport;
+ this.reportSql = reportSql;
+ validate();
+ }
- public Map update(final JsonCommand command) {
+ public Map update(final JsonCommand command) {
- final Map actualChanges = new LinkedHashMap(
- 8);
+ final Map actualChanges = new LinkedHashMap(8);
- String paramName = "reportName";
- if (command.isChangeInStringParameterNamed(paramName, this.reportName)) {
- final String newValue = command
- .stringValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.reportName = StringUtils.defaultIfEmpty(newValue, null);
- }
- paramName = "reportType";
- if (command.isChangeInStringParameterNamed(paramName, this.reportType)) {
- final String newValue = command
- .stringValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.reportType = StringUtils.defaultIfEmpty(newValue, null);
- }
- paramName = "reportSubType";
- if (command.isChangeInStringParameterNamed(paramName,
- this.reportSubType)) {
- final String newValue = command
- .stringValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.reportSubType = StringUtils.defaultIfEmpty(newValue, null);
- }
- paramName = "reportCategory";
- if (command.isChangeInStringParameterNamed(paramName,
- this.reportCategory)) {
- final String newValue = command
- .stringValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.reportCategory = StringUtils.defaultIfEmpty(newValue, null);
- }
- paramName = "description";
- if (command.isChangeInStringParameterNamed(paramName, this.description)) {
- final String newValue = command
- .stringValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.description = StringUtils.defaultIfEmpty(newValue, null);
- }
- paramName = "useReport";
- if (command.isChangeInBooleanParameterNamed(paramName, this.useReport)) {
- final boolean newValue = command
- .booleanPrimitiveValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.useReport = newValue;
- }
- paramName = "reportSql";
- if (command.isChangeInStringParameterNamed(paramName, this.reportSql)) {
- final String newValue = command
- .stringValueOfParameterNamed(paramName);
- actualChanges.put(paramName, newValue);
- this.reportSql = StringUtils.defaultIfEmpty(newValue, null);
- }
+ String paramName = "reportName";
+ if (command.isChangeInStringParameterNamed(paramName, this.reportName)) {
+ final String newValue = command.stringValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.reportName = StringUtils.defaultIfEmpty(newValue, null);
+ }
+ paramName = "reportType";
+ if (command.isChangeInStringParameterNamed(paramName, this.reportType)) {
+ final String newValue = command.stringValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.reportType = StringUtils.defaultIfEmpty(newValue, null);
+ }
+ paramName = "reportSubType";
+ if (command.isChangeInStringParameterNamed(paramName, this.reportSubType)) {
+ final String newValue = command.stringValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.reportSubType = StringUtils.defaultIfEmpty(newValue, null);
+ }
+ paramName = "reportCategory";
+ if (command.isChangeInStringParameterNamed(paramName, this.reportCategory)) {
+ final String newValue = command.stringValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.reportCategory = StringUtils.defaultIfEmpty(newValue, null);
+ }
+ paramName = "description";
+ if (command.isChangeInStringParameterNamed(paramName, this.description)) {
+ final String newValue = command.stringValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.description = StringUtils.defaultIfEmpty(newValue, null);
+ }
+ paramName = "useReport";
+ if (command.isChangeInBooleanParameterNamed(paramName, this.useReport)) {
+ final boolean newValue = command.booleanPrimitiveValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.useReport = newValue;
+ }
+ paramName = "reportSql";
+ if (command.isChangeInStringParameterNamed(paramName, this.reportSql)) {
+ final String newValue = command.stringValueOfParameterNamed(paramName);
+ actualChanges.put(paramName, newValue);
+ this.reportSql = StringUtils.defaultIfEmpty(newValue, null);
+ }
- validate();
+ validate();
- if (!actualChanges.isEmpty()) {
- if (isCoreReport()) {
- for (final String key : actualChanges.keySet()) {
- if (!(key.equals("useReport"))) {
- throw new PlatformDataIntegrityException(
- "error.msg.only.use.report.can.be.updated.for.core.report",
- "Only the Use Report field can be updated for Core Reports",
- key);
- }
- }
- }
- }
+ if (!actualChanges.isEmpty()) {
+ if (isCoreReport()) {
+ for (final String key : actualChanges.keySet()) {
+ if (!(key.equals("useReport"))) { throw new PlatformDataIntegrityException(
+ "error.msg.only.use.report.can.be.updated.for.core.report",
+ "Only the Use Report field can be updated for Core Reports", key); }
+ }
+ }
+ }
- return actualChanges;
- }
+ return actualChanges;
+ }
- public boolean isCoreReport() {
- return coreReport;
- }
+ public boolean isCoreReport() {
+ return coreReport;
+ }
- private void validate() {
+ private void validate() {
- final List dataValidationErrors = new ArrayList();
- final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(
- dataValidationErrors).resource("report");
+ final List dataValidationErrors = new ArrayList();
+ final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("report");
- baseDataValidator.reset().parameter("reportName")
- .value(this.reportName).notBlank().notExceedingLengthOf(100);
+ baseDataValidator.reset().parameter("reportName").value(this.reportName).notBlank().notExceedingLengthOf(100);
- baseDataValidator
- .reset()
- .parameter("reportType")
- .value(this.reportType)
- .notBlank()
- .isOneOfTheseValues(
- new Object[] { "Table", "Pentaho", "Chart" });
+ baseDataValidator.reset().parameter("reportType").value(this.reportType).notBlank()
+ .isOneOfTheseValues(new Object[] { "Table", "Pentaho", "Chart" });
- baseDataValidator.reset().parameter("reportSubType")
- .value(this.reportSubType).notExceedingLengthOf(20);
+ baseDataValidator.reset().parameter("reportSubType").value(this.reportSubType).notExceedingLengthOf(20);
- if (StringUtils.isNotBlank(this.reportType)) {
- if (this.reportType.equals("Chart")) {
- baseDataValidator
- .reset()
- .parameter("reportSubType")
- .value(this.reportSubType)
- .cantBeBlankWhenParameterProvidedIs("reportType",
- this.reportType)
- .isOneOfTheseValues(new Object[] { "Bar", "Pie" });
- } else {
- baseDataValidator
- .reset()
- .parameter("reportSubType")
- .value(this.reportSubType)
- .mustBeBlankWhenParameterProvidedIs("reportType",
- this.reportType);
- }
- }
+ if (StringUtils.isNotBlank(this.reportType)) {
+ if (this.reportType.equals("Chart")) {
+ baseDataValidator.reset().parameter("reportSubType").value(this.reportSubType)
+ .cantBeBlankWhenParameterProvidedIs("reportType", this.reportType)
+ .isOneOfTheseValues(new Object[] { "Bar", "Pie" });
+ } else {
+ baseDataValidator.reset().parameter("reportSubType").value(this.reportSubType)
+ .mustBeBlankWhenParameterProvidedIs("reportType", this.reportType);
+ }
+ }
- baseDataValidator.reset().parameter("reportCategory")
- .value(this.reportCategory).notExceedingLengthOf(45);
+ baseDataValidator.reset().parameter("reportCategory").value(this.reportCategory).notExceedingLengthOf(45);
- if (StringUtils.isNotBlank(this.reportType)) {
- if ((this.reportType.equals("Table"))
- || (this.reportType.equals("Chart"))) {
- baseDataValidator
- .reset()
- .parameter("reportSql")
- .value(this.reportSql)
- .cantBeBlankWhenParameterProvidedIs("reportType",
- this.reportType);
- } else {
- baseDataValidator
- .reset()
- .parameter("reportSql")
- .value(this.reportSql)
- .mustBeBlankWhenParameterProvidedIs("reportType",
- this.reportType);
- }
- }
- throwExceptionIfValidationWarningsExist(dataValidationErrors);
- }
+ if (StringUtils.isNotBlank(this.reportType)) {
+ if ((this.reportType.equals("Table")) || (this.reportType.equals("Chart"))) {
+ baseDataValidator.reset().parameter("reportSql").value(this.reportSql)
+ .cantBeBlankWhenParameterProvidedIs("reportType", this.reportType);
+ } else {
+ baseDataValidator.reset().parameter("reportSql").value(this.reportSql)
+ .mustBeBlankWhenParameterProvidedIs("reportType", this.reportType);
+ }
+ }
+ throwExceptionIfValidationWarningsExist(dataValidationErrors);
+ }
- private void throwExceptionIfValidationWarningsExist(
- final List dataValidationErrors) {
- if (!dataValidationErrors.isEmpty()) {
- throw new PlatformApiDataValidationException(
- "validation.msg.validation.errors.exist",
- "Validation errors exist.", dataValidationErrors);
- }
- }
+ private void throwExceptionIfValidationWarningsExist(final List dataValidationErrors) {
+ if (!dataValidationErrors.isEmpty()) { throw new PlatformApiDataValidationException("validation.msg.validation.errors.exist",
+ "Validation errors exist.", dataValidationErrors); }
+ }
- public String getReportName() {
- return reportName;
- }
+ public String getReportName() {
+ return reportName;
+ }
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/ReportRepository.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/ReportRepository.java
index 27607d13f..0a21d3f42 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/ReportRepository.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/domain/ReportRepository.java
@@ -9,5 +9,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
public interface ReportRepository extends JpaRepository, JpaSpecificationExecutor {
- // no added behaviour
+ // no added behaviour
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableNotFoundException.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableNotFoundException.java
index a82da4fb6..d33635e15 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableNotFoundException.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableNotFoundException.java
@@ -8,7 +8,7 @@ package org.mifosplatform.infrastructure.dataqueries.exception;
import org.mifosplatform.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
/**
- * A {@link RuntimeException} thrown when client resources are not found.
+ * A {@link RuntimeException} thrown when datatable resources are not found.
*/
public class DatatableNotFoundException extends AbstractPlatformResourceNotFoundException {
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableSystemErrorException.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableSystemErrorException.java
index 58e8964c5..503d2023e 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableSystemErrorException.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/DatatableSystemErrorException.java
@@ -12,5 +12,4 @@ public class DatatableSystemErrorException extends AbstractPlatformDomainRuleExc
public DatatableSystemErrorException(final String msg) {
super("error.msg.datatable.system.error", msg, msg);
}
-
-}
+}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/ReportNotFoundException.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/ReportNotFoundException.java
index f248e56ce..0a4780769 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/ReportNotFoundException.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/exception/ReportNotFoundException.java
@@ -15,7 +15,7 @@ public class ReportNotFoundException extends AbstractPlatformResourceNotFoundExc
public ReportNotFoundException(final String reportSql) {
super("error.msg.report.name.not.found", "Reporting meta-data entry not found.", "Input sql: " + reportSql);
}
-
+
public ReportNotFoundException(final Long id) {
super("error.msg.report.id.invalid", "Report with identifier " + id + " does not exist", id);
}
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateDatatableEntryCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateDatatableEntryCommandHandler.java
index 68cb68a30..deee0fec3 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateDatatableEntryCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateDatatableEntryCommandHandler.java
@@ -28,16 +28,17 @@ public class CreateDatatableEntryCommandHandler implements NewCommandSourceHandl
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
- CommandProcessingResult commandProcessingResult = this.writePlatformService.createNewDatatableEntry(command.entityName(), command.entityId(), command);
+ CommandProcessingResult commandProcessingResult = this.writePlatformService.createNewDatatableEntry(command.entityName(),
+ command.entityId(), command);
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(command.entityId()) //
- .withOfficeId(commandProcessingResult.getOfficeId()) //
- .withGroupId(commandProcessingResult.getGroupId()) //
- .withClientId(commandProcessingResult.getClientId()) //
- .withSavingsId(commandProcessingResult.getSavingsId()) //
- .withLoanId(commandProcessingResult.getLoanId()) //
+ .withOfficeId(commandProcessingResult.getOfficeId()) //
+ .withGroupId(commandProcessingResult.getGroupId()) //
+ .withClientId(commandProcessingResult.getClientId()) //
+ .withSavingsId(commandProcessingResult.getSavingsId()) //
+ .withLoanId(commandProcessingResult.getLoanId()) //
.build();
}
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateReportCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateReportCommandHandler.java
index 497ad616a..345062e56 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateReportCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/CreateReportCommandHandler.java
@@ -16,18 +16,17 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public class CreateReportCommandHandler implements NewCommandSourceHandler {
- private final ReportWritePlatformService writePlatformService;
+ private final ReportWritePlatformService writePlatformService;
- @Autowired
- public CreateReportCommandHandler(
- final ReportWritePlatformService writePlatformService) {
- this.writePlatformService = writePlatformService;
- }
+ @Autowired
+ public CreateReportCommandHandler(final ReportWritePlatformService writePlatformService) {
+ this.writePlatformService = writePlatformService;
+ }
- @Transactional
- @Override
- public CommandProcessingResult processCommand(final JsonCommand command) {
+ @Transactional
+ @Override
+ public CommandProcessingResult processCommand(final JsonCommand command) {
- return this.writePlatformService.createReport(command);
- }
+ return this.writePlatformService.createReport(command);
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToManyDatatableEntryCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToManyDatatableEntryCommandHandler.java
index 0356c642a..0a791f123 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToManyDatatableEntryCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToManyDatatableEntryCommandHandler.java
@@ -28,16 +28,17 @@ public class DeleteOneToManyDatatableEntryCommandHandler implements NewCommandSo
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
- CommandProcessingResult commandProcessingResult = this.writePlatformService.deleteDatatableEntry(command.entityName(), command.entityId(), command.subentityId());
+ CommandProcessingResult commandProcessingResult = this.writePlatformService.deleteDatatableEntry(command.entityName(),
+ command.entityId(), command.subentityId());
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(command.entityId()) //
- .withOfficeId(commandProcessingResult.getOfficeId()) //
- .withGroupId(commandProcessingResult.getGroupId()) //
- .withClientId(commandProcessingResult.getClientId()) //
- .withSavingsId(commandProcessingResult.getSavingsId()) //
- .withLoanId(commandProcessingResult.getLoanId()) //
+ .withOfficeId(commandProcessingResult.getOfficeId()) //
+ .withGroupId(commandProcessingResult.getGroupId()) //
+ .withClientId(commandProcessingResult.getClientId()) //
+ .withSavingsId(commandProcessingResult.getSavingsId()) //
+ .withLoanId(commandProcessingResult.getLoanId()) //
.build();
}
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToOneDatatableEntryCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToOneDatatableEntryCommandHandler.java
index 8f031c1b3..301e29bbb 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToOneDatatableEntryCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteOneToOneDatatableEntryCommandHandler.java
@@ -28,16 +28,17 @@ public class DeleteOneToOneDatatableEntryCommandHandler implements NewCommandSou
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
- CommandProcessingResult commandProcessingResult = this.writePlatformService.deleteDatatableEntries(command.entityName(), command.entityId());
+ CommandProcessingResult commandProcessingResult = this.writePlatformService.deleteDatatableEntries(command.entityName(),
+ command.entityId());
return new CommandProcessingResultBuilder() //
.withCommandId(command.commandId()) //
.withEntityId(command.entityId()) //
- .withOfficeId(commandProcessingResult.getOfficeId()) //
- .withGroupId(commandProcessingResult.getGroupId()) //
- .withClientId(commandProcessingResult.getClientId()) //
- .withSavingsId(commandProcessingResult.getSavingsId()) //
- .withLoanId(commandProcessingResult.getLoanId()) //
+ .withOfficeId(commandProcessingResult.getOfficeId()) //
+ .withGroupId(commandProcessingResult.getGroupId()) //
+ .withClientId(commandProcessingResult.getClientId()) //
+ .withSavingsId(commandProcessingResult.getSavingsId()) //
+ .withLoanId(commandProcessingResult.getLoanId()) //
.build();
}
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteReportCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteReportCommandHandler.java
index 497e42f07..c7b78b788 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteReportCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/DeleteReportCommandHandler.java
@@ -17,23 +17,22 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public class DeleteReportCommandHandler implements NewCommandSourceHandler {
- private final ReportWritePlatformService writePlatformService;
+ private final ReportWritePlatformService writePlatformService;
- @Autowired
- public DeleteReportCommandHandler(
- final ReportWritePlatformService writePlatformService) {
- this.writePlatformService = writePlatformService;
- }
+ @Autowired
+ public DeleteReportCommandHandler(final ReportWritePlatformService writePlatformService) {
+ this.writePlatformService = writePlatformService;
+ }
- @Transactional
- @Override
- public CommandProcessingResult processCommand(final JsonCommand command) {
+ @Transactional
+ @Override
+ public CommandProcessingResult processCommand(final JsonCommand command) {
- this.writePlatformService.deleteReport(command.entityId());
+ this.writePlatformService.deleteReport(command.entityId());
- return new CommandProcessingResultBuilder() //
- .withCommandId(command.commandId()) //
- .withEntityId(command.entityId()) //
- .build();
- }
+ return new CommandProcessingResultBuilder() //
+ .withCommandId(command.commandId()) //
+ .withEntityId(command.entityId()) //
+ .build();
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToManyDatatableEntryCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToManyDatatableEntryCommandHandler.java
index eb867109f..71bfef446 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToManyDatatableEntryCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToManyDatatableEntryCommandHandler.java
@@ -28,18 +28,18 @@ public class UpdateOneToManyDatatableEntryCommandHandler implements NewCommandSo
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
- final CommandProcessingResult commandProcessingResult = this.writePlatformService.updateDatatableEntryOneToMany(command.entityName(),
- command.entityId(), command.subentityId(), command);
+ final CommandProcessingResult commandProcessingResult = this.writePlatformService.updateDatatableEntryOneToMany(
+ command.entityName(), command.entityId(), command.subentityId(), command);
return new CommandProcessingResultBuilder() //
- .withCommandId(command.commandId()) //
- .withEntityId(command.entityId()) //
- .withOfficeId(commandProcessingResult.getOfficeId()) //
- .withGroupId(commandProcessingResult.getGroupId()) //
- .withClientId(commandProcessingResult.getClientId()) //
- .withSavingsId(commandProcessingResult.getSavingsId()) //
- .withLoanId(commandProcessingResult.getLoanId()) //
- .with(commandProcessingResult.getChanges()) //
- .build();
+ .withCommandId(command.commandId()) //
+ .withEntityId(command.entityId()) //
+ .withOfficeId(commandProcessingResult.getOfficeId()) //
+ .withGroupId(commandProcessingResult.getGroupId()) //
+ .withClientId(commandProcessingResult.getClientId()) //
+ .withSavingsId(commandProcessingResult.getSavingsId()) //
+ .withLoanId(commandProcessingResult.getLoanId()) //
+ .with(commandProcessingResult.getChanges()) //
+ .build();
}
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToOneDatatableEntryCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToOneDatatableEntryCommandHandler.java
index 5805864be..b8dc7f82f 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToOneDatatableEntryCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateOneToOneDatatableEntryCommandHandler.java
@@ -28,18 +28,18 @@ public class UpdateOneToOneDatatableEntryCommandHandler implements NewCommandSou
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
- final CommandProcessingResult commandProcessingResult = this.writePlatformService.updateDatatableEntryOneToOne(command.entityName(), command.entityId(),
- command);
+ final CommandProcessingResult commandProcessingResult = this.writePlatformService.updateDatatableEntryOneToOne(
+ command.entityName(), command.entityId(), command);
return new CommandProcessingResultBuilder() //
- .withCommandId(command.commandId()) //
- .withEntityId(command.entityId()) //
- .withOfficeId(commandProcessingResult.getOfficeId()) //
- .withGroupId(commandProcessingResult.getGroupId()) //
- .withClientId(commandProcessingResult.getClientId()) //
- .withSavingsId(commandProcessingResult.getSavingsId()) //
- .withLoanId(commandProcessingResult.getLoanId()) //
- .with(commandProcessingResult.getChanges()) //
- .build();
+ .withCommandId(command.commandId()) //
+ .withEntityId(command.entityId()) //
+ .withOfficeId(commandProcessingResult.getOfficeId()) //
+ .withGroupId(commandProcessingResult.getGroupId()) //
+ .withClientId(commandProcessingResult.getClientId()) //
+ .withSavingsId(commandProcessingResult.getSavingsId()) //
+ .withLoanId(commandProcessingResult.getLoanId()) //
+ .with(commandProcessingResult.getChanges()) //
+ .build();
}
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateReportCommandHandler.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateReportCommandHandler.java
index 66fc1d6fb..a42685f86 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateReportCommandHandler.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/handler/UpdateReportCommandHandler.java
@@ -16,19 +16,17 @@ import org.springframework.transaction.annotation.Transactional;
@Service
public class UpdateReportCommandHandler implements NewCommandSourceHandler {
- private final ReportWritePlatformService writePlatformService;
+ private final ReportWritePlatformService writePlatformService;
- @Autowired
- public UpdateReportCommandHandler(
- final ReportWritePlatformService writePlatformService) {
- this.writePlatformService = writePlatformService;
- }
+ @Autowired
+ public UpdateReportCommandHandler(final ReportWritePlatformService writePlatformService) {
+ this.writePlatformService = writePlatformService;
+ }
- @Transactional
- @Override
- public CommandProcessingResult processCommand(final JsonCommand command) {
+ @Transactional
+ @Override
+ public CommandProcessingResult processCommand(final JsonCommand command) {
- return this.writePlatformService.updateReport(command.entityId(),
- command);
- }
+ return this.writePlatformService.updateReport(command.entityId(), command);
+ }
}
\ No newline at end of file
diff --git a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/serialization/ReportCommandFromApiJsonDeserializer.java b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/serialization/ReportCommandFromApiJsonDeserializer.java
index 689df151c..f91efd770 100644
--- a/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/serialization/ReportCommandFromApiJsonDeserializer.java
+++ b/mifosng-provider/src/main/java/org/mifosplatform/infrastructure/dataqueries/serialization/ReportCommandFromApiJsonDeserializer.java
@@ -22,30 +22,24 @@ import com.google.gson.reflect.TypeToken;
@Component
public final class ReportCommandFromApiJsonDeserializer {
- /**
- * The parameters supported for this command.
- */
- private final Set supportedParameters = new HashSet(
- Arrays.asList("reportName", "reportType", "reportSubType",
- "reportCategory", "description", "reportSql", "useReport"));
+ /**
+ * The parameters supported for this command.
+ */
+ private final Set supportedParameters = new HashSet(Arrays.asList("reportName", "reportType", "reportSubType",
+ "reportCategory", "description", "reportSql", "useReport"));
- private final FromJsonHelper fromApiJsonHelper;
+ private final FromJsonHelper fromApiJsonHelper;
- @Autowired
- public ReportCommandFromApiJsonDeserializer(
- final FromJsonHelper fromApiJsonHelper) {
- this.fromApiJsonHelper = fromApiJsonHelper;
- }
+ @Autowired
+ public ReportCommandFromApiJsonDeserializer(final FromJsonHelper fromApiJsonHelper) {
+ this.fromApiJsonHelper = fromApiJsonHelper;
+ }
- public void validate(final String json) {
- if (StringUtils.isBlank(json)) {
- throw new InvalidJsonException();
- }
+ public void validate(final String json) {
+ if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
- final Type typeOfMap = new TypeToken