diff options
author | Yegor Kozlov <yegor@apache.org> | 2009-10-04 10:00:52 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2009-10-04 10:00:52 +0000 |
commit | f35f76926cfb6cc2a32bc038d9f0d19fdd3926f5 (patch) | |
tree | 4ba54e9773e07d4f16aef55236f694ff44a06497 /src/examples | |
parent | 38deacac7d2ab320487850ba46f6578118e02aaf (diff) | |
download | poi-f35f76926cfb6cc2a32bc038d9f0d19fdd3926f5.tar.gz poi-f35f76926cfb6cc2a32bc038d9f0d19fdd3926f5.zip |
improved API for OOXML custom properties
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@821496 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/examples')
-rwxr-xr-x | src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkbookProperties.java | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkbookProperties.java b/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkbookProperties.java index 0e00c7d94b..3a8fd56d00 100755 --- a/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkbookProperties.java +++ b/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkbookProperties.java @@ -47,24 +47,15 @@ public class WorkbookProperties { ext.getUnderlyingProperties().setTemplate("XSSF"); /** - * Custom properties enable users to define custom metadata properties - * through a set of well-defined data types. For example, a custom - * OLE Editor property of type string can be defined as follows: - * - * <property fmtid="{D5CDD505-2E9C-101B-9397-08002B2CF9AE}" pid="2" name="Editor"> - * <vt:lpwstr>John Smith</vt:lpwstr> - * </property> + * Custom properties enable users to define custom metadata properties. */ POIXMLProperties.CustomProperties cust = props.getCustomProperties(); - org.openxmlformats.schemas.officeDocument.x2006.customProperties.CTProperty - property = cust.getUnderlyingProperties().addNewProperty(); + cust.addProperty("Author", "John Smith"); + cust.addProperty("Year", 2009); + cust.addProperty("Price", 45.50); + cust.addProperty("Available", true); - property.setFmtid("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}"); - property.setPid(2); - property.setName("Editor"); - property.setLpwstr("John Smith"); - FileOutputStream out = new FileOutputStream("workbook.xlsx"); workbook.write(out); out.close(); |