From odf-dev-return-822-apmail-incubator-odf-dev-archive=incubator.apache.org@incubator.apache.org Fri Apr 6 01:04:51 2012 Return-Path: X-Original-To: apmail-incubator-odf-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-odf-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F73399E1 for ; Fri, 6 Apr 2012 01:04:51 +0000 (UTC) Received: (qmail 18668 invoked by uid 500); 6 Apr 2012 01:04:51 -0000 Delivered-To: apmail-incubator-odf-dev-archive@incubator.apache.org Received: (qmail 18640 invoked by uid 500); 6 Apr 2012 01:04:51 -0000 Mailing-List: contact odf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: odf-dev@incubator.apache.org Delivered-To: mailing list odf-dev@incubator.apache.org Received: (qmail 18632 invoked by uid 99); 6 Apr 2012 01:04:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 01:04:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Apr 2012 01:04:46 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C872C35B075 for ; Fri, 6 Apr 2012 01:04:25 +0000 (UTC) Date: Fri, 6 Apr 2012 01:04:25 +0000 (UTC) From: "Svante Schubert (Closed) (JIRA)" To: odf-dev@incubator.apache.org Message-ID: <591934630.20983.1333674265822.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Closed] (ODFTOOLKIT-104) Create new spreadsheet, save it, load it, add a sheet, save it, then load it causes failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/ODFTOOLKIT-104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Svante Schubert closed ODFTOOLKIT-104. -------------------------------------- Resolution: Fixed Closing this issue, as there is neither a test case nor a stakeholder who can verify a problem or test a potential fix. > Create new spreadsheet, save it, load it, add a sheet, save it, then load it causes failure > ------------------------------------------------------------------------------------------- > > Key: ODFTOOLKIT-104 > URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-104 > Project: ODF Toolkit > Issue Type: Bug > Components: java > Affects Versions: 0.8.5 > Environment: Operating System: Linux > Platform: PC > Reporter: datanucleus > Priority: Critical > Fix For: 0.8.7 > > Attachments: bug173-closedocument.patch, odf_load.zip > > > Created an attachment (id=257) > Test app demonstrating the problem > Very basic test of creating a new spreadsheet, saving it, then loading it and adding a new sheet with 2 columns, then saving it, and when loaded again it gives > java.lang.IllegalArgumentException: Document contains incorrect ODF Mediatype 'null' > at org.odftoolkit.odfdom.doc.OdfDocument.loadDocument(OdfDocument.java:356) > at org.odftoolkit.odfdom.doc.OdfDocument.loadDocument(OdfDocument.java:344) > at org.datanucleus.test.Main.main(Main.java:51) > Such things never happened with 0.6.16. Sample app attached, and is as below. > This was reported previously via the forum/mailing list and issue 106 got raised, but that hasn't addressed this basic problem. > If there is some missing step in the provided app (that makes it work) then please let me know, but the documentation and examples for creating spreadsheets seem lacking. > OdfDocument doc = null; > String filename = "test.ods"; > File file = new File(filename); > System.out.println(">> file=" + file); > if (!file.exists()) > { > // ODF spreadsheet doesn't exist, so create > System.out.println(">> OdfDocument.newSpreadsheetDocument()"); > doc = OdfSpreadsheetDocument.newSpreadsheetDocument(); > System.out.println(">> OdfDocument.save(" + file + ")"); > doc.save(file); > } > // Load the document > System.out.println(">> OdfDocument.loadDocument(" + file + ")"); > doc = OdfDocument.loadDocument(file); > // Add the table and its columns > OdfTable table = OdfTable.newTable(doc); > String sheetName = "FirstSheet"; > table.setTableName(sheetName); > int numCols = 2; > for (int i=0;i { > OdfTableColumn col = table.appendColumn(); > } > // Save the document > System.out.println(">> OdfDocument.save(" + file + ")"); > doc.save(file); > // Load the document > System.out.println(">> OdfDocument.loadDocument(" + file + ")"); > doc = OdfDocument.loadDocument(file); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira