You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "DhroovSankla (via GitHub)" <gi...@apache.org> on 2026/07/05 11:01:42 UTC

[PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

DhroovSankla opened a new pull request, #6090:
URL: https://github.com/apache/fineract/pull/6090

   **Description**
   This PR addresses technical debt within the fineract-mix module by replacing manual XML string concatenation and heavyweight DOM manipulation with a native, type-safe JAX-RS and JAXB serialization workflow.
   
   Previously, the module manually assembled XBRL reports into raw string text blocks, placing a heavy maintenance and memory overhead on the streaming pipeline. This refactoring introduces a structured domain DTO graph that allows the underlying JAX-RS framework to handle content negotiation, marshalling, and streaming natively.
   
   _Note_: During the review of the initial type-safety changes, a discussion was raised regarding the historical relevance and potential deprecation of the MIX XBRL standards. As noted by the maintainers, module removal is a project-wide decision requiring a Fineract DEV mailing list proposal. Because deprecation and code debt mitigation are independent concerns, this PR proceeds with cleaning up the existing codebase architecture as an immediate optimization.
   
   **Changes Left for Review**
   `fineract-mix/build.gradle`: Added `jakarta.xml.bind:jakarta.xml.bind-api` dependency to expose native JAXB annotation support to the sub-module.
   
   `MixReportXBRLDocument.java`: Created a brand-new, structured JAXB schema object model graph utilizing framework decorators (`@XmlRootElement`, `@XmlElement`, nested context/unit DTO definitions) to serve as a clean blueprint for report serialization.
   
   `MixReportXBRLBuilder.java`: Implemented `buildDocumentGraph()`, migrating the transformation logic from legacy string operations to clean, object-oriented graph hydration. Included standard W3C elements processing for dynamic context mappings.
   
   `MixReportApiResource.java`: Modernized the `retrieveXBRLReport` endpoint signature to return the type-safe `MixReportXBRLDocument` DTO instead of a raw string, delegating streaming and content serialization directly to the framework.
   
   **Context & Lifecycle Management**
   
   - **Jira Ticke**t: https://issues.apache.org/jira/browse/FINERACT-2670
   
   - **Code Style**: Validated and formatted locally using ./gradlew :fineract-mix:spotlessApply.
   
   - **Compilation Check:** Verified clean build execution via ./gradlew :fineract-mix:compileJava.
   
   **Checklist**
   
   -  My code follows the code style of this project (Spotless verification passed successfully).
   
   -  All new and existing tests pass locally.
   
   -  I have performed a self-review of my own code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "vidakovic (via GitHub)" <gi...@apache.org>.
vidakovic commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4958645331

   I know, I'm a bit repetitive here... but please have a look at https://github.com/apache/fineract/blob/45d8e24f82c9c42c46a6762b24e102ad2c723824/fineract-mix/src/main/java/org/apache/fineract/mix/service/MixReportXBRLResultServiceImpl.java#L30
   
   We are still referencing the Java script engine in this module (mix)! This horse is dead... how valuable are then the other changes we are discussing here (read: not so much I'd say). Before everything else that script engine reference needs to go, this has been deprecated since Java 11 and removed since Java 15. And beyond that I still want to question if we should keep a module about a standard that has long ago been abandoned (https://themix.org etc. etc.).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-5164923638

   > @adamsaghy @vidakovic ,
   > 
   > Thank you for coordinating the discussion on the DEV mailing list! Since the community consensus is to deprecate and remove the MIX XBRL capability from the upcoming release, I will leave this PR as is.
   > 
   > Glad to have helped bring this legacy module cleanup to light. I'm ready to move on to other open issues in the codebase!
   
   Would you mind to pick up the work to remove this functionality?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4969011537

   Hi @adamsaghy @vidakovic, thank you for the feedback! I have successfully squashed the PR history down to a single clean commit. As suggested, I have just initiated the discussion thread on the Fineract DEV mailing list regarding the potential deprecation and removal of the MIX sub-module. I will keep an eye on the community consensus there before making any further adjustments here.
   For right now, I am pausing the refactoring work here!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3524820245


##########
fineract-mix/src/main/java/org/apache/fineract/mix/data/MixReportXBRLDocument.java:
##########
@@ -0,0 +1,127 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.mix.data;
+
+import jakarta.xml.bind.annotation.XmlAnyElement;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.w3c.dom.Element;
+
+@Data
+@NoArgsConstructor
+@XmlRootElement(name = "xbrl")
+public class MixReportXBRLDocument implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    private List<Element> taxonomyElements = new ArrayList<>();
+    private List<XBRLContextDTO> contexts = new ArrayList<>();
+    private List<XBRLUnitDTO> units = new ArrayList<>();
+
+    @XmlElement(name = "schemaRef")
+    public SchemaRefDTO getSchemaRef() {
+        return new SchemaRefDTO();
+    }
+
+    @XmlAnyElement
+    public List<Element> getTaxonomyElements() {
+        return this.taxonomyElements;
+    }
+
+    @XmlElement(name = "context")
+    public List<XBRLContextDTO> getContexts() {
+        return this.contexts;
+    }
+
+    @XmlElement(name = "unit")
+    public List<XBRLUnitDTO> getUnits() {
+        return this.units;
+    }
+
+    @lombok.Getter
+    @lombok.Setter
+    public static class SchemaRefDTO {
+
+        private final String link = "http://www.themix.org/sites/default/files/Taxonomy2010/dct/dc-all_2010-08-31.xsd";

Review Comment:
   I cannot seem to approve of this. Need to know what license it uses. I cant seem to find it on net either. Introducing their party dependency is red flag for me



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4981667523

   Moving into draft, till community decides on its fate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla closed pull request #6090: FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization
URL: https://github.com/apache/fineract/pull/6090


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-5061158656

   Lets deprecate and we can remove it as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4935713212

   > @DhroovSankla Would you mind to write an integration or E2E test case which ensures the proper XML document is created before and after this PR (you might need to run manually the written test before and after the changes to ensure same outcome!)
   
   @adamsaghy Updated the PR history to resolve the upstream merge conflicts in `MixReportApiResource`. The integration test suite for the `Mix` module (XBRLIntegrationTest) is now passing natively using in-memory JAXB context verification without relying on missing schema mappings. Note that the Shard 7 `CobPartitioningTest` failure is an independent regression present on upstream develop due to a syntax error in the core loan query
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4954599517

   @adamsaghy Any update?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3569383947


##########
fineract-mix/src/main/java/org/apache/fineract/mix/service/MixReportXBRLBuilder.java:
##########
@@ -205,4 +206,76 @@ private Integer getNumberOfDecimalPlaces(final BigDecimal bigDecimal) {
         final int index = string.indexOf(".");
         return index < 0 ? 0 : string.length() - index - 1;
     }
+
+    public MixReportXBRLDocument buildDocumentGraph(final MixReportXBRLData xbrlData) {

Review Comment:
   Do we really need to build this manually?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-5070535770

   I just closed the PR by mistake, I revert it back.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3524871813


##########
fineract-mix/src/main/java/org/apache/fineract/mix/data/MixReportXBRLDocument.java:
##########
@@ -0,0 +1,127 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.mix.data;
+
+import jakarta.xml.bind.annotation.XmlAnyElement;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.w3c.dom.Element;
+
+@Data
+@NoArgsConstructor
+@XmlRootElement(name = "xbrl")
+public class MixReportXBRLDocument implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    private List<Element> taxonomyElements = new ArrayList<>();
+    private List<XBRLContextDTO> contexts = new ArrayList<>();
+    private List<XBRLUnitDTO> units = new ArrayList<>();
+
+    @XmlElement(name = "schemaRef")
+    public SchemaRefDTO getSchemaRef() {
+        return new SchemaRefDTO();
+    }
+
+    @XmlAnyElement
+    public List<Element> getTaxonomyElements() {
+        return this.taxonomyElements;
+    }
+
+    @XmlElement(name = "context")
+    public List<XBRLContextDTO> getContexts() {
+        return this.contexts;
+    }
+
+    @XmlElement(name = "unit")
+    public List<XBRLUnitDTO> getUnits() {
+        return this.units;
+    }
+
+    @lombok.Getter
+    @lombok.Setter
+    public static class SchemaRefDTO {
+
+        private final String link = "http://www.themix.org/sites/default/files/Taxonomy2010/dct/dc-all_2010-08-31.xsd";

Review Comment:
   Hi @Aman-Mittal,
   
   Thank you for your review and for keeping a close eye on legal compliance! 
   
   I want to clarify that this PR does **not** introduce any new third-party library or external software dependency here. 
   
   The `String link` value you highlighted is simply a static metadata URI string literal required verbatim by the XBRL standard schema specification layout. It is used purely as an identifier text for the XML document graph structure; no connection or runtime dependency tracking is made to `themix.org`. This exact URI token was pulled directly from the legacy manual string generation logic we are refactoring.
   
   The only actual build artifact dependency introduced in this modernization is `jakarta.xml.bind-api` in `build.gradle`, which is fully compliant under the standard Eclipse Foundation / Apache-approved open-source licensing guidelines.
   
   Please let me know if this clears up the concern or if you would like me to rename the variable wrapper to something like `NAMESPACE_URI` to prevent any visual confusion!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3528839742


##########
fineract-mix/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java:
##########
@@ -48,8 +51,18 @@ public String retrieveXBRLReport(@QueryParam("startDate") final Date startDate,
             @QueryParam("currency") final String currency) {
 
         final var data = xbrlResultService.getXBRLResult(startDate, endDate, currency);
+        final MixReportXBRLDocument document = this.xbrlBuilder.buildDocumentGraph(data);
 
-        // TODO: make this type safe?
-        return this.xbrlBuilder.build(data);
+        try {
+            final JAXBContext context = JAXBContext.newInstance(MixReportXBRLDocument.class);
+            final Marshaller marshaller = context.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+
+            final StringWriter writer = new StringWriter();
+            marshaller.marshal(document, writer);
+            return writer.toString();
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to serialize XBRL report document graph", e);
+        }

Review Comment:
   Done! I've updated the endpoint to return `MixReportXBRLDocument` directly and let the Jakarta framework layer manage the native XML serialization as suggested. I also simplified the DTO inner class definitions to clear the static analysis/SpotBugs checks. Thanks for the catch!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3527695714


##########
fineract-mix/src/main/java/org/apache/fineract/mix/api/MixReportApiResource.java:
##########
@@ -48,8 +51,18 @@ public String retrieveXBRLReport(@QueryParam("startDate") final Date startDate,
             @QueryParam("currency") final String currency) {
 
         final var data = xbrlResultService.getXBRLResult(startDate, endDate, currency);
+        final MixReportXBRLDocument document = this.xbrlBuilder.buildDocumentGraph(data);
 
-        // TODO: make this type safe?
-        return this.xbrlBuilder.build(data);
+        try {
+            final JAXBContext context = JAXBContext.newInstance(MixReportXBRLDocument.class);
+            final Marshaller marshaller = context.createMarshaller();
+            marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
+
+            final StringWriter writer = new StringWriter();
+            marshaller.marshal(document, writer);
+            return writer.toString();
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to serialize XBRL report document graph", e);
+        }

Review Comment:
   Cant we just return `MixReportXBRLDocument` and let the framework do the serialization?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4893583903

   @DhroovSankla Would you mind to write an integration or E2E test case which ensures the proper XML document is created before and after this PR (you might need to run manually the written test before and after the changes to ensure same outcome!)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4956327339

   @DhroovSankla Kindly review my concerns and please squash your commits ;) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-5070521236

   @adamsaghy  @vidakovic ,
   
   Thank you for coordinating the discussion on the DEV mailing list! Since the community consensus is to deprecate and remove the MIX XBRL capability from the upcoming release, I will leave this PR as is. 
   
   Glad to have helped bring this legacy module cleanup to light. I'm ready to move on to other open issues in the codebase!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4968633579

   > I know, I'm a bit repetitive here... but please have a look at
   > 
   > https://github.com/apache/fineract/blob/45d8e24f82c9c42c46a6762b24e102ad2c723824/fineract-mix/src/main/java/org/apache/fineract/mix/service/MixReportXBRLResultServiceImpl.java#L30
   > 
   > We are still referencing the Java script engine in this module (mix)! This horse is dead... how valuable are then the other changes we are discussing here (read: not so much I'd say). Before everything else that script engine reference needs to go, this has been deprecated since Java 11 and removed since Java 15. And beyond that I still want to question if we should keep a module about a standard that has long ago been abandoned (https://themix.org etc. etc.).
   
   @DhroovSankla Would you mind to open a discussion on Fineract DEV mail list about this? @vidakovic has a valid point, maybe we should handle this entirely differently.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4885779083

   @adamsaghy Looking forward your review!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3524967038


##########
fineract-mix/src/main/java/org/apache/fineract/mix/data/MixReportXBRLDocument.java:
##########
@@ -0,0 +1,127 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.mix.data;
+
+import jakarta.xml.bind.annotation.XmlAnyElement;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.w3c.dom.Element;
+
+@Data
+@NoArgsConstructor
+@XmlRootElement(name = "xbrl")
+public class MixReportXBRLDocument implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    private List<Element> taxonomyElements = new ArrayList<>();
+    private List<XBRLContextDTO> contexts = new ArrayList<>();
+    private List<XBRLUnitDTO> units = new ArrayList<>();
+
+    @XmlElement(name = "schemaRef")
+    public SchemaRefDTO getSchemaRef() {
+        return new SchemaRefDTO();
+    }
+
+    @XmlAnyElement
+    public List<Element> getTaxonomyElements() {
+        return this.taxonomyElements;
+    }
+
+    @XmlElement(name = "context")
+    public List<XBRLContextDTO> getContexts() {
+        return this.contexts;
+    }
+
+    @XmlElement(name = "unit")
+    public List<XBRLUnitDTO> getUnits() {
+        return this.units;
+    }
+
+    @lombok.Getter
+    @lombok.Setter
+    public static class SchemaRefDTO {
+
+        private final String link = "http://www.themix.org/sites/default/files/Taxonomy2010/dct/dc-all_2010-08-31.xsd";

Review Comment:
   Also handle failing checks



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4893237520

   Hi @adamsaghy, 
   
   The codebase pipeline metrics are looking great—84/85 checks are completely green, and all quality gates (Spotless & SpotBugs) are fully satisfied. 
   
   The single remaining failing check is `api-compatibility-check`. This is purely an automated flag triggered by updating the `retrieveXBRLReport` endpoint method signature from returning a raw `String` to our structured data graph model (`MixReportXBRLDocument`), as we discussed. 
   
   Since this modernization lets the native JAX-RS/JAXB framework handle the content negotiation and serialization natively without breaking the end payload format, this is an intentional contract update. Please let me know if we are good to bypass or override this check to get this merged!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy closed pull request #6090: FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization
URL: https://github.com/apache/fineract/pull/6090


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3524966421


##########
fineract-mix/src/main/java/org/apache/fineract/mix/data/MixReportXBRLDocument.java:
##########
@@ -0,0 +1,127 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.fineract.mix.data;
+
+import jakarta.xml.bind.annotation.XmlAnyElement;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.w3c.dom.Element;
+
+@Data
+@NoArgsConstructor
+@XmlRootElement(name = "xbrl")
+public class MixReportXBRLDocument implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 1L;
+
+    private List<Element> taxonomyElements = new ArrayList<>();
+    private List<XBRLContextDTO> contexts = new ArrayList<>();
+    private List<XBRLUnitDTO> units = new ArrayList<>();
+
+    @XmlElement(name = "schemaRef")
+    public SchemaRefDTO getSchemaRef() {
+        return new SchemaRefDTO();
+    }
+
+    @XmlAnyElement
+    public List<Element> getTaxonomyElements() {
+        return this.taxonomyElements;
+    }
+
+    @XmlElement(name = "context")
+    public List<XBRLContextDTO> getContexts() {
+        return this.contexts;
+    }
+
+    @XmlElement(name = "unit")
+    public List<XBRLUnitDTO> getUnits() {
+        return this.units;
+    }
+
+    @lombok.Getter
+    @lombok.Setter
+    public static class SchemaRefDTO {
+
+        private final String link = "http://www.themix.org/sites/default/files/Taxonomy2010/dct/dc-all_2010-08-31.xsd";

Review Comment:
   Please do that. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4885942492

   Pls refer to https://www.apache.org/legal/resolved.html for more info


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on code in PR #6090:
URL: https://github.com/apache/fineract/pull/6090#discussion_r3569379863


##########
integration-tests/src/test/java/org/apache/fineract/integrationtests/XBRLIntegrationTest.java:
##########
@@ -64,4 +64,28 @@ private void verifyTaxonomyList(final ArrayList<HashMap> taxonomyList) {
         assertEquals("AdministrativeExpense", taxonomyList.get(0).get("name"), "Checking for the 1st taxonomy");
     }
 
+    @Test
+    public void shouldSerializeMixXBRLReportToXMLNatively() throws Exception {

Review Comment:
   This looks to me a dummy test case... it does not test anything useful in my understanding... 
   
   Would you mind to write an integration test which calls the relevant API and checks whether the returned XML matches with the one that was created before and after this PR?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "adamsaghy (via GitHub)" <gi...@apache.org>.
adamsaghy commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-4891082538

   ```
   * What went wrong:
   Execution failed for task ':fineract-mix:spotbugsMain'.
   > A failure occurred while executing com.github.spotbugs.snom.internal.SpotBugsRunnerForHybrid$SpotBugsExecutor
      > Verification failed: SpotBugs ended with exit code 1. See the report at: file:///home/runner/work/fineract/fineract/fineract-mix/build/reports/spotbugs/main.html
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] FINERACT-2670: Refactor MixReport module to use native JAX-RS serialization [fineract]

Posted by "DhroovSankla (via GitHub)" <gi...@apache.org>.
DhroovSankla commented on PR #6090:
URL: https://github.com/apache/fineract/pull/6090#issuecomment-5165045382

   @adamsaghy 
   
   I'd be happy to take this on! I will create a dedicated PR to cleanly remove the MIX XBRL functionality and its associated dependencies.
   
   Since I am currently traveling back to campus, I will kick this off and open the PR by Wednesday. 
   
   In the meantime, please let me know if there are any specific scope boundaries or legacy configuration files I should pay special attention to during the cleanup.
   
   Thanks for the trust and guidance!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org