diff options
author | Paolo Mottadelli <paolo@apache.org> | 2009-07-21 10:23:05 +0000 |
---|---|---|
committer | Paolo Mottadelli <paolo@apache.org> | 2009-07-21 10:23:05 +0000 |
commit | 60836558ade474c541ed8087c5cbeb9501c613b2 (patch) | |
tree | e89d8d1692f106cdcb38382bef76bb7d4c499db9 /src/ooxml/java | |
parent | 8c3825be73d3b5aa20a7931ec3536c649e2c0d2f (diff) | |
download | poi-60836558ade474c541ed8087c5cbeb9501c613b2.tar.gz poi-60836558ade474c541ed8087c5cbeb9501c613b2.zip |
POIXMLproperties: created, creator, modified, lastprinted, identifier, revision + test
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@796239 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java')
-rw-r--r-- | src/ooxml/java/org/apache/poi/POIXMLProperties.java | 89 |
1 files changed, 81 insertions, 8 deletions
diff --git a/src/ooxml/java/org/apache/poi/POIXMLProperties.java b/src/ooxml/java/org/apache/poi/POIXMLProperties.java index ca2ca808b9..1ccf736744 100644 --- a/src/ooxml/java/org/apache/poi/POIXMLProperties.java +++ b/src/ooxml/java/org/apache/poi/POIXMLProperties.java @@ -18,16 +18,22 @@ package org.apache.poi; import java.io.IOException; import java.io.OutputStream; -import java.util.Map; +import java.util.Date; import java.util.HashMap; +import java.util.Map; -import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.apache.poi.openxml4j.opc.*; +import org.apache.poi.openxml4j.exceptions.OpenXML4JException; +import org.apache.poi.openxml4j.opc.OPCPackage; +import org.apache.poi.openxml4j.opc.PackagePart; +import org.apache.poi.openxml4j.opc.PackagePartName; +import org.apache.poi.openxml4j.opc.PackageRelationshipCollection; +import org.apache.poi.openxml4j.opc.PackagingURIHelper; +import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart; +import org.apache.poi.openxml4j.util.Nullable; import org.apache.xmlbeans.XmlException; import org.apache.xmlbeans.XmlOptions; -import org.openxmlformats.schemas.officeDocument.x2006.extendedProperties.PropertiesDocument; /** * Wrapper around the two different kinds of OOXML properties @@ -159,11 +165,32 @@ public class POIXMLProperties { this.part = part; } - public void setTitle(String title) { - part.setTitleProperty(title); + public String getCategory() { + return part.getCategoryProperty().getValue(); } - public String getTitle() { - return part.getTitleProperty().getValue(); + public void setCategory(String category) { + part.setCategoryProperty(category); + } + public String getContentStatus() { + return part.getContentStatusProperty().getValue(); + } + public void setContentStatus(String contentStatus) { + part.setContentStatusProperty(contentStatus); + } + public String getContentType() { + return part.getContentTypeProperty().getValue(); + } + public void setContentType(String contentType) { + part.setContentTypeProperty(contentType); + } + public Date getCreated() { + return part.getCreatedProperty().getValue(); + } + public void setCreated(Nullable<Date> date) { + part.setCreatedProperty(date); + } + public void setCreated(String date) { + part.setCreatedProperty(date); } public String getCreator() { return part.getCreatorProperty().getValue(); @@ -171,12 +198,58 @@ public class POIXMLProperties { public void setCreator(String creator) { part.setCreatorProperty(creator); } + public String getDescription() { + return part.getDescriptionProperty().getValue(); + } + public void setDescription(String description) { + part.setDescriptionProperty(description); + } + public String getIdentifier() { + return part.getIdentifierProperty().getValue(); + } + public void setIdentifier(String identifier) { + part.setIdentifierProperty(identifier); + } + public Date getLastPrinted() { + return part.getLastPrintedProperty().getValue(); + } + public void setLastPrinted(Nullable<Date> date) { + part.setLastPrintedProperty(date); + } + public void setLastPrinted(String date) { + part.setLastPrintedProperty(date); + } + public Date getModified() { + return part.getModifiedProperty().getValue(); + } + public void setModified(Nullable<Date> date) { + part.setModifiedProperty(date); + } + public void setModified(String date) { + part.setModifiedProperty(date); + } public String getSubject() { return part.getSubjectProperty().getValue(); } public void setSubjectProperty(String subject) { part.setSubjectProperty(subject); } + public void setTitle(String title) { + part.setTitleProperty(title); + } + public String getTitle() { + return part.getTitleProperty().getValue(); + } + public String getRevision() { + return part.getRevisionProperty().getValue(); + } + public void setRevision(String revision) { + try { + new Long(revision); + part.setRevisionProperty(revision); + } + catch (NumberFormatException e) {} + } public PackagePropertiesPart getUnderlyingProperties() { return part; |