[dna-commits] DNA SVN: r291 - in trunk: sequencers and 28 other directories.

dna-commits at lists.jboss.org dna-commits at lists.jboss.org
Mon Jun 16 16:31:26 EDT 2008


Author: rhauch
Date: 2008-06-16 16:31:26 -0400 (Mon, 16 Jun 2008)
New Revision: 291

Added:
   trunk/sequencers/dna-sequencer-msoffice/
   trunk/sequencers/dna-sequencer-msoffice/.classpath
   trunk/sequencers/dna-sequencer-msoffice/.project
   trunk/sequencers/dna-sequencer-msoffice/dna-sequencer-msoffice.iml
   trunk/sequencers/dna-sequencer-msoffice/pom.xml
   trunk/sequencers/dna-sequencer-msoffice/src/
   trunk/sequencers/dna-sequencer-msoffice/src/main/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadata.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataReader.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataSequencer.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadata.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReader.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReader.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/SlideMetadata.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadata.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadataReader.java
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/log4j.properties
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.properties
   trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/msoffice.cnd
   trunk/sequencers/dna-sequencer-msoffice/src/test/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18nTest.java
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataTest.java
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/excel/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReaderTest.java
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/powerpoint/
   trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReaderTest.java
   trunk/sequencers/dna-sequencer-msoffice/src/test/resources/
   trunk/sequencers/dna-sequencer-msoffice/src/test/resources/excel.xls
   trunk/sequencers/dna-sequencer-msoffice/src/test/resources/powerpoint.ppt
   trunk/sequencers/dna-sequencer-msoffice/src/test/resources/word.doc
Modified:
   trunk/pom.xml
Log:
Added new Microsoft Office document sequencer, contributed by Michael Trezzi

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2008-06-16 19:10:52 UTC (rev 290)
+++ trunk/pom.xml	2008-06-16 20:31:26 UTC (rev 291)
@@ -65,6 +65,7 @@
 		<!--module>sequencers/dna-sequencer-esbMessage</module-->
 		<module>sequencers/dna-sequencer-cnd</module>
 		<module>sequencers/dna-sequencer-java</module>
+		<module>sequencers/dna-sequencer-msoffice</module>
 		<module>connectors/dna-connector-jbosscache</module>
     	<module>dna-integration-tests</module>
 	</modules>


Property changes on: trunk/sequencers/dna-sequencer-msoffice
___________________________________________________________________
Name: svn:ignore
   + target


Added: trunk/sequencers/dna-sequencer-msoffice/.classpath
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/.classpath	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/.classpath	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+  <classpathentry kind="src" path="src/main/java"/>
+    <classpathentry kind="src" path="src/main/resources"/>
+  <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+  <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+  <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+  <classpathentry kind="output" path="target/classes"/>
+</classpath>
\ No newline at end of file

Added: trunk/sequencers/dna-sequencer-msoffice/.project
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/.project	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/.project	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>dna-sequencer-msoffice</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+	</natures>
+</projectDescription>

Added: trunk/sequencers/dna-sequencer-msoffice/dna-sequencer-msoffice.iml
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/dna-sequencer-msoffice.iml	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/dna-sequencer-msoffice.iml	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <exclude-output />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/resources" isTestSource="true" />
+      <excludeFolder url="file://$MODULE_DIR$/target/classes" />
+      <excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
+      <excludeFolder url="file://$MODULE_DIR$/target/surefire-reports" />
+      <excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="dna-common" exported="" />
+    <orderEntry type="module-library" exported="">
+      <library name="org.slf4j:slf4j-api:1.4.3">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/slf4j/slf4j-api/1.4.3/slf4j-api-1.4.3-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library name="net.jcip:jcip-annotations:1.0">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="dna-spi" exported="" />
+    <orderEntry type="module-library" exported="">
+      <library name="joda-time:joda-time:1.4">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/joda-time/joda-time/1.4/joda-time-1.4.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/joda-time/joda-time/1.4/joda-time-1.4-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/joda-time/joda-time/1.4/joda-time-1.4-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library name="org.apache.poi:poi:3.1-beta2">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/apache/poi/poi/3.1-beta2/poi-3.1-beta2.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/apache/poi/poi/3.1-beta2/poi-3.1-beta2-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/apache/poi/poi/3.1-beta2/poi-3.1-beta2-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library name="commons-logging:commons-logging:1.1">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library name="log4j:log4j:1.2.14">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library name="org.apache.poi:poi-scratchpad:3.1-beta2">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/apache/poi/poi-scratchpad/3.1-beta2/poi-scratchpad-3.1-beta2.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/apache/poi/poi-scratchpad/3.1-beta2/poi-scratchpad-3.1-beta2-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/apache/poi/poi-scratchpad/3.1-beta2/poi-scratchpad-3.1-beta2-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library name="junit:junit-dep:4.4">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/junit/junit-dep/4.4/junit-dep-4.4.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/junit/junit-dep/4.4/junit-dep-4.4-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/junit/junit-dep/4.4/junit-dep-4.4-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library" exported="">
+      <library name="org.hamcrest:hamcrest-core:1.1">
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-javadoc.jar!/" />
+        </JAVADOC>
+        <SOURCES>
+          <root url="jar://$MODULE_DIR$/../../../../.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar!/" />
+        </SOURCES>
+      </library>
+    </orderEntry>
+    <orderEntryProperties />
+  </component>
+</module>
+

Added: trunk/sequencers/dna-sequencer-msoffice/pom.xml
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/pom.xml	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/pom.xml	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,64 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>dna</artifactId>
+    <groupId>org.jboss.dna</groupId>
+    <version>0.2-SNAPSHOT</version>
+    <relativePath>../..</relativePath>
+  </parent>
+  <!-- The groupId and version values are inherited from parent -->
+  <artifactId>dna-sequencer-msoffice</artifactId>
+  <packaging>jar</packaging>
+  <name>JBoss DNA Microsoft Office Sequencer</name>
+  <description>JBoss DNA Sequencer that processes Microsoft Office files and searches for common metadata</description>
+  <url>http://labs.jboss.org/dna</url>
+  <dependencies>
+    <dependency>
+      <groupId>org.jboss.dna</groupId>
+      <artifactId>dna-common</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.dna</groupId>
+      <artifactId>dna-common</artifactId>
+      <version>${dna-version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.dna</groupId>
+      <artifactId>dna-spi</artifactId>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.poi</groupId>
+        <artifactId>poi</artifactId>
+        <version>3.1-beta2</version>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.poi</groupId>
+        <artifactId>poi-scratchpad</artifactId>
+        <version>3.1-beta2</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit-dep</artifactId>
+      <version>4.4</version>
+    </dependency>
+    <!-- 
+    Logging (require SLF4J API for compiling, but use Log4J and its SLF4J binding for testing) 
+    -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-log4j12</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadata.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadata.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadata.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice;
+
+import java.util.Date;
+import org.apache.poi.hpsf.PropertySetFactory;
+import org.apache.poi.hpsf.SummaryInformation;
+import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
+import org.apache.poi.poifs.eventfilesystem.POIFSReaderListener;
+import org.jboss.dna.common.util.Logger;
+
+public class MSOfficeMetadata implements POIFSReaderListener {
+
+    private String title;
+    private String subject;
+    private String author;
+    private String keywords;
+    private String comment;
+    private String template;
+    private Date lastSavedBy;
+    private String revision;
+    private Long totalEditingTime;
+    private Date lastPrinted;
+    private Date created;
+    private Date saved;
+    private int pages;
+    private int words;
+    private int characters;
+    private String creatingApplication;
+    private byte[] thumbnail;
+
+    public void processPOIFSReaderEvent( POIFSReaderEvent event ) {
+        try {
+            SummaryInformation si = (SummaryInformation)PropertySetFactory.create(event.getStream());
+            title = si.getTitle();
+            subject = si.getSubject();
+            author = si.getAuthor();
+            keywords = si.getKeywords();
+            comment = si.getComments();
+            template = si.getTemplate();
+            lastSavedBy = si.getLastSaveDateTime();
+            revision = si.getRevNumber();
+            totalEditingTime = si.getEditTime();
+            lastPrinted = si.getLastPrinted();
+            created = si.getCreateDateTime();
+            saved = si.getLastSaveDateTime();
+            pages = si.getPageCount();
+            words = si.getWordCount();
+            characters = si.getCharCount();
+            creatingApplication = si.getApplicationName();
+            thumbnail = si.getThumbnail();
+        } catch (Exception ex) {
+            Logger.getLogger(this.getClass()).debug(ex, "Error processing the metadata for the MS Office document");
+        }
+
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public String getSubject() {
+        return subject;
+    }
+
+    public String getAuthor() {
+        return author;
+    }
+
+    public String getKeywords() {
+        return keywords;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public String getTemplate() {
+        return template;
+    }
+
+    public Date getLastSavedBy() {
+        return lastSavedBy;
+    }
+
+    public String getRevision() {
+        return revision;
+    }
+
+    public Long getTotalEditingTime() {
+        return totalEditingTime;
+    }
+
+    public Date getLastPrinted() {
+        return lastPrinted;
+    }
+
+    public Date getCreated() {
+        return created;
+    }
+
+    public Date getSaved() {
+        return saved;
+    }
+
+    public int getPages() {
+        return pages;
+    }
+
+    public int getWords() {
+        return words;
+    }
+
+    public int getCharacters() {
+        return characters;
+    }
+
+    public String getCreatingApplication() {
+        return creatingApplication;
+    }
+
+    public byte[] getThumbnail() {
+        return thumbnail;
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice;
+
+import org.jboss.dna.common.i18n.I18n;
+
+import java.util.Locale;
+import java.util.Set;
+
+/**
+ * @author Randall Hauch
+ */
+public final class MSOfficeMetadataI18n {
+
+    public static I18n sequencerTaskName;
+
+    static {
+        try {
+            I18n.initialize(MSOfficeMetadataI18n.class);
+        } catch (final Exception err) {
+            System.err.println(err);
+        }
+    }
+
+    public static Set<Locale> getLocalizationProblemLocales() {
+        return I18n.getLocalizationProblemLocales(MSOfficeMetadataI18n.class);
+    }
+
+    public static Set<String> getLocalizationProblems() {
+        return I18n.getLocalizationProblems(MSOfficeMetadataI18n.class);
+    }
+
+    public static Set<String> getLocalizationProblems( Locale locale ) {
+        return I18n.getLocalizationProblems(MSOfficeMetadataI18n.class, locale);
+    }
+}
\ No newline at end of file

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataReader.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataReader.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataReader.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,48 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice;
+
+
+import java.io.InputStream;
+import org.apache.poi.poifs.eventfilesystem.*;
+
+
+/**
+ * Utility for extracting metadata from Excel files
+ * @author Michael Trezzi
+ */
+public class MSOfficeMetadataReader {
+
+     public static MSOfficeMetadata instance( InputStream stream ) {
+        try {
+            POIFSReader r = new POIFSReader();
+            MSOfficeMetadata MSOfficeMetadataListener = new MSOfficeMetadata();
+            r.registerListener(MSOfficeMetadataListener, "\005SummaryInformation");
+            r.read(stream);
+            return MSOfficeMetadataListener;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataSequencer.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataSequencer.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataSequencer.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import org.jboss.dna.common.monitor.ProgressMonitor;
+import org.jboss.dna.common.util.Logger;
+import org.jboss.dna.sequencer.msoffice.excel.ExcelMetadata;
+import org.jboss.dna.sequencer.msoffice.excel.ExcelMetadataReader;
+import org.jboss.dna.sequencer.msoffice.powerpoint.PowerPointMetadataReader;
+import org.jboss.dna.sequencer.msoffice.powerpoint.SlideMetadata;
+import org.jboss.dna.sequencer.msoffice.word.WordMetadataReader;
+import org.jboss.dna.spi.sequencers.SequencerOutput;
+import org.jboss.dna.spi.sequencers.StreamSequencer;
+
+/**
+ * A sequencer that processes the content of an MS Office document, extracts the metadata for the file, and then writes that
+ * metadata to the repository.
+ * <p>
+ * This sequencer produces data that corresponds to the following structure:
+ * <ul>
+ * <li><strong>msoffice:metadata</strong> node of type <code>msoffice:metadata</code>
+ * <ul>
+ * <li><strong>msoffice:title</strong> optional string property for the title of the documnt</li>
+ * <li><strong>msoffice:subject</strong> optional string property for the subject of the document</li>
+ * <li><strong>msoffice:author</strong> optional string property for the author of the document</li>
+ * <li><strong>msoffice:keywords</strong> optional string property for the document keywords</li>
+ * <li><strong>msoffice:comment</strong> optional string property for the document comment</li>
+ * <li><strong>msoffice:template</strong> optional string property for the template from which this document originates</li>
+ * <li><strong>msoffice:last_saved_by</strong> optional string property for the person that last saved this document</li>
+ * <li><strong>msoffice:revision</strong> optional string property for this document revision</li>
+ * <li><strong>msoffice:total_editing_time</strong> optional long property for the length this document has been edited</li>
+ * <li><strong>msoffice:last_printed</strong> optional date property for the date of last printing this document</li>
+ * <li><strong>msoffice:created</strong> date property for the date of creation of the document</li>
+ * <li><strong>msoffice:saved</strong> date property for the date of last save of this document</li>
+ * <li><strong>msoffice:pages</strong> long property for the number of pages of this document</li>
+ * <li><strong>msoffice:words</strong> long property for the number of words in this document</li>
+ * <li><strong>msoffice:characters</strong> long property for the number of characters in this document</li>
+ * <li><strong>msoffice:creating_application</strong> string property for the application used to create this document</li>
+ * <li><strong>msoffice:thumbnail</strong> optional binary property for the thumbanail of this document</li>
+ * <li><strong>msoffice:full_contents</strong> optional String property holding the text contents of an excel file</li>
+ * <li><strong>msoffice:sheet_name</strong> optional String property for the name of a sheet in excel (multiple)</li>
+ * </ul>
+ * </li>
+ * <li><strong>msoffice:slide</strong> node of type <code>msoffice:pptslide</code>
+ * <ul>
+ * <li><strong>msoffice:title</strong> optional String property for the title of a slide</li>
+ * <li><strong>msoffice:notes</strong> optional String property for the notes of a slide</li>
+ * <li><strong>msoffice:text</strong> optional String property for the text of a slide</li>
+ * <li><strong>msoffice:thumbnail</strong> optional binary property for the thumbnail of a slide (PNG image)</li>
+ * </ul>
+ * </li>
+ * </ul>
+ * </p>
+ * 
+ * @author Michael Trezzi
+ */
+public class MSOfficeMetadataSequencer implements StreamSequencer {
+
+    public static final String METADATA_NODE = "msoffice:metadata";
+    public static final String MSOFFICE_PRIMARY_TYPE = "jcr:primaryType";
+    public static final String MSOFFICE_TITLE = "msoffice:title";
+    public static final String MSOFFICE_SUBJECT = "msoffice:subject";
+    public static final String MSOFFICE_AUTHOR = "msoffice:author";
+    public static final String MSOFFICE_KEYWORDS = "msoffice:keywords";
+    public static final String MSOFFICE_COMMENT = "msoffice:comment";
+    public static final String MSOFFICE_TEMPLATE = "msoffice:template";
+    public static final String MSOFFICE_LAST_SAVED_BY = "msoffice:last_saved_by";
+    public static final String MSOFFICE_REVISION = "msoffice:revision";
+    public static final String MSOFFICE_TOTAL_EDITING_TIME = "msoffice:total_editing_time";
+    public static final String MSOFFICE_LAST_PRINTED = "msoffice:last_printed";
+    public static final String MSOFFICE_CREATED = "msoffice:created";
+    public static final String MSOFFICE_SAVED = "msoffice:saved";
+    public static final String MSOFFICE_PAGES = "msoffice:pages";
+    public static final String MSOFFICE_WORDS = "msoffice:words";
+    public static final String MSOFFICE_CHARACTERS = "msoffice:characters";
+    public static final String MSOFFICE_CREATING_APPLICATION = "msoffice:creating_application";
+    public static final String MSOFFICE_THUMBNAIL = "msoffice:thumbnail";
+
+    // PowerPoint specific
+    public static final String POWERPOINT_SLIDE_NODE = "msoffice:slide";
+    public static final String SLIDE_TITLE = "msoffice:title";
+    public static final String SLIDE_TEXT = "msoffice:text";
+    public static final String SLIDE_NOTES = "msoffice:notes";
+    public static final String SLIDE_THUMBNAIL = "msoffice:thumbnail";
+
+    // Excel specific
+    public static final String EXCEL_FULL_CONTENT = "msoffice:full_contents";
+    public static final String EXCEL_SHEET_NAME = "msoffice:sheet_name";
+
+    /**
+     * {@inheritDoc}
+     */
+    public void sequence( InputStream stream,
+                          SequencerOutput output,
+                          ProgressMonitor progressMonitor ) {
+        progressMonitor.beginTask(10, MSOfficeMetadataI18n.sequencerTaskName);
+
+        MSOfficeMetadata metadata = MSOfficeMetadataReader.instance(stream);
+        progressMonitor.worked(3);
+
+        // TODO
+        String mimeType = "get mimetype here"; // This will be finished when the Sequencing Context class is done
+
+        if (metadata != null) {
+            output.setProperty(METADATA_NODE, MSOFFICE_PRIMARY_TYPE, "msoffice:metadata");
+            output.setProperty(METADATA_NODE, MSOFFICE_TITLE, metadata.getTitle());
+            output.setProperty(METADATA_NODE, MSOFFICE_SUBJECT, metadata.getSubject());
+            output.setProperty(METADATA_NODE, MSOFFICE_AUTHOR, metadata.getAuthor());
+            output.setProperty(METADATA_NODE, MSOFFICE_KEYWORDS, metadata.getKeywords());
+            output.setProperty(METADATA_NODE, MSOFFICE_COMMENT, metadata.getComment());
+            output.setProperty(METADATA_NODE, MSOFFICE_TEMPLATE, metadata.getTemplate());
+            output.setProperty(METADATA_NODE, MSOFFICE_LAST_SAVED_BY, metadata.getLastSavedBy());
+            output.setProperty(METADATA_NODE, MSOFFICE_REVISION, metadata.getRevision());
+            output.setProperty(METADATA_NODE, MSOFFICE_TOTAL_EDITING_TIME, metadata.getTotalEditingTime());
+            output.setProperty(METADATA_NODE, MSOFFICE_LAST_PRINTED, metadata.getLastPrinted());
+            output.setProperty(METADATA_NODE, MSOFFICE_CREATED, metadata.getCreated());
+            output.setProperty(METADATA_NODE, MSOFFICE_SAVED, metadata.getSaved());
+            output.setProperty(METADATA_NODE, MSOFFICE_PAGES, metadata.getPages());
+            output.setProperty(METADATA_NODE, MSOFFICE_WORDS, metadata.getWords());
+            output.setProperty(METADATA_NODE, MSOFFICE_CHARACTERS, metadata.getCharacters());
+            output.setProperty(METADATA_NODE, MSOFFICE_CREATING_APPLICATION, metadata.getCreatingApplication());
+            output.setProperty(METADATA_NODE, MSOFFICE_THUMBNAIL, metadata.getThumbnail());
+
+        } else {
+            return;
+        }
+        progressMonitor.worked(1);
+        // process PowerPoint specific metadata
+        if (mimeType.equals("application/vnd.ms-powerpoint")) { // replace true with check if it's ppt file being sequenced
+            try {
+                List<SlideMetadata> ppt_metadata = PowerPointMetadataReader.instance(stream);
+                if (ppt_metadata != null) {
+                    for (SlideMetadata sm : ppt_metadata) {
+                        output.setProperty(METADATA_NODE + "/" + POWERPOINT_SLIDE_NODE, SLIDE_TITLE, sm.getTitle());
+                        output.setProperty(METADATA_NODE + "/" + POWERPOINT_SLIDE_NODE, SLIDE_TEXT, sm.getText());
+                        output.setProperty(METADATA_NODE + "/" + POWERPOINT_SLIDE_NODE, SLIDE_NOTES, sm.getNotes());
+                        output.setProperty(METADATA_NODE + "/" + POWERPOINT_SLIDE_NODE, SLIDE_THUMBNAIL, sm.getThumbnail());
+                    }
+                }
+            } catch (IOException e) {
+                // There was an error reading, so log and continue ...
+                Logger.getLogger(this.getClass()).debug(e, "Error while extracting the PowerPoint metadata");
+            }
+        }
+        progressMonitor.worked(2);
+
+        if (mimeType.equals("application/vnd.ms-word")) {
+            // Sometime in the future this will sequence WORD Table of contents.
+            try {
+                /*WordMetadata wordMetadata =*/WordMetadataReader.invoke(stream);
+            } catch (IOException e) {
+                // There was an error reading, so log and continue ...
+                Logger.getLogger(this.getClass()).debug(e, "Error while extracting the Word document metadata");
+            }
+
+        }
+        progressMonitor.worked(2);
+
+        if (mimeType.equals("application/vnd.ms-excel")) {
+            try {
+                ExcelMetadata excel_metadata = ExcelMetadataReader.instance(stream);
+                if (excel_metadata != null) {
+                    output.setProperty(METADATA_NODE, EXCEL_FULL_CONTENT, excel_metadata.getText());
+                    for (String sheet : excel_metadata.getSheets()) {
+                        output.setProperty(METADATA_NODE, EXCEL_SHEET_NAME, sheet);
+                    }
+                }
+            } catch (IOException e) {
+                // There was an error reading, so log and continue ...
+                Logger.getLogger(this.getClass()).debug(e, "Error while extracting the Excel metadata");
+            }
+        }
+        progressMonitor.worked(2);
+        progressMonitor.done();
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadata.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadata.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadata.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice.excel;
+
+import java.util.List;
+
+/**
+ * @author Michael Trezzi
+ * @description Metadata for Excel (Full text contents and list of sheet names
+ */
+public class ExcelMetadata {
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    public List<String> getSheets() {
+        return sheets;
+    }
+
+    public void setSheets(List<String> sheets) {
+        this.sheets = sheets;
+    }
+
+    private String text;
+    private List<String> sheets;
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReader.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReader.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReader.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice.excel;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.poi.hssf.extractor.ExcelExtractor;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
+
+/**
+ * @author Michael Trezzi
+ * @description Extracts data and some metadata from excel files
+ */
+public class ExcelMetadataReader {
+
+    public static ExcelMetadata instance( InputStream stream ) throws IOException {
+        ExcelMetadata metadata = new ExcelMetadata();
+        HSSFWorkbook wb = new HSSFWorkbook(new POIFSFileSystem(stream));
+        ExcelExtractor extractor = new ExcelExtractor(wb);
+
+        extractor.setFormulasNotResults(true);
+        extractor.setIncludeSheetNames(false);
+        metadata.setText(extractor.getText());
+        List<String> sheets = new ArrayList<String>();
+        for (int i = 0; i < wb.getNumberOfSheets(); i++) {
+            sheets.add(wb.getSheetName(i));
+        }
+        metadata.setSheets(sheets);
+        return metadata;
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReader.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReader.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReader.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice.powerpoint;
+
+import java.util.List;
+import java.io.*;
+import java.awt.image.BufferedImage;
+import java.awt.*;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import org.apache.poi.hslf.usermodel.SlideShow;
+import org.apache.poi.hslf.model.Slide;
+import org.apache.poi.hslf.model.TextRun;
+
+/**
+ * Utility for extracting metadata from PowerPoint files
+ * 
+ * @author Michael Trezzi
+ */
+public class PowerPointMetadataReader {
+
+    public static List<SlideMetadata> instance( InputStream stream ) throws IOException {
+        SlideShow slideshow = new SlideShow(stream);
+        Slide[] slides = slideshow.getSlides();
+
+        List<SlideMetadata> slidesMetadata = new ArrayList<SlideMetadata>();
+
+        for (Slide slide : slides) {
+            SlideMetadata slideMetadata = new SlideMetadata();
+            // process title
+            slideMetadata.setTitle(slide.getTitle());
+
+            // process notes
+            for (TextRun textRun : slide.getNotesSheet().getTextRuns()) {
+                if (slideMetadata.getNotes() == null) {
+                    slideMetadata.setNotes("");
+                }
+                slideMetadata.setNotes(slideMetadata.getNotes() + textRun.getText());
+            }
+            // process text
+            for (TextRun textRun : slide.getTextRuns()) {
+                if (!textRun.getText().equals(slideMetadata.getTitle()) && textRun.getText() != null) {
+                    if (slideMetadata.getText() == null) {
+                        slideMetadata.setText("");
+                    }
+                    slideMetadata.setText(slideMetadata.getText() + textRun.getText());
+                }
+            }
+
+            // process thumbnail
+            Dimension pgsize = slideshow.getPageSize();
+
+            BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB);
+            Graphics2D graphics = img.createGraphics();
+            // clear the drawing area
+            graphics.setPaint(Color.white);
+            graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
+
+            // render
+            slide.draw(graphics);
+
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            javax.imageio.ImageIO.write(img, "png", out);
+            slideMetadata.setThumbnail(out.toByteArray());
+
+            slidesMetadata.add(slideMetadata);
+
+        }
+
+        return slidesMetadata;
+    }
+
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/SlideMetadata.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/SlideMetadata.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/powerpoint/SlideMetadata.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice.powerpoint;
+
+/**
+ * @author Michael Trezzi
+ */
+public class SlideMetadata {
+    private String title;
+    private String text;
+    private byte[] thumbnail;
+    private String notes;
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    public byte[] getThumbnail() {
+        return thumbnail;
+    }
+
+    public void setThumbnail(byte[] thumbnail) {
+        this.thumbnail = thumbnail;
+    }
+
+
+    public String getNotes() {
+        return notes;
+    }
+
+    public void setNotes(String notes) {
+        this.notes = notes;
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadata.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadata.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadata.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.dna.sequencer.msoffice.word;
+
+/**
+ * @author Michael Trezzi
+ */
+public class WordMetadata {
+
+
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadataReader.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadataReader.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/java/org/jboss/dna/sequencer/msoffice/word/WordMetadataReader.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.dna.sequencer.msoffice.word;
+
+import java.io.IOException;
+import java.io.InputStream;
+import org.apache.poi.hwpf.HWPFDocument;
+
+/**
+ * Reades table of contents from Word document
+ * 
+ * @author Michael Trezzi
+ */
+public class WordMetadataReader {
+
+    @SuppressWarnings( "null" )
+    public static WordMetadata invoke( InputStream stream ) throws IOException {
+        WordMetadata metadata = new WordMetadata();
+        HWPFDocument document = new HWPFDocument(stream);
+        if (document != null) {
+            // TODO
+        }
+        return metadata;
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/resources/log4j.properties
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/resources/log4j.properties	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/resources/log4j.properties	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,12 @@
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %m%n
+
+# Root logger option
+log4j.rootLogger=INFO, stdout
+
+# Set up the default logging to be INFO level, then override specific units
+log4j.logger.org.jboss.dna=INFO
+

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.properties
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.properties	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18n.properties	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,22 @@
+#
+# JBoss, Home of Professional Open Source.
+# Copyright 2008, Red Hat Middleware LLC, and individual contributors
+# as indicated by the @author tags. See the copyright.txt file in the
+# distribution for a full listing of individual contributors.
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+sequencerTaskName = Processing document contents

Added: trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/msoffice.cnd
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/msoffice.cnd	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/main/resources/org/jboss/dna/sequencer/msoffice/msoffice.cnd	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+//------------------------------------------------------------------------------
+// N A M E S P A C E S
+//------------------------------------------------------------------------------
+<jcr='http://www.jcp.org/jcr/1.0'>
+<nt='http://www.jcp.org/jcr/nt/1.0'>
+<mix='http://www.jcp.org/jcr/mix/1.0'>
+<msoffice='http://jboss.org/dna/msoffice/1.0'>
+
+// ----------------------------------------------------------
+// JCR Pre-defined Mixin Types that are not loaded by default
+// ----------------------------------------------------------
+
+[mix:mimeType] mixin
+  - jcr:mimeType (string)
+  - jcr:encoding (string)
+
+
+//------------------------------------------------------------------------------
+// N O D E T Y P E S
+//------------------------------------------------------------------------------
+
+[msoffice:metadata] > nt:unstructured, mix:mimeTyped
+  - msoffice:title (string)
+  - msoffice:subject (string)
+  - msoffice:author (string)
+  - msoffice:keywords (string)
+  - msoffice:comment (string)
+  - msoffice:template (string)
+  - msoffice:last_saved_by (string)
+  - msoffice:revision (string)
+  - msoffice:total_editing_time (long)
+  - msoffice:last_printed (date)
+  - msoffice:created (date)
+  - msoffice:saved (date)
+  - msoffice:pages (long)
+  - msoffice:words (long)
+  - msoffice:characters (long)
+  - msoffice:creating_application (string)
+  - msoffice:thumbnail (binary)
+
+// PowerPoint specific data
+  + msoffice:slide (msoffice:pptslide) multiple
+
+// Excel specific data
+  - msoffice:full_content (string)
+  - msoffice:sheet_name (string) multiple
+
+[msoffice:pptslide]
+  - msoffice:title (string)
+  - msoffice:text (string)
+  - msoffice:thumbnail (binary)
+
+

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18nTest.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18nTest.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataI18nTest.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,34 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors. 
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice;
+
+import org.jboss.dna.common.AbstractI18nTest;
+
+/**
+ * @author Randall Hauch
+ */
+public class MSOfficeMetadataI18nTest extends AbstractI18nTest {
+
+    public MSOfficeMetadataI18nTest() {
+        super(MSOfficeMetadataI18n.class);
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataTest.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataTest.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/MSOfficeMetadataTest.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice;
+
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import java.io.InputStream;
+import org.junit.After;
+import org.junit.Test;
+
+public class MSOfficeMetadataTest {
+
+    private MSOfficeMetadata MSOfficeMetadata;
+    private InputStream imageStream;
+
+    @After
+    public void afterEach() throws Exception {
+        if (imageStream != null) {
+            try {
+                imageStream.close();
+            } finally {
+                imageStream = null;
+            }
+        }
+    }
+
+    protected InputStream getTestDocument( String resourcePath ) {
+        return this.getClass().getResourceAsStream("/" + resourcePath);
+    }
+
+    @Test
+    public void shouldBeAbleToCreateMetadataForWord() {
+        MSOfficeMetadata = MSOfficeMetadataReader.instance(this.getTestDocument("word.doc"));
+        assertThat(MSOfficeMetadata.getComment(), is("Test Comment"));
+        assertThat(MSOfficeMetadata.getAuthor(), is("Michael Trezzi"));
+        assertThat(MSOfficeMetadata.getKeywords(), is("jboss, test, dna"));
+        assertThat(MSOfficeMetadata.getTitle(), is("Test Document"));
+        assertThat(MSOfficeMetadata.getSubject(), is("Test Subject"));
+    }
+
+}
+

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReaderTest.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReaderTest.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/excel/ExcelMetadataReaderTest.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors. 
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.dna.sequencer.msoffice.excel;
+
+import static org.hamcrest.core.Is.is;
+import org.junit.After;
+import static org.junit.Assert.assertThat;
+import org.junit.Test;
+import java.io.InputStream;
+
+/**
+ * @author Michael Trezzi
+ */
+public class ExcelMetadataReaderTest {
+
+    private ExcelMetadata excelReader;
+    private InputStream imageStream;
+
+    @After
+    public void afterEach() throws Exception {
+        if (imageStream != null) {
+            try {
+                imageStream.close();
+            } finally {
+                imageStream = null;
+            }
+        }
+    }
+
+    protected InputStream getTestDocument( String resourcePath ) {
+        return this.getClass().getResourceAsStream("/" + resourcePath);
+    }
+
+    @Test
+    public void shouldBeAbleToCreateMetadataForExcel() throws Exception {
+        excelReader = ExcelMetadataReader.instance(this.getTestDocument("excel.xls"));
+        assertThat(excelReader.getSheets().contains("MySheet2"), is(true));
+        assertThat(excelReader.getText().startsWith("This is a text"), is(true));
+
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReaderTest.java
===================================================================
--- trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReaderTest.java	                        (rev 0)
+++ trunk/sequencers/dna-sequencer-msoffice/src/test/java/org/jboss/dna/sequencer/msoffice/powerpoint/PowerPointMetadataReaderTest.java	2008-06-16 20:31:26 UTC (rev 291)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.dna.sequencer.msoffice.powerpoint;
+
+import static org.hamcrest.core.Is.is;
+import org.junit.After;
+import static org.junit.Assert.assertThat;
+import org.junit.Test;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.util.List;
+
+/**
+ * @author Michael Trezzi
+ */
+public class PowerPointMetadataReaderTest {
+
+    private List<SlideMetadata> pptReader;
+    private InputStream imageStream;
+
+    @After
+    public void afterEach() throws Exception {
+        if (imageStream != null) {
+            try {
+                imageStream.close();
+            } finally {
+                imageStream = null;
+            }
+        }
+    }
+
+    protected InputStream getTestDocument( String resourcePath ) {
+        return this.getClass().getResourceAsStream("/" + resourcePath);
+    }
+
+    @Test
+    public void shouldBeAbleToCreateMetadataForPowerPoint() throws Exception {
+        pptReader = PowerPointMetadataReader.instance(this.getTestDocument("powerpoint.ppt"));
+        SlideMetadata slide = pptReader.get(0);
+        assertThat(slide.getTitle(), is("Test Slide"));
+        assertThat(slide.getText(), is("This is some text"));
+        assertThat(slide.getNotes(), is("My notes"));
+        try {
+            FileOutputStream out = new FileOutputStream("slide.png");
+            out.write(slide.getThumbnail());
+            out.close();
+
+            File f = new File("slide.png");
+            assertThat(f.exists(), is(true));
+            f.delete();
+        } catch (Exception e) {
+            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+        }
+
+    }
+}

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/resources/excel.xls
===================================================================
(Binary files differ)


Property changes on: trunk/sequencers/dna-sequencer-msoffice/src/test/resources/excel.xls
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/resources/powerpoint.ppt
===================================================================
(Binary files differ)


Property changes on: trunk/sequencers/dna-sequencer-msoffice/src/test/resources/powerpoint.ppt
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/sequencers/dna-sequencer-msoffice/src/test/resources/word.doc
===================================================================
(Binary files differ)


Property changes on: trunk/sequencers/dna-sequencer-msoffice/src/test/resources/word.doc
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream




More information about the dna-commits mailing list