You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2009/06/30 17:58:45 UTC

DO NOT REPLY [Bug 47460] New: XFFSWorkbook Core Properties initialization

https://issues.apache.org/bugzilla/show_bug.cgi?id=47460

           Summary: XFFSWorkbook Core Properties initialization
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Mac OS X 10.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: roberto.manicardi@gmail.com


I'm trying to create a new Spreadsheet document and set come Core properties
(such the author and the title) but I have some problems. 

To show what I'm doing I've created a simple TestCase:

package org.apache.poi.xssf.usermodel;
import org.apache.poi.POIXMLProperties;
import junit.framework.TestCase;

public class TestXSSFProperties extends TestCase {

    public void testCreateWorkbookAndSetCoreProperties() throws Exception{
        XSSFWorkbook workbook = new XSSFWorkbook();
        POIXMLProperties properties = workbook.getProperties();

        assertNotNull(properties);
    }
}



If I run the testcase (I'm using the trunk version of POI) I have the following
error:


java.lang.IllegalArgumentException: A document must always have core properties
defined!
    at org.apache.poi.POIXMLProperties.<init>(POIXMLProperties.java:47)
    at org.apache.poi.POIXMLDocument.getProperties(POIXMLDocument.java:162)
    at
org.apache.poi.xssf.usermodel.TestXSSFProperties.testCreateWorkbookAndSetCoreProperties(TestXSSFProperties.java:13)
    ....


I've tried to find a way to set  the Core properties object but I haven't found
any useful Java method. 

If I create a new Workbook by loading and existing xlsx file it all works fine
but If I create it from scratch the Core Propeties object is not create.

Is there a way to create the core properties or I have to patch the 
XSSFWorkbook constructor? In the second case, it's best to create the core
properties upon creation or to add a createProperties method?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


DO NOT REPLY [Bug 47460] XFFSWorkbook Core Properties initialization

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47460


Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Yegor Kozlov <ye...@dinom.ru>  2009-07-12 01:22:01 PST ---
Fixed in r793291 ( https://svn.apache.org/viewcvs.cgi?view=rev&rev=793291 )

Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org