Uploaded image for project: 'Pentaho BA Platform'
  1. Pentaho BA Platform
  2. BISERVER-2758

JPivot: Save analysis generates invalid files if xml document != OS encoding. Fix provided

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0.GA
    • Component/s: None
    • Labels:
      None
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      This is the true cause of http://jira.pentaho.com/browse/BISERVER-2510 .

      This is the wrong snippet in AnalysisSaver.java :

      result = solutionRepository.addSolutionFile(baseUrl, path, fileName, document.asXML().getBytes(), overwrite);

      You can't assume the document is in the default encoding. This is the patch to fix it.

      Index: server/pentaho/src/org/pentaho/plugin/olap/AnalysisSaver.java
      ===================================================================
      — server/pentaho/src/org/pentaho/plugin/olap/AnalysisSaver.java (revision 34651)
      +++ server/pentaho/src/org/pentaho/plugin/olap/AnalysisSaver.java (working copy)
      @@ -81,7 +81,7 @@
      document = updateDocument(document, props);
      System.out.println(document.asXML());
      fileName = fileName.endsWith(SUFFIX) ? fileName : fileName + SUFFIX;

      • result = solutionRepository.addSolutionFile(baseUrl, path, fileName, document.asXML().getBytes(), overwrite);
        + result = solutionRepository.addSolutionFile(baseUrl, path, fileName, document.asXML().getBytes(document.getXMLEncoding()), overwrite);

      // Now save the resource files
      ActionInfo actionInfo = PentahoSystem.parseActionString(originalActionReference);

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              pmalves Pedro Alves
              Votes:
              5 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: