incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r1172466 [1/16] - in /incubator/odf/trunk/validator: ./ misc/ nbproject/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/odftoolkit/ src/main/java/org/odftoolkit/odfvalidator/ src/main/resources/ src/main/resources/META-INF/ s...
Date Mon, 19 Sep 2011 05:43:28 GMT
Author: devinhan
Date: Mon Sep 19 05:43:23 2011
New Revision: 1172466

URL: http://svn.apache.org/viewvc?rev=1172466&view=rev
Log:
changeset:   35:7d3a640c9b8f
user:        Developer:Svante;Reviewer:Devin
date:        Mon Sep 19 13:18:53 2011 +0800
Maven & WebApp switch

Added:
    incubator/odf/trunk/validator/.hgeol
    incubator/odf/trunk/validator/LICENSE.txt
    incubator/odf/trunk/validator/README.txt
    incubator/odf/trunk/validator/pom.xml
    incubator/odf/trunk/validator/src/main/
    incubator/odf/trunk/validator/src/main/java/
    incubator/odf/trunk/validator/src/main/java/org/
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Configuration.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ContentFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/DSigFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentListener.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/InternalResources.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Logger.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Main.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ManifestEntry.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ManifestEntryListener.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ManifestFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ManifestListener.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/MathML101Filter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/MathML20Filter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/MetaFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/MetaInformation.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/MetaInformationListener.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/NamespaceFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFFileFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFFileValidator.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFMediaTypes.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFPackageErrorHandler.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFPackageValidator.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFRootPackageValidator.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFStreamValidator.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFSubPackageValidator.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFValidationResult.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFValidator.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFValidatorException.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ODFValidatorProvider.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/OdfPackageExt.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/OdfValidatorMode.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/OdfVersion.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/SAXParseExceptionFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/SAXVersionException.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/SchemaErrorHandler.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/SchemaFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/SchemaResourceResolver.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ValidationMessageCollectorErrorFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ValidationOOoTaskIdErrorFilter.java
    incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/VersionHandler.java
    incubator/odf/trunk/validator/src/main/resources/
    incubator/odf/trunk/validator/src/main/resources/META-INF/
    incubator/odf/trunk/validator/src/main/resources/META-INF/services/
    incubator/odf/trunk/validator/src/main/resources/META-INF/services/org.iso_relax.verifier.VerifierFactoryLoader
    incubator/odf/trunk/validator/src/main/resources/schema/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml1.01/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml1.01/math.dtd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml1.01/w3c_ipr_software_notice.html
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/common/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/common/common-attribs.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/common/math.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/common/xlink-href.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/arith.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/calculus.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/common-attrib.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/constants.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/constructs.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/elementary-functions.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/functions.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/linear-algebra.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/logic.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/relations.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/semantics.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/sets.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/statistics.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/tokens.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/content/vector-calculus.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/mathml2.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/action.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/characters.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/common-attribs.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/common-types.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/error.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/layout.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/scripts.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/space.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/style.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/table.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml2.0/presentation/tokens.xsd
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/algebra-logic.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/algebra-logic.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/basic-content-elements.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/basic-content-elements.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/calculus_veccalc.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/calculus_veccalc.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/constants.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/constants.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/errors.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/errors.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/linear_algebra.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/linear_algebra.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml-p.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-cds-pragmatic.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-cds-pragmatic.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-cds.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-cds.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-common.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-common.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-content.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-content.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-deprecated.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-deprecated.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-pragmatic.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-pragmatic.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-presentation.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-presentation.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-strict-content.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-strict-content.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-strict.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3-strict.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/mathml3.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/relations.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/relations.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/sequences_series.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/sequences_series.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/sets.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/sets.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/specfun.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/specfun.rng
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/statistics.rnc
    incubator/odf/trunk/validator/src/main/resources/schema/mathml3.0/statistics.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.0/
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.0/OpenDocument-manifest-schema-v1.0-os.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.0/OpenDocument-schema-v1.0-os.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.0/OpenDocument-strict-schema-v1.0-os.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.1/
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.1/OpenDocument-manifest-schema-v1.1.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.1/OpenDocument-schema-v1.1.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.1/OpenDocument-strict-schema-v1.1.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/OpenDocument-v1.2-cos01-dsig-schema.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/OpenDocument-v1.2-cos01-manifest-schema.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/OpenDocument-v1.2-cos01-metadata.owl
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/OpenDocument-v1.2-cos01-package-metadata.owl
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/OpenDocument-v1.2-cos01-schema.rng
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/odf.htm
    incubator/odf/trunk/validator/src/main/resources/schema/odf1.2/pkg.htm
    incubator/odf/trunk/validator/src/main/resources/schema/odf1_0.properties
    incubator/odf/trunk/validator/src/main/resources/schema/odf1_1.properties
    incubator/odf/trunk/validator/src/main/resources/schema/odf1_2.properties
    incubator/odf/trunk/validator/src/main/webapp/
    incubator/odf/trunk/validator/src/main/webapp/META-INF/
    incubator/odf/trunk/validator/src/main/webapp/META-INF/context.xml
    incubator/odf/trunk/validator/src/main/webapp/WEB-INF/
    incubator/odf/trunk/validator/src/main/webapp/WEB-INF/web.xml
    incubator/odf/trunk/validator/src/main/webapp/jsp/
    incubator/odf/trunk/validator/src/main/webapp/jsp/common/
    incubator/odf/trunk/validator/src/main/webapp/jsp/common/footer.jsp
    incubator/odf/trunk/validator/src/main/webapp/jsp/common/header.jsp
    incubator/odf/trunk/validator/src/main/webapp/jsp/common/supporter.jsp
    incubator/odf/trunk/validator/src/main/webapp/jsp/index.jsp
    incubator/odf/trunk/validator/src/main/webapp/jsp/info/
    incubator/odf/trunk/validator/src/main/webapp/jsp/info/index.jsp
    incubator/odf/trunk/validator/src/main/webapp/jsp/info/info.jsp
    incubator/odf/trunk/validator/src/main/webapp/jsp/validate.jsp
    incubator/odf/trunk/validator/src/test/
    incubator/odf/trunk/validator/src/test/java/
    incubator/odf/trunk/validator/src/test/java/org/
    incubator/odf/trunk/validator/src/test/java/org/odftoolkit/
    incubator/odf/trunk/validator/src/test/java/org/odftoolkit/odfvalidator/
    incubator/odf/trunk/validator/src/test/java/org/odftoolkit/odfvalidator/InvalidPackageTest.java
    incubator/odf/trunk/validator/src/test/java/org/odftoolkit/odfvalidator/OdfValidatorTestBase.java
    incubator/odf/trunk/validator/src/test/java/org/odftoolkit/odfvalidator/ValidTest.java
    incubator/odf/trunk/validator/src/test/resources/
    incubator/odf/trunk/validator/src/test/resources/config_template.properties
    incubator/odf/trunk/validator/src/test/resources/empty.odt   (with props)
    incubator/odf/trunk/validator/src/test/resources/extract-schema.xsl
    incubator/odf/trunk/validator/src/test/resources/filter.rng
    incubator/odf/trunk/validator/src/test/resources/testInvalidPkg1.odt   (with props)
    incubator/odf/trunk/validator/src/test/resources/testInvalidPkg2.odt   (with props)
    incubator/odf/trunk/validator/src/test/resources/testInvalidPkg3.odt   (with props)
    incubator/odf/trunk/validator/src/test/resources/testValid1.odt   (with props)
Removed:
    incubator/odf/trunk/validator/ant.properties
    incubator/odf/trunk/validator/build.xml
    incubator/odf/trunk/validator/manifest.mf
    incubator/odf/trunk/validator/misc/
    incubator/odf/trunk/validator/nbproject/
    incubator/odf/trunk/validator/schema.properties
    incubator/odf/trunk/validator/schema.user.properties
    incubator/odf/trunk/validator/src/org/odftoolkit/odfvalidator/
    incubator/odf/trunk/validator/test-resources/
    incubator/odf/trunk/validator/test/org/odftoolkit/odfvalidator/
    incubator/odf/trunk/validator/xslt/

Added: incubator/odf/trunk/validator/.hgeol
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/.hgeol?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/.hgeol (added)
+++ incubator/odf/trunk/validator/.hgeol Mon Sep 19 05:43:23 2011
@@ -0,0 +1,27 @@
+[patterns]
+**.html = native
+**.java = native
+**.rng = native
+**.txt = native
+**.vm = native
+**.xml = native
+**.xsl = native
+**.jpeg = BIN
+**.png = BIN
+**.odc = BIN
+**.otc = BIN
+**.odf = BIN
+**.otf = BIN
+**.odb = BIN
+**.odg = BIN
+**.otg = BIN
+**.odi = BIN
+**.oti = BIN
+**.odp = BIN
+**.otp = BIN
+**.ods = BIN
+**.ots = BIN
+**.odt = BIN
+**.ott = BIN
+**.odm = BIN
+**.oth = BIN

Added: incubator/odf/trunk/validator/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/LICENSE.txt?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/LICENSE.txt (added)
+++ incubator/odf/trunk/validator/LICENSE.txt Mon Sep 19 05:43:23 2011
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   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
+
+   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.

Added: incubator/odf/trunk/validator/README.txt
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/README.txt?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/README.txt (added)
+++ incubator/odf/trunk/validator/README.txt Mon Sep 19 05:43:23 2011
@@ -0,0 +1,49 @@
+*************************************************************
+* ODFDOM Java Library                                       *
+*                                                           *
+*************************************************************
+
+
+About ODFDOM
+-------------
+
+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.
+
+
+Documentation
+--------------
+
+The latest release notes and a summary of API changes (if any) are available
+online at the project's Wiki page:
+    http://odftoolkit.org/projects/odfdom/pages/ReleaseNotes
+
+In general, the Wiki page is a great place to start when looking for online
+documentation and other information about the odfdom project.
+    http://odftoolkit.org/projects/odfdom/pages/Home
+
+API documentation (Javadoc) can be downloaded from the project's download area:
+    http://odftoolkit.org/projects/odfdom/downloads
+
+The Javadoc can also be viewed online and is available for each version, e.g.
+    http://odfdom.odftoolkit.org/0.8.6/docs/api/
+
+
+License
+--------
+
+Apache License, Version 2.0. Please see file LICENSE.txt.
+
+
+Installation
+-------------
+
+Just put the file odfdom.jar in your classpath. You will
+need Apache Xerces-J as well. Get it from
+    http://xml.apache.org/dist/xerces-j/

Added: incubator/odf/trunk/validator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/pom.xml?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/pom.xml (added)
+++ incubator/odf/trunk/validator/pom.xml Mon Sep 19 05:43:23 2011
@@ -0,0 +1,460 @@
+<?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>
+
+	<!-- The Basics -->
+	<groupId>org.odftoolkit</groupId>
+	<artifactId>odfvalidator</artifactId>
+	<version>0.8.7</version>
+	<packaging>war</packaging>
+	<parent>
+		<groupId>org.sonatype.oss</groupId>
+		<artifactId>oss-parent</artifactId>
+		<version>7</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.odftoolkit</groupId>
+			<artifactId>odfdom-java</artifactId>
+			<version>0.8.7</version>
+		</dependency>	
+		<dependency>
+			<groupId>commons-fileupload</groupId>
+			<artifactId>commons-fileupload</artifactId>
+			<version>1.2.2</version>
+		</dependency>
+		<dependency>
+			<groupId>net.java.dev.msv</groupId>
+			<artifactId>msv-core</artifactId>
+			<version>2011.1</version>
+		</dependency>		
+		<dependency>
+		  <groupId>org.iso_relax.verifier.jaxp.validation</groupId>
+		  <artifactId>isorelax-jaxp-bridge</artifactId>
+		  <version>1.0</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>
+	 <netbeans.hint.deploy.server>Tomcat</netbeans.hint.deploy.server>
+	</properties>
+
+	<!-- Build Settings -->
+	<build>
+		<finalName>odfvalidator</finalName>
+		<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.6</source>
+					<target>1.6</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>
+						<manifestEntries>
+							<version>${project.version}</version>
+						</manifestEntries>
+						<manifestSections>
+							<manifestSection>
+								<name>odfvalidator</name>
+								<manifestEntries>
+									<ODFDOM-Name>odfdom</ODFDOM-Name>
+									<ODFDOM-Version>${project.version}</ODFDOM-Version>
+									<ODFDOM-Website>http://odftoolkit.org</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>
+				<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>
+		</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>
+
+	<!-- More Project Information -->
+	<name>ODF Validator</name>
+	<description>ODF Validator is a tool that validates OpenDocument files and checks them for certain conformance criteria.
+	</description>
+	<url>http://incubator.apache.org/odftoolkit/conformance/ODFValidator.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>Apache Project</name>
+		<url>http://www.apache.org/</url>
+	</organization>
+	<developers>
+		<developer>
+			<id>svanteschubert</id>
+			<name>Svante</name>
+			<email>svanteschubert AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/7-Svante-Schubert</url>
+			<roles>
+				<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>Devin</id>
+			<name>Han Biao</name>
+			<email>devin AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/748-Devin</url>
+			<organization>IBM</organization>
+			<organizationUrl>http://www.ibm.com/</organizationUrl>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+8</timezone>
+		</developer>
+		<developer>
+			<id>Daisy</id>
+			<name>Ying Chun Guo</name>
+			<email>Daisy AT odftoolkit.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>FrankMeies</id>
+			<name>Frank</name>
+			<email>FrankMeies AT odftoolkit.org</email>
+			<url>http://odftoolkit.org/people/332-FrankMeies</url>
+			<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>
+			<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>
+			<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>
+			<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>
+			<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>
+			<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>
+			<roles>
+				<role>developer</role>
+			</roles>
+			<timezone>+1</timezone>
+		</developer>
+	</developers>
+
+	<!-- Environment Settings -->
+	<issueManagement>
+		<system>Bugzilla</system>
+		<url>https://odftoolkit.org/bugzilla/enter_bug.cgi?product=odfdom</url>
+	</issueManagement>
+	<mailingLists>
+		<!-- To subscribe one of the mailing lists:
+			1) First become a member of the http://odftoolkit.org project
+			2) Second subscribe here: http://odftoolkit.org/projects/odfdom/lists -->
+		<mailingList>
+			<name>Dev List</name>
+			<archive>http://odftoolkit.org/projects/odfdom/lists/dev/archive</archive>
+		</mailingList>
+		<mailingList>
+			<name>Users List</name>
+			<archive>http://odftoolkit.org/projects/odfdom/lists/users/archive</archive>
+		</mailingList>
+		<mailingList>
+			<name>Issues List</name>
+			<archive>http://odftoolkit.org/projects/odfdom/lists/issues/archive</archive>
+		</mailingList>
+		<mailingList>
+			<name>Commits List</name>
+			<archive>http://odftoolkit.org/projects/odfdom/lists/commits/archive</archive>
+		</mailingList>
+	</mailingLists>
+	<scm>
+		<connection>scm:hg:https://hg.odftoolkit.org/hg/odfdom~developer</connection>
+		<developerConnection>scm:hg:https://hg.odftoolkit.org/hg/odfdom~developer</developerConnection>
+		<url>http://odftoolkit.org/projects/odfdom/sources/developer/show</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>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>odfvalidator</id>
+					<name>ODF Toolkit Project</name>
+					<url>dav:https://odftoolkit.org/website/odfdom/${project.version}/odfdom</url>
+				</site>
+			</distributionManagement>-->
+		</profile>
+	</profiles>
+</project>

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Configuration.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Configuration.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Configuration.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,93 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.TreeSet;
+import java.util.Vector;
+
+public class Configuration extends Properties {
+
+    
+    public static final String SCHEMA = "schema";
+    public static final String STRICT_SCHEMA = "strict-schema";
+    public static final String MANIFEST_SCHEMA = "manifest-schema";
+    public static final String MATHML_SCHEMA = "mathml-schema";
+    public static final String MATHML2_SCHEMA = "mathml2-schema";
+    public static final String DSIG_SCHEMA = "dsig-schema";
+    public static final String PATH = "path";
+    public static final String EXCLUDE = "exclude";
+    public static final String RECURSIVE = "recursive";
+    public static final String FILTER = "filter";
+
+    public static final String VALIDATOR_URL = "validator-url";
+    public static final String PROXY_HOST="proxy-host";
+    public static final String PROXY_PORT="proxy-port";
+
+    /** Creates a new instance of AppProperties */
+    public Configuration()
+    {
+    }
+    
+    public Configuration( File aConfigFile ) throws FileNotFoundException, IOException
+    {
+        FileInputStream aInStream = new FileInputStream( aConfigFile );
+        loadFromXML( aInStream );
+        aInStream.close();
+    }
+    
+
+    public void store( File aConfigFile ) throws FileNotFoundException, IOException 
+    {
+        FileOutputStream aOutStream = new FileOutputStream( aConfigFile );
+        storeToXML( aOutStream, null );
+        aOutStream.close();
+    }
+    
+    public List<String> getListPropety( String aPropNamePrefix )
+    {
+        TreeSet<String> aSortedPropNames = new TreeSet<String>();
+        Enumeration aPropNames = propertyNames();
+        while( aPropNames.hasMoreElements() )
+        {
+            String aPropName = (String)aPropNames.nextElement();
+            if( aPropName.startsWith(aPropNamePrefix))
+                aSortedPropNames.add(aPropName);
+        }
+        
+        List<String> aValues = new Vector<String>(aSortedPropNames.size());
+        Iterator<String> aIter = aSortedPropNames.iterator();
+        while( aIter.hasNext() )
+            aValues.add(getProperty( aIter.next() ) );
+        
+        return aValues;
+    }
+}

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ContentFilter.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ContentFilter.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ContentFilter.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ContentFilter.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,112 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+class ContentFilter extends NamespaceFilter {
+
+    private static final String CD2_SVG_NAMESPACE_URI = "http://www.w3.org/2000/svg";
+    private static final String CD2_XSL_NAMESPACE_URI = "http://www.w3.org/1999/XSL/Format";
+    private static final String CD2_SMIL_NAMESPACE_URI = "http://www.w3.org/2001/SMIL20/";
+    private static final String BASE_OFFICE_NAMESPACE_URI = "http://openoffice.org/2004/office";
+    private static final String BASE_DB_NAMESPACE_URI = "http://openoffice.org/2004/database";
+    private static final String SVG_NAMESPACE_URI = OdfDocumentNamespace.SVG.getUri();
+    private static final String XSL_NAMESPACE_URI = OdfDocumentNamespace.FO.getUri();
+    private static final String SMIL_NAMESPACE_URI = OdfDocumentNamespace.SMIL.getUri();
+    private static final String DRAW_NAMESPACE_URI = OdfDocumentNamespace.DRAW.getUri();
+    private static final String OFFICE_NAMESPACE_URI = OdfDocumentNamespace.OFFICE.getUri();
+    private static final String DB_NAMESPACE_URI = OdfDocumentNamespace.DB.getUri();
+    private static final String BASE_OFFICE_NAMESPACE_PREFIX = "office";
+    private static final String POLYGON = "polygon";
+    private static final String CONTOUR_POLYGON = "contour-polygon";
+    private static final String POLYLINE = "polyline";
+    private static final String POINTS = "points";
+    private static final int MAX_POINTS_LEN = 2048;
+        
+    private Logger m_aLogger;
+    private String m_aLocalElementName;
+    private boolean m_bRoot = true;
+    
+    /** Creates a new instance of KnownIssueFilter */
+    ContentFilter( Logger aLogger, String aLocalElementName ) {
+        m_aLogger = aLogger;
+        m_aLocalElementName = aLocalElementName;
+    }
+
+    String adaptNamespaceUri( String aUri, String aPrefix)
+    {
+        String aNewUri = null;
+        if( aUri.equals(CD2_SVG_NAMESPACE_URI) )
+            aNewUri = SVG_NAMESPACE_URI;
+        else if( aUri.equals(CD2_XSL_NAMESPACE_URI) )
+             aNewUri = XSL_NAMESPACE_URI;
+        else if( aUri.equals(CD2_SMIL_NAMESPACE_URI) ) 
+            aNewUri = SMIL_NAMESPACE_URI;
+        else if( aUri.equals(BASE_OFFICE_NAMESPACE_URI) &&
+                 (aPrefix == null || aPrefix.startsWith(BASE_OFFICE_NAMESPACE_PREFIX)) )
+            aNewUri = OFFICE_NAMESPACE_URI;
+        else if( aUri.equals(BASE_DB_NAMESPACE_URI) )
+            aNewUri = DB_NAMESPACE_URI;
+        
+        return aNewUri;
+    }
+
+    void namespaceUriAdapted( String aUri, String aNewUri )
+    {
+        String aMsg = (aUri.equals(BASE_OFFICE_NAMESPACE_URI) || aUri.equals(BASE_DB_NAMESPACE_URI))
+                ? "Adapting Base namspace'" + aUri + "'"
+                : "Adapting OpenDocument CD2 namspace'" + aUri + "' (has been stored by old OOo versions)";
+        m_aLogger.logInfo( aMsg , false);
+    }
+
+    @Override
+    public void startElement(String aUri, String aLocalName, String aQName, Attributes aAtts) throws SAXException {
+        if( aUri.equals(DRAW_NAMESPACE_URI) && 
+            (aLocalName.equals(POLYGON) || aLocalName.equals(POLYLINE) || aLocalName.equals(CONTOUR_POLYGON)) )
+        {
+            String aPointsValue = aAtts.getValue(DRAW_NAMESPACE_URI,POINTS);
+            if( aPointsValue != null && aPointsValue.length() > MAX_POINTS_LEN )
+            {
+                m_aLogger.logInfo( String.format("'draw:points' of <%s> has been stripped (value starts with '%s')",aQName,aPointsValue.substring(0,40)), false);
+                AttributesImpl aNewAtts = new AttributesImpl( aAtts );
+                int nAttr = aNewAtts.getIndex(DRAW_NAMESPACE_URI,POINTS);
+                int nPos = aPointsValue.lastIndexOf(' ',MAX_POINTS_LEN);
+                String aNewValue = nPos != -1 ? aPointsValue.substring(0,nPos) : "";
+                aNewAtts.setValue(nAttr, aNewValue );
+                aAtts = aNewAtts;
+            }
+        }
+        super.startElement(aUri, aLocalName, aQName, aAtts);
+        if( m_bRoot )
+        {
+            if( !(aUri.equals(OFFICE_NAMESPACE_URI) && aLocalName.equals(m_aLocalElementName)) )
+                m_aLogger.logError("Invalid root element: " + aQName );
+            m_bRoot = false;
+        }
+    }
+
+}

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/DSigFilter.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/DSigFilter.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/DSigFilter.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/DSigFilter.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,53 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+class DSigFilter extends NamespaceFilter {
+
+    private static final String OOO_DSIG_NAMESPACE_URI = "http://openoffice.org/2004/documentsignatures";
+    private static final String DSIG_NAMESPACE_URI = "urn:oasis:names:tc:opendocument:xmlns:digitalsignature:1.0";
+        
+    private Logger m_aLogger;
+    
+    /** Creates a new instance of KnownIssueFilter */
+    DSigFilter( Logger aLogger ) {
+        m_aLogger = aLogger;
+    }
+
+    String adaptNamespaceUri( String aUri, String aPrefix)
+    {
+        String aNewUri = null;
+        if( aUri.equals(OOO_DSIG_NAMESPACE_URI) )
+            aNewUri = DSIG_NAMESPACE_URI;
+        
+        return aNewUri;
+    }
+
+    void namespaceUriAdapted( String aUri, String aNewUri )
+    {
+        String aMsg = "Adapting dsig namspace'" + aUri + "'";
+        m_aLogger.logInfo( aMsg , false);
+    }
+
+
+}

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentFilter.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentFilter.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentFilter.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentFilter.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,191 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+import java.util.HashSet;
+import java.util.Vector;
+import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+import org.xml.sax.helpers.XMLFilterImpl;
+
+class ForeignContentFilter extends XMLFilterImpl {
+
+    private static final String OFFICE_NAMESPACE_URI = OdfDocumentNamespace.OFFICE.getUri();
+    private static final String TEXT_NAMESPACE_URI = OdfDocumentNamespace.TEXT.getUri();
+
+    private static final String H = "h";
+    private static final String P = "p";
+
+    private static final String PROCESS_CONTENT = "process-content";
+    private static final String TRUE = "true";
+
+    // Set of ODF namespace URIs
+    private static HashSet<String> m_aODFNamespaceSet = null;
+
+    // This list contains a boolean for all ancestor foreign elements.
+    // That boolean values specifies whether the element content is processed or not.
+    private Vector<Boolean> m_aAlienElementProcessContents = null;
+
+    // This list contains a boolean for all ancestor elements.
+    // That boolean values specifies whether the element is a text:h ot text:p
+    // element itself or has a text:h or text:p ancestor element.
+    private Vector<Boolean> m_aParagraphAncestorElements = null;
+
+    private ForeignContentListener m_aForeignContentListener = null;
+
+    private OdfVersion m_aVersion = null;
+    private Logger m_aLogger;
+
+    /** Creates a new instance of NamespaceFilter */
+    ForeignContentFilter( Logger aLogger, OdfVersion aVersion, ForeignContentListener aForeignContentListener ) {
+        m_aLogger = aLogger;
+        m_aVersion = aVersion;
+        m_aForeignContentListener = aForeignContentListener;
+
+        m_aAlienElementProcessContents = new Vector<Boolean>();
+        m_aParagraphAncestorElements = new Vector<Boolean>();
+        
+        m_aODFNamespaceSet = new HashSet<String>();
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.OFFICE.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.STYLE.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.TEXT.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.TABLE.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.DRAW.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.FO.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.DC.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.META.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.NUMBER.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.SVG.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.CHART.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.DR3D.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.FORM.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.PRESENTATION.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.SMIL.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.CONFIG.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.SCRIPT.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.XLINK.getUri() );
+        m_aODFNamespaceSet.add( OdfDocumentNamespace.XFORMS.getUri() );
+        if( m_aVersion.compareTo( OdfVersion.V1_2 ) >= 0 )
+        {
+            m_aODFNamespaceSet.add( OdfDocumentNamespace.XHTML.getUri() );
+            m_aODFNamespaceSet.add( OdfDocumentNamespace.GRDDL.getUri() );
+            m_aODFNamespaceSet.add( OdfDocumentNamespace.DB.getUri() );
+            m_aODFNamespaceSet.add( javax.xml.XMLConstants.XML_NS_URI );
+        }
+    }
+
+
+    @Override
+    public void endElement(String aUri, String aLocalName, String aQName) throws SAXException {
+        if( isAlienNamespace(aUri) )
+        {
+            m_aAlienElementProcessContents.removeElementAt( m_aAlienElementProcessContents.size()-1 );
+        }
+        else
+        {
+            if( isProcessContent() )
+                super.endElement(aUri,aLocalName,aQName);
+        }
+    }
+
+
+    @Override
+    public void startElement(String aUri, String aLocalName, String aQName, Attributes aAtts) throws SAXException
+    {
+        boolean bProcessContent = isProcessContent();
+        
+        if( isAlienNamespace(aUri) )
+        {
+            if( bProcessContent )
+            {
+                String aProcessContentValue = aAtts.getValue( OFFICE_NAMESPACE_URI, PROCESS_CONTENT );
+                if( m_aVersion.compareTo( OdfVersion.V1_2 ) >= 0 )
+                {
+                    bProcessContent = aProcessContentValue != null ? aProcessContentValue.equals(TRUE) : true;
+                }
+                else
+                {
+                    bProcessContent = aProcessContentValue == null || aProcessContentValue.equals(TRUE);
+                }
+
+                if( m_aForeignContentListener!= null )
+                    m_aForeignContentListener.foreignElementDetected(aUri, aLocalName, aQName, aAtts);
+                m_aLogger.logInfo( String.format("extension element <%s> found, element is ignored, element content is %s.",aQName,bProcessContent?"processed":"is ignored"), false);
+            }
+            m_aAlienElementProcessContents.addElement( bProcessContent );
+        }
+        else if( bProcessContent )
+        {
+            Attributes aOldAtts = aAtts;
+
+            AttributesImpl aNewAtts = null;
+            int i = aOldAtts.getLength();
+            while( i>0 ) {
+                --i;
+                String aAttrUri = aOldAtts.getURI(i);
+                if ( isAlienNamespace( aAttrUri ) ) {
+                    if (aNewAtts == null) {
+                        aNewAtts = new AttributesImpl(aOldAtts);
+                        aAtts = aNewAtts;
+                    }
+                    if( m_aForeignContentListener!= null )
+                        m_aForeignContentListener.foreignAttributeDetected(aAttrUri, aOldAtts.getLocalName(i), aOldAtts.getQName(i), aOldAtts.getValue(i));
+                    m_aLogger.logInfo( String.format("extension attribute '%s' of element <%s> found and ignored.",aAtts.getQName(i),aQName), false);
+                    aNewAtts.removeAttribute(i);
+                }
+            }
+
+            boolean bParagraphAncestor = hasParagraphAncestorElement();
+            bParagraphAncestor |= ((aLocalName.equals(P) || aLocalName.equals(H)) && aUri.equals(TEXT_NAMESPACE_URI));
+            m_aParagraphAncestorElements.add(bParagraphAncestor);
+
+            super.startElement(aUri, aLocalName, aQName, aAtts);
+        }
+    }
+    
+    
+
+    private boolean isAlienNamespace( String aUri )
+    {
+        return !m_aODFNamespaceSet.contains(aUri);
+    }
+
+    private boolean isProcessContent()
+    {
+        return m_aAlienElementProcessContents.isEmpty() ? true : m_aAlienElementProcessContents.lastElement();
+    }
+
+    private boolean hasParagraphAncestorElement()
+    {
+        return m_aParagraphAncestorElements.isEmpty() ? false : m_aParagraphAncestorElements.lastElement();
+    }
+
+    @Override
+    public void characters(char[] aChars, int nStart, int nLength) throws SAXException {
+        if( isProcessContent() )
+            super.characters(aChars, nStart, nLength);
+    }
+    
+}

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentListener.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentListener.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentListener.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/ForeignContentListener.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,39 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+import org.xml.sax.Attributes;
+
+/**
+ * Listener interface for foreign elements and attributes that are detected while
+ * validating a stream.
+ *
+ * @author Michael Brauer
+ */
+interface ForeignContentListener {
+    
+    void foreignElementDetected( String aUri, String aLocalName, String aQName, Attributes aAtts );
+
+    void foreignAttributeDetected( String aUri, String aLocalName, String aQName, String aValue );
+    
+}

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/InternalResources.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/InternalResources.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/InternalResources.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/InternalResources.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,50 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+public class InternalResources {
+
+    static final private String INTERNAL_RESOURCE_PREFIX = "internal:";
+
+    static boolean isInternalResourceIdentifer( String aPath )
+    {
+        return aPath.startsWith(INTERNAL_RESOURCE_PREFIX);
+    }
+    
+    static String getResourcePath( String aPath )
+    {
+		String newPath = null;
+        if(aPath.startsWith("internal:")){			
+			newPath = aPath.substring(INTERNAL_RESOURCE_PREFIX.length());
+		}
+		if(!newPath.startsWith("/")){		
+			newPath = "/".concat(aPath.substring(INTERNAL_RESOURCE_PREFIX.length()));
+		}			
+		return newPath;
+    }
+    
+    static String createInternalResourceIdentifier( String aPath )
+    {
+        return INTERNAL_RESOURCE_PREFIX.concat(aPath);
+    }
+}

Added: incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Logger.java
URL: http://svn.apache.org/viewvc/incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Logger.java?rev=1172466&view=auto
==============================================================================
--- incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Logger.java (added)
+++ incubator/odf/trunk/validator/src/main/java/org/odftoolkit/odfvalidator/Logger.java Mon Sep 19 05:43:23 2011
@@ -0,0 +1,246 @@
+/************************************************************************
+ *
+ * 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.odfvalidator;
+
+import java.io.PrintStream;
+
+import org.xml.sax.SAXParseException;
+
+public class Logger {
+
+	public enum LogLevel {
+
+		ERROR,
+		WARNING,
+		INFO
+	};
+	private String m_aFileName;
+	private String m_aEntryName;
+	private PrintStream m_aOut;
+	private int m_nErrors;
+	private int m_nWarnings;
+	private LogLevel m_nLevel;
+	private Logger m_aParentLogger;
+	private static final String INFO_PREFIX = "Info:";
+	private static final String WARNING_PREFIX = "Warning:";
+	private static final String ERROR_PREFIX = "Error:";
+	private static final String FATAL_PREFIX = "Fatal:";
+	private static boolean m_isHTMLEnabled;
+
+	/** Creates a new instance of Logger */
+	Logger(String aFileName, String aEntryName, PrintStream aOut, LogLevel nLevel) {
+		m_aFileName = aFileName;
+		m_aEntryName = aEntryName;
+		m_aOut = aOut;
+		m_nLevel = nLevel;
+		m_nErrors = 0;
+		m_nWarnings = 0;
+		m_aParentLogger = null;
+	}
+
+	/** Creates a new instance of Logger */
+	Logger(String aEntryName, Logger aParentLogger) {
+		m_aFileName = aParentLogger.m_aFileName;
+		m_aEntryName = aEntryName;
+		m_aOut = aParentLogger.m_aOut;
+		m_nLevel = aParentLogger.m_nLevel;
+		m_nErrors = 0;
+		m_nWarnings = 0;
+		m_aParentLogger = aParentLogger;
+	}
+
+	static void enableHTML(boolean isHTMLEnabled) {
+		m_isHTMLEnabled = isHTMLEnabled;
+	}
+
+	public PrintStream getOutputStream() {
+		return m_aOut;
+	}
+
+	public void setOutputStream(PrintStream aOut) {
+		m_aOut = aOut;
+	}
+
+	boolean hasError() {
+		return m_nErrors > 0;
+	}
+
+	boolean hasWarning() {
+		return m_nWarnings > 0;
+	}
+
+	int getErrorCount() {
+		return m_nErrors;
+	}
+
+	int getWarningCount() {
+		return m_nWarnings;
+	}
+
+	void logWarning(String aMsg) {
+		if (m_nLevel.compareTo(LogLevel.WARNING) >= 0) {
+			if (m_isHTMLEnabled) {
+				m_aOut.print("<span class='warning'>");
+			}
+			logMessage(WARNING_PREFIX, aMsg);
+		}
+		incWarnings();
+	}
+
+	void logFatalError(String aMsg) {
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='fatalError'>");
+		}
+		logMessage(FATAL_PREFIX, aMsg);
+		incErrors();
+	}
+
+	void logError(String aMsg) {
+		if (m_nLevel.compareTo(LogLevel.ERROR) >= 0) {
+			if (m_isHTMLEnabled) {
+				m_aOut.print("<span class='error'>");
+			}
+			logMessage(ERROR_PREFIX, aMsg);
+		}
+		incErrors();
+	}
+
+	void logInfo(String aMsg, boolean bForceOutput) {
+		if (m_nLevel.compareTo(LogLevel.INFO) >= 0 || bForceOutput) {
+			if (m_isHTMLEnabled) {
+				m_aOut.print("<span class='info'>");
+			}
+			logMessage(INFO_PREFIX, aMsg);
+		}
+	}
+
+	void logWarning(SAXParseException e) {
+		if (m_nLevel.compareTo(LogLevel.WARNING) >= 0) {
+			if (m_isHTMLEnabled) {
+				m_aOut.print("<span class='warning'>");
+			}
+			logMessage(WARNING_PREFIX, e);
+		}
+		incWarnings();
+	}
+
+	void logFatalError(SAXParseException e) {
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='fatalError'>");
+		}
+		logMessage(FATAL_PREFIX, e);
+		incErrors();
+	}
+
+	void logError(SAXParseException e) {
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='error'>");
+		}
+		if (m_nLevel.compareTo(LogLevel.ERROR) >= 0) {
+			logMessage(ERROR_PREFIX, e);
+		}
+		incErrors();
+	}
+
+	void logSummaryInfo() {
+		logInfo((hasError() ? getErrorCount() : "no") + " errors, " + (hasWarning() ? getWarningCount() : "no") + " warnings", false);
+	}
+
+	private void printFileEntryPrefix() {
+		m_aOut.print(m_aFileName);
+		if (m_aEntryName != null && m_aEntryName.length() > 0) {
+			m_aOut.print("/");
+			m_aOut.print(m_aEntryName);
+		}
+	}
+
+	private void logMessage(String aPrefix, SAXParseException e) {
+		// filepath
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='filePath'>");
+		}
+		printFileEntryPrefix();
+		m_aOut.print("[");
+		m_aOut.print(e.getLineNumber());
+		m_aOut.print(",");
+		m_aOut.print(e.getColumnNumber());
+		m_aOut.print("]:  ");
+		if (m_isHTMLEnabled) {
+			m_aOut.print("</span>");
+		}
+
+		// prefix, e.g. warning
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='messageType'>");
+		}
+		m_aOut.print(aPrefix);
+		if (m_isHTMLEnabled) {
+			m_aOut.print("</span>");
+		}
+
+		m_aOut.print(" " + e.getMessage());
+		if (m_isHTMLEnabled) {
+			m_aOut.print("</span></br>");
+		}
+		m_aOut.println();
+	}
+
+	private void logMessage(String aPrefix, String aMsg) {
+		// filepath
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='filePath'>");
+		}
+		printFileEntryPrefix();
+		m_aOut.print(":  ");
+		if (m_isHTMLEnabled) {
+			m_aOut.print("</span>");
+		}
+
+		// prefix, e.g. warning
+		if (m_isHTMLEnabled) {
+			m_aOut.print("<span class='messageType'>");
+		}
+		m_aOut.print(aPrefix);
+		if (m_isHTMLEnabled) {
+			m_aOut.print("</span>");
+		}
+		m_aOut.print(" " + aMsg);
+		if (m_isHTMLEnabled) {
+			m_aOut.print("</span></br>");
+		}
+		m_aOut.println();
+	}
+
+	private void incErrors() {
+		++m_nErrors;
+		if (m_aParentLogger != null) {
+			m_aParentLogger.incErrors();
+		}
+	}
+
+	private void incWarnings() {
+		++m_nWarnings;
+		if (m_aParentLogger != null) {
+			m_aParentLogger.incWarnings();
+		}
+	}
+}



Mime
View raw message