poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r755699 [5/7] - in /poi/trunk/src: examples/src/org/apache/poi/xssf/eventusermodel/examples/ ooxml/java/org/apache/poi/ ooxml/java/org/apache/poi/dev/ ooxml/java/org/apache/poi/extractor/ ooxml/java/org/apache/poi/openxml4j/opc/ ooxml/java/...
Date Wed, 18 Mar 2009 18:54:02 GMT
Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/PackagePropertiesPart.java Wed Mar 18 18:54:01 2009
@@ -1,621 +1,621 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-
-package org.apache.poi.openxml4j.opc.internal;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.text.ParsePosition;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.ContentTypes;
-import org.apache.poi.openxml4j.opc.Package;
-import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.openxml4j.opc.PackagePartName;
-import org.apache.poi.openxml4j.opc.PackageProperties;
-import org.apache.poi.openxml4j.util.Nullable;
-
-/**
- * Represents the core properties part of a package.
- * 
- * @author Julien Chable
- * @version 1.0
- */
-public class PackagePropertiesPart extends PackagePart implements
-		PackageProperties {
-
-	public final static String NAMESPACE_DC_URI = "http://purl.org/dc/elements/1.1/";
-
-	public final static String NAMESPACE_CP_URI = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
-
-	public final static String NAMESPACE_DCTERMS_URI = "http://purl.org/dc/terms/";
-
-	public final static String NAMESPACE_XSI_URI = "http://www.w3.org/2001/XMLSchema-instance";
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param pack
-	 *            Container package.
-	 * @param partName
-	 *            Name of this part.
-	 * @throws InvalidFormatException
-	 *             Throws if the content is invalid.
-	 */
-	public PackagePropertiesPart(Package pack, PackagePartName partName)
-			throws InvalidFormatException {
-		super(pack, partName, ContentTypes.CORE_PROPERTIES_PART);
-	}
-
-	/**
-	 * A categorization of the content of this package.
-	 * 
-	 * [Example: Example values for this property might include: Resume, Letter,
-	 * Financial Forecast, Proposal, Technical Presentation, and so on. This
-	 * value might be used by an application's user interface to facilitate
-	 * navigation of a large set of documents. end example]
-	 */
-	protected Nullable<String> category = new Nullable<String>();
-
-	/**
-	 * The status of the content.
-	 * 
-	 * [Example: Values might include "Draft", "Reviewed", and "Final". end
-	 * example]
-	 */
-	protected Nullable<String> contentStatus = new Nullable<String>();
-
-	/**
-	 * The type of content represented, generally defined by a specific use and
-	 * intended audience.
-	 * 
-	 * [Example: Values might include "Whitepaper", "Security Bulletin", and
-	 * "Exam". end example] [Note: This property is distinct from MIME content
-	 * types as defined in RFC 2616. end note]
-	 */
-	protected Nullable<String> contentType = new Nullable<String>();
-
-	/**
-	 * Date of creation of the resource.
-	 */
-	protected Nullable<Date> created = new Nullable<Date>();
-
-	/**
-	 * An entity primarily responsible for making the content of the resource.
-	 */
-	protected Nullable<String> creator = new Nullable<String>();
-
-	/**
-	 * An explanation of the content of the resource.
-	 * 
-	 * [Example: Values might include an abstract, table of contents, reference
-	 * to a graphical representation of content, and a free-text account of the
-	 * content. end example]
-	 */
-	protected Nullable<String> description = new Nullable<String>();
-
-	/**
-	 * An unambiguous reference to the resource within a given context.
-	 */
-	protected Nullable<String> identifier = new Nullable<String>();
-
-	/**
-	 * A delimited set of keywords to support searching and indexing. This is
-	 * typically a list of terms that are not available elsewhere in the
-	 * properties.
-	 */
-	protected Nullable<String> keywords = new Nullable<String>();
-
-	/**
-	 * The language of the intellectual content of the resource.
-	 * 
-	 * [Note: IETF RFC 3066 provides guidance on encoding to represent
-	 * languages. end note]
-	 */
-	protected Nullable<String> language = new Nullable<String>();
-
-	/**
-	 * The user who performed the last modification. The identification is
-	 * environment-specific.
-	 * 
-	 * [Example: A name, email address, or employee ID. end example] It is
-	 * recommended that this value be as concise as possible.
-	 */
-	protected Nullable<String> lastModifiedBy = new Nullable<String>();
-
-	/**
-	 * The date and time of the last printing.
-	 */
-	protected Nullable<Date> lastPrinted = new Nullable<Date>();
-
-	/**
-	 * Date on which the resource was changed.
-	 */
-	protected Nullable<Date> modified = new Nullable<Date>();
-
-	/**
-	 * The revision number.
-	 * 
-	 * [Example: This value might indicate the number of saves or revisions,
-	 * provided the application updates it after each revision. end example]
-	 */
-	protected Nullable<String> revision = new Nullable<String>();
-
-	/**
-	 * The topic of the content of the resource.
-	 */
-	protected Nullable<String> subject = new Nullable<String>();
-
-	/**
-	 * The name given to the resource.
-	 */
-	protected Nullable<String> title = new Nullable<String>();
-
-	/**
-	 * The version number. This value is set by the user or by the application.
-	 */
-	protected Nullable<String> version = new Nullable<String>();
-
-	/*
-	 * Getters and setters
-	 */
-
-	/**
-	 * Get the category property.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getCategoryProperty()
-	 */
-	public Nullable<String> getCategoryProperty() {
-		return category;
-	}
-
-	/**
-	 * Get content status.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getContentStatusProperty()
-	 */
-	public Nullable<String> getContentStatusProperty() {
-		return contentStatus;
-	}
-
-	/**
-	 * Get content type.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getContentTypeProperty()
-	 */
-	public Nullable<String> getContentTypeProperty() {
-		return contentType;
-	}
-
-	/**
-	 * Get created date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getCreatedProperty()
-	 */
-	public Nullable<Date> getCreatedProperty() {
-		return created;
-	}
-
-	/**
-	 * Get created date formated into a String.
-	 * 
-	 * @return A string representation of the created date.
-	 */
-	public String getCreatedPropertyString() {
-		return getDateValue(created);
-	}
-
-	/**
-	 * Get creator.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getCreatorProperty()
-	 */
-	public Nullable<String> getCreatorProperty() {
-		return creator;
-	}
-
-	/**
-	 * Get description.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getDescriptionProperty()
-	 */
-	public Nullable<String> getDescriptionProperty() {
-		return description;
-	}
-
-	/**
-	 * Get identifier.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getIdentifierProperty()
-	 */
-	public Nullable<String> getIdentifierProperty() {
-		return identifier;
-	}
-
-	/**
-	 * Get keywords.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getKeywordsProperty()
-	 */
-	public Nullable<String> getKeywordsProperty() {
-		return keywords;
-	}
-
-	/**
-	 * Get the language.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getLanguageProperty()
-	 */
-	public Nullable<String> getLanguageProperty() {
-		return language;
-	}
-
-	/**
-	 * Get the author of last modifications.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getLastModifiedByProperty()
-	 */
-	public Nullable<String> getLastModifiedByProperty() {
-		return lastModifiedBy;
-	}
-
-	/**
-	 * Get last printed date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getLastPrintedProperty()
-	 */
-	public Nullable<Date> getLastPrintedProperty() {
-		return lastPrinted;
-	}
-
-	/**
-	 * Get last printed date formated into a String.
-	 * 
-	 * @return A string representation of the last printed date.
-	 */
-	public String getLastPrintedPropertyString() {
-		return getDateValue(created);
-	}
-
-	/**
-	 * Get modified date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getModifiedProperty()
-	 */
-	public Nullable<Date> getModifiedProperty() {
-		return modified;
-	}
-
-	/**
-	 * Get modified date formated into a String.
-	 * 
-	 * @return A string representation of the modified date.
-	 */
-	public String getModifiedPropertyString() {
-		if (!modified.hasValue())
-			return getDateValue(new Nullable<Date>(new Date()));
-		else
-			return getDateValue(modified);
-	}
-
-	/**
-	 * Get revision.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getRevisionProperty()
-	 */
-	public Nullable<String> getRevisionProperty() {
-		return revision;
-	}
-
-	/**
-	 * Get subject.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getSubjectProperty()
-	 */
-	public Nullable<String> getSubjectProperty() {
-		return subject;
-	}
-
-	/**
-	 * Get title.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getTitleProperty()
-	 */
-	public Nullable<String> getTitleProperty() {
-		return title;
-	}
-
-	/**
-	 * Get version.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getVersionProperty()
-	 */
-	public Nullable<String> getVersionProperty() {
-		return version;
-	}
-
-	/**
-	 * Set the category.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCategoryProperty(java.lang.String)
-	 */
-	public void setCategoryProperty(String category) {
-		this.category = setStringValue(category);
-	}
-
-	/**
-	 * Set the content status.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setContentStatusProperty(java.lang.String)
-	 */
-	public void setContentStatusProperty(String contentStatus) {
-		this.contentStatus = setStringValue(contentStatus);
-	}
-
-	/**
-	 * Set the content type.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setContentTypeProperty(java.lang.String)
-	 */
-	public void setContentTypeProperty(String contentType) {
-		this.contentType = setStringValue(contentType);
-	}
-
-	/**
-	 * Set the created date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatedProperty(org.apache.poi.openxml4j.util.Nullable)
-	 */
-	public void setCreatedProperty(String created) {
-		try {
-			this.created = setDateValue(created);
-		} catch (InvalidFormatException e) {
-			new IllegalArgumentException("created  : "
-					+ e.getLocalizedMessage());
-		}
-	}
-
-	/**
-	 * Set the created date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatedProperty(org.apache.poi.openxml4j.util.Nullable)
-	 */
-	public void setCreatedProperty(Nullable<Date> created) {
-		if (created.hasValue())
-			this.created = created;
-	}
-
-	/**
-	 * Set the creator.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatorProperty(java.lang.String)
-	 */
-	public void setCreatorProperty(String creator) {
-		this.creator = setStringValue(creator);
-	}
-
-	/**
-	 * Set the description.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setDescriptionProperty(java.lang.String)
-	 */
-	public void setDescriptionProperty(String description) {
-		this.description = setStringValue(description);
-	}
-
-	/**
-	 * Set identifier.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setIdentifierProperty(java.lang.String)
-	 */
-	public void setIdentifierProperty(String identifier) {
-		this.identifier = setStringValue(identifier);
-	}
-
-	/**
-	 * Set keywords.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setKeywordsProperty(java.lang.String)
-	 */
-	public void setKeywordsProperty(String keywords) {
-		this.keywords = setStringValue(keywords);
-	}
-
-	/**
-	 * Set language.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLanguageProperty(java.lang.String)
-	 */
-	public void setLanguageProperty(String language) {
-		this.language = setStringValue(language);
-	}
-
-	/**
-	 * Set last modifications author.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLastModifiedByProperty(java.lang.String)
-	 */
-	public void setLastModifiedByProperty(String lastModifiedBy) {
-		this.lastModifiedBy = setStringValue(lastModifiedBy);
-	}
-
-	/**
-	 * Set last printed date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLastPrintedProperty(org.apache.poi.openxml4j.util.Nullable)
-	 */
-	public void setLastPrintedProperty(String lastPrinted) {
-		try {
-			this.lastPrinted = setDateValue(lastPrinted);
-		} catch (InvalidFormatException e) {
-			new IllegalArgumentException("lastPrinted  : "
-					+ e.getLocalizedMessage());
-		}
-	}
-
-	/**
-	 * Set last printed date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLastPrintedProperty(org.apache.poi.openxml4j.util.Nullable)
-	 */
-	public void setLastPrintedProperty(Nullable<Date> lastPrinted) {
-		if (lastPrinted.hasValue())
-			this.lastPrinted = lastPrinted;
-	}
-
-	/**
-	 * Set last modification date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setModifiedProperty(org.apache.poi.openxml4j.util.Nullable)
-	 */
-	public void setModifiedProperty(String modified) {
-		try {
-			this.modified = setDateValue(modified);
-		} catch (InvalidFormatException e) {
-			new IllegalArgumentException("modified  : "
-					+ e.getLocalizedMessage());
-		}
-	}
-
-	/**
-	 * Set last modification date.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setModifiedProperty(org.apache.poi.openxml4j.util.Nullable)
-	 */
-	public void setModifiedProperty(Nullable<Date> modified) {
-		if (modified.hasValue())
-			this.modified = modified;
-	}
-
-	/**
-	 * Set revision.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setRevisionProperty(java.lang.String)
-	 */
-	public void setRevisionProperty(String revision) {
-		this.revision = setStringValue(revision);
-	}
-
-	/**
-	 * Set subject.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setSubjectProperty(java.lang.String)
-	 */
-	public void setSubjectProperty(String subject) {
-		this.subject = setStringValue(subject);
-	}
-
-	/**
-	 * Set title.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setTitleProperty(java.lang.String)
-	 */
-	public void setTitleProperty(String title) {
-		this.title = setStringValue(title);
-	}
-
-	/**
-	 * Set version.
-	 * 
-	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setVersionProperty(java.lang.String)
-	 */
-	public void setVersionProperty(String version) {
-		this.version = setStringValue(version);
-	}
-
-	/**
-	 * Convert a strig value into a Nullable<String>
-	 */
-	private Nullable<String> setStringValue(String s) {
-		if (s == null || s.equals(""))
-			return new Nullable<String>();
-		else
-			return new Nullable<String>(s);
-	}
-
-	/**
-	 * Convert a string value represented a date into a Nullable<Date>.
-	 * 
-	 * @throws InvalidFormatException
-	 *             Throws if the date format isnot valid.
-	 */
-	private Nullable<Date> setDateValue(String s) throws InvalidFormatException {
-		if (s == null || s.equals(""))
-			return new Nullable<Date>();
-		else {
-			SimpleDateFormat df = new SimpleDateFormat(
-					"yyyy-MM-dd'T'HH:mm:ss'Z'");
-			Date d = df.parse(s, new ParsePosition(0));
-			if (d == null)
-				throw new InvalidFormatException("Date not well formated");
-			return new Nullable<Date>(d);
-		}
-	}
-
-	/**
-	 * Convert a Nullable<Date> into a String.
-	 * 
-	 * @param d
-	 *            The Date to convert.
-	 * @return The formated date or null.
-	 * @see java.util.SimpleDateFormat
-	 */
-	private String getDateValue(Nullable<Date> d) {
-		if (d == null || d.equals(""))
-			return "";
-		else {
-			SimpleDateFormat df = new SimpleDateFormat(
-					"yyyy-MM-dd'T'HH:mm:ss'Z'");
-			return df.format(d.getValue());
-		}
-	}
-
-	@Override
-	protected InputStream getInputStreamImpl() {
-		throw new InvalidOperationException("Operation not authorized");
-	}
-
-	@Override
-	protected OutputStream getOutputStreamImpl() {
-		throw new InvalidOperationException(
-				"Can't use output stream to set properties !");
-	}
-
-	@Override
-	public boolean save(OutputStream zos) throws OpenXML4JException {
-		throw new InvalidOperationException("Operation not authorized");
-	}
-
-	@Override
-	public boolean load(InputStream ios) throws InvalidFormatException {
-		throw new InvalidOperationException("Operation not authorized");
-	}
-
-	@Override
-	public void close() {
-		// Do nothing
-	}
-
-	@Override
-	public void flush() {
-		// Do nothing
-	}
-}
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.internal;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.text.ParsePosition;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
+import org.apache.poi.openxml4j.opc.ContentTypes;
+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.PackageProperties;
+import org.apache.poi.openxml4j.util.Nullable;
+
+/**
+ * Represents the core properties part of a package.
+ * 
+ * @author Julien Chable
+ * @version 1.0
+ */
+public class PackagePropertiesPart extends PackagePart implements
+		PackageProperties {
+
+	public final static String NAMESPACE_DC_URI = "http://purl.org/dc/elements/1.1/";
+
+	public final static String NAMESPACE_CP_URI = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
+
+	public final static String NAMESPACE_DCTERMS_URI = "http://purl.org/dc/terms/";
+
+	public final static String NAMESPACE_XSI_URI = "http://www.w3.org/2001/XMLSchema-instance";
+
+	/**
+	 * Constructor.
+	 * 
+	 * @param pack
+	 *            Container package.
+	 * @param partName
+	 *            Name of this part.
+	 * @throws InvalidFormatException
+	 *             Throws if the content is invalid.
+	 */
+	public PackagePropertiesPart(OPCPackage pack, PackagePartName partName)
+			throws InvalidFormatException {
+		super(pack, partName, ContentTypes.CORE_PROPERTIES_PART);
+	}
+
+	/**
+	 * A categorization of the content of this package.
+	 * 
+	 * [Example: Example values for this property might include: Resume, Letter,
+	 * Financial Forecast, Proposal, Technical Presentation, and so on. This
+	 * value might be used by an application's user interface to facilitate
+	 * navigation of a large set of documents. end example]
+	 */
+	protected Nullable<String> category = new Nullable<String>();
+
+	/**
+	 * The status of the content.
+	 * 
+	 * [Example: Values might include "Draft", "Reviewed", and "Final". end
+	 * example]
+	 */
+	protected Nullable<String> contentStatus = new Nullable<String>();
+
+	/**
+	 * The type of content represented, generally defined by a specific use and
+	 * intended audience.
+	 * 
+	 * [Example: Values might include "Whitepaper", "Security Bulletin", and
+	 * "Exam". end example] [Note: This property is distinct from MIME content
+	 * types as defined in RFC 2616. end note]
+	 */
+	protected Nullable<String> contentType = new Nullable<String>();
+
+	/**
+	 * Date of creation of the resource.
+	 */
+	protected Nullable<Date> created = new Nullable<Date>();
+
+	/**
+	 * An entity primarily responsible for making the content of the resource.
+	 */
+	protected Nullable<String> creator = new Nullable<String>();
+
+	/**
+	 * An explanation of the content of the resource.
+	 * 
+	 * [Example: Values might include an abstract, table of contents, reference
+	 * to a graphical representation of content, and a free-text account of the
+	 * content. end example]
+	 */
+	protected Nullable<String> description = new Nullable<String>();
+
+	/**
+	 * An unambiguous reference to the resource within a given context.
+	 */
+	protected Nullable<String> identifier = new Nullable<String>();
+
+	/**
+	 * A delimited set of keywords to support searching and indexing. This is
+	 * typically a list of terms that are not available elsewhere in the
+	 * properties.
+	 */
+	protected Nullable<String> keywords = new Nullable<String>();
+
+	/**
+	 * The language of the intellectual content of the resource.
+	 * 
+	 * [Note: IETF RFC 3066 provides guidance on encoding to represent
+	 * languages. end note]
+	 */
+	protected Nullable<String> language = new Nullable<String>();
+
+	/**
+	 * The user who performed the last modification. The identification is
+	 * environment-specific.
+	 * 
+	 * [Example: A name, email address, or employee ID. end example] It is
+	 * recommended that this value be as concise as possible.
+	 */
+	protected Nullable<String> lastModifiedBy = new Nullable<String>();
+
+	/**
+	 * The date and time of the last printing.
+	 */
+	protected Nullable<Date> lastPrinted = new Nullable<Date>();
+
+	/**
+	 * Date on which the resource was changed.
+	 */
+	protected Nullable<Date> modified = new Nullable<Date>();
+
+	/**
+	 * The revision number.
+	 * 
+	 * [Example: This value might indicate the number of saves or revisions,
+	 * provided the application updates it after each revision. end example]
+	 */
+	protected Nullable<String> revision = new Nullable<String>();
+
+	/**
+	 * The topic of the content of the resource.
+	 */
+	protected Nullable<String> subject = new Nullable<String>();
+
+	/**
+	 * The name given to the resource.
+	 */
+	protected Nullable<String> title = new Nullable<String>();
+
+	/**
+	 * The version number. This value is set by the user or by the application.
+	 */
+	protected Nullable<String> version = new Nullable<String>();
+
+	/*
+	 * Getters and setters
+	 */
+
+	/**
+	 * Get the category property.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getCategoryProperty()
+	 */
+	public Nullable<String> getCategoryProperty() {
+		return category;
+	}
+
+	/**
+	 * Get content status.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getContentStatusProperty()
+	 */
+	public Nullable<String> getContentStatusProperty() {
+		return contentStatus;
+	}
+
+	/**
+	 * Get content type.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getContentTypeProperty()
+	 */
+	public Nullable<String> getContentTypeProperty() {
+		return contentType;
+	}
+
+	/**
+	 * Get created date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getCreatedProperty()
+	 */
+	public Nullable<Date> getCreatedProperty() {
+		return created;
+	}
+
+	/**
+	 * Get created date formated into a String.
+	 * 
+	 * @return A string representation of the created date.
+	 */
+	public String getCreatedPropertyString() {
+		return getDateValue(created);
+	}
+
+	/**
+	 * Get creator.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getCreatorProperty()
+	 */
+	public Nullable<String> getCreatorProperty() {
+		return creator;
+	}
+
+	/**
+	 * Get description.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getDescriptionProperty()
+	 */
+	public Nullable<String> getDescriptionProperty() {
+		return description;
+	}
+
+	/**
+	 * Get identifier.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getIdentifierProperty()
+	 */
+	public Nullable<String> getIdentifierProperty() {
+		return identifier;
+	}
+
+	/**
+	 * Get keywords.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getKeywordsProperty()
+	 */
+	public Nullable<String> getKeywordsProperty() {
+		return keywords;
+	}
+
+	/**
+	 * Get the language.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getLanguageProperty()
+	 */
+	public Nullable<String> getLanguageProperty() {
+		return language;
+	}
+
+	/**
+	 * Get the author of last modifications.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getLastModifiedByProperty()
+	 */
+	public Nullable<String> getLastModifiedByProperty() {
+		return lastModifiedBy;
+	}
+
+	/**
+	 * Get last printed date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getLastPrintedProperty()
+	 */
+	public Nullable<Date> getLastPrintedProperty() {
+		return lastPrinted;
+	}
+
+	/**
+	 * Get last printed date formated into a String.
+	 * 
+	 * @return A string representation of the last printed date.
+	 */
+	public String getLastPrintedPropertyString() {
+		return getDateValue(created);
+	}
+
+	/**
+	 * Get modified date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getModifiedProperty()
+	 */
+	public Nullable<Date> getModifiedProperty() {
+		return modified;
+	}
+
+	/**
+	 * Get modified date formated into a String.
+	 * 
+	 * @return A string representation of the modified date.
+	 */
+	public String getModifiedPropertyString() {
+		if (!modified.hasValue())
+			return getDateValue(new Nullable<Date>(new Date()));
+		else
+			return getDateValue(modified);
+	}
+
+	/**
+	 * Get revision.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getRevisionProperty()
+	 */
+	public Nullable<String> getRevisionProperty() {
+		return revision;
+	}
+
+	/**
+	 * Get subject.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getSubjectProperty()
+	 */
+	public Nullable<String> getSubjectProperty() {
+		return subject;
+	}
+
+	/**
+	 * Get title.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getTitleProperty()
+	 */
+	public Nullable<String> getTitleProperty() {
+		return title;
+	}
+
+	/**
+	 * Get version.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#getVersionProperty()
+	 */
+	public Nullable<String> getVersionProperty() {
+		return version;
+	}
+
+	/**
+	 * Set the category.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCategoryProperty(java.lang.String)
+	 */
+	public void setCategoryProperty(String category) {
+		this.category = setStringValue(category);
+	}
+
+	/**
+	 * Set the content status.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setContentStatusProperty(java.lang.String)
+	 */
+	public void setContentStatusProperty(String contentStatus) {
+		this.contentStatus = setStringValue(contentStatus);
+	}
+
+	/**
+	 * Set the content type.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setContentTypeProperty(java.lang.String)
+	 */
+	public void setContentTypeProperty(String contentType) {
+		this.contentType = setStringValue(contentType);
+	}
+
+	/**
+	 * Set the created date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatedProperty(org.apache.poi.openxml4j.util.Nullable)
+	 */
+	public void setCreatedProperty(String created) {
+		try {
+			this.created = setDateValue(created);
+		} catch (InvalidFormatException e) {
+			new IllegalArgumentException("created  : "
+					+ e.getLocalizedMessage());
+		}
+	}
+
+	/**
+	 * Set the created date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatedProperty(org.apache.poi.openxml4j.util.Nullable)
+	 */
+	public void setCreatedProperty(Nullable<Date> created) {
+		if (created.hasValue())
+			this.created = created;
+	}
+
+	/**
+	 * Set the creator.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setCreatorProperty(java.lang.String)
+	 */
+	public void setCreatorProperty(String creator) {
+		this.creator = setStringValue(creator);
+	}
+
+	/**
+	 * Set the description.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setDescriptionProperty(java.lang.String)
+	 */
+	public void setDescriptionProperty(String description) {
+		this.description = setStringValue(description);
+	}
+
+	/**
+	 * Set identifier.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setIdentifierProperty(java.lang.String)
+	 */
+	public void setIdentifierProperty(String identifier) {
+		this.identifier = setStringValue(identifier);
+	}
+
+	/**
+	 * Set keywords.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setKeywordsProperty(java.lang.String)
+	 */
+	public void setKeywordsProperty(String keywords) {
+		this.keywords = setStringValue(keywords);
+	}
+
+	/**
+	 * Set language.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLanguageProperty(java.lang.String)
+	 */
+	public void setLanguageProperty(String language) {
+		this.language = setStringValue(language);
+	}
+
+	/**
+	 * Set last modifications author.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLastModifiedByProperty(java.lang.String)
+	 */
+	public void setLastModifiedByProperty(String lastModifiedBy) {
+		this.lastModifiedBy = setStringValue(lastModifiedBy);
+	}
+
+	/**
+	 * Set last printed date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLastPrintedProperty(org.apache.poi.openxml4j.util.Nullable)
+	 */
+	public void setLastPrintedProperty(String lastPrinted) {
+		try {
+			this.lastPrinted = setDateValue(lastPrinted);
+		} catch (InvalidFormatException e) {
+			new IllegalArgumentException("lastPrinted  : "
+					+ e.getLocalizedMessage());
+		}
+	}
+
+	/**
+	 * Set last printed date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setLastPrintedProperty(org.apache.poi.openxml4j.util.Nullable)
+	 */
+	public void setLastPrintedProperty(Nullable<Date> lastPrinted) {
+		if (lastPrinted.hasValue())
+			this.lastPrinted = lastPrinted;
+	}
+
+	/**
+	 * Set last modification date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setModifiedProperty(org.apache.poi.openxml4j.util.Nullable)
+	 */
+	public void setModifiedProperty(String modified) {
+		try {
+			this.modified = setDateValue(modified);
+		} catch (InvalidFormatException e) {
+			new IllegalArgumentException("modified  : "
+					+ e.getLocalizedMessage());
+		}
+	}
+
+	/**
+	 * Set last modification date.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setModifiedProperty(org.apache.poi.openxml4j.util.Nullable)
+	 */
+	public void setModifiedProperty(Nullable<Date> modified) {
+		if (modified.hasValue())
+			this.modified = modified;
+	}
+
+	/**
+	 * Set revision.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setRevisionProperty(java.lang.String)
+	 */
+	public void setRevisionProperty(String revision) {
+		this.revision = setStringValue(revision);
+	}
+
+	/**
+	 * Set subject.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setSubjectProperty(java.lang.String)
+	 */
+	public void setSubjectProperty(String subject) {
+		this.subject = setStringValue(subject);
+	}
+
+	/**
+	 * Set title.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setTitleProperty(java.lang.String)
+	 */
+	public void setTitleProperty(String title) {
+		this.title = setStringValue(title);
+	}
+
+	/**
+	 * Set version.
+	 * 
+	 * @see org.apache.poi.openxml4j.opc.PackageProperties#setVersionProperty(java.lang.String)
+	 */
+	public void setVersionProperty(String version) {
+		this.version = setStringValue(version);
+	}
+
+	/**
+	 * Convert a strig value into a Nullable<String>
+	 */
+	private Nullable<String> setStringValue(String s) {
+		if (s == null || s.equals(""))
+			return new Nullable<String>();
+		else
+			return new Nullable<String>(s);
+	}
+
+	/**
+	 * Convert a string value represented a date into a Nullable<Date>.
+	 * 
+	 * @throws InvalidFormatException
+	 *             Throws if the date format isnot valid.
+	 */
+	private Nullable<Date> setDateValue(String s) throws InvalidFormatException {
+		if (s == null || s.equals(""))
+			return new Nullable<Date>();
+		else {
+			SimpleDateFormat df = new SimpleDateFormat(
+					"yyyy-MM-dd'T'HH:mm:ss'Z'");
+			Date d = df.parse(s, new ParsePosition(0));
+			if (d == null)
+				throw new InvalidFormatException("Date not well formated");
+			return new Nullable<Date>(d);
+		}
+	}
+
+	/**
+	 * Convert a Nullable<Date> into a String.
+	 * 
+	 * @param d
+	 *            The Date to convert.
+	 * @return The formated date or null.
+	 * @see java.util.SimpleDateFormat
+	 */
+	private String getDateValue(Nullable<Date> d) {
+		if (d == null || d.equals(""))
+			return "";
+		else {
+			SimpleDateFormat df = new SimpleDateFormat(
+					"yyyy-MM-dd'T'HH:mm:ss'Z'");
+			return df.format(d.getValue());
+		}
+	}
+
+	@Override
+	protected InputStream getInputStreamImpl() {
+		throw new InvalidOperationException("Operation not authorized");
+	}
+
+	@Override
+	protected OutputStream getOutputStreamImpl() {
+		throw new InvalidOperationException(
+				"Can't use output stream to set properties !");
+	}
+
+	@Override
+	public boolean save(OutputStream zos) throws OpenXML4JException {
+		throw new InvalidOperationException("Operation not authorized");
+	}
+
+	@Override
+	public boolean load(InputStream ios) throws InvalidFormatException {
+		throw new InvalidOperationException("Operation not authorized");
+	}
+
+	@Override
+	public void close() {
+		// Do nothing
+	}
+
+	@Override
+	public void flush() {
+		// Do nothing
+	}
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ZipContentTypeManager.java Wed Mar 18 18:54:01 2009
@@ -1,93 +1,93 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-
-package org.apache.poi.openxml4j.opc.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import org.dom4j.Document;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.openxml4j.opc.Package;
-import org.apache.poi.openxml4j.opc.StreamHelper;
-import org.apache.poi.util.POILogger;
-import org.apache.poi.util.POILogFactory;
-
-/**
- * Zip implementation of the ContentTypeManager.
- * 
- * @author Julien Chable
- * @version 1.0
- * @see ContentTypeManager
- */
-public class ZipContentTypeManager extends ContentTypeManager {
-    private static POILogger logger = POILogFactory.getLogger(ZipContentTypeManager.class);
-
-	/**
-	 * Delegate constructor to the super constructor.
-	 * 
-	 * @param in
-	 *            The input stream to parse to fill internal content type
-	 *            collections.
-	 * @throws InvalidFormatException
-	 *             If the content types part content is not valid.
-	 */
-	public ZipContentTypeManager(InputStream in, Package pkg)
-			throws InvalidFormatException {
-		super(in, pkg);
-	}
-
-	@Override
-	public boolean saveImpl(Document content, OutputStream out) {
-		ZipOutputStream zos = null;
-		if (out instanceof ZipOutputStream)
-			zos = (ZipOutputStream) out;
-		else
-			zos = new ZipOutputStream(out);
-
-		ZipEntry partEntry = new ZipEntry(CONTENT_TYPES_PART_NAME);
-		try {
-			// Referenced in ZIP
-			zos.putNextEntry(partEntry);
-			// Saving data in the ZIP file
-			ByteArrayOutputStream outTemp = new ByteArrayOutputStream();
-			StreamHelper.saveXmlInStream(content, out);
-			InputStream ins = new ByteArrayInputStream(outTemp.toByteArray());
-			byte[] buff = new byte[ZipHelper.READ_WRITE_FILE_BUFFER_SIZE];
-			while (ins.available() > 0) {
-				int resultRead = ins.read(buff);
-				if (resultRead == -1) {
-					// end of file reached
-					break;
-				} else {
-					zos.write(buff, 0, resultRead);
-				}
-			}
-			zos.closeEntry();
-		} catch (IOException ioe) {
-			logger.log(POILogger.ERROR, "Cannot write: " + CONTENT_TYPES_PART_NAME
-					+ " in Zip !", ioe);
-			return false;
-		}
-		return true;
-	}
-}
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.internal;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipOutputStream;
+
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.openxml4j.opc.StreamHelper;
+import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
+import org.dom4j.Document;
+
+/**
+ * Zip implementation of the ContentTypeManager.
+ * 
+ * @author Julien Chable
+ * @version 1.0
+ * @see ContentTypeManager
+ */
+public class ZipContentTypeManager extends ContentTypeManager {
+    private static POILogger logger = POILogFactory.getLogger(ZipContentTypeManager.class);
+
+	/**
+	 * Delegate constructor to the super constructor.
+	 * 
+	 * @param in
+	 *            The input stream to parse to fill internal content type
+	 *            collections.
+	 * @throws InvalidFormatException
+	 *             If the content types part content is not valid.
+	 */
+	public ZipContentTypeManager(InputStream in, OPCPackage pkg)
+			throws InvalidFormatException {
+		super(in, pkg);
+	}
+
+	@Override
+	public boolean saveImpl(Document content, OutputStream out) {
+		ZipOutputStream zos = null;
+		if (out instanceof ZipOutputStream)
+			zos = (ZipOutputStream) out;
+		else
+			zos = new ZipOutputStream(out);
+
+		ZipEntry partEntry = new ZipEntry(CONTENT_TYPES_PART_NAME);
+		try {
+			// Referenced in ZIP
+			zos.putNextEntry(partEntry);
+			// Saving data in the ZIP file
+			ByteArrayOutputStream outTemp = new ByteArrayOutputStream();
+			StreamHelper.saveXmlInStream(content, out);
+			InputStream ins = new ByteArrayInputStream(outTemp.toByteArray());
+			byte[] buff = new byte[ZipHelper.READ_WRITE_FILE_BUFFER_SIZE];
+			while (ins.available() > 0) {
+				int resultRead = ins.read(buff);
+				if (resultRead == -1) {
+					// end of file reached
+					break;
+				} else {
+					zos.write(buff, 0, resultRead);
+				}
+			}
+			zos.closeEntry();
+		} catch (IOException ioe) {
+			logger.log(POILogger.ERROR, "Cannot write: " + CONTENT_TYPES_PART_NAME
+					+ " in Zip !", ioe);
+			return false;
+		}
+		return true;
+	}
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/openxml4j/opc/internal/unmarshallers/UnmarshallContext.java Wed Mar 18 18:54:01 2009
@@ -1,96 +1,96 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-
-package org.apache.poi.openxml4j.opc.internal.unmarshallers;
-
-import java.util.zip.ZipEntry;
-
-import org.apache.poi.openxml4j.opc.Package;
-import org.apache.poi.openxml4j.opc.PackagePartName;
-
-/**
- * Context needed for the unmarshall process of a part. This class is immutable.
- * 
- * @author Julien Chable
- * @version 1.0
- */
-public final class UnmarshallContext {
-
-	private Package _package;
-
-	private PackagePartName partName;
-
-	private ZipEntry zipEntry;
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param targetPackage
-	 *            Container.
-	 * @param partName
-	 *            Name of the part to unmarshall.
-	 */
-	public UnmarshallContext(Package targetPackage, PackagePartName partName) {
-		this._package = targetPackage;
-		this.partName = partName;
-	}
-
-	/**
-	 * @return the container
-	 */
-	Package getPackage() {
-		return _package;
-	}
-
-	/**
-	 * @param container
-	 *            the container to set
-	 */
-	public void setPackage(Package container) {
-		this._package = container;
-	}
-
-	/**
-	 * @return the partName
-	 */
-	PackagePartName getPartName() {
-		return partName;
-	}
-
-	/**
-	 * @param partName
-	 *            the partName to set
-	 */
-	public void setPartName(PackagePartName partName) {
-		this.partName = partName;
-	}
-
-	/**
-	 * @return the zipEntry
-	 */
-	ZipEntry getZipEntry() {
-		return zipEntry;
-	}
-
-	/**
-	 * @param zipEntry
-	 *            the zipEntry to set
-	 */
-	public void setZipEntry(ZipEntry zipEntry) {
-		this.zipEntry = zipEntry;
-	}
-}
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+
+package org.apache.poi.openxml4j.opc.internal.unmarshallers;
+
+import java.util.zip.ZipEntry;
+
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.openxml4j.opc.PackagePartName;
+
+/**
+ * Context needed for the unmarshall process of a part. This class is immutable.
+ * 
+ * @author Julien Chable
+ * @version 1.0
+ */
+public final class UnmarshallContext {
+
+	private OPCPackage _package;
+
+	private PackagePartName partName;
+
+	private ZipEntry zipEntry;
+
+	/**
+	 * Constructor.
+	 * 
+	 * @param targetPackage
+	 *            Container.
+	 * @param partName
+	 *            Name of the part to unmarshall.
+	 */
+	public UnmarshallContext(OPCPackage targetPackage, PackagePartName partName) {
+		this._package = targetPackage;
+		this.partName = partName;
+	}
+
+	/**
+	 * @return the container
+	 */
+	OPCPackage getPackage() {
+		return _package;
+	}
+
+	/**
+	 * @param container
+	 *            the container to set
+	 */
+	public void setPackage(OPCPackage container) {
+		this._package = container;
+	}
+
+	/**
+	 * @return the partName
+	 */
+	PackagePartName getPartName() {
+		return partName;
+	}
+
+	/**
+	 * @param partName
+	 *            the partName to set
+	 */
+	public void setPartName(PackagePartName partName) {
+		this.partName = partName;
+	}
+
+	/**
+	 * @return the zipEntry
+	 */
+	ZipEntry getZipEntry() {
+		return zipEntry;
+	}
+
+	/**
+	 * @param zipEntry
+	 *            the zipEntry to set
+	 */
+	public void setZipEntry(ZipEntry zipEntry) {
+		this.zipEntry = zipEntry;
+	}
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/ss/usermodel/WorkbookFactory.java Wed Mar 18 18:54:01 2009
@@ -22,10 +22,10 @@
 
 import org.apache.poi.POIXMLDocument;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.openxml4j.opc.Package;
 
 /**
  * Factory for creating the appropriate kind of Workbook
@@ -41,7 +41,7 @@
 	/**
 	 * Creates an XSSFWorkbook from the given OOXML Package
 	 */
-	public static Workbook create(Package pkg) throws IOException {
+	public static Workbook create(OPCPackage pkg) throws IOException {
 		return new XSSFWorkbook(pkg);
 	}
 	/**
@@ -60,7 +60,7 @@
 			return new HSSFWorkbook(inp);
 		}
 		if(POIXMLDocument.hasOOXMLHeader(inp)) {
-			return new XSSFWorkbook( Package.open(inp) );
+			return new XSSFWorkbook(OPCPackage.open(inp));
 		}
 		throw new IllegalArgumentException("Your InputStream was neither an OLE2 stream, nor an OOXML stream");
 	}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/util/PackageHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/util/PackageHelper.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/util/PackageHelper.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/util/PackageHelper.java Wed Mar 18 18:54:01 2009
@@ -1,144 +1,144 @@
-/* ====================================================================
-   Licensed to the Apache Software Foundation (ASF) under one or more
-   contributor license agreements.  See the NOTICE file distributed with
-   this work for additional information regarding copyright ownership.
-   The ASF licenses this file to You under the Apache License, Version 2.0
-   (the "License"); you may not use this file except in compliance with
-   the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-==================================================================== */
-package org.apache.poi.util;
-
-import org.apache.poi.openxml4j.opc.*;
-import org.apache.poi.openxml4j.opc.Package;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.util.IOUtils;
-
-import java.io.*;
-
-/**
- * Provides handy methods to work with OOXML packages
- *
- * @author Yegor Kozlov
- */
-public class PackageHelper {
-
-    /**
-     * Clone the specified package.
-     *
-     * @param   pkg   the package to clone
-     * @return  the cloned package
-     */
-    public static Package clone(Package pkg) throws OpenXML4JException, IOException {
-        return clone(pkg, createTempFile());
-    }
-
-    /**
-     * Clone the specified package.
-     *
-     * @param   pkg   the package to clone
-     * @param   file  the destination file
-     * @return  the cloned package
-     */
-    public static Package clone(Package pkg, File file) throws OpenXML4JException, IOException {
-
-        String path = file.getAbsolutePath();
-
-        Package dest = Package.create(path);
-        PackageRelationshipCollection rels = pkg.getRelationships();
-        for (PackageRelationship rel : rels) {
-            PackagePart part = pkg.getPart(rel);
-            PackagePart part_tgt;
-            if (rel.getRelationshipType().equals(PackageRelationshipTypes.CORE_PROPERTIES)) {
-                copyProperties(pkg.getPackageProperties(), dest.getPackageProperties());
-                continue;
-            } else {
-                dest.addRelationship(part.getPartName(), rel.getTargetMode(), rel.getRelationshipType());
-                part_tgt = dest.createPart(part.getPartName(), part.getContentType());
-            }
-
-            OutputStream out = part_tgt.getOutputStream();
-            IOUtils.copy(part.getInputStream(), out);
-            out.close();
-
-            if(part.hasRelationships()) {
-                copy(pkg, part, dest, part_tgt);
-            }
-        }
-        dest.close();
-
-        //the temp file will be deleted when JVM terminates
-        new File(path).deleteOnExit();
-        return Package.open(path);
-    }
-
-    /**
-     * Creates an empty file in the default temporary-file directory, 
-     */
-    public static File createTempFile() throws IOException {
-        File file = File.createTempFile("poi-ooxml-", ".tmp");
-        //there is no way to pass an existing file to Package.create(file),
-        //delete first, the file will be re-created in Packe.create(file)
-        file.delete();
-        file.deleteOnExit();
-        return file;
-
-    }
-
-    /**
-     * Recursively copy package parts to the destination package
-     */
-    private static void copy(Package pkg, PackagePart part, Package tgt, PackagePart part_tgt) throws OpenXML4JException, IOException {
-        PackageRelationshipCollection rels = part.getRelationships();
-        if(rels != null) for (PackageRelationship rel : rels) {
-            PackagePart p;
-            if(rel.getTargetMode() == TargetMode.EXTERNAL){
-                part_tgt.addExternalRelationship(rel.getTargetURI().toString(), rel.getRelationshipType(), rel.getId());
-                //external relations don't have associated package parts
-                continue;
-            } else {
-                PackagePartName relName = PackagingURIHelper.createPartName(rel.getTargetURI());
-                p = pkg.getPart(relName);
-            }
-
-            part_tgt.addRelationship(p.getPartName(), rel.getTargetMode(), rel.getRelationshipType(), rel.getId());
-
-            PackagePart dest;
-            if(!tgt.containPart(p.getPartName())){
-                dest = tgt.createPart(p.getPartName(), p.getContentType());
-                OutputStream out = dest.getOutputStream();
-                IOUtils.copy(p.getInputStream(), out);
-                out.close();
-                copy(pkg, p, tgt, dest);
-            }
-        }
-    }
-
-    /**
-     * Copy core package properties
-     *
-     * @param src source properties
-     * @param tgt target properties
-     */
-    private static void copyProperties(PackageProperties src, PackageProperties tgt){
-        tgt.setCategoryProperty(src.getCategoryProperty().getValue());
-        tgt.setContentStatusProperty(src.getContentStatusProperty().getValue());
-        tgt.setContentTypeProperty(src.getContentTypeProperty().getValue());
-        tgt.setCreatorProperty(src.getCreatorProperty().getValue());
-        tgt.setDescriptionProperty(src.getDescriptionProperty().getValue());
-        tgt.setIdentifierProperty(src.getIdentifierProperty().getValue());
-        tgt.setKeywordsProperty(src.getKeywordsProperty().getValue());
-        tgt.setLanguageProperty(src.getLanguageProperty().getValue());
-        tgt.setRevisionProperty(src.getRevisionProperty().getValue());
-        tgt.setSubjectProperty(src.getSubjectProperty().getValue());
-        tgt.setTitleProperty(src.getTitleProperty().getValue());
-        tgt.setVersionProperty(src.getVersionProperty().getValue());
-    }
-}
+/* ====================================================================
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+==================================================================== */
+package org.apache.poi.util;
+
+import org.apache.poi.openxml4j.opc.*;
+import org.apache.poi.openxml4j.opc.OPCPackage;
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
+import org.apache.poi.util.IOUtils;
+
+import java.io.*;
+
+/**
+ * Provides handy methods to work with OOXML packages
+ *
+ * @author Yegor Kozlov
+ */
+public class PackageHelper {
+
+    /**
+     * Clone the specified package.
+     *
+     * @param   pkg   the package to clone
+     * @return  the cloned package
+     */
+    public static OPCPackage clone(OPCPackage pkg) throws OpenXML4JException, IOException {
+        return clone(pkg, createTempFile());
+    }
+
+    /**
+     * Clone the specified package.
+     *
+     * @param   pkg   the package to clone
+     * @param   file  the destination file
+     * @return  the cloned package
+     */
+    public static OPCPackage clone(OPCPackage pkg, File file) throws OpenXML4JException, IOException {
+
+        String path = file.getAbsolutePath();
+
+        OPCPackage dest = OPCPackage.create(path);
+        PackageRelationshipCollection rels = pkg.getRelationships();
+        for (PackageRelationship rel : rels) {
+            PackagePart part = pkg.getPart(rel);
+            PackagePart part_tgt;
+            if (rel.getRelationshipType().equals(PackageRelationshipTypes.CORE_PROPERTIES)) {
+                copyProperties(pkg.getPackageProperties(), dest.getPackageProperties());
+                continue;
+            } else {
+                dest.addRelationship(part.getPartName(), rel.getTargetMode(), rel.getRelationshipType());
+                part_tgt = dest.createPart(part.getPartName(), part.getContentType());
+            }
+
+            OutputStream out = part_tgt.getOutputStream();
+            IOUtils.copy(part.getInputStream(), out);
+            out.close();
+
+            if(part.hasRelationships()) {
+                copy(pkg, part, dest, part_tgt);
+            }
+        }
+        dest.close();
+
+        //the temp file will be deleted when JVM terminates
+        new File(path).deleteOnExit();
+        return OPCPackage.open(path);
+    }
+
+    /**
+     * Creates an empty file in the default temporary-file directory, 
+     */
+    public static File createTempFile() throws IOException {
+        File file = File.createTempFile("poi-ooxml-", ".tmp");
+        //there is no way to pass an existing file to Package.create(file),
+        //delete first, the file will be re-created in Packe.create(file)
+        file.delete();
+        file.deleteOnExit();
+        return file;
+
+    }
+
+    /**
+     * Recursively copy package parts to the destination package
+     */
+    private static void copy(OPCPackage pkg, PackagePart part, OPCPackage tgt, PackagePart part_tgt) throws OpenXML4JException, IOException {
+        PackageRelationshipCollection rels = part.getRelationships();
+        if(rels != null) for (PackageRelationship rel : rels) {
+            PackagePart p;
+            if(rel.getTargetMode() == TargetMode.EXTERNAL){
+                part_tgt.addExternalRelationship(rel.getTargetURI().toString(), rel.getRelationshipType(), rel.getId());
+                //external relations don't have associated package parts
+                continue;
+            } else {
+                PackagePartName relName = PackagingURIHelper.createPartName(rel.getTargetURI());
+                p = pkg.getPart(relName);
+            }
+
+            part_tgt.addRelationship(p.getPartName(), rel.getTargetMode(), rel.getRelationshipType(), rel.getId());
+
+            PackagePart dest;
+            if(!tgt.containPart(p.getPartName())){
+                dest = tgt.createPart(p.getPartName(), p.getContentType());
+                OutputStream out = dest.getOutputStream();
+                IOUtils.copy(p.getInputStream(), out);
+                out.close();
+                copy(pkg, p, tgt, dest);
+            }
+        }
+    }
+
+    /**
+     * Copy core package properties
+     *
+     * @param src source properties
+     * @param tgt target properties
+     */
+    private static void copyProperties(PackageProperties src, PackageProperties tgt){
+        tgt.setCategoryProperty(src.getCategoryProperty().getValue());
+        tgt.setContentStatusProperty(src.getContentStatusProperty().getValue());
+        tgt.setContentTypeProperty(src.getContentTypeProperty().getValue());
+        tgt.setCreatorProperty(src.getCreatorProperty().getValue());
+        tgt.setDescriptionProperty(src.getDescriptionProperty().getValue());
+        tgt.setIdentifierProperty(src.getIdentifierProperty().getValue());
+        tgt.setKeywordsProperty(src.getKeywordsProperty().getValue());
+        tgt.setLanguageProperty(src.getLanguageProperty().getValue());
+        tgt.setRevisionProperty(src.getRevisionProperty().getValue());
+        tgt.setSubjectProperty(src.getSubjectProperty().getValue());
+        tgt.setTitleProperty(src.getTitleProperty().getValue());
+        tgt.setVersionProperty(src.getVersionProperty().getValue());
+    }
+}

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/XSLFSlideShow.java Wed Mar 18 18:54:01 2009
@@ -17,17 +17,17 @@
 package org.apache.poi.xslf;
 
 import java.io.IOException;
-import java.util.List;
 import java.util.LinkedList;
+import java.util.List;
 
 import org.apache.poi.POIXMLDocument;
-import org.apache.xmlbeans.XmlException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.openxml4j.opc.PackagePart;
 import org.apache.poi.openxml4j.opc.PackageRelationship;
 import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
+import org.apache.xmlbeans.XmlException;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTCommentList;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTNotesSlide;
 import org.openxmlformats.schemas.presentationml.x2006.main.CTPresentation;
@@ -68,7 +68,7 @@
      */
     private List<PackagePart> embedds;
 
-	public XSLFSlideShow(Package container) throws OpenXML4JException, IOException, XmlException {
+	public XSLFSlideShow(OPCPackage container) throws OpenXML4JException, IOException, XmlException {
 		super(container);
 		
 		presentationDoc =

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xslf/extractor/XSLFPowerPointExtractor.java Wed Mar 18 18:54:01 2009
@@ -19,12 +19,12 @@
 import java.io.IOException;
 
 import org.apache.poi.POIXMLTextExtractor;
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.xslf.XSLFSlideShow;
 import org.apache.poi.xslf.usermodel.XMLSlideShow;
 import org.apache.poi.xslf.usermodel.XSLFSlide;
 import org.apache.xmlbeans.XmlException;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.Package;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextBody;
 import org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph;
@@ -48,7 +48,7 @@
 	public XSLFPowerPointExtractor(XSLFSlideShow slideshow) throws XmlException, IOException {
 		this(new XMLSlideShow(slideshow));
 	}
-	public XSLFPowerPointExtractor(Package container) throws XmlException, OpenXML4JException, IOException {
+	public XSLFPowerPointExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
 		this(new XSLFSlideShow(container));
 	}
 

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFReader.java Wed Mar 18 18:54:01 2009
@@ -18,24 +18,28 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
-import org.apache.poi.xssf.model.SharedStringsTable;
-import org.apache.poi.xssf.model.StylesTable;
-import org.apache.poi.xssf.usermodel.XSSFRelation;
 import org.apache.poi.POIXMLException;
-import org.apache.xmlbeans.XmlException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.Package;
+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.PackageRelationship;
 import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
 import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.xssf.model.SharedStringsTable;
+import org.apache.poi.xssf.model.StylesTable;
+import org.apache.poi.xssf.usermodel.XSSFRelation;
+import org.apache.xmlbeans.XmlException;
+import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTWorkbook;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.WorkbookDocument;
-import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTSheet;
 
 /**
  * This class makes it easy to get at individual parts
@@ -45,13 +49,13 @@
  *  for XSSF.
  */
 public class XSSFReader {
-    private Package pkg;
+    private OPCPackage pkg;
     private PackagePart workbookPart;
 
     /**
      * Creates a new XSSFReader, for the given package
      */
-    public XSSFReader(Package pkg) throws IOException, OpenXML4JException {
+    public XSSFReader(OPCPackage pkg) throws IOException, OpenXML4JException {
         this.pkg = pkg;
 
         PackageRelationship coreDocRelationship = this.pkg.getRelationshipsByType(

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java Wed Mar 18 18:54:01 2009
@@ -21,6 +21,8 @@
 
 import org.apache.poi.POIXMLTextExtractor;
 import org.apache.poi.hssf.extractor.ExcelExtractor;
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Comment;
 import org.apache.poi.ss.usermodel.HeaderFooter;
@@ -29,8 +31,6 @@
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.xmlbeans.XmlException;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.Package;
 
 /**
  * Helper class to extract text from an OOXML Excel file
@@ -44,7 +44,7 @@
 	public XSSFExcelExtractor(String path) throws XmlException, OpenXML4JException, IOException {
 		this(new XSSFWorkbook(path));
 	}
-	public XSSFExcelExtractor(Package container) throws XmlException, OpenXML4JException, IOException {
+	public XSSFExcelExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
 		this(new XSSFWorkbook(container));
 	}
 	public XSSFExcelExtractor(XSSFWorkbook workbook) {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java Wed Mar 18 18:54:01 2009
@@ -36,6 +36,14 @@
 import org.apache.poi.POIXMLDocumentPart;
 import org.apache.poi.POIXMLException;
 import org.apache.poi.hssf.record.formula.SheetNameFormatter;
+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.PackageRelationship;
+import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
+import org.apache.poi.openxml4j.opc.PackagingURIHelper;
+import org.apache.poi.openxml4j.opc.TargetMode;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -45,20 +53,12 @@
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 import org.apache.poi.util.PackageHelper;
+import org.apache.poi.xssf.model.CalculationChain;
 import org.apache.poi.xssf.model.SharedStringsTable;
 import org.apache.poi.xssf.model.StylesTable;
-import org.apache.poi.xssf.model.CalculationChain;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.Package;
-import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.openxml4j.opc.PackagePartName;
-import org.apache.poi.openxml4j.opc.PackageRelationship;
-import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
-import org.apache.poi.openxml4j.opc.PackagingURIHelper;
-import org.apache.poi.openxml4j.opc.TargetMode;
 import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookView;
 import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTBookViews;
@@ -152,7 +152,7 @@
      *
      * @param pkg the OpenXML4J <code>Package</code> object.
      */
-    public XSSFWorkbook(Package pkg) throws IOException {
+    public XSSFWorkbook(OPCPackage pkg) throws IOException {
         super(ensureWriteAccess(pkg));
 
         //build a tree of POIXMLDocumentParts, this workbook being the root
@@ -240,9 +240,9 @@
     /**
      * Create a new SpreadsheetML package and setup the default minimal content
      */
-    protected static Package newPackage() {
+    protected static OPCPackage newPackage() {
         try {
-            Package pkg = Package.create(PackageHelper.createTempFile());
+            OPCPackage pkg = OPCPackage.create(PackageHelper.createTempFile());
             // Main part
             PackagePartName corePartName = PackagingURIHelper.createPartName(XSSFRelation.WORKBOOK.getDefaultFileName());
             // Create main part relationship

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/extractor/XWPFWordExtractor.java Wed Mar 18 18:54:01 2009
@@ -21,16 +21,16 @@
 
 import org.apache.poi.POIXMLDocument;
 import org.apache.poi.POIXMLTextExtractor;
-import org.apache.poi.xwpf.usermodel.XWPFDocument;
+import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.xwpf.model.XWPFCommentsDecorator;
 import org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy;
 import org.apache.poi.xwpf.model.XWPFHyperlinkDecorator;
 import org.apache.poi.xwpf.model.XWPFParagraphDecorator;
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
 import org.apache.poi.xwpf.usermodel.XWPFParagraph;
 import org.apache.poi.xwpf.usermodel.XWPFTable;
 import org.apache.xmlbeans.XmlException;
-import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
-import org.apache.poi.openxml4j.opc.Package;
 
 /**
  * Helper class to extract text from an OOXML Word file
@@ -39,7 +39,7 @@
 	private XWPFDocument document;
 	private boolean fetchHyperlinks = false;
 	
-	public XWPFWordExtractor(Package container) throws XmlException, OpenXML4JException, IOException {
+	public XWPFWordExtractor(OPCPackage container) throws XmlException, OpenXML4JException, IOException {
 		this(new XWPFDocument(container));
 	}
 	public XWPFWordExtractor(XWPFDocument document) {

Modified: poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java Wed Mar 18 18:54:01 2009
@@ -30,7 +30,6 @@
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
 import org.apache.poi.openxml4j.opc.*;
-import org.apache.poi.openxml4j.opc.Package;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBody;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTComment;
 import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1;
@@ -65,7 +64,7 @@
     /** Handles the joy of different headers/footers for different pages */
     private XWPFHeaderFooterPolicy headerFooterPolicy;
 
-    public XWPFDocument(Package pkg) throws IOException {
+    public XWPFDocument(OPCPackage pkg) throws IOException {
         super(ensureWriteAccess(pkg));
 
         //build a tree of POIXMLDocumentParts, this document being the root
@@ -143,9 +142,9 @@
     /**
      * Create a new SpreadsheetML package and setup the default minimal content
      */
-    protected static Package newPackage() {
+    protected static OPCPackage newPackage() {
         try {
-            Package pkg = Package.create(PackageHelper.createTempFile());
+        	OPCPackage pkg = OPCPackage.create(PackageHelper.createTempFile());
             // Main part
             PackagePartName corePartName = PackagingURIHelper.createPartName(XWPFRelation.DOCUMENT.getDefaultFileName());
             // Create main part relationship

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/TestEmbeded.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/TestEmbeded.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/TestEmbeded.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/TestEmbeded.java Wed Mar 18 18:54:01 2009
@@ -25,7 +25,7 @@
 import org.apache.poi.xslf.XSLFSlideShow;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.apache.poi.xwpf.usermodel.XWPFDocument;
-import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 import org.apache.poi.openxml4j.opc.PackagePart;
 
 import junit.framework.TestCase;
@@ -47,7 +47,7 @@
 		File f = new File(dirname, "ExcelWithAttachments.xlsx");
 		assertTrue(f.exists());
 		
-		POIXMLDocument doc = new XSSFWorkbook(Package.open(f.toString()));
+		POIXMLDocument doc = new XSSFWorkbook(OPCPackage.open(f.toString()));
 		test(doc, 4);
 	}
 
@@ -55,7 +55,7 @@
 		File f = new File(dirname, "WordWithAttachments.docx");
 		assertTrue(f.exists());
 		
-		POIXMLDocument doc = new XWPFDocument(Package.open(f.toString()));
+		POIXMLDocument doc = new XWPFDocument(OPCPackage.open(f.toString()));
 		test(doc, 5);
 	}
 
@@ -63,7 +63,7 @@
 		File f = new File(dirname, "PPTWithAttachments.pptx");
 		assertTrue(f.exists());
 		
-		POIXMLDocument doc = new XSLFSlideShow(Package.open(f.toString()));
+		POIXMLDocument doc = new XSLFSlideShow(OPCPackage.open(f.toString()));
 		test(doc, 4);
 	}
 	

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/TestXMLPropertiesTextExtractor.java Wed Mar 18 18:54:01 2009
@@ -20,7 +20,7 @@
 
 import org.apache.poi.xssf.extractor.XSSFExcelExtractor;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
-import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 
 import junit.framework.TestCase;
 
@@ -33,7 +33,7 @@
 	}
 	
 	public void testGetFromMainExtractor() throws Exception {
-		org.apache.poi.openxml4j.opc.Package pkg = Package.open(
+		OPCPackage pkg = OPCPackage.open(
 				(new File(dirname, "ExcelWithAttachments.xlsx")).toString()
 		);
 		XSSFWorkbook wb = new XSSFWorkbook(pkg);
@@ -54,7 +54,7 @@
 	}
 
 	public void testCore() throws Exception {
-		org.apache.poi.openxml4j.opc.Package pkg = Package.open(
+		OPCPackage pkg = OPCPackage.open(
 				(new File(dirname, "ExcelWithAttachments.xlsx")).toString()
 		);
 		XSSFWorkbook wb = new XSSFWorkbook(pkg);
@@ -71,7 +71,7 @@
 	}
 	
 	public void testExtended() throws Exception {
-		org.apache.poi.openxml4j.opc.Package pkg = Package.open(
+		OPCPackage pkg = OPCPackage.open(
 				(new File(dirname, "ExcelWithAttachments.xlsx")).toString()
 		);
 		XSSFWorkbook wb = new XSSFWorkbook(pkg);

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java?rev=755699&r1=755698&r2=755699&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/extractor/TestExtractorFactory.java Wed Mar 18 18:54:01 2009
@@ -34,7 +34,7 @@
 import junit.framework.TestCase;
 
 import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
-import org.apache.poi.openxml4j.opc.Package;
+import org.apache.poi.openxml4j.opc.OPCPackage;
 
 /**
  * Test that the extractor factory plays nicely
@@ -276,34 +276,34 @@
 	public void testPackage() throws Exception {
 		// Excel
 		assertTrue(
-				ExtractorFactory.createExtractor(Package.open(xlsx.toString()))
+				ExtractorFactory.createExtractor(OPCPackage.open(xlsx.toString()))
 				instanceof XSSFExcelExtractor
 		);
 		assertTrue(
-				ExtractorFactory.createExtractor(Package.open(xlsx.toString())).getText().length() > 200
+				ExtractorFactory.createExtractor(OPCPackage.open(xlsx.toString())).getText().length() > 200
 		);
 		
 		// Word
 		assertTrue(
-				ExtractorFactory.createExtractor(Package.open(docx.toString()))
+				ExtractorFactory.createExtractor(OPCPackage.open(docx.toString()))
 				instanceof XWPFWordExtractor
 		);
 		assertTrue(
-				ExtractorFactory.createExtractor(Package.open(docx.toString())).getText().length() > 120
+				ExtractorFactory.createExtractor(OPCPackage.open(docx.toString())).getText().length() > 120
 		);
 		
 		// PowerPoint
 		assertTrue(
-				ExtractorFactory.createExtractor(Package.open(pptx.toString()))
+				ExtractorFactory.createExtractor(OPCPackage.open(pptx.toString()))
 				instanceof XSLFPowerPointExtractor
 		);
 		assertTrue(
-				ExtractorFactory.createExtractor(Package.open(pptx.toString())).getText().length() > 120
+				ExtractorFactory.createExtractor(OPCPackage.open(pptx.toString())).getText().length() > 120
 		);
 		
 		// Text
 		try {
-			ExtractorFactory.createExtractor(Package.open(txt.toString()));
+			ExtractorFactory.createExtractor(OPCPackage.open(txt.toString()));
 			fail();
 		} catch(InvalidOperationException e) {
 			// Good



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


Mime
View raw message