You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by do...@apache.org on 2008/08/06 10:47:43 UTC

svn commit: r683173 [1/10] - in /incubator/empire-db/trunk/core/Empire-db: ./ .settings/ bin/ lib/ src/ src/META-INF/ src/org/ src/org/apache/ src/org/apache/empire/ src/org/apache/empire/commons/ src/org/apache/empire/data/ src/org/apache/empire/data/...

Author: doebele
Date: Wed Aug  6 01:47:37 2008
New Revision: 683173

URL: http://svn.apache.org/viewvc?rev=683173&view=rev
Log: (empty)

Added:
    incubator/empire-db/trunk/core/Empire-db/.classpath
    incubator/empire-db/trunk/core/Empire-db/.cvsignore
    incubator/empire-db/trunk/core/Empire-db/.project
    incubator/empire-db/trunk/core/Empire-db/.settings/
    incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.jdt.core.prefs
    incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.component
    incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.project.facet.core.xml
    incubator/empire-db/trunk/core/Empire-db/CHANGELOG.txt
    incubator/empire-db/trunk/core/Empire-db/LICENSE.txt
    incubator/empire-db/trunk/core/Empire-db/NOTICE.txt
    incubator/empire-db/trunk/core/Empire-db/bin/
    incubator/empire-db/trunk/core/Empire-db/build.xml
    incubator/empire-db/trunk/core/Empire-db/buildRelease.xml
    incubator/empire-db/trunk/core/Empire-db/javadoc.xml
    incubator/empire-db/trunk/core/Empire-db/lib/
    incubator/empire-db/trunk/core/Empire-db/lib/commons-beanutils-1.7.0.jar   (with props)
    incubator/empire-db/trunk/core/Empire-db/lib/commons-collections-2.1.1.jar   (with props)
    incubator/empire-db/trunk/core/Empire-db/lib/commons-logging-1.0.4.jar   (with props)
    incubator/empire-db/trunk/core/Empire-db/lib/log4j-1.2.14.jar   (with props)
    incubator/empire-db/trunk/core/Empire-db/src/
    incubator/empire-db/trunk/core/Empire-db/src/META-INF/
    incubator/empire-db/trunk/core/Empire-db/src/META-INF/MANIFEST.MF
    incubator/empire-db/trunk/core/Empire-db/src/org/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/EmpireException.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Attributes.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/DateUtils.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorInfo.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorObject.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Errors.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ObjectUtils.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/OptionEntry.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Options.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/StringUtils.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/Column.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/ColumnExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/DataType.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/Record.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/RecordData.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanClass.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanDomain.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanProperty.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/BeanRecordProxy.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/bean/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/data/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBBlobData.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBClobData.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBCmdType.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBCmpType.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumn.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBColumnExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBCombinedCmd.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBCommand.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBCommandExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabase.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDatabaseDriver.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBDriverFeature.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBErrors.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBIndex.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBJoinType.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBObject.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBQuery.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBReader.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecord.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRecordData.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRelation.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBRowSet.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBSQLScript.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBTable.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBTableColumn.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBView.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/DBXmlDictionary.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBAliasExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCalcExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBConcatExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBCountExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBFuncExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBFuncExprEx.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/DBValueExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/column/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareAndOrExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareColExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBCompareNotExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/DBExistsExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/compare/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/join/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/join/DBJoinExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/join/DBJoinExprEx.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/join/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/DBSetExpr.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/expr/set/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/hsql/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/mysql/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBCommandOracle.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/OracleDataDictionnary.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/OracleSYSDatabase.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/oracle/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/db/sqlserver/package.html
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/xml/
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/xml/XMLConfiguration.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/xml/XMLUtil.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/xml/XMLWriter.java
    incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/xml/package.html

Added: incubator/empire-db/trunk/core/Empire-db/.classpath
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/.classpath?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/.classpath (added)
+++ incubator/empire-db/trunk/core/Empire-db/.classpath Wed Aug  6 01:47:37 2008
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry exported="true" kind="lib" path="lib/commons-collections-2.1.1.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.4.jar"/>
+	<classpathentry exported="true" kind="lib" path="lib/commons-beanutils-1.7.0.jar" sourcepath="D:/DevTools/Frameworks/commons-beanutils-1.7.0-src/src/java">
+		<attributes>
+			<attribute name="javadoc_location" value="http://jakarta.apache.org/commons/beanutils/api"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry exported="true" kind="lib" path="lib/log4j-1.2.14.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Added: incubator/empire-db/trunk/core/Empire-db/.cvsignore
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/.cvsignore?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/.cvsignore (added)
+++ incubator/empire-db/trunk/core/Empire-db/.cvsignore Wed Aug  6 01:47:37 2008
@@ -0,0 +1 @@
+doc

Added: incubator/empire-db/trunk/core/Empire-db/.project
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/.project?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/.project (added)
+++ incubator/empire-db/trunk/core/Empire-db/.project Wed Aug  6 01:47:37 2008
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>Empire-db</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.common.project.facet.core.builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.ibm.sse.model.structuredbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.ibm.etools.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.wst.validation.validationbuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+		<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+		<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+	</natures>
+</projectDescription>

Added: incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.jdt.core.prefs?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.jdt.core.prefs Wed Aug  6 01:47:37 2008
@@ -0,0 +1,7 @@
+#Wed Jun 06 10:01:48 CEST 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

Added: incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.component
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.component?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.component (added)
+++ incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.component Wed Aug  6 01:47:37 2008
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="Empire-db">
+<wb-resource deploy-path="/" source-path="/src"/>
+</wb-module>
+</project-modules>

Added: incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.project.facet.core.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.project.facet.core.xml?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.project.facet.core.xml (added)
+++ incubator/empire-db/trunk/core/Empire-db/.settings/org.eclipse.wst.common.project.facet.core.xml Wed Aug  6 01:47:37 2008
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+  <fixed facet="jst.utility"/>
+  <fixed facet="jst.java"/>
+  <installed facet="jst.java" version="5.0"/>
+  <installed facet="jst.utility" version="1.0"/>
+</faceted-project>

Added: incubator/empire-db/trunk/core/Empire-db/CHANGELOG.txt
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/CHANGELOG.txt?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/CHANGELOG.txt (added)
+++ incubator/empire-db/trunk/core/Empire-db/CHANGELOG.txt Wed Aug  6 01:47:37 2008
@@ -0,0 +1,25 @@
+--------------
+Release 2.1.0:
+--------------
+114:	All package names changed to org.apache.empire.
+
+--------------
+Release 2.0.2:
+--------------
+113:	NEW FEATURE: class BeanRecordProxy<T> implements the Record interface of any given JavaBean object.	
+112:	NEW FEATURE: classes BeanDomain, BeanClass and BeanProperty allow metadata defition for JavaBean objects using the Column interface.
+111:	DBDatabaseDriverOracle: new implementation for checkDatabase
+110:	Method getSourceColumn added for data.Column
+109:	DBRecordData: Typ conversion moved to ObjectUtils
+108:	NEW FEATURE: createView implemented for all Database Drivers
+107:	DBView: canUpdateReocrds = Flag for updateable and non-updateable Views;
+
+--------------
+Release 2.0.1:
+--------------
+106:	NEW FEATURE: DBDatabaseDriverMySQL:	Driver for MySQL 5 added.
+105:	NEW FEATURE: DBColumnExpr: Added Support for REVERSE() and INSTR() SQL Functions
+104:	BUGFIX: DBRecord::getFieldValue(): Field Access to invalid DBRecord returned Boolean FALSE instead of null.
+103:	DBDatabaseDriver: Function isSupported() and getPostInsertAutoIncValue() added
+102:	DBColumnExpr: Substring function now excepts column expressions 
+101:	DBSQLScript: New class to replace StringBuilder for DDL Script generation. See also DBDatabase::getCreateDDLScript()

Added: incubator/empire-db/trunk/core/Empire-db/LICENSE.txt
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/LICENSE.txt?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/LICENSE.txt (added)
+++ incubator/empire-db/trunk/core/Empire-db/LICENSE.txt Wed Aug  6 01:47:37 2008
@@ -0,0 +1,174 @@
+                                 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.

Added: incubator/empire-db/trunk/core/Empire-db/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/NOTICE.txt?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/NOTICE.txt (added)
+++ incubator/empire-db/trunk/core/Empire-db/NOTICE.txt Wed Aug  6 01:47:37 2008
@@ -0,0 +1,2 @@
+This product includes software developed by ESTEAM Software.
+For further information see http://www.empire-db.org

Added: incubator/empire-db/trunk/core/Empire-db/build.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/build.xml?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/build.xml (added)
+++ incubator/empire-db/trunk/core/Empire-db/build.xml Wed Aug  6 01:47:37 2008
@@ -0,0 +1,70 @@
+<project name="empire-db" default="build" basedir=".">
+	<description>Builds empire-db.jar</description>
+	<!-- set properties for this build -->
+	<property name="src.dir" location="src"/>
+	<property name="lib.dir" location="lib"/>
+	<property name="deploy.dir" location="../deploy"/>
+	<property name="this.deploy.dir" location="${deploy.dir}/empire-db"/>
+	<property name="out.dir" location="${this.deploy.dir}/out"/>
+	<property name="jar.file" location="${this.deploy.dir}/empire-db.jar"/>
+	<property name="jar.version.file" location="${this.deploy.dir}/empire-db-2.0.3.jar"/>
+	
+	<!-- 
+		target build
+	 -->
+	<target name="build" depends="clean,compile,jar,dependjars,tidy" />
+	
+	<!-- 
+		target clean
+	 -->
+	<target name="clean" description="delete everything">
+		<delete dir="${this.deploy.dir}"/>
+	</target>
+	<!-- 
+		target compile
+	 -->
+	<target name="compile" description="delete class folder, compiling all source files of the packages">
+		<delete dir="${this.deploy.dir}"/>
+		<mkdir dir="${this.deploy.dir}"/>
+		<mkdir dir="${out.dir}" />
+		
+	    <javac srcdir="${src.dir}" destdir="${out.dir}" listfiles="false" debug="on">
+	    	<classpath>
+	    		<pathelement location="${lib.dir}/commons-beanutils-1.7.0.jar"/>
+	    		<pathelement location="${lib.dir}/commons-collections-2.1.1.jar"/>
+	    		<pathelement location="${lib.dir}/commons-logging-1.0.4.jar"/>	
+	    		<pathelement location="${lib.dir}/log4j-1.2.14.jar"/>	
+			</classpath>
+<!--    	<compilerarg value="-Xlint" /> -->
+		</javac>
+    </target>
+	<!-- 
+		target jar
+	 -->
+	<target name="jar">
+		<jar destfile="${jar.file}" compress="true">
+			<fileset dir="${out.dir}" />
+			<fileset dir="${src.dir}" />
+			<fileset dir="" includes="*.txt" />
+		</jar>
+		<jar destfile="${jar.version.file}" compress="true">
+			<fileset dir="${out.dir}" />
+			<fileset dir="${src.dir}" />
+			<fileset dir="" includes="*.txt" />
+		</jar>
+	</target>
+	<!-- 
+		dependjars
+	 -->
+	<target name="dependjars" description="copy dependancies to deploy dir">
+		<copy todir="${this.deploy.dir}">
+			<fileset dir="${lib.dir}" includes="*.jar"/>				
+		</copy>
+	</target>
+	<!-- 
+		target tidy
+	 -->
+	<target name="tidy" description="delete temp files">
+		<delete dir="${out.dir}"/>
+	</target>
+</project>

Added: incubator/empire-db/trunk/core/Empire-db/buildRelease.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/buildRelease.xml?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/buildRelease.xml (added)
+++ incubator/empire-db/trunk/core/Empire-db/buildRelease.xml Wed Aug  6 01:47:37 2008
@@ -0,0 +1,151 @@
+<project name="buildRelease" default="build" basedir=".">
+	<description>Builds the download folder</description>
+	<!-- set properties for this build -->
+	<property name="src.dir" location="src"/>
+	<property name="lib.dir" location="lib"/>
+	<property name="deploy.dir" location="../deploy"/>
+	<property name="this.deploy.dir" location="${deploy.dir}/empire-db-2.0.3"/>
+	<property name="out.dir" location="${this.deploy.dir}/out"/>
+	<property name="lib.deploy.dir" location="${this.deploy.dir}/lib" />
+	<property name="src.deploy.dir" location="${this.deploy.dir}/src" />
+	<property name="examples.deploy.dir" location="${this.deploy.dir}/examples" />
+	<property name="jar.version.file" location="${this.deploy.dir}/empire-db-2.0.3.jar"/>
+	
+	<!-- 
+		target build
+	 -->
+	<target name="build" depends="clean,compile,jar,dependjars,copySourceFolder,generateJavadocs,createEclipseExample,miscellaneous,tidy" />
+	
+	<!-- 
+		target clean
+	 -->
+	<target name="clean" description="delete everything">
+		<delete dir="${this.deploy.dir}"/>
+	</target>
+	<!-- 
+		target compile
+	 -->
+	<target name="compile" description="delete class folder, compiling all source files of the packages">
+		<delete dir="${this.deploy.dir}"/>
+		<mkdir dir="${this.deploy.dir}"/>
+		<mkdir dir="${out.dir}" />
+		
+	    <javac srcdir="${src.dir}" destdir="${out.dir}" listfiles="false" debug="on">
+	    	<classpath>
+	    		<path>
+	    			<fileset dir="${lib.dir}"/>
+	    		</path>
+			</classpath>
+		</javac>
+    </target>
+	<!-- 
+		target jar
+	 -->
+	<target name="jar">
+		<jar destfile="${jar.version.file}" compress="true">
+			<fileset dir="${out.dir}" />
+			<fileset dir="${src.dir}" />
+			<fileset dir="" includes="*.txt" />
+		</jar>
+	</target>
+	<!-- 
+		dependjars
+	 -->
+	<target name="dependjars" description="copy dependancies to deploy dir">
+		<mkdir dir="${lib.deploy.dir}"/>
+		<copy todir="${lib.deploy.dir}">
+			<fileset dir="${lib.dir}" includes="*.jar"/>		
+		</copy>
+	</target>
+	
+	<!-- 
+		copySourceFolder
+	 -->
+	 <target name="copySourceFolder" description="copies dependancies to deploy dir">
+		<mkdir dir="${src.deploy.dir}"/>
+		<copy todir="${src.deploy.dir}">
+	 		<fileset dir="${src.dir}" includes="**/*.*" />
+	 	</copy>
+	 </target>
+	 
+	 <!-- 
+		createEclipseExample
+	 -->
+	 <target name="createEclipseExample" description="creates an Eclipse example">
+		<mkdir dir="${examples.deploy.dir}"/>
+	 	<concat destfile="${examples.deploy.dir}/readme.txt">For an Empire-db introcution tutorial see tutorial.pdf in the DBSample subdirecotry.</concat>
+		<copy todir="${examples.deploy.dir}">
+	 		<fileset dir="../" includes="DBSample/**/*.*" >
+	 			<exclude name="**/.settings/**" />
+	 			<exclude name="**/build.xml" />
+	 			<exclude name="**/sqljdbc.jar" />
+	 			<exclude name="**/hsqldb/**" />
+	 		</fileset>
+			<fileset dir="../">
+				<include name="DBSample/classpath_delivery-version"/>
+			</fileset>
+	 	</copy>
+	 	<move file="${examples.deploy.dir}/DBSample/classpath_delivery-version" tofile="${examples.deploy.dir}/DBSample/.classpath" overwrite="true" />
+		<copy todir="${examples.deploy.dir}">
+	 		<fileset dir="../" includes="DBSampleAdv/**/*.*" >
+	 			<exclude name="**/.settings/**" />
+	 			<exclude name="**/build.xml" />
+	 			<exclude name="**/sqljdbc.jar" />
+	 			<exclude name="**/hsqldb/**" />
+	 		</fileset>
+			<fileset dir="../">
+				<include name="DBSampleAdv/classpath_delivery-version"/>
+			</fileset>
+	 	</copy>
+	 	<move file="${examples.deploy.dir}/DBSampleAdv/classpath_delivery-version" tofile="${examples.deploy.dir}/DBSampleAdv/.classpath" overwrite="true" />
+		<copy todir="${examples.deploy.dir}/DBSample/lib">
+			<fileset dir="${this.deploy.dir}/">
+				<include name="*.jar"/>
+			</fileset>
+			<fileset dir="${this.deploy.dir}/lib/">
+				<include name="*.jar"/>
+			</fileset>
+			<fileset dir="../JDBCDrivers/lib/">
+				<include name="hsqldb.jar"/>
+			</fileset>
+		</copy>
+		<copy todir="${examples.deploy.dir}/DBSampleAdv/lib">
+			<fileset dir="${this.deploy.dir}/">
+				<include name="*.jar"/>
+			</fileset>
+			<fileset dir="${this.deploy.dir}/lib/">
+				<include name="*.jar"/>
+			</fileset>
+			<fileset dir="../JDBCDrivers/lib/">
+				<include name="hsqldb.jar"/>
+			</fileset>
+		</copy>
+	 </target>
+	 
+	 <!-- 
+		generate Javadocs
+	 -->
+	 <target name="generateJavadocs" description="generates the javadocs for this project">
+	 	<ant inheritAll="true" antfile="javadoc.xml" />
+	 </target>
+	 
+	 <!-- 
+	 	miscellaneous
+	  -->
+	  <target name="miscellaneous">
+	  	<copy todir="${this.deploy.dir}">
+	  		<fileset dir=".">
+	  			<include name="NOTICE.txt" />
+	  			<include name="LICENSE.txt" />
+	  			<include name="CHANGELOG.txt" />
+	  		</fileset>
+	  	</copy>
+	  </target>
+	  
+	<!-- 
+		target tidy
+	 -->
+	<target name="tidy" description="delete temp files">
+		<delete dir="${out.dir}"/>
+	</target>
+</project>

Added: incubator/empire-db/trunk/core/Empire-db/javadoc.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/javadoc.xml?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/javadoc.xml (added)
+++ incubator/empire-db/trunk/core/Empire-db/javadoc.xml Wed Aug  6 01:47:37 2008
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project default="javadoc">
+	<property name="lib.dir" location="lib"/>
+	<property name="dest.dir" location="../deploy/empire-db-2.0.3/docs"/>
+	<property name="sourcepath" location="src"/>
+<target name="javadoc">
+<javadoc access="public" author="true" destdir="${dest.dir}" doctitle="Empire-db API Specification" nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" 
+	     packagenames="org.apache.empire.commons,
+					   org.apache.empire.data,
+	                   org.apache.empire.db,
+					   org.apache.empire.db.expr.column,
+					   org.apache.empire.db.expr.compare,
+					   org.apache.empire.db.expr.join,
+	                   org.apache.empire.db.expr.set,
+					   org.apache.empire.db.hsql,
+					   org.apache.empire.db.mysql,
+					   org.apache.empire.db.oracle,
+	                   org.apache.empire.db.sqlserver,
+					   org.apache.empire.xml" 
+	     source="1.5" sourcepath="${sourcepath}" splitindex="true" use="true" version="true">
+	<classpath>
+		<path>
+			<fileset dir="${lib.dir}"/>
+		</path>
+	</classpath>
+</javadoc>
+</target>
+</project>

Added: incubator/empire-db/trunk/core/Empire-db/lib/commons-beanutils-1.7.0.jar
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/lib/commons-beanutils-1.7.0.jar?rev=683173&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/empire-db/trunk/core/Empire-db/lib/commons-beanutils-1.7.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/empire-db/trunk/core/Empire-db/lib/commons-collections-2.1.1.jar
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/lib/commons-collections-2.1.1.jar?rev=683173&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/empire-db/trunk/core/Empire-db/lib/commons-collections-2.1.1.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/empire-db/trunk/core/Empire-db/lib/commons-logging-1.0.4.jar
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/lib/commons-logging-1.0.4.jar?rev=683173&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/empire-db/trunk/core/Empire-db/lib/commons-logging-1.0.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/empire-db/trunk/core/Empire-db/lib/log4j-1.2.14.jar
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/lib/log4j-1.2.14.jar?rev=683173&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/empire-db/trunk/core/Empire-db/lib/log4j-1.2.14.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/empire-db/trunk/core/Empire-db/src/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/META-INF/MANIFEST.MF?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/META-INF/MANIFEST.MF (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/META-INF/MANIFEST.MF Wed Aug  6 01:47:37 2008
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Specification-Title: empire-db
+Specification-Version: 2.1.0b
+Specification-Vendor: ESTEAM Software

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/EmpireException.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/EmpireException.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/EmpireException.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/EmpireException.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,58 @@
+/*
+ * ESTEAM Software GmbH, 26.12.2007
+ */
+package org.apache.empire;
+
+import org.apache.empire.commons.ErrorObject;
+import org.apache.empire.commons.ErrorType;
+
+/**
+ * This exception type is used for all empire errors.<br>
+ * Exceptions will only be thrown if exceptions are enabled in the ErrorObject.<BR>
+ * @see ErrorObject#setExceptionsEnabled(boolean)<BR>
+ * <P>
+ * @param errorObject the object that caused the error
+ */
+public final class EmpireException extends RuntimeException
+{
+    private static final long serialVersionUID = 1L;
+    
+    private final ErrorType errorType;
+    private final ErrorObject errorObject; 
+    
+    /**
+     * creates an empire exception from an error object.
+     * @param errorObject
+     */
+    public EmpireException(final ErrorObject errorObject)
+    {
+        super(errorObject.getErrorMessage());
+        // init
+        this.errorType = errorObject.getErrorType();
+        this.errorObject = errorObject;
+    }
+    
+    @Override
+    public String toString()
+    {   // Return Object class name and error message
+        return errorObject.getClass().getName() + ": " + getMessage();
+    }
+
+    /**
+     * The type of error that occurred<BR>
+     * @see org.apache.empire.commons.Errors<BR>
+     * @return the type of error
+     */
+    public ErrorType getErrorType()
+    {
+        return errorType;
+    }
+
+    /**
+     * @return the object that caused the error
+     */
+    public ErrorObject getErrorObject()
+    {
+        return errorObject;
+    }
+}

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Attributes.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Attributes.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Attributes.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Attributes.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,68 @@
+/*
+ * ESTEAM Software GmbH
+ */
+package org.apache.empire.commons;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+
+import org.w3c.dom.Element;
+
+/**
+ * This class holds a map of objects which are identified by a case insensitive key string.
+ * 
+ * @author ESTEAM software <A TARGET="esteam" HREF="http://www.esteam.de">www.esteam.de </A>
+ */
+@SuppressWarnings("serial")
+public class Attributes extends LinkedHashMap<String, Object>
+{
+    /**
+     * @param key the attribute
+     * @return the attribute value
+     */
+    public Object get(String key)
+    {   // Check Key
+        if (key==null || key.length()==0)
+            return null;
+        // Get
+        return super.get(key.toLowerCase());
+    }
+
+    @Override
+    public Object get(Object key)
+    {   // Check Key
+        return get((key!=null ? key.toString() : null));
+    }
+
+    @Override
+    public Object put(String key, Object v)
+    {
+        if (key==null || key.length()==0)
+            return null;
+        return super.put(key.toLowerCase(), v);
+    }
+
+    /**
+     * @param name the attribute
+     * @param object the attribute value
+     */
+    public void set(String name, Object object)
+    {
+        this.put(name, object);
+    }
+
+    /**
+     * @param element the XMLElement to which to append the options
+     * @param flags options (currently unused)
+     */
+    public void addXml(Element element, long flags)
+    {
+        // add All Options
+        Iterator<String> i = keySet().iterator();
+        while (i.hasNext())
+        {
+            String key = i.next();
+            element.setAttribute(key, String.valueOf(get(key)));
+        }
+    }
+}

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/DateUtils.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/DateUtils.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/DateUtils.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/DateUtils.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,231 @@
+/*
+ * ESTEAM Software GmbH
+ */
+package org.apache.empire.commons;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * This class contains common functions for comparing and converting values of type Date. 
+ * 
+ * @author ESTEAM software <A TARGET="esteam" HREF="http://www.esteam.de">www.esteam.de </A>
+ */
+public class DateUtils
+{
+    // Logger
+    private static final Log log = LogFactory.getLog(DateUtils.class);
+    
+    private DateUtils()
+    {
+        // Static Function only
+        // No instance may be created
+    }
+        
+    /**
+     * returns a date relative from the current date.
+     * <P>
+     * @param withTime true if the current time should be added or false if only the date is desired.
+     * @param years number of years to add or subtract from the current date
+     * @param months number of months to add or subtract from the current date
+     * @param days number of days to add or subtract from the current date
+     * @return the target date
+     */
+    public static Date getDateTimeFromNow(boolean withTime, int years, int months, int days)
+    {
+        Calendar calendar = Calendar.getInstance();
+        if (withTime==false)
+        {
+            calendar.set(Calendar.HOUR_OF_DAY, 0);
+            calendar.set(Calendar.MINUTE, 0);
+            calendar.set(Calendar.SECOND, 0);
+            calendar.set(Calendar.MILLISECOND, 0);
+        }
+        // Roll
+        if (years!=0)
+            calendar.add(Calendar.YEAR, years);
+        if (months!=0)
+            calendar.add(Calendar.MONTH, months);
+        if (days!=0)
+            calendar.add(Calendar.DAY_OF_MONTH, days);
+        // get Time
+        return calendar.getTime();
+    }
+
+    /**
+     * Returns the current date without time
+     */
+    public static Date getDateNow()
+    {
+        return getDateTimeFromNow(false, 0, 0, 0);
+    }
+
+    /**
+     * Returns the current date and time
+     */
+    public static Date getTimeNow()
+    {
+        return getDateTimeFromNow(true, 0, 0, 0);
+    }
+
+    /**
+     * Calculates a date relative to the supplied date.
+     * @param date date to calculate from 
+     * @param years number of years to add or subtract from the supplied date
+     * @param months number of months to add or subtract from the supplied date
+     * @param days number of days to add or subtract from the supplied date
+     * @return the target date
+     */
+    public static Date addDate(Date date, int years, int months, int days)
+    {
+        Calendar calendar = Calendar.getInstance();
+        if (date!=null)
+            calendar.setTime(date);
+        if (years!=0)
+            calendar.add(Calendar.YEAR, years);
+        if (months!=0)
+            calendar.add(Calendar.MONTH, months);
+        if (days!=0)
+            calendar.add(Calendar.DAY_OF_MONTH, days);
+        return calendar.getTime();
+    }
+    
+    public static Date setDate(Date date, int year, int month, int day)
+    {
+        Calendar calendar = Calendar.getInstance();
+        if (date!=null)
+            calendar.setTime(date);
+        if (year>0)
+            calendar.set(Calendar.YEAR, year);
+        if (month>=0)
+            calendar.set(Calendar.MONTH, month);
+        if (day>0)
+            calendar.set(Calendar.DAY_OF_MONTH, day);
+        return calendar.getTime();
+    }
+    
+    public static Date getDate(int year, int month, int day)
+    {
+        Calendar calendar = Calendar.getInstance();
+        if (year>0)
+            calendar.set(Calendar.YEAR, year);
+        if (month>=0)
+            calendar.set(Calendar.MONTH, month);
+        if (day>0)
+            calendar.set(Calendar.DAY_OF_MONTH, day);
+        // No Time
+        calendar.set(Calendar.HOUR_OF_DAY, 0);
+        calendar.set(Calendar.MINUTE, 0);
+        calendar.set(Calendar.SECOND, 0);
+        calendar.set(Calendar.MILLISECOND, 0);
+        return calendar.getTime();
+    }
+
+    public static Date setTime(Date date, int hours, int minutes, int seconds, int millis)
+    {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.set(Calendar.HOUR_OF_DAY, hours);
+        calendar.set(Calendar.MINUTE, minutes);
+        calendar.set(Calendar.SECOND, seconds);
+        calendar.set(Calendar.MILLISECOND, millis);
+        return calendar.getTime();
+    }
+
+    public static Date getDateOnly(Date date)
+    {
+        return setTime(date, 0, 0, 0, 0);
+    }
+    
+    // ------- parsing functions -----
+
+    public static Date parseDate(String sDate, Locale locale)
+    {
+        // Try to parse
+        try 
+        {
+            DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, getSafeLocale(locale));
+            df.setLenient(true);
+            return df.parse(sDate);
+        } catch (ParseException e)
+        {
+            log.error("Invalid date value", e);
+            return null;
+        }
+    }
+    
+    // ------- formating functions -------
+    
+    private static Locale getSafeLocale(Locale locale)
+    {
+        return (locale==null) ? Locale.getDefault() : locale;        
+    }
+    
+    public static String formatDate(Date d, Locale locale)
+    {
+        DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, getSafeLocale(locale));
+        return df.format(d);
+    }
+    
+    public static String formatTime(Date d, Locale locale, boolean withSeconds)
+    {
+        int style = (withSeconds ? DateFormat.MEDIUM : DateFormat.SHORT);
+        DateFormat df = DateFormat.getTimeInstance(style, getSafeLocale(locale));
+        return df.format(d);
+    }
+    
+    public static String formatDayOfWeek(Date d, Locale locale, boolean longFormat)
+    {
+        SimpleDateFormat sdf = new SimpleDateFormat("", getSafeLocale(locale));
+        Calendar c = Calendar.getInstance(getSafeLocale(locale));
+        c.setTime(d);
+        int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
+        if (longFormat)
+            return sdf.getDateFormatSymbols().getWeekdays()[dayOfWeek];
+        else
+            return sdf.getDateFormatSymbols().getShortWeekdays()[dayOfWeek];
+    }
+    
+    public static String formatMonth(Date d, Locale locale, boolean longFormat)
+    {
+        SimpleDateFormat sdf = new SimpleDateFormat("", getSafeLocale(locale));
+        Calendar c = Calendar.getInstance(getSafeLocale(locale));
+        c.setTime(d);
+        int month = c.get(Calendar.MONTH);
+        if (longFormat)
+            return sdf.getDateFormatSymbols().getMonths()[month];
+        else
+            return sdf.getDateFormatSymbols().getShortMonths()[month];
+    }
+    
+    public static int getWeekOfYear(Date d, Locale locale)
+    {
+        Calendar c = Calendar.getInstance(getSafeLocale(locale));
+        c.setTime(d);
+        return c.get(Calendar.WEEK_OF_YEAR);
+    }
+    
+    public static String formatMonth(int month, Locale locale, boolean longFormat)
+    {
+        SimpleDateFormat sdf = new SimpleDateFormat("", getSafeLocale(locale));
+        if (longFormat)
+            return sdf.getDateFormatSymbols().getMonths()[month];
+        else
+            return sdf.getDateFormatSymbols().getShortMonths()[month];
+    }
+    
+    public static String formatYear(Date d, Locale locale)
+    {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy", getSafeLocale(locale));
+        Calendar c = Calendar.getInstance(getSafeLocale(locale));
+        c.setTime(d);
+        return sdf.format(d);
+    }
+}

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorInfo.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorInfo.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorInfo.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorInfo.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,41 @@
+/*
+ * ESTEAM Software GmbH
+ */
+package org.apache.empire.commons;
+
+/**
+ * This interface allows access to the last error that occured on a object.
+ * 
+ * @author ESTEAM software <A TARGET="esteam" HREF="http://www.esteam.de">www.esteam.de </A>
+ */
+public interface ErrorInfo
+{
+  /**
+   * Returns wether or not an error is set.
+   * 
+   * @return true if an error has been set, or otherwise false
+   */
+  boolean hasError();
+
+  /**
+   * Returns the last error code.
+   * 
+   * @return the error code of ERR_NONE if no error has been set.
+   */
+  ErrorType getErrorType();
+
+  /**
+   * Returns the parameters used to build the error text.
+   * 
+   * @return the error message or null if no error has been set.
+   */
+  Object[] getErrorParams();
+
+  /**
+   * Returns the source object's class name that raised the error
+   * 
+   * @return the error message or null if no error has been set.
+   */
+  String getErrorSource();
+  
+}
\ No newline at end of file

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorObject.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorObject.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorObject.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorObject.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,386 @@
+/*
+ * ESTEAM Software GmbH
+ */
+package org.apache.empire.commons;
+
+import java.text.MessageFormat;
+import java.util.WeakHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.empire.EmpireException;
+
+
+/**
+ * This class holds and provides information about the last error that occured on an object.
+ * <P> 
+ * In order to use this class you must derive your class from Error Object.<BR>
+ * If a method fails then you must set the error by calling one of the error(...) functions.<BR>
+ * The method usually indicates failure by returning false.<BR>
+ * You may then retrieve error information by calling one of the function defined by the {@link ErrorInfo} interface.<BR>
+ * All classes of the empire framework are derived from this class.<BR>
+ * <P> 
+ * This class is thread save so each thread may have it's own error information for a particular object. 
+ * <P> 
+ * @author ESTEAM software <A TARGET="esteam" HREF="http://www.esteam.de">www.esteam.de </A>
+ */
+public abstract class ErrorObject implements ErrorInfo
+{
+    // Logger
+    private static final Log log = LogFactory.getLog(ErrorObject.class);
+    // Exceptions flag
+    private static boolean exceptionsEnabled = false;
+
+    /**
+     * Returns wether or not Exceptions will be thrown on failure.<BR>
+     * If disabled (default) the functions' return values will indicate success or failure<BR> 
+     * @return true if Exceptions are enable or false otherwise
+     */
+    public static boolean isExceptionsEnabled()
+    {
+        return exceptionsEnabled;
+    }
+
+    /**
+     * Use this to enable or disable Exceptions.<BR>
+     * If exceptionsEnabled is false no exceptions will be thrown.<BR>
+     * Instead the functions' return values will indicate success or failure<BR> 
+     * @param enableExceptions true to enable exceptions or false to disable
+     */
+    public static void setExceptionsEnabled(boolean enableExceptions)
+    {
+        ErrorObject.exceptionsEnabled = enableExceptions;
+    }
+
+    /**
+     * This class is internally used by the ErrorObject 
+     * to provide thread-safe access to the error information.
+     */
+    protected static class ObjectErrorInfo
+    {
+        /**
+         * Type of error
+         */
+        public ErrorType errType    = null; 
+        /**
+         * Error message params
+         */
+        public Object[]  errParams  = null; 
+        /**
+         * Source object's class name 
+         */
+        public String    errSource  = null;
+        /**
+         *  public constructor allows
+         *  derived classes to instantiate 
+         */
+        public ObjectErrorInfo() 
+        { 
+            /* allow derived classes to instantiate */ 
+        }
+    }
+
+    // The HashMap of error objects for the local thread
+    private static final ThreadLocal<WeakHashMap<ErrorObject, ObjectErrorInfo>>
+          errorMap = new ThreadLocal<WeakHashMap<ErrorObject, ObjectErrorInfo>>();
+
+    
+    /**
+     * Returns the message associated with an error.
+     * 
+     * @param error the error information for which to obtain an error message
+     * @return the error message or an empty string if no error has been set.
+     */
+    public static String getMessage(ErrorInfo error)
+    {
+        if (error==null)
+            return "";
+        // Check params
+        ErrorType type = error.getErrorType();
+        if (type==null || type==Errors.None)
+            return ""; // No Error
+        if (error.getErrorParams()==null)
+            return type.getMessagePattern();
+        // Get Error Message
+        String msgPattern = type.getMessagePattern();
+        String msg = MessageFormat.format(msgPattern, error.getErrorParams());
+        return msg;
+    }
+    
+    /**
+     * Constructs an ErrorObject object.
+     */
+    public ErrorObject()
+    {
+        // Default Constructor
+    }
+
+    /**
+     * Constructs a ErrorObject object
+     * copying the Error information of another object.
+     * 
+     * @param other the source error information
+     */
+    public ErrorObject(ErrorInfo other)
+    {
+        error(other);
+    }
+    
+    /**
+     * getErrorInfo
+     */
+    protected ObjectErrorInfo getErrorInfo(boolean create)
+    {
+        WeakHashMap<ErrorObject, ObjectErrorInfo> map = errorMap.get();
+        if (map==null)
+        {   map = new WeakHashMap<ErrorObject, ObjectErrorInfo>();
+            errorMap.set(map);
+        }
+        ObjectErrorInfo info = errorMap.get().get(this);
+        if (info==null && create)
+        {   info = new ObjectErrorInfo();
+            map.put(this, info);
+        }
+        return info;
+    }
+    
+    /**
+     * Clears the ErrorInfo.
+     */
+    protected void clearErrorInfo()
+    {
+        WeakHashMap<ErrorObject, ObjectErrorInfo> map = errorMap.get();
+        if (map!=null)
+            map.remove(this);
+    }
+
+    /**
+     * Returns wether or not an error is set.
+     * 
+     * @return true if an error has been set, or otherwise false
+     */
+    public final boolean hasError()
+    {
+        ObjectErrorInfo info = getErrorInfo(false);
+        return (info!=null && info.errType!=Errors.None);
+    }
+
+    /**
+     * Returns the last error code.
+     * 
+     * @return the error code of ERR_NONE if no error has been set.
+     */
+    public final ErrorType getErrorType()
+    {
+        ObjectErrorInfo info = getErrorInfo(false);
+        return ((info!=null) ? info.errType : Errors.None);
+    }
+
+    /**
+     * Returns the parameters used to build the error text.
+     * 
+     * @return the error message or null if no error has been set.
+     */
+    public final String getErrorSource()
+    {
+        ObjectErrorInfo info = getErrorInfo(false);
+        return ((info!=null) ? info.errSource : null);
+    }
+
+    /**
+     * Returns the parameters used to build the error text.
+     * 
+     * @return the error message or null if no error has been set.
+     */
+    public final Object[] getErrorParams()
+    {
+        ObjectErrorInfo info = getErrorInfo(false);
+        return ((info!=null) ? info.errParams : null);
+    }
+    
+    /**
+     * Clears the error for this object.
+     */
+    public final void clearError()
+    {
+        internalSetError(Errors.None, null, null);
+    }
+    
+    /**
+     * Returns the message associated with the last error.
+     * 
+     * @return the error message or an empty string if no error has been set.
+     */
+    public final String getErrorMessage()
+    {
+        return getMessage(this);
+    }
+    
+    /**
+     * Sets the last error and the corresponding error message on this object.
+     * 
+     * @param errType the type of error to set.
+     * @param params array of parameters for the error message if any.
+     * @param source object from which this error originated from.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected boolean internalSetError(ErrorType errType, Object[] params, ErrorInfo source)
+    { 	// setError
+        if (errType == Errors.None )
+        {   // No Error
+            clearErrorInfo();
+            return true;
+        }    
+        // set error info
+        ObjectErrorInfo info = getErrorInfo(true);
+        info.errType   = errType;
+        info.errParams = params;
+        info.errSource =(source!=null) ? source.getClass().getName() : getClass().getName();
+        // Use Exceptions
+        if (exceptionsEnabled)
+            throw new EmpireException(this);
+        // return Error Status
+        return false;
+    }
+    
+    /** returns true */
+    protected final boolean success()
+    {
+        return internalSetError(Errors.None, null, null);
+    }
+
+    /**
+     * Sets an error from an error code an an array of parameters
+     * 
+     * @param errType the type of error to set.
+     * @param params array of parameters for the error message if any.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(ErrorType errType, Object[] params)
+    {
+        // check error code
+        if (errType == Errors.None)
+        {	// Must supply a valid error code
+            log.error("error function called with invalid error Code.");
+            return true; 
+        }
+        // Check parameter count
+        int paramCount = (params!=null) ? params.length : 0;
+        if (paramCount!= errType.getNumParams())
+        {   // Number of parameters does not match
+            log.warn("Invalid Number of arguments supplied for error " + errType.getKey() 
+                   + "\nArguments supplied= " + String.valueOf(paramCount) + "; Arguments expected= " + String.valueOf(errType.getNumParams()));
+        }
+        // Make sure no real objects are stored in the params section
+        if (params!=null && params.length>0)
+        {   // convert complex params form object[] to string[]
+            for (int i=0; i<params.length; i++)
+            {   // convert to String
+                Object o = params[i]; 
+                if (o==null || (o instanceof String))
+                    continue;
+                if (o.getClass().isPrimitive())
+                    continue;
+                // Convert to String
+                if (o instanceof ErrorInfo)
+                    params[i] = getMessage((ErrorInfo)o);
+                else 
+                    params[i] = String.valueOf(o.toString());
+            }
+        }
+        // Log Error
+        try
+        {
+            log.info("Error '" +  MessageFormat.format(errType.getMessagePattern(), params) + "' has been set for object " + getClass().getName());
+        } catch (EmpireException e)
+        {
+            log.error("Unable to log error message.", e);
+        }
+        // Set the Error
+        return internalSetError(errType, params, null);
+    }
+
+    /**
+     * Sets the error.
+     * 
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(ErrorType errType)
+    {
+        return error(errType, (Object[])null);
+    }
+
+    /**
+     * Sets the specified error and and the message.
+     * 
+     * @param errType the type of error to set.
+     * @param param parameter for the error message.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(ErrorType errType, Object param)
+    {
+        return error(errType, new Object[] { param });
+    }
+
+    /**
+     * Sets the specified error and two messages.
+     * 
+     * @param errType the type of error to set.
+     * @param param1 parameter for the error message.
+     * @param param2 parameter for the error message.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(ErrorType errType, Object param1, Object param2)
+    {
+        return error(errType, new Object[] { param1, param2 });
+    }
+
+    /**
+     * Sets the specified error and the corresponding error message on this object.
+     * 
+     * @param errType the type of error to set.
+     * @param exptn Exception from witch the error message is copied.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(ErrorType errType, Throwable exptn)
+    {
+        if (exptn==null)
+        {   log.warn("Cannot set exception error with param of null!");
+            return true; // No Error
+        }
+        // Exception
+        String type  = exptn.getClass().getName();
+        if (type.startsWith("java.lang."))
+            type = type.substring("java.lang.".length());
+        // The message
+        String msg   = exptn.getMessage();
+        // Prepare stack trace
+        StackTraceElement[] stack = exptn.getStackTrace();
+        String pos = (stack!=null) ? stack[0].toString() : getClass().getName();
+        // Create Error
+        return error(errType, new Object[] { type, msg, pos });
+    }
+
+    /**
+     * Sets the last error and the error message: ERR_EXCEPTION.
+     * 
+     * @param exptn Exception from witch the error message is copied.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(Throwable exptn)
+    {
+        return error(Errors.Exception, exptn);
+    }
+
+    /**
+     * Copies the error set on another object to this object.
+     * 
+     * @param other the object from which to copy the error.
+     * @return always false except if the errType is of Type Errors.None
+     */
+    protected final boolean error(ErrorInfo other)
+    {   // copy other error
+        return internalSetError(other.getErrorType(),
+                                other.getErrorParams(), other);
+    }
+}
\ No newline at end of file

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/ErrorType.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,83 @@
+/*
+ * ESTEAM Software GmbH
+ */
+package org.apache.empire.commons;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * The ErrorType class defines a type of error.
+ * In order to define an error you need to provide an ErrorKey and a MessagePattern.
+ * <P>
+ * The ErrorKey is a unique identifier for the error that may also be used as a translation key
+ * The ErrorKey should always start with the "error." prefix. 
+ * <P>
+ * The MessagePattern is a template containing the error message and placeholders for additional parameters.
+ * The MessagePattern must be formated according to the {@link java.text.MessageFormat} rules.
+ * <P>
+ * @author ESTEAM software <A TARGET="esteam" HREF="http://www.esteam.de">www.esteam.de </A>
+ */
+public class ErrorType
+{
+    // Logger
+    private static final Log log = LogFactory.getLog(ErrorType.class);
+
+    private String key;
+    private String msgPattern;
+    private int    numParams;
+
+    /**
+     * Defines an error type.
+     * 
+     * @param errorKey the error key string (can be used for internationalization)
+     * @param msgPattern message pattern in english language used e.g. for logging
+     */
+    public ErrorType(String errorKey, String msgPattern)
+    {
+        this.key = errorKey;
+        this.msgPattern = msgPattern;
+        // Count number of params
+        numParams = 0;
+        while(true)
+        {
+            String placeholder = "{" + String.valueOf(numParams) + "}";
+            if (msgPattern.indexOf(placeholder)<0)
+                break;
+            // Param found
+            numParams++;    
+        }
+        // Write error definition to log
+        log.info("Error defined: " + key + "=" + msgPattern);
+    }
+
+    /**
+     * Returns the error type key (might be used for internationalization).
+     * 
+     * @return the error type key
+     */
+    public String getKey()
+    {
+        return key;
+    }
+
+    /**
+     * Returns the message pattern.
+     * 
+     * @return the message pattern
+     */
+    public String getMessagePattern()
+    {
+        return msgPattern;
+    }
+
+    /**
+     * Returns the number of parameters required for the message pattern.
+     * 
+     * @return the number of parameters required for the message pattern
+     */
+    public int getNumParams()
+    {
+        return numParams;
+    }
+}

Added: incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Errors.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Errors.java?rev=683173&view=auto
==============================================================================
--- incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Errors.java (added)
+++ incubator/empire-db/trunk/core/Empire-db/src/org/apache/empire/commons/Errors.java Wed Aug  6 01:47:37 2008
@@ -0,0 +1,82 @@
+/*
+ * ESTEAM Software GmbH
+ */
+package org.apache.empire.commons;
+
+import java.text.MessageFormat;
+
+/**
+ * This class holds the definition of common error types.
+ * No instances of this class can be created. It's sole
+ * purpose is to hold the definition of Error Types.
+ * <P>
+ * Define your own error types in the same way.
+ * See @link {@link ErrorType} for futher information.
+ * <P>
+ * @author ESTEAM software <A TARGET="esteam" HREF="http://www.esteam.de">www.esteam.de </A>
+ */
+public class Errors
+{
+    // No Error
+    public static final ErrorType None            = new ErrorType("error.none", "");
+    public static final ErrorType Cancelled       = new ErrorType("error.cancelled", "The action has been cancelled by the user");
+    // Code Errors
+    public static final ErrorType Exception       = new ErrorType("error.exception", "An Exception of type {0} occurred.\n-->Message is {1}\n-->at Position {2}");
+    public static final ErrorType Internal        = new ErrorType("error.internal", "Internal Error: {0}");
+    public static final ErrorType InvalidArg      = new ErrorType("error.invalidarg", "Invalid Argument {0} for parameter {1}.");
+    public static final ErrorType NotSupported    = new ErrorType("error.notsupported", "The function {0} is not supported");
+    public static final ErrorType NotImplemented  = new ErrorType("error.notimplemented", "The function {0} is not implemented");
+    public static final ErrorType ObjectNotValid  = new ErrorType("error.objectnotvalid", "The object {0} has not been initialized.");
+    public static final ErrorType InvalidProperty = new ErrorType("error.invalidproperty", "The value of the property {0} is not valid.");
+    // Security Errors
+    public static final ErrorType NoAccess        = new ErrorType("error.noaccess", "Access denied");
+    public static final ErrorType NotAuthorized   = new ErrorType("error.notauthorized", "You are not autorized for this operation.");
+    public static final ErrorType InvalidPassword = new ErrorType("error.invalidpassword", "Invalid username or password.");
+    // Item-Error
+    public static final ErrorType OutOfRange      = new ErrorType("error.outofrange", "The value of {0} is out of range.");
+    public static final ErrorType ItemNotFound    = new ErrorType("error.itemnotfound", "The element {0} was not found.");
+    public static final ErrorType ItemExists      = new ErrorType("error.itemexists", "The element {0} already exists.");
+    public static final ErrorType IllegalValue    = new ErrorType("error.illegalvalue", "The value {0} is invalid.");
+    public static final ErrorType IllegalFormat   = new ErrorType("error.illegalformat", "The format of {0} is invalid for {1}");
+    public static final ErrorType NoResult        = new ErrorType("error.noresult", "No data available for {0}");
+    public static final ErrorType NoMoreData      = new ErrorType("error.nomoredata", "No more data available.");
+    // File-Errors
+    public static final ErrorType FileNotFound    = new ErrorType("error.filenotfound", "The file {0} was not found.");
+    public static final ErrorType FileExists      = new ErrorType("error.fileexits", "The file {0} already exists");
+    public static final ErrorType FileFormatError = new ErrorType("error.fileformaterror", "The format of file {0} has not been recognized.");
+    public static final ErrorType FileReadError   = new ErrorType("error.filereaderror", "Error reading file {0}");
+    public static final ErrorType FileWriteError  = new ErrorType("error.filewriteerror", "Error creating or writing file {0}");
+    public static final ErrorType PathNotFound    = new ErrorType("error.pathnotfound", "The directory {0} does not exists.");
+    public static final ErrorType PathCreateFailed= new ErrorType("error.pathcreatefailed", "Error creating the directory {0}");
+
+    /**
+     *  No instances of this class can be created.
+     *  It's sole purpose is to hold the definition of Error Types
+     */
+    private Errors()
+    {
+        // see comment.
+    }
+    
+    /**
+     *  Gets an error Message from an object implementing the error info interface.
+     */
+    public static String getErrorMessage(ErrorInfo info)
+    {
+        // Check Param
+        if (info==null || info.hasError()==false)
+            return ""; // No Error
+        // Get Error Type
+        ErrorType type = info.getErrorType();
+        if (type==null || type==Errors.None)
+            return ""; // No Error
+        // Get Message Pattern and Params
+        String msgPattern = type.getMessagePattern();
+        Object[] msgParams = info.getErrorParams();
+        if (msgParams==null)
+            return msgPattern;
+        // Get Error Message
+        String msg = MessageFormat.format(msgPattern, msgParams);
+        return msg;
+    }
+}