incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svanteschub...@apache.org
Subject svn commit: r1418326 [1/8] - in /incubator/odf/trunk: ./ odfdom/ odfdom/src/main/java/org/odftoolkit/odfdom/dom/ odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/table/ odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/text/ odfdom/src/main/...
Date Fri, 07 Dec 2012 14:28:13 GMT
Author: svanteschubert
Date: Fri Dec  7 14:28:07 2012
New Revision: 1418326

URL: http://svn.apache.org/viewvc?rev=1418326&view=rev
Log:
#ODFTOOLKIT-50# Add ODF 1.2 RDF metadata support to ODF Toolkit - developer:Tao Lin, Svante Schubert, Dali Liu

Added:
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/rdfa/
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/rdfa/BookmarkRDFMetadataExtractor.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/OdfXMLHelper.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/manifest/OdfManifestDom.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/DOMAttributes.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/DOMRDFaParser.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/EvalContext.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/JenaSink.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/MultiContentHandler.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/RDFaParser.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/SAXRDFaParser.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/URIExtractor.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/URIExtractorImpl.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/rdfa/Util.java
    incubator/odf/trunk/odfdom/src/main/resources/grddl/
    incubator/odf/trunk/odfdom/src/main/resources/grddl/odf2rdf.xsl
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/pkg/GRDDLTest.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/pkg/RDFMetadataTest.java
    incubator/odf/trunk/odfdom/src/test/resources/test_rdfmeta.odt   (with props)
Modified:
    incubator/odf/trunk/odfdom/pom.xml
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/OdfSchemaDocument.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/table/TableTableCellElementBase.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/text/TextBookmarkStartElement.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/text/TextMetaElement.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/element/text/TextParagraphElementBase.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/OdfFileDom.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/OdfFileSaxHandler.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/OdfPackage.java
    incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/pkg/OdfPackageDocument.java
    incubator/odf/trunk/odfdom/src/test/java/org/odftoolkit/odfdom/utils/ResourceUtilities.java
    incubator/odf/trunk/pom.xml
    incubator/odf/trunk/simple/src/test/java/org/odftoolkit/simple/utils/ResourceUtilities.java

Modified: incubator/odf/trunk/odfdom/pom.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/pom.xml?rev=1418326&r1=1418325&r2=1418326&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/pom.xml (original)
+++ incubator/odf/trunk/odfdom/pom.xml Fri Dec  7 14:28:07 2012
@@ -1,507 +1,531 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <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>
+	<modelVersion>4.0.0</modelVersion>
 
-    <parent>
-    <groupId>org.apache.odftoolkit</groupId>
-    <artifactId>odftoolkit</artifactId>
-    <version>0.6-incubating-SNAPSHOT</version>
-    </parent>
+	<parent>
+		<groupId>org.apache.odftoolkit</groupId>
+		<artifactId>odftoolkit</artifactId>
+		<version>0.6-incubating-SNAPSHOT</version>
+	</parent>
   
-    <artifactId>odfdom-java</artifactId>
-    <version>0.8.9-incubating-SNAPSHOT</version>
-    <packaging>jar</packaging>
+	<artifactId>odfdom-java</artifactId>
+	<version>0.8.9-incubating-SNAPSHOT</version>
+	<packaging>jar</packaging>
 
-    <dependencies>
-        <dependency>
-          <groupId>${project.groupId}</groupId>
-          <artifactId>taglets</artifactId>
-          <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <version>2.9.1</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.8.1</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss</maven.build.timestamp.format>
-    </properties>
+	<dependencies>
+		<dependency>
+			<groupId>${project.groupId}</groupId>
+			<artifactId>taglets</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>xerces</groupId>
+			<artifactId>xercesImpl</artifactId>
+			<version>2.9.1</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>4.8.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.jena</groupId>
+			<artifactId>jena-arq</artifactId>
+			<version>2.9.4</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.jena</groupId>
+			<artifactId>jena-core</artifactId>
+			<classifier>tests</classifier>
+			<version>2.7.4</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.clerezza</groupId>
+			<artifactId>rdf.rdfa</artifactId>
+			<version>0.1-incubating</version>
+		</dependency>
+		<dependency>
+			<groupId>commons-validator</groupId>
+			<artifactId>commons-validator</artifactId>
+			<version>1.4.0</version>
+		</dependency>
+	</dependencies>
+	<properties>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss</maven.build.timestamp.format>
+	</properties>
 
-    <!-- Build Settings -->
-    <build>
-        <extensions>
-            <extension>
-                <groupId>org.apache.maven.wagon</groupId>
-                <artifactId>wagon-webdav-jackrabbit</artifactId>
-                <version>1.0-beta-7</version>
-            </extension>
-        </extensions>
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>2.3.2</version>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                    <meminitial>512m</meminitial>
-                    <maxmem>1024m</maxmem>
-                    <showDeprecation>true</showDeprecation>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.3.1</version>
-                <configuration>
-                    <archive>
-                        <index>true</index>
-                        <manifest>
-                            <mainClass>org.odftoolkit.odfdom.JarManifest</mainClass>
-                        </manifest>
-                        <manifestEntries>
-                            <version>${project.version}</version>
-                        </manifestEntries>
-                        <manifestSections>
-                            <manifestSection>
-                                <name>ODFDOM</name>
-                                <manifestEntries>
-                                    <ODFDOM-Name>odfdom</ODFDOM-Name>
-                                    <ODFDOM-Version>${project.version}</ODFDOM-Version>
-                                    <ODFDOM-Website>http://incubator.apache.org/odftoolkit/odfdom/index.html</ODFDOM-Website>
-                                    <ODFDOM-Built-Date>${build.timestamp}</ODFDOM-Built-Date>
-                                    <ODFDOM-Supported-Odf-Version>1.2</ODFDOM-Supported-Odf-Version>
-                                </manifestEntries>
-                            </manifestSection>
-                        </manifestSections>
-                    </archive>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-release-plugin</artifactId>
-                <version>2.1</version>
-                <configuration>
-                    <!-- Workaround for http://jira.codehaus.org/browse/MGPG-9 -->
-                    <mavenExecutorId>forked-path</mavenExecutorId>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <!-- Explizit version required for fix on systemPropertyVariables -->
-                <version>2.6</version>
-                <configuration>
-                    <systemPropertyVariables>
-                        <odfdom.version>${project.version}</odfdom.version>
-                        <odfdom.timestamp>${build.timestamp}</odfdom.timestamp>
-                        <org.odftoolkit.odfdom.validation>org.odftoolkit.odfdom.pkg.DefaultErrorHandler</org.odftoolkit.odfdom.validation>
-                    </systemPropertyVariables>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-javadoc-plugin</artifactId>
-                <version>2.7</version>
-                <configuration>
-                    <doctitle>ODFDOM</doctitle>
-                    <minmemory>1024m</minmemory>
-                    <maxmemory>1024m</maxmemory>
-                    <links>
-                        <link>http://download.oracle.com/javase/6/docs/api/</link>
-                        <link>http://xerces.apache.org/xerces-j/apiDocs/</link>
-                        <link>http://simple.odftoolkit.org/javadoc/</link>
-                    </links>
-                    <splitindex>true</splitindex>
-                    <windowtitle>ODFDOM API v${project.version} - http://incubator.apache.org/odftoolkit/</windowtitle>
-                    <taglets>
-                        <taglet>
-                            <tagletClass>org.odftoolkit.odfdom.taglet.OdfElementTaglet</tagletClass>
-                        </taglet>
-                        <taglet>
-                            <tagletClass>org.odftoolkit.odfdom.taglet.OdfAttributeTaglet</tagletClass>
-                        </taglet>
-                        <taglet>
-                            <tagletClass>org.odftoolkit.odfdom.taglet.OdfDatatypeTaglet</tagletClass>
-                        </taglet>
-                    </taglets>
-                    <tagletArtifact>
-                        <groupId>${project.groupId}</groupId>
-                        <artifactId>taglets</artifactId>
-                        <version>${project.version}</version>
-                    </tagletArtifact>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>attach-javadocs</id>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-source-plugin</artifactId>
-                <version>2.1.2</version>
-                <executions>
-                    <execution>
-                        <id>attach-sources</id>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <descriptorRefs>
-                        <descriptorRef>jar-with-dependencies</descriptorRef>
-                    </descriptorRefs>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>single</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>src/main/resources/**</exclude>
-                        <exclude>src/test/resources/**</exclude>
-                        <exclude>src/main/javadoc/doc-files/OpenDocument-v1.2-part1.html</exclude>
-                        <exclude>src/main/javadoc/doc-files/OpenDocument-v1.2-part3.html</exclude>
-                        <exclude>src/codegen/resources/dom/*.rng</exclude>
-                        <exclude>src/codegen/resources/pkg/*.rng</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-    <reporting>
-        <plugins>
-            <!-- Code Coverage Testing generated by Cobertura -->
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>cobertura-maven-plugin</artifactId>
-                <version>2.4</version>
-                <configuration>
-                    <instrumentation>
-                        <excludes>
-                            <exclude>org/odftoolkit/**/*Test.class</exclude>
-                        </excludes>
-                    </instrumentation>
-                </configuration>
-            </plugin>
+	<!-- Build Settings -->
+	<build>
+		<extensions>
+			<extension>
+				<groupId>org.apache.maven.wagon</groupId>
+				<artifactId>wagon-webdav-jackrabbit</artifactId>
+				<version>1.0-beta-7</version>
+			</extension>
+		</extensions>
+		<plugins>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>2.3.2</version>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+					<meminitial>512m</meminitial>
+					<maxmem>1024m</maxmem>
+					<showDeprecation>true</showDeprecation>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.3.1</version>
+				<configuration>
+					<archive>
+						<index>true</index>
+						<manifest>
+							<mainClass>org.odftoolkit.odfdom.JarManifest</mainClass>
+						</manifest>
+						<manifestEntries>
+							<version>${project.version}</version>
+						</manifestEntries>
+						<manifestSections>
+							<manifestSection>
+								<name>ODFDOM</name>
+								<manifestEntries>
+									<ODFDOM-Name>odfdom</ODFDOM-Name>
+									<ODFDOM-Version>${project.version}</ODFDOM-Version>
+									<ODFDOM-Website>http://incubator.apache.org/odftoolkit/odfdom/index.html</ODFDOM-Website>
+									<ODFDOM-Built-Date>${build.timestamp}</ODFDOM-Built-Date>
+									<ODFDOM-Supported-Odf-Version>1.2</ODFDOM-Supported-Odf-Version>
+								</manifestEntries>
+							</manifestSection>
+						</manifestSections>
+					</archive>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-release-plugin</artifactId>
+				<version>2.1</version>
+				<configuration>
+					<!-- Workaround for http://jira.codehaus.org/browse/MGPG-9 -->
+					<mavenExecutorId>forked-path</mavenExecutorId>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<!-- Explizit version required for fix on systemPropertyVariables -->
+				<version>2.6</version>
+				<configuration>
+					<forkMode>pertest</forkMode>
+					<argLine>-Xms512m -Xmx512m</argLine>
+					<systemPropertyVariables>
+						<odfdom.version>${project.version}</odfdom.version>
+						<odfdom.timestamp>${build.timestamp}</odfdom.timestamp>
+						<org.odftoolkit.odfdom.validation>org.odftoolkit.odfdom.pkg.DefaultErrorHandler</org.odftoolkit.odfdom.validation>
+					</systemPropertyVariables>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-javadoc-plugin</artifactId>
+				<version>2.7</version>
+				<configuration>
+					<doctitle>ODFDOM</doctitle>
+					<minmemory>1024m</minmemory>
+					<maxmemory>1024m</maxmemory>
+					<links>
+						<link>http://download.oracle.com/javase/6/docs/api/</link>
+						<link>http://xerces.apache.org/xerces-j/apiDocs/</link>
+						<link>http://simple.odftoolkit.org/javadoc/</link>
+					</links>
+					<splitindex>true</splitindex>
+					<windowtitle>ODFDOM API v${project.version} - http://incubator.apache.org/odftoolkit/</windowtitle>
+					<taglets>
+						<taglet>
+							<tagletClass>org.odftoolkit.odfdom.taglet.OdfElementTaglet</tagletClass>
+						</taglet>
+						<taglet>
+							<tagletClass>org.odftoolkit.odfdom.taglet.OdfAttributeTaglet</tagletClass>
+						</taglet>
+						<taglet>
+							<tagletClass>org.odftoolkit.odfdom.taglet.OdfDatatypeTaglet</tagletClass>
+						</taglet>
+					</taglets>
+					<tagletArtifact>
+						<groupId>${project.groupId}</groupId>
+						<artifactId>taglets</artifactId>
+						<version>${project.version}</version>
+					</tagletArtifact>
+				</configuration>
+				<executions>
+					<execution>
+						<id>attach-javadocs</id>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-source-plugin</artifactId>
+				<version>2.1.2</version>
+				<executions>
+					<execution>
+						<id>attach-sources</id>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-assembly-plugin</artifactId>
+				<configuration>
+					<descriptorRefs>
+						<descriptorRef>jar-with-dependencies</descriptorRef>
+					</descriptorRefs>
+				</configuration>
+				<executions>
+					<execution>
+						<id>single</id>
+						<phase>package</phase>
+						<goals>
+							<goal>single</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.rat</groupId>
+				<artifactId>apache-rat-plugin</artifactId>
+				<configuration>
+					<excludes>
+						<exclude>src/main/resources/**</exclude>
+						<exclude>src/test/resources/**</exclude>
+						<exclude>src/main/javadoc/doc-files/OpenDocument-v1.2-part1.html</exclude>
+						<exclude>src/main/javadoc/doc-files/OpenDocument-v1.2-part3.html</exclude>
+						<exclude>src/codegen/resources/dom/*.rng</exclude>
+						<exclude>src/codegen/resources/pkg/*.rng</exclude>
+					</excludes>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+	<reporting>
+		<plugins>
+			<!-- Code Coverage Testing generated by Cobertura -->
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>cobertura-maven-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<instrumentation>
+						<excludes>
+							<exclude>org/odftoolkit/**/*Test.class</exclude>
+						</excludes>
+					</instrumentation>
+				</configuration>
+			</plugin>
             
-            <!-- Reporting integration test results -->
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-failsafe-plugin</artifactId>
-                <version>2.5</version>
-                <reportSets>
-                    <reportSet>
-                        <id>integration-tests</id>
-                        <reports>
-                            <report>report-only</report>
-                        </reports>
-                        <configuration>
-                            <outputName>failsafe-report</outputName>
-                        </configuration>
-                    </reportSet>
-                </reportSets>
-            </plugin>
-        </plugins>
-    </reporting>
+			<!-- Reporting integration test results -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-failsafe-plugin</artifactId>
+				<version>2.5</version>
+				<reportSets>
+					<reportSet>
+						<id>integration-tests</id>
+						<reports>
+							<report>report-only</report>
+						</reports>
+						<configuration>
+							<outputName>failsafe-report</outputName>
+						</configuration>
+					</reportSet>
+				</reportSets>
+			</plugin>
+		</plugins>
+	</reporting>
 
-    <!-- More Project Information -->
-    <name>ODFDOM</name>
-    <description>
-        ODFDOM is an OpenDocument Format (ODF) framework. Its purpose
-        is to provide an easy common way to create, access and
-        manipulate ODF files, without requiring detailed knowledge of
-        the ODF specification. It is designed to provide the ODF
-        developer community with an easy lightwork programming API
-        portable to any object-oriented language.
+	<!-- More Project Information -->
+	<name>ODFDOM</name>
+	<description>
+		ODFDOM is an OpenDocument Format (ODF) framework. Its purpose
+		is to provide an easy common way to create, access and
+		manipulate ODF files, without requiring detailed knowledge of
+		the ODF specification. It is designed to provide the ODF
+		developer community with an easy lightwork programming API
+		portable to any object-oriented language.
 
-        The current reference implementation is written in Java.
-    </description>
-    <url>http://incubator.apache.org/odftoolkit/odfdom/index.html</url>
-    <inceptionYear>2008</inceptionYear>
+		The current reference implementation is written in Java.
+	</description>
+	<url>http://incubator.apache.org/odftoolkit/odfdom/index.html</url>
+	<inceptionYear>2008</inceptionYear>
     
-    <licenses>
-        <license>
-            <name>Apache 2</name>
-            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
-        </license>
-    </licenses>
-    <organization>
-        <name>The Apache Software Foundation</name>
-        <url>http://www.apache.org/</url>
-    </organization>
-    <developers>
-        <developer>
-            <id>svanteschubert</id>
-            <name>Svante</name>
-            <email>svanteschubert AT apache.org</email>
-            <url>http://odftoolkit.org/people/7-Svante-Schubert</url>
-            <organization>Individual</organization>
-            <roles>
-                <role>ODFDOM working group chair</role>
-                <role>architect</role>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-            <properties>
-                <picUrl>http://asset-1.odftoolkit.org/attachments/images/person/SvanteSchubert-2_small.jpg</picUrl>
-            </properties>
-        </developer>
-        <developer>
-            <id>devinhan</id>
-            <name>Han Biao</name>
-            <email>devinhan AT apache.org</email>
-            <organization>IBM</organization>
-            <organizationUrl>http://www.ibm.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+8</timezone>
-        </developer>
-        <developer>
-            <id>daisyguo</id>
-            <name>Ying Chun Guo</name>
-            <email>daisyguo AT apache.org</email>
-            <url>http://odftoolkit.org/people/274-Ying-Chun-Guo</url>
-            <organization>IBM</organization>
-            <organizationUrl>http://www.ibm.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+8</timezone>
-            <properties>
-                <picUrl>http://asset-2.odftoolkit.org/attachments/images/person/Daisy.jpg</picUrl>
-            </properties>
-        </developer>
-        <developer>
-            <id>weihuaWang</id>
-            <name>Wei Hua Wang</name>
-            <email>weihuaWang AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/297-weihuaWang</url>
-            <organization>IBM</organization>
-            <organizationUrl>http://www.ibm.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+8</timezone>
-        </developer>
-        <developer>
-            <id>FrankMeies</id>
-            <name>Frank</name>
-            <email>FrankMeies AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/332-FrankMeies</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-            <properties>
-                <picUrl>http://asset-1.odftoolkit.org/attachments/images/person/FrankMeies.jpg</picUrl>
-            </properties>
-        </developer>
-        <developer>
-            <id>lars_behrmann</id>
-            <name>Lars</name>
-            <email>lars_behrmann AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/6-Lars-Behrmann</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-            <properties>
-                <picUrl>http://asset-2.odftoolkit.org/attachments/images/person/lars_behrmann_small.png</picUrl>
-            </properties>
-        </developer>
-        <developer>
-            <id>steffeng</id>
-            <name>Steffen</name>
-            <email>steffeng AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/418-steffeng</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-        </developer>
-        <developer>
-            <id>hans-peter</id>
-            <name>Hans-Peter</name>
-            <email>hans-peter AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/463-hans-peter</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-        </developer>
-        <developer>
-            <id>bei</id>
-            <name>Bernd</name>
-            <email>bei AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/16-Bernd-Eilers</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-            <properties>
-                <picUrl>http://asset-0.odftoolkit.org/attachments/images/person/bei.JPG</picUrl>
-            </properties>
-        </developer>
-        <developer>
-            <id>mst</id>
-            <name>Michael</name>
-            <email>mst AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/768-Michael-Stahl</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-        </developer>
-        <developer>
-            <id>clippka</id>
-            <name>Christian</name>
-            <email>clippka AT odftoolkit.org</email>
-            <url>http://odftoolkit.org/people/259-clippka</url>
-            <organization>Oracle Inc.</organization>
-            <organizationUrl>http://www.oracle.com/</organizationUrl>
-            <roles>
-                <role>developer</role>
-            </roles>
-            <timezone>+1</timezone>
-        </developer>
-    </developers>
+	<licenses>
+		<license>
+			<name>Apache 2</name>
+			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+		</license>
+	</licenses>
+	<organization>
+		<name>The Apache Software Foundation</name>
+		<url>http://www.apache.org/</url>
+	</organization>
+	<developers>
+		<developer>
+			<id>svanteschubert</id>
+			<name>Svante</name>
+			<email>svanteschubert AT apache.org</email>
+			<url>http://odftoolkit.org/people/7-Svante-Schubert</url>
+			<organization>Individual</organization>
+			<roles>
+				<role>ODFDOM working group chair</role>
+				<role>architect</role>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+			<properties>
+				<picUrl>http://asset-1.odftoolkit.org/attachments/images/person/SvanteSchubert-2_small.jpg</picUrl>
+			</properties>
+		</developer>
+		<developer>
+			<id>devinhan</id>
+			<name>Han Biao</name>
+			<email>devinhan AT apache.org</email>
+			<organization>IBM</organization>
+			<organizationUrl>http://www.ibm.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+8</timezone>
+		</developer>
+		<developer>
+			<id>daisyguo</id>
+			<name>Ying Chun Guo</name>
+			<email>daisyguo AT apache.org</email>
+			<url>http://odftoolkit.org/people/274-Ying-Chun-Guo</url>
+			<organization>IBM</organization>
+			<organizationUrl>http://www.ibm.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+8</timezone>
+			<properties>
+				<picUrl>http://asset-2.odftoolkit.org/attachments/images/person/Daisy.jpg</picUrl>
+			</properties>
+		</developer>
+		<developer>
+			<id>weihuaWang</id>
+			<name>Wei Hua Wang</name>
+			<email>weihuaWang AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/297-weihuaWang</url>
+			<organization>IBM</organization>
+			<organizationUrl>http://www.ibm.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+8</timezone>
+		</developer>
+		<developer>
+			<id>FrankMeies</id>
+			<name>Frank</name>
+			<email>FrankMeies AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/332-FrankMeies</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+			<properties>
+				<picUrl>http://asset-1.odftoolkit.org/attachments/images/person/FrankMeies.jpg</picUrl>
+			</properties>
+		</developer>
+		<developer>
+			<id>lars_behrmann</id>
+			<name>Lars</name>
+			<email>lars_behrmann AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/6-Lars-Behrmann</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+			<properties>
+				<picUrl>http://asset-2.odftoolkit.org/attachments/images/person/lars_behrmann_small.png</picUrl>
+			</properties>
+		</developer>
+		<developer>
+			<id>steffeng</id>
+			<name>Steffen</name>
+			<email>steffeng AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/418-steffeng</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+		</developer>
+		<developer>
+			<id>hans-peter</id>
+			<name>Hans-Peter</name>
+			<email>hans-peter AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/463-hans-peter</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+		</developer>
+		<developer>
+			<id>bei</id>
+			<name>Bernd</name>
+			<email>bei AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/16-Bernd-Eilers</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+			<properties>
+				<picUrl>http://asset-0.odftoolkit.org/attachments/images/person/bei.JPG</picUrl>
+			</properties>
+		</developer>
+		<developer>
+			<id>mst</id>
+			<name>Michael</name>
+			<email>mst AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/768-Michael-Stahl</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+		</developer>
+		<developer>
+			<id>clippka</id>
+			<name>Christian</name>
+			<email>clippka AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/259-clippka</url>
+			<organization>Oracle Inc.</organization>
+			<organizationUrl>http://www.oracle.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+		</developer>
+	</developers>
 
-    <!-- Environment Settings -->
-    <issueManagement>
-        <system>JIRA</system>
-        <url>https://issues.apache.org/jira/browse/ODFTOOLKIT</url>
-    </issueManagement>
-    <mailingLists>
-        <mailingList>
-            <name>User List</name>
-            <post>odf-users@incubator.apache.org</post>
-            <subscribe>odf-users-subscribe@incubator.apache.org</subscribe>
-            <unsubscribe>odf-users-unsubscribe@incubator.apache.org</unsubscribe>
-            <archive>http://mail-archives.apache.org/mod_mbox/incubator-odf-users/</archive>
-        </mailingList>
-        <mailingList>
-            <name>Developer List</name>
-            <post>odf-dev@incubator.apache.org</post>
-            <subscribe>odf-dev-subscribe@incubator.apache.org</subscribe>
-            <unsubscribe>odf-dev-unsubscribe@incubator.apache.org</unsubscribe>
-            <archive>http://mail-archives.apache.org/mod_mbox/incubator-odf-dev/</archive>
-        </mailingList>
-        <mailingList>
-            <name>Commits</name>
-            <subscribe>odf-commits-subscribe@incubator.apache.org</subscribe>
-            <unsubscribe>odf-commmits-unsubscribe@incubator.apache.org</unsubscribe>
-            <archive>http://mail-archives.apache.org/mod_mbox/incubator-odf-commits/</archive>
-        </mailingList>
-    </mailingLists>
-    <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/odf/trunk/odfdom</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/odf/trunk/odfdom</developerConnection>
-        <url>http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom</url>
-    </scm>
-    <!-- Upload of JAVA DOC for SNAPSHOOTs
-    <distributionManagement>
-        <site>
-            <id>odfdom</id>
-            <name>ODFDOM Java Toolkit Project</name>
-            <url>dav:https://odftoolkit.org/website/odfdom/${project.version}</url>
-        </site>
-    </distributionManagement> -->
-    <profiles>
-        <profile>
+	<!-- Environment Settings -->
+	<issueManagement>
+		<system>JIRA</system>
+		<url>https://issues.apache.org/jira/browse/ODFTOOLKIT</url>
+	</issueManagement>
+	<mailingLists>
+		<mailingList>
+			<name>User List</name>
+			<post>odf-users@incubator.apache.org</post>
+			<subscribe>odf-users-subscribe@incubator.apache.org</subscribe>
+			<unsubscribe>odf-users-unsubscribe@incubator.apache.org</unsubscribe>
+			<archive>http://mail-archives.apache.org/mod_mbox/incubator-odf-users/</archive>
+		</mailingList>
+		<mailingList>
+			<name>Developer List</name>
+			<post>odf-dev@incubator.apache.org</post>
+			<subscribe>odf-dev-subscribe@incubator.apache.org</subscribe>
+			<unsubscribe>odf-dev-unsubscribe@incubator.apache.org</unsubscribe>
+			<archive>http://mail-archives.apache.org/mod_mbox/incubator-odf-dev/</archive>
+		</mailingList>
+		<mailingList>
+			<name>Commits</name>
+			<subscribe>odf-commits-subscribe@incubator.apache.org</subscribe>
+			<unsubscribe>odf-commmits-unsubscribe@incubator.apache.org</unsubscribe>
+			<archive>http://mail-archives.apache.org/mod_mbox/incubator-odf-commits/</archive>
+		</mailingList>
+	</mailingLists>
+	<scm>
+		<connection>scm:svn:http://svn.apache.org/repos/asf/incubator/odf/trunk/odfdom</connection>
+		<developerConnection>scm:svn:https://svn.apache.org/repos/asf/incubator/odf/trunk/odfdom</developerConnection>
+		<url>http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom</url>
+	</scm>
+	<!-- Upload of JAVA DOC for SNAPSHOOTs
+	<distributionManagement>
+		<site>
+			<id>odfdom</id>
+			<name>ODFDOM Java Toolkit Project</name>
+			<url>dav:https://odftoolkit.org/website/odfdom/${project.version}</url>
+		</site>
+	</distributionManagement> -->
+	<profiles>
+		<profile>
 			<id>codegen</id>
 			<build>
 				<plugins>
 					<plugin>
-      					<groupId>org.codehaus.mojo</groupId>
-      					<artifactId>wagon-maven-plugin</artifactId>
-      					<version>1.0-beta-3</version>
-      					<executions>
-      						<execution>
-          						<id>download-odf-schema-v1.2</id>
-          						<phase>validate</phase>
-          						<goals>
-            						<goal>download-single</goal>
-          						</goals>
-          						<configuration>
-            						<url>dav:http://docs.oasis-open.org/office/v1.2</url>
-            						<fromFile>os/OpenDocument-v1.2-os-schema.rng</fromFile>
-            						<toDir>${project.build.directory}/odf-schemas</toDir>
-          						</configuration>
-        					</execution>
-        					<execution>
-          						<id>download-odf-manifest-schema-v1.2</id>
-          						<phase>validate</phase>
-          						<goals>
-            						<goal>download-single</goal>
-          						</goals>
-          						<configuration>
-            						<url>dav:http://docs.oasis-open.org/office/v1.2</url>
-            						<fromFile>os/OpenDocument-v1.2-os-manifest-schema.rng</fromFile>
-            						<toDir>${project.build.directory}/odf-schemas</toDir>
-          						</configuration>
-        					</execution>
-        					<execution>
-          						<id>download-odf-dsig-schema-v1.2</id>
-          						<phase>validate</phase>
-          						<goals>
-            						<goal>download-single</goal>
-          						</goals>
-          						<configuration>
-            						<url>dav:http://docs.oasis-open.org/office/v1.2</url>
-            						<fromFile>os/OpenDocument-v1.2-os-dsig-schema.rng</fromFile>
-            						<toDir>${project.build.directory}/odf-schemas</toDir>
-          						</configuration>
-        					</execution>
-        					<execution>
-          						<id>download-odf-schema-v1.1</id>
-          						<phase>validate</phase>
-          						<goals>
-            						<goal>download-single</goal>
-          						</goals>
-          						<configuration>
-            						<url>dav:http://docs.oasis-open.org/office/v1.1</url>
-            						<fromFile>OS/OpenDocument-schema-v1.1.rng</fromFile>
-            						<toDir>${project.build.directory}/odf-schemas</toDir>
-          						</configuration>
-        					</execution>
-        				</executions>
-    				</plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>wagon-maven-plugin</artifactId>
+						<version>1.0-beta-3</version>
+						<executions>
+							<execution>
+								<id>download-odf-schema-v1.2</id>
+								<phase>validate</phase>
+								<goals>
+									<goal>download-single</goal>
+								</goals>
+								<configuration>
+									<url>dav:http://docs.oasis-open.org/office/v1.2</url>
+									<fromFile>os/OpenDocument-v1.2-os-schema.rng</fromFile>
+									<toDir>${project.build.directory}/odf-schemas</toDir>
+								</configuration>
+							</execution>
+							<execution>
+								<id>download-odf-manifest-schema-v1.2</id>
+								<phase>validate</phase>
+								<goals>
+									<goal>download-single</goal>
+								</goals>
+								<configuration>
+									<url>dav:http://docs.oasis-open.org/office/v1.2</url>
+									<fromFile>os/OpenDocument-v1.2-os-manifest-schema.rng</fromFile>
+									<toDir>${project.build.directory}/odf-schemas</toDir>
+								</configuration>
+							</execution>
+							<execution>
+								<id>download-odf-dsig-schema-v1.2</id>
+								<phase>validate</phase>
+								<goals>
+									<goal>download-single</goal>
+								</goals>
+								<configuration>
+									<url>dav:http://docs.oasis-open.org/office/v1.2</url>
+									<fromFile>os/OpenDocument-v1.2-os-dsig-schema.rng</fromFile>
+									<toDir>${project.build.directory}/odf-schemas</toDir>
+								</configuration>
+							</execution>
+							<execution>
+								<id>download-odf-schema-v1.1</id>
+								<phase>validate</phase>
+								<goals>
+									<goal>download-single</goal>
+								</goals>
+								<configuration>
+									<url>dav:http://docs.oasis-open.org/office/v1.1</url>
+									<fromFile>OS/OpenDocument-schema-v1.1.rng</fromFile>
+									<toDir>${project.build.directory}/odf-schemas</toDir>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
 					<plugin>
 						<groupId>${project.groupId}</groupId>
 						<artifactId>schema2template-maven-plugin</artifactId>
@@ -530,129 +554,129 @@
 				</plugins>
 			</build>
 		</profile>
-        <!--
-        <profile>
-            <id>codegen-pkg</id>
-            <activation>
-              <activeByDefault>true</activeByDefault>
-            </activation>
-            <build>
-                <defaultGoal>install</defaultGoal>
-                <plugins>
-                    <plugin>
-                        <groupId>org.odftoolkit</groupId>
-                        <artifactId>maven-codegen-plugin</artifactId>
-                        <version>0.8-SNAPSHOT</version>
-                        <executions>
-                            <execution>
-                                <id>pkg</id>
-                                <phase>generate-sources</phase>
-                                <goals>
-                                    <goal>codegen</goal>
-                                </goals>
-                                <configuration>
-                                    <sourceRoot>${basedir}/src/main/java</sourceRoot>
-                                    <schemaFile>${basedir}/src/codegen/resources/pkg/OpenDocument-manifest-schema-v1.2-draft7.rng</schemaFile>
-                                    <configFile>${basedir}/src/codegen/resources/pkg/config.xml</configFile>
-                                    <templateFile>${basedir}/src/codegen/resources/pkg/javacodetemplate.xml</templateFile>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        -->
-        <profile>
-            <id>integration-test</id>
-            <activation>
-                <property>
-                    <name>integration-test</name>
-                </property>
-            </activation>
-            <build>
-                <defaultGoal>verify</defaultGoal>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-failsafe-plugin</artifactId>
-                        <version>2.5</version>
-                        <executions>
-                            <execution>
-                                <id>failsafe-it</id>
-                                <phase>integration-test</phase>
-                                <goals>
-                                    <goal>integration-test</goal>
-                                    <goal>verify</goal>
-                                </goals>
-                                <configuration>
-                                    <classesDirectory>${basedir}/target/odfdom*.jar</classesDirectory>
-                                    <systemPropertyVariables>
-                                        <testresourcefolder>performance</testresourcefolder>
-                                        <executetimes>1</executetimes>
-                                        <testflag>test</testflag>
-                                    </systemPropertyVariables>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-surefire-plugin</artifactId>
-                        <!-- Explizit version required for fix on systemPropertyVariables -->
-                        <version>2.6</version>
-                        <configuration>
-                            <systemPropertyVariables>
-                                <odfdom.version>${project.version}</odfdom.version>
-                                <odfdom.timestamp>${build.timestamp}</odfdom.timestamp>
-                                <org.odftoolkit.odfdom.validation>true</org.odftoolkit.odfdom.validation>
-                            </systemPropertyVariables>
-                            <skip>true</skip>
-                        </configuration>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <!-- Profile for deploying to the Sonatype repository, which
-         requires GPG signatures 
-         see
-         https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
-         https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
-         https://issues.sonatype.org/browse/OSSRH-960
-         -->
-        <profile>
-            <id>release-sign-artifacts</id>
-            <activation>
-                <property>
-                    <name>performRelease</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-gpg-plugin</artifactId>
-                        <version>1.1</version>
-                        <executions>
-                            <execution>
-                                <id>sign-artifacts</id>
-                                <phase>verify</phase>
-                                <goals>
-                                    <goal>sign</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-            <!-- <distributionManagement>
-                <site>
-                    <id>odfdom</id>
-                    <name>ODFDOM Java Toolkit Project</name>
-                    <url>dav:https://odftoolkit.org/website/odfdom/${project.version}/odfdom</url>
-                </site>
-            </distributionManagement> -->
-        </profile>
-    </profiles>
+		<!--
+		<profile>
+			<id>codegen-pkg</id>
+			<activation>
+			  <activeByDefault>true</activeByDefault>
+			</activation>
+			<build>
+				<defaultGoal>install</defaultGoal>
+				<plugins>
+					<plugin>
+						<groupId>org.odftoolkit</groupId>
+						<artifactId>maven-codegen-plugin</artifactId>
+						<version>0.8-SNAPSHOT</version>
+						<executions>
+							<execution>
+								<id>pkg</id>
+								<phase>generate-sources</phase>
+								<goals>
+									<goal>codegen</goal>
+								</goals>
+								<configuration>
+									<sourceRoot>${basedir}/src/main/java</sourceRoot>
+									<schemaFile>${basedir}/src/codegen/resources/pkg/OpenDocument-manifest-schema-v1.2-draft7.rng</schemaFile>
+									<configFile>${basedir}/src/codegen/resources/pkg/config.xml</configFile>
+									<templateFile>${basedir}/src/codegen/resources/pkg/javacodetemplate.xml</templateFile>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		-->
+		<profile>
+			<id>integration-test</id>
+			<activation>
+				<property>
+					<name>integration-test</name>
+				</property>
+			</activation>
+			<build>
+				<defaultGoal>verify</defaultGoal>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-failsafe-plugin</artifactId>
+						<version>2.5</version>
+						<executions>
+							<execution>
+								<id>failsafe-it</id>
+								<phase>integration-test</phase>
+								<goals>
+									<goal>integration-test</goal>
+									<goal>verify</goal>
+								</goals>
+								<configuration>
+									<classesDirectory>${basedir}/target/odfdom*.jar</classesDirectory>
+									<systemPropertyVariables>
+										<testresourcefolder>performance</testresourcefolder>
+										<executetimes>1</executetimes>
+										<testflag>test</testflag>
+									</systemPropertyVariables>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-surefire-plugin</artifactId>
+						<!-- Explizit version required for fix on systemPropertyVariables -->
+						<version>2.6</version>
+						<configuration>
+							<systemPropertyVariables>
+								<odfdom.version>${project.version}</odfdom.version>
+								<odfdom.timestamp>${build.timestamp}</odfdom.timestamp>
+								<org.odftoolkit.odfdom.validation>true</org.odftoolkit.odfdom.validation>
+							</systemPropertyVariables>
+							<skip>true</skip>
+						</configuration>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+		<!-- Profile for deploying to the Sonatype repository, which
+		requires GPG signatures 
+		see
+		https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
+		https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
+		https://issues.sonatype.org/browse/OSSRH-960
+		-->
+		<profile>
+			<id>release-sign-artifacts</id>
+			<activation>
+				<property>
+					<name>performRelease</name>
+					<value>true</value>
+				</property>
+			</activation>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-gpg-plugin</artifactId>
+						<version>1.1</version>
+						<executions>
+							<execution>
+								<id>sign-artifacts</id>
+								<phase>verify</phase>
+								<goals>
+									<goal>sign</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+			<!-- <distributionManagement>
+				<site>
+					<id>odfdom</id>
+					<name>ODFDOM Java Toolkit Project</name>
+					<url>dav:https://odftoolkit.org/website/odfdom/${project.version}/odfdom</url>
+				</site>
+			</distributionManagement> -->
+		</profile>
+	</profiles>
 </project>

Modified: incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/OdfSchemaDocument.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/OdfSchemaDocument.java?rev=1418326&r1=1418325&r2=1418326&view=diff
==============================================================================
--- incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/OdfSchemaDocument.java (original)
+++ incubator/odf/trunk/odfdom/src/main/java/org/odftoolkit/odfdom/dom/OdfSchemaDocument.java Fri Dec  7 14:28:07 2012
@@ -1,395 +1,496 @@
-/************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
- * 
- * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
- * 
- * Use is subject to license terms.
- * 
- * Licensed 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. You can also
- * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
- * 
- * 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.odftoolkit.odfdom.dom;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-import org.odftoolkit.odfdom.dom.element.office.OfficeBodyElement;
-import org.odftoolkit.odfdom.dom.element.office.OfficeMasterStylesElement;
-import org.odftoolkit.odfdom.dom.element.style.StyleMasterPageElement;
-import org.odftoolkit.odfdom.dom.element.table.TableTableElement;
-import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeMasterStyles;
-import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles;
-import org.odftoolkit.odfdom.pkg.OdfElement;
-import org.odftoolkit.odfdom.pkg.OdfFileDom;
-import org.odftoolkit.odfdom.pkg.OdfPackage;
-import org.odftoolkit.odfdom.pkg.OdfPackageDocument;
-import org.odftoolkit.odfdom.pkg.OdfValidationException;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-
-/**
- * A document in ODF is from the package view a directory with a media type.
- * If the media type represents a document described by the ODF 1.2 Schema,
- * certain files are assumed within:
- * content.xml, styles.xml, metadata.xml and settings.xml.
- * 
- * The class represents such a document, providing easier access to its XML files.
- */
-public abstract class OdfSchemaDocument extends OdfPackageDocument {
-
-	protected OdfContentDom mContentDom;
-	protected OdfStylesDom mStylesDom;
-	protected OdfMetaDom mMetaDom;
-	protected OdfSettingsDom mSettingsDom;
-	protected OdfOfficeStyles mDocumentStyles;
-
-	/**
-	 * Creates a new OdfSchemaDocument.
-	 * 
-	 * @param pkg - the ODF Package that contains the document. A baseURL is being generated based on its location.
-	 * @param internalPath - the directory path within the package from where the document should be loaded.
-	 * @param mediaTypeString
-	 *      - media type of stream. If unknown null can be used.
-	 */
-	protected OdfSchemaDocument(OdfPackage pkg, String internalPath, String mediaTypeString) {
-		super(pkg, internalPath, mediaTypeString);
-		ErrorHandler errorHandler = pkg.getErrorHandler();
-		if (errorHandler != null) {
-			if (pkg.getFileEntry(internalPath + "content.xml") == null && pkg.getFileEntry(internalPath + "styles.xml") == null) {
-				try {
-					String baseURI = pkg.getBaseURI();
-					if (baseURI == null) {
-						baseURI = internalPath;
-					} else {
-						if (!internalPath.equals(ROOT_DOCUMENT_PATH)) {
-							baseURI = "/" + internalPath;
-						}
-					}
-					errorHandler.error(new OdfValidationException(OdfSchemaConstraint.DOCUMENT_WITHOUT_CONTENT_NOR_STYLES_XML, baseURI));
-				} catch (SAXException ex) {
-					Logger.getLogger(OdfPackage.class.getName()).log(Level.SEVERE, null, ex);
-				}
-			}
-			InputStream mimetypeStream = pkg.getInputStream(OdfPackage.OdfFile.MEDIA_TYPE.getPath(), true);
-			if (internalPath.equals(ROOT_DOCUMENT_PATH) && mimetypeStream == null) {
-				try {
-					errorHandler.error(new OdfValidationException(OdfSchemaConstraint.PACKAGE_SHALL_CONTAIN_MIMETYPE, pkg.getBaseURI()));
-				} catch (SAXException ex) {
-					Logger.getLogger(OdfPackage.class.getName()).log(Level.SEVERE, null, ex);
-				}
-			}
-		}
-	}
-
-	/**
-	 * This enum contains all possible standardized XML ODF files of the OpenDocument document.
-	 */
-	public static enum OdfXMLFile {
-
-		/** The XML file containing the content of an ODF document as specified by the ODF 1.2 specification part 1. */
-		CONTENT("content.xml"),
-		/** The XML file containing a predifined set of metadata related to an ODF document as specified by the ODF 1.2 specification part 1. */
-		META("meta.xml"),
-		/** The XML file containing the settings of an ODF document as specified by the ODF 1.2 specification part 1. */
-		SETTINGS("settings.xml"),
-		/** The XML file containing the styles of an ODF document as specified by the ODF 1.2 specification part 1. */
-		STYLES("styles.xml");
-		private final String mFileName;
-
-		/**
-		 * @return the file name of xml files contained in odf packages.
-		 */
-		public String getFileName() {
-			return mFileName;
-		}
-
-		OdfXMLFile(String fileName) {
-			this.mFileName = fileName;
-		}
-	}
-
-	/**
-	 * Gets the ODF content.xml file as stream.
-	 * @return - a stream of the ODF content 'content.xml' file
-	 * @throws java.lang.Exception - if the stream can not be extracted
-	 */
-	public InputStream getContentStream() throws Exception {
-		String path = getXMLFilePath(OdfXMLFile.CONTENT);
-		return mPackage.getInputStream(path);
-	}
-
-	/**
-	 * Gets the ODF style.xml file as stream.
-	 *
-	 * @return - a stream of the ODF style 'styles.xml' file
-	 * @throws java.lang.Exception - if the stream can not be extracted
-	 */
-	public InputStream getStylesStream() throws Exception {
-		return mPackage.getInputStream(getXMLFilePath(OdfXMLFile.STYLES));
-	}
-
-	/**
-	 * Gets the ODF settings.xml file as stream.
-	 *
-	 * @return - a stream of the ODF settings 'setting.xml' file
-	 * @throws java.lang.Exception - if the stream can not be extracted
-	 */
-	public InputStream getSettingsStream() throws Exception {
-		return mPackage.getInputStream(getXMLFilePath(OdfXMLFile.SETTINGS));
-	}
-
-	/**
-	 * Gets the ODF metadata.xml file as stream.
-	 *
-	 * @return - a stream of the ODF metadata 'meta.xml' file
-	 * @throws java.lang.Exception - if the stream can not be extracted
-	 */
-	public InputStream getMetaStream() throws Exception {
-		return mPackage.getInputStream(getXMLFilePath(OdfXMLFile.META));
-	}
-
-	/**
-	 * Get the relative path for an embedded ODF document including its file name.
-	 * @param file represents one of the standardized XML ODF files.
-	 * @return path to embedded ODF XML file relative to ODF package root.
-	 */
-	protected String getXMLFilePath(OdfXMLFile file) {
-		return file.mFileName;
-	}
-
-	/**
-	 * Get the URI, where this ODF document is stored.
-	 * @return the URI to the ODF document. Returns null if document is not stored yet.
-	 */
-	public String getBaseURI() {
-		return mPackage.getBaseURI();
-
-
-	}
-
-	/**
-	 * Return the ODF type-based content DOM of the content.xml
-	 * @return ODF type-based content DOM or null if no content.xml exists.
-	 * @throws Exception if content DOM could not be initialized
-	 */
-	public OdfContentDom getContentDom() throws Exception {
-		if (mContentDom == null) {
-			mContentDom = (OdfContentDom) getFileDom(OdfXMLFile.CONTENT);
-		}
-		return mContentDom;
-	}
-
-	/**
-	 * Return the ODF type-based styles DOM of the styles.xml
-	 * @return ODF type-based styles DOM or null if no styles.xml exists.
-	 * @throws Exception if styles DOM could not be initialized
-	 */
-	public OdfStylesDom getStylesDom() throws Exception {
-		if (mStylesDom == null) {
-			mStylesDom = (OdfStylesDom) getFileDom(OdfXMLFile.STYLES);
-		}
-		return mStylesDom;
-	}
-
-	/**
-	 * Return the ODF type-based metadata DOM of the meta.xml
-	 * 
-	 * @return ODF type-based meta DOM or null if no meta.xml exists.
-	 * @throws Exception if meta DOM could not be initialized
-	 */
-	public OdfMetaDom getMetaDom() throws Exception {
-		if (mMetaDom == null) {
-			mMetaDom = (OdfMetaDom) getFileDom(OdfXMLFile.META);
-		}
-		return mMetaDom;
-	}
-
-	/**
-	 * Return the ODF type-based settings DOM of the settings.xml
-	 *
-	 * @return ODF type-based settings DOM or null if no settings.xml exists.
-	 * @throws Exception if settings DOM could not be initialized
-	 */
-	public OdfSettingsDom getSettingsDom() throws Exception {
-		if (mSettingsDom == null) {
-			mSettingsDom = (OdfSettingsDom) getFileDom(OdfXMLFile.SETTINGS);
-		}
-		return mSettingsDom;
-	}
-
-	/**
-	 *
-	 * @return the office:styles element from the styles dom or null if there
-	 *         is no such element.
-	 */
-	public OdfOfficeStyles getDocumentStyles() {
-		if (mDocumentStyles == null) {
-			try {
-				OdfFileDom stylesDom = getStylesDom();
-				if (stylesDom != null) {
-					mDocumentStyles = OdfElement.findFirstChildNode(OdfOfficeStyles.class, stylesDom.getFirstChild());
-				} else {
-					return null;
-				}
-			} catch (Exception ex) {
-				Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
-			}
-		}
-		return mDocumentStyles;
-	}
-
-	/**
-	 * return the office:master-styles element of this document.
-	 * @return the office:master-styles element
-	 */
-	public OdfOfficeMasterStyles getOfficeMasterStyles() {
-		try {
-			OdfFileDom fileDom = getStylesDom();
-			if (fileDom != null) {
-				return OdfElement.findFirstChildNode(OdfOfficeMasterStyles.class, fileDom.getFirstChild());
-			}
-		} catch (Exception ex) {
-			Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
-		}
-		return null;
-	}
-
-	/**
-	 *
-	 * @return the office:styles element from the styles dom. If there is not
-	 *         yet such an element, it is created.
-	 */
-	public OdfOfficeStyles getOrCreateDocumentStyles() {
-		if (mDocumentStyles == null) {
-			try {
-				OdfFileDom stylesDom = getStylesDom();
-				Node parent = stylesDom != null ? stylesDom.getFirstChild() : null;
-				if (parent != null) {
-					mDocumentStyles = OdfElement.findFirstChildNode(OdfOfficeStyles.class, parent);
-					if (mDocumentStyles == null) {
-						mDocumentStyles = stylesDom.newOdfElement(OdfOfficeStyles.class);
-						parent.insertBefore(mDocumentStyles, parent.getFirstChild());
-					}
-				}
-			} catch (Exception ex) {
-				Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
-			}
-		}
-		return mDocumentStyles;
-	}
-
-	/**
-	 * Return a list of table features in this document.
-	 * @return a list of table features in this document.
-	 */
-	// ToDo: Instead of a method to receive all possible feature/components on the document, there might be a generic or one each element?
-	public List<TableTableElement> getTables() {
-		List<TableTableElement> tableList = new ArrayList<TableTableElement>();
-		try {
-			// find tables from content.xml
-			OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, getContentDom().getRootElement());
-			OdfElement contentRoot = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
-			tableList = fillTableList(contentRoot, tableList);
-			
-			// find tables from styles.xml (header & footer)
-			Map<String, StyleMasterPageElement> masterPages = getMasterPages();
-			StyleMasterPageElement defaultMasterPage = masterPages.get("Standard");
-			if (defaultMasterPage != null) {
-				tableList = fillTableList(defaultMasterPage, tableList);
-			}
-		} catch (Exception ex) {
-			Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
-		}
-		return tableList;
-	}
-
-	// Only tables being on root level are being considered
-	private List<TableTableElement> fillTableList(Element startElement, List<TableTableElement> tableList) {
-		NodeList childList = startElement.getChildNodes();
-		for (int i = 0;
-				i < childList.getLength();
-				i++) {
-			Node childNode = childList.item(i);
-			if (childNode instanceof Element) {
-				if(childNode instanceof TableTableElement){
-					tableList.add((TableTableElement) childList.item(i));
-				}else{
-					fillTableList((Element) childNode, tableList);
-				}
-			}
-		}
-		return tableList;
-	}
-
-	/**
-	 * ToDo: Instead of adding all elements using an index to the document, we
-	 * might add a pattern to the code generation to create a HashMap either on
-	 * demand (whenever such a structure is required from the user) or by
-	 * default
-	 * 
-	 * @deprecated This method will be moved to the generated sources as soon
-	 *              code generation was improved!
-	 * 
-	 */
-	public Map<String, StyleMasterPageElement> getMasterPages() throws Exception {
-
-		// get original values:
-		OdfStylesDom stylesDoc = getStylesDom();
-		OfficeMasterStylesElement masterStyles = OdfElement.findFirstChildNode(OfficeMasterStylesElement.class, stylesDoc.getRootElement());
-		Map<String, StyleMasterPageElement> masterPages = null;
-		if (masterStyles != null) {
-			NodeList lstMasterPages = stylesDoc.getElementsByTagNameNS(OdfDocumentNamespace.STYLE.getUri(), "master-page");
-			if (lstMasterPages != null && lstMasterPages.getLength() > 0) {
-				masterPages = new HashMap();
-				for (int i = 0; i < lstMasterPages.getLength(); i++) {
-					StyleMasterPageElement masterPage = (StyleMasterPageElement) lstMasterPages.item(i); //Take the node from the list
-					//ToDo: Drop Attribute Suffix for methods returning String values and NOT Attributes
-					String styleName = masterPage.getStyleNameAttribute();
-					masterPages.put(styleName, masterPage);
-				}
-			}
-		}
-		return masterPages;
-	}
-
-	/**
-	 * Close the OdfPackage and release all temporary created data.
-	 * Acter execution of this method, this class is no longer usable.
-	 * Do this as the last action to free resources.
-	 * Closing an already closed document has no effect.
-	 * Note that this will not close any cached documents.
-	 */
-	@Override
-	public void close() {
-		mContentDom = null;
-		mStylesDom = null;
-		mMetaDom = null;
-		mSettingsDom = null;
-		mDocumentStyles = null;
-		super.close();
-	}
-
-	public OdfFileDom getFileDom(OdfXMLFile file) throws Exception {
-		return getFileDom(getXMLFilePath(file));
-	}
-}
+/**
+ * **********************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
+ *
+ * Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Use is subject to license terms.
+ *
+ * Licensed 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. You can also
+ * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
+ *
+ * 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.odftoolkit.odfdom.dom;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+
+import org.odftoolkit.odfdom.dom.element.office.OfficeBodyElement;
+import org.odftoolkit.odfdom.dom.element.office.OfficeMasterStylesElement;
+import org.odftoolkit.odfdom.dom.element.style.StyleMasterPageElement;
+import org.odftoolkit.odfdom.dom.element.table.TableTableElement;
+import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeMasterStyles;
+import org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles;
+import org.odftoolkit.odfdom.pkg.OdfElement;
+import org.odftoolkit.odfdom.pkg.OdfFileDom;
+import org.odftoolkit.odfdom.pkg.OdfPackage;
+import org.odftoolkit.odfdom.pkg.OdfPackageDocument;
+import org.odftoolkit.odfdom.pkg.OdfValidationException;
+import org.odftoolkit.odfdom.pkg.rdfa.Util;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+
+import com.hp.hpl.jena.rdf.model.Model;
+import com.hp.hpl.jena.rdf.model.ModelFactory;
+import com.hp.hpl.jena.util.ResourceUtils;
+import java.io.InputStreamReader;
+
+/**
+ * A document in ODF is from the package view a directory with a media type.
+ * If the media type represents a document described by the ODF 1.2 Schema,
+ * certain files are assumed within:
+ * content.xml, styles.xml, metadata.xml and settings.xml.
+ *
+ * The class represents such a document, providing easier access to its XML files.
+ */
+public abstract class OdfSchemaDocument extends OdfPackageDocument {
+
+	protected OdfContentDom mContentDom;
+	protected OdfStylesDom mStylesDom;
+	protected OdfMetaDom mMetaDom;
+	protected OdfSettingsDom mSettingsDom;
+	protected OdfOfficeStyles mDocumentStyles;
+
+	/**
+	 * Creates a new OdfSchemaDocument.
+	 *
+	 * @param pkg - the ODF Package that contains the document. A baseURL is being generated based on its location.
+	 * @param internalPath - the directory path within the package from where the document should be loaded.
+	 * @param mediaTypeString
+	 *      - media type of stream. If unknown null can be used.
+	 */
+	protected OdfSchemaDocument(OdfPackage pkg, String internalPath, String mediaTypeString) {
+		super(pkg, internalPath, mediaTypeString);
+		ErrorHandler errorHandler = pkg.getErrorHandler();
+		if (errorHandler != null) {
+			if (pkg.getFileEntry(internalPath + "content.xml") == null && pkg.getFileEntry(internalPath + "styles.xml") == null) {
+				try {
+					String baseURI = pkg.getBaseURI();
+					if (baseURI == null) {
+						baseURI = internalPath;
+					} else {
+						if (!internalPath.equals(ROOT_DOCUMENT_PATH)) {
+							baseURI = "/" + internalPath;
+						}
+					}
+					errorHandler.error(new OdfValidationException(OdfSchemaConstraint.DOCUMENT_WITHOUT_CONTENT_NOR_STYLES_XML, baseURI));
+				} catch (SAXException ex) {
+					Logger.getLogger(OdfPackage.class.getName()).log(Level.SEVERE, null, ex);
+				}
+			}
+			InputStream mimetypeStream = pkg.getInputStream(OdfPackage.OdfFile.MEDIA_TYPE.getPath(), true);
+			if (internalPath.equals(ROOT_DOCUMENT_PATH) && mimetypeStream == null) {
+				try {
+					errorHandler.error(new OdfValidationException(OdfSchemaConstraint.PACKAGE_SHALL_CONTAIN_MIMETYPE, pkg.getBaseURI()));
+				} catch (SAXException ex) {
+					Logger.getLogger(OdfPackage.class.getName()).log(Level.SEVERE, null, ex);
+				}
+			}
+		}
+	}
+
+	/**
+	 * This enum contains all possible standardized XML ODF files of the OpenDocument document.
+	 */
+	public static enum OdfXMLFile {
+
+		/** The XML file containing the content of an ODF document as specified by the ODF 1.2 specification part 1. */
+		CONTENT("content.xml"),
+		/** The XML file containing a predifined set of metadata related to an ODF document as specified by the ODF 1.2 specification part 1. */
+		META("meta.xml"),
+		/** The XML file containing the settings of an ODF document as specified by the ODF 1.2 specification part 1. */
+		SETTINGS("settings.xml"),
+		/** The XML file containing the styles of an ODF document as specified by the ODF 1.2 specification part 1. */
+		STYLES("styles.xml");
+		private final String mFileName;
+
+		/**
+		 * @return the file name of xml files contained in odf packages.
+		 */
+		public String getFileName() {
+			return mFileName;
+		}
+
+		OdfXMLFile(String fileName) {
+			this.mFileName = fileName;
+		}
+	}
+
+	/**
+	 * Gets the ODF content.xml file as stream.
+	 *
+	 * @return - a stream of the ODF content 'content.xml' file
+	 * @throws java.lang.Exception - if the stream can not be extracted
+	 */
+	public InputStream getContentStream() throws Exception {
+		String path = getXMLFilePath(OdfXMLFile.CONTENT);
+		return mPackage.getInputStream(path);
+	}
+
+	/**
+	 * Gets the ODF style.xml file as stream.
+	 *
+	 * @return - a stream of the ODF style 'styles.xml' file
+	 * @throws java.lang.Exception - if the stream can not be extracted
+	 */
+	public InputStream getStylesStream() throws Exception {
+		return mPackage.getInputStream(getXMLFilePath(OdfXMLFile.STYLES));
+	}
+
+	/**
+	 * Gets the ODF settings.xml file as stream.
+	 *
+	 * @return - a stream of the ODF settings 'setting.xml' file
+	 * @throws java.lang.Exception - if the stream can not be extracted
+	 */
+	public InputStream getSettingsStream() throws Exception {
+		return mPackage.getInputStream(getXMLFilePath(OdfXMLFile.SETTINGS));
+	}
+
+	/**
+	 * Gets the ODF metadata.xml file as stream.
+	 *
+	 * @return - a stream of the ODF metadata 'meta.xml' file
+	 * @throws java.lang.Exception - if the stream can not be extracted
+	 */
+	public InputStream getMetaStream() throws Exception {
+		return mPackage.getInputStream(getXMLFilePath(OdfXMLFile.META));
+	}
+
+	/**
+	 * Get the relative path for an embedded ODF document including its file name.
+	 * @param file represents one of the standardized XML ODF files.
+	 * @return path to embedded ODF XML file relative to ODF package root.
+	 */
+	protected String getXMLFilePath(OdfXMLFile file) {
+		return file.mFileName;
+	}
+
+	/**
+	 * Get the URI, where this ODF document is stored.
+	 * @return the URI to the ODF document. Returns null if document is not stored yet.
+	 */
+	public String getBaseURI() {
+		return mPackage.getBaseURI();
+
+
+	}
+
+	/**
+	 * Return the ODF type-based content DOM of the content.xml
+	 *
+	 * @return ODF type-based content DOM or null if no content.xml exists.
+	 * @throws Exception if content DOM could not be initialized
+	 */
+	public OdfContentDom getContentDom() throws Exception {
+		if (mContentDom == null) {
+			mContentDom = (OdfContentDom) getFileDom(OdfXMLFile.CONTENT);
+		}
+		return mContentDom;
+	}
+
+	/**
+	 * Return the ODF type-based styles DOM of the styles.xml
+	 *
+	 * @return ODF type-based styles DOM or null if no styles.xml exists.
+	 * @throws Exception if styles DOM could not be initialized
+	 */
+	public OdfStylesDom getStylesDom() throws Exception {
+		if (mStylesDom == null) {
+			mStylesDom = (OdfStylesDom) getFileDom(OdfXMLFile.STYLES);
+		}
+		return mStylesDom;
+	}
+
+	/**
+	 * Return the ODF type-based metadata DOM of the meta.xml
+	 *
+	 * @return ODF type-based meta DOM or null if no meta.xml exists.
+	 * @throws Exception if meta DOM could not be initialized
+	 */
+	public OdfMetaDom getMetaDom() throws Exception {
+		if (mMetaDom == null) {
+			mMetaDom = (OdfMetaDom) getFileDom(OdfXMLFile.META);
+		}
+		return mMetaDom;
+	}
+
+	/**
+	 * Return the ODF type-based settings DOM of the settings.xml
+	 *
+	 * @return ODF type-based settings DOM or null if no settings.xml exists.
+	 * @throws Exception if settings DOM could not be initialized
+	 */
+	public OdfSettingsDom getSettingsDom() throws Exception {
+		if (mSettingsDom == null) {
+			mSettingsDom = (OdfSettingsDom) getFileDom(OdfXMLFile.SETTINGS);
+		}
+		return mSettingsDom;
+	}
+
+	/**
+	 *
+	 * @return the office:styles element from the styles dom or null if there is
+	 * no such element.
+	 */
+	public OdfOfficeStyles getDocumentStyles() {
+		if (mDocumentStyles == null) {
+			try {
+				OdfFileDom stylesDom = getStylesDom();
+				if (stylesDom != null) {
+					mDocumentStyles = OdfElement.findFirstChildNode(OdfOfficeStyles.class, stylesDom.getFirstChild());
+				} else {
+					return null;
+				}
+			} catch (Exception ex) {
+				Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
+			}
+		}
+		return mDocumentStyles;
+	}
+
+	/**
+	 * return the office:master-styles element of this document.
+	 *
+	 * @return the office:master-styles element
+	 */
+	public OdfOfficeMasterStyles getOfficeMasterStyles() {
+		try {
+			OdfFileDom fileDom = getStylesDom();
+			if (fileDom != null) {
+				return OdfElement.findFirstChildNode(OdfOfficeMasterStyles.class, fileDom.getFirstChild());
+			}
+		} catch (Exception ex) {
+			Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
+		}
+		return null;
+	}
+
+	/**
+	 *
+	 * @return the office:styles element from the styles dom. If there is not
+	 *         yet such an element, it is created.
+	 */
+	public OdfOfficeStyles getOrCreateDocumentStyles() {
+		if (mDocumentStyles == null) {
+			try {
+				OdfFileDom stylesDom = getStylesDom();
+				Node parent = stylesDom != null ? stylesDom.getFirstChild() : null;
+				if (parent != null) {
+					mDocumentStyles = OdfElement.findFirstChildNode(OdfOfficeStyles.class, parent);
+					if (mDocumentStyles == null) {
+						mDocumentStyles = stylesDom.newOdfElement(OdfOfficeStyles.class);
+						parent.insertBefore(mDocumentStyles, parent.getFirstChild());
+					}
+				}
+			} catch (Exception ex) {
+				Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
+			}
+		}
+		return mDocumentStyles;
+	}
+
+	/**
+	 * Return a list of table features in this document.
+	 *
+	 * @return a list of table features in this document.
+	 */
+	// ToDo: Instead of a method to receive all possible feature/components on the document, there might be a generic or one each element?
+	public List<TableTableElement> getTables() {
+		List<TableTableElement> tableList = new ArrayList<TableTableElement>();
+		try {
+			// find tables from content.xml
+			OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, getContentDom().getRootElement());
+			OdfElement contentRoot = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
+			tableList = fillTableList(contentRoot, tableList);
+
+			// find tables from styles.xml (header & footer)
+			Map<String, StyleMasterPageElement> masterPages = getMasterPages();
+			StyleMasterPageElement defaultMasterPage = masterPages.get("Standard");
+			if (defaultMasterPage != null) {
+				tableList = fillTableList(defaultMasterPage, tableList);
+			}
+		} catch (Exception ex) {
+			Logger.getLogger(OdfSchemaDocument.class.getName()).log(Level.SEVERE, null, ex);
+		}
+		return tableList;
+	}
+
+	// Only tables being on root level are being considered
+	private List<TableTableElement> fillTableList(Element startElement, List<TableTableElement> tableList) {
+		NodeList childList = startElement.getChildNodes();
+		for (int i = 0;
+				i < childList.getLength();
+				i++) {
+			Node childNode = childList.item(i);
+			if (childNode instanceof Element) {
+				if(childNode instanceof TableTableElement){
+					tableList.add((TableTableElement) childList.item(i));
+				}else{
+					fillTableList((Element) childNode, tableList);
+				}
+			}
+		}
+		return tableList;
+	}
+
+	/**
+	 * ToDo: Instead of adding all elements using an index to the document, we
+	 * might add a pattern to the code generation to create a HashMap either on
+	 * demand (whenever such a structure is required from the user) or by
+	 * default
+	 *
+	 * @deprecated This method will be moved to the generated sources as soon
+	 *              code generation was improved!
+	 *
+	 */
+	public Map<String, StyleMasterPageElement> getMasterPages() throws Exception {
+
+		// get original values:
+		OdfStylesDom stylesDoc = getStylesDom();
+		OfficeMasterStylesElement masterStyles = OdfElement.findFirstChildNode(OfficeMasterStylesElement.class, stylesDoc.getRootElement());
+		Map<String, StyleMasterPageElement> masterPages = null;
+		if (masterStyles != null) {
+			NodeList lstMasterPages = stylesDoc.getElementsByTagNameNS(OdfDocumentNamespace.STYLE.getUri(), "master-page");
+			if (lstMasterPages != null && lstMasterPages.getLength() > 0) {
+				masterPages = new HashMap();
+				for (int i = 0; i < lstMasterPages.getLength(); i++) {
+					StyleMasterPageElement masterPage = (StyleMasterPageElement) lstMasterPages.item(i); //Take the node from the list
+					//ToDo: Drop Attribute Suffix for methods returning String values and NOT Attributes
+					String styleName = masterPage.getStyleNameAttribute();
+					masterPages.put(styleName, masterPage);
+				}
+			}
+		}
+		return masterPages;
+	}
+
+	/**
+	 * Close the OdfPackage and release all temporary created data.
+	 * Acter execution of this method, this class is no longer usable.
+	 * Do this as the last action to free resources.
+	 * Closing an already closed document has no effect.
+	 * Note that this will not close any cached documents.
+	 */
+	@Override
+	public void close() {
+		mContentDom = null;
+		mStylesDom = null;
+		mMetaDom = null;
+		mSettingsDom = null;
+		mDocumentStyles = null;
+		super.close();
+	}
+
+	public OdfFileDom getFileDom(OdfXMLFile file) throws Exception {
+		return getFileDom(getXMLFilePath(file));
+	}
+
+	/**
+	 * Get all two types of RDF Metadata through GRDDL XSLT:
+	 * http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415068_253892949
+	 */
+	public Model getRDFMetadata() throws Exception {
+		Model m = getInContentMetadata().union(this.getManifestRDFMetadata());
+		return m;
+	}
+
+	/**
+	 * Get In Content RDF Metadata through GRDDL XSLT
+	 * http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415070_253892949
+	 */
+	public Model getInContentMetadata() throws Exception {
+		Model documentRDFModel = ModelFactory.createDefaultModel();
+		Model fileRDFModel = null;
+		for (String internalPath : this.getPackage().getFilePaths()) {
+			for (OdfXMLFile file : OdfXMLFile.values()) {
+				if (Util.isSubPathOf(internalPath, this.getDocumentPath())
+						&& internalPath.endsWith(file.getFileName())) {
+					fileRDFModel = getXMLFileMetadata(internalPath);
+					if (fileRDFModel.size() > 0) {
+						documentRDFModel = documentRDFModel.union(fileRDFModel);
+					}
+					break;
+				}
+			}
+		}
+		if (fileRDFModel.size() > 0) {
+			documentRDFModel = documentRDFModel.union(fileRDFModel);
+		}
+		return documentRDFModel;
+	}
+
+	/**
+	 * Get in-content metadata cache model
+	 *
+	 * @return The in-content metadata cache model
+	 * @throws Exception
+	 */
+	public Model getInContentMetadataFromCache() throws Exception {
+		Model m = ModelFactory.createDefaultModel();
+		// find and merge the RDF triples cache from the OdfXMLFile files
+		for (OdfXMLFile file : OdfXMLFile.values()) {
+			for (Model m1 : this.getFileDom(file).getInContentMetadataCache().values()) {
+				m = m.union(m1);
+			}
+		}
+		return m;
+	}
+
+	/**
+	 * Get RDF metadata from manifest.rdf and those rdf files registered in the
+	 * manifest.xml as "application/rdf+xml" through GRDDL XSLT
+	 * http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415072_253892949
+	 */
+	public Model getManifestRDFMetadata() throws Exception {
+		Model m = ModelFactory.createDefaultModel();
+		for (String internalPath : this.getPackage().getFilePaths()) {
+			if (Util.isSubPathOf(internalPath, this.getDocumentPath()) && this.getPackage().getMediaTypeString(internalPath).endsWith("application/rdf+xml")) {
+				Model m1 = ModelFactory.createDefaultModel();
+				String RDFBaseUri = Util.getRDFBaseUri(this.getPackage().getBaseURI(), internalPath);
+				m1.read(new InputStreamReader(this.getPackage().getInputStream(internalPath), "utf-8"), RDFBaseUri);
+				// remove the last SLASH at the end of the RDFBaseUri:
+				// test_rdfmeta.odt/ --> test_rdfmeta.odt
+				ResourceUtils.renameResource(m1.getResource(RDFBaseUri), RDFBaseUri.substring(0, RDFBaseUri.length() - 1));
+				if (m1.size() > 0) {
+					m = m.union(m1);
+				}
+			}
+		}
+		return m;
+	}
+
+	/**
+	 * Get in-content metadata model of bookmarks
+	 *
+	 * @return The in-content metadata model of bookmarks
+	 * @throws Exception
+	 */
+	public Model getBookmarkRDFMetadata() throws Exception {
+		Model m = ModelFactory.createDefaultModel();
+		for (OdfXMLFile file : OdfXMLFile.values()) {
+			OdfFileDom dom = getFileDom(file);
+			m = m.union(dom.getBookmarkRDFMetadata());
+		}
+		return m;
+	}
+}



Mime
View raw message