Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'origin/develop' into feature/lucence-ra…

…nge-index
  • Loading branch information...
commit 68d500333835e289e71f0ad08ca286a83fdc6614 2 parents 3bcba5b + c3a6502
@wolfgangmm wolfgangmm authored
Showing with 10,504 additions and 9,597 deletions.
  1. +14 −1 .gitignore
  2. +6 −0 .travis.yml
  3. +172 −0 README.md
  4. +1 −1  bin/backup.bat
  5. +1 −1  bin/client.bat
  6. +1 −1  bin/run.bat
  7. +1 −1  bin/server.bat
  8. +1 −1  bin/startup.bat
  9. +1 −1  build.bat
  10. +3 −3 build.properties
  11. +1 −1  build.sh
  12. +1 −3 build.xml
  13. +12 −12 build/scripts/build-impl.xml
  14. +4 −8 build/scripts/dist.xml
  15. +21 −14 build/scripts/installer.xml
  16. +1 −0  build/scripts/junit.xml
  17. +2 −2 build/scripts/macosx.xml
  18. +0 −125 build/scripts/subversion.xml
  19. +1 −1  extensions/contentextraction/ivy.xml
  20. +4 −2 extensions/modules/src/org/exist/xquery/modules/file/Sync.java
  21. +1 −1  extensions/replication/src/org/exist/replication/jms/publish/JMSMessageSender.java
  22. +73 −22 extensions/replication/src/org/exist/replication/jms/publish/ReplicationTrigger.java
  23. +139 −79 extensions/replication/src/org/exist/replication/jms/subscribe/JMSMessageListener.java
  24. +23 −0 extensions/replication/src/org/exist/replication/shared/eXistMessage.java
  25. +1 −1  extensions/xqdoc/build.properties
  26. +1 −1  installer/apps.properties
  27. +7 −1 installer/install.xsl
  28. +1 −1  installer/userInput.xml
  29. +6 −2 installer/vm.properties
  30. +3 −1 src/org/exist/backup/xquery/RetrieveBackup.java
  31. +21 −13 src/org/exist/client/ConnectionDialog.form
  32. +14 −14 src/org/exist/client/ConnectionDialog.java
  33. +198 −160 src/org/exist/config/Configurator.java
  34. +2 −1  src/org/exist/http/servlets/AbstractExistHttpServlet.java
  35. +2 −1  src/org/exist/http/servlets/XQueryServlet.java
  36. +2 −1  src/org/exist/http/servlets/XSLTServlet.java
  37. +3 −2 src/org/exist/http/urlrewrite/XQueryURLRewrite.java
  38. +3 −3 src/org/exist/launcher/ConfigurationDialog.form
  39. +3 −7 src/org/exist/launcher/ConfigurationDialog.java
  40. +20 −12 src/org/exist/launcher/Launcher.java
  41. +5 −0 src/org/exist/launcher/UtilityPanel.java
  42. +11 −5 src/org/exist/repo/AutoDeploymentTrigger.java
  43. +2 −34 src/org/exist/security/internal/AccountImpl.java
  44. +60 −0 src/org/exist/security/internal/web/HttpAccount.java
  45. +14 −2 src/org/exist/start/Main.java
  46. +3 −4 src/org/exist/storage/BrokerPool.java
  47. +20 −0 src/org/exist/storage/txn/Txn.java
  48. +5 −0 src/org/exist/xquery/AttributeConstructor.java
  49. +17 −1 src/org/exist/xquery/BindingExpression.java
  50. +9 −5 src/org/exist/xquery/ConditionalExpression.java
  51. +31 −4 src/org/exist/xquery/DefaultExpressionVisitor.java
  52. +4 −0 src/org/exist/xquery/ElementConstructor.java
  53. +8 −2 src/org/exist/xquery/GroupSpec.java
  54. +7 −1 src/org/exist/xquery/OrderSpec.java
  55. +1 −0  src/org/exist/xquery/SwitchExpression.java
  56. +1 −0  src/org/exist/xquery/TypeswitchExpression.java
  57. +9 −0 src/org/exist/xquery/functions/map/MapExpr.java
  58. +2 −0  src/org/exist/xquery/functions/request/GetData.java
  59. +1 −0  src/org/exist/xquery/functions/system/FunctionTrace.java
  60. +30 −35 src/org/exist/xquery/lib/kwic.xql
  61. +26 −1 src/org/exist/xquery/lib/xqsuite/xqsuite.xql
  62. +2 −0  src/org/exist/xquery/parser/XQuery.g
  63. +3,560 −3,560 src/org/exist/xquery/parser/XQueryLexer.smap
  64. +193 −157 src/org/exist/xquery/parser/XQueryParser.java
  65. +5,316 −5,285 src/org/exist/xquery/parser/XQueryParser.smap
  66. +14 −0 test/src/xquery/optimizer/OptimizerTests.java
  67. +375 −0 test/src/xquery/optimizer/optimizer.xql
  68. +7 −0 test/src/xquery/optimizer/suite.xql
  69. BIN  tools/jetty/lib/org.objectweb.asm-3.1.0.v200803061910.jar
View
15 .gitignore
@@ -17,7 +17,12 @@ start.jar
test/external/
test/src/org/exist/xquery/xqts/
tools/wrapper/bin/exist.sh
-tools/wrapper/conf/
+tools/wrapper/conf/log4j.xml
+tools/wrapper/conf/wrapper.conf
+tools/wrapper/conf/wrapper.conf.install
+tools/wrapper/bin/eXist-db.java.status
+tools/wrapper/bin/eXist-db.pid
+tools/wrapper/bin/eXist-db.status
uninstall/
webapp/WEB-INF/betterform-config.xml
webapp/WEB-INF/betterform-version.info
@@ -25,3 +30,11 @@ webapp/WEB-INF/dwr.xml
webapp/WEB-INF/dwr20.dtd
webapp/WEB-INF/web.xml
webapp/xqts/config.xml
+webapp/WEB-INF/logs/*.log
+webapp/WEB-INF/logs/*.log.*
+tools/jetty/logs/
+tools/jetty/tmp/
+tools/wrapper/logs/
+backup/
+test/junit/
+test/temp/
View
6 .travis.yml
@@ -0,0 +1,6 @@
+language: java
+jdk:
+ - openjdk6
+ - openjdk7
+ - oraclejdk7
+script: ./build.sh clean-all all test
View
172 README.md
@@ -0,0 +1,172 @@
+eXist Native XML Database
+=========================
+[![Build Status](https://travis-ci.org/eXist-db/exist.png?branch=develop)](https://travis-ci.org/eXist-db/exist)
+[![Build Status](http://build.exist-db.se/buildStatus/icon?job=github-eXist-db-develop-rebuild-test)](http://build.exist-db.se/view/github/job/github-eXist-db-develop-rebuild-test/)
+
+This is the GitHub for the [eXist](http://www.exist-db.org "eXist") Native XML Database.
+
+If you're looking to work with the eXist source code, you've come to the right place. If not, you're probably looking for the [eXist Documentation](http://www.exist-db.org/exist/apps/doc/ "Documentation of eXist").
+
+If you're looking for help or discussion, visit the eXist community [mailing lists](http://www.exist-db.org/exist/apps/doc/getting-help.xml "eXist Mailing Lists").
+
+
+Information for Developers
+--------------------------
+If you wish to work on the eXist source code we're now using [Git](http://git-scm.org "Git SCM") (and [GitHub](http://www.github.com)) for our source code management. If you're not familiar with Git, we recommend [this excellent online interactive tutorial](http://try.github.io).
+
+
+Building eXist from Source
+--------------------------
+eXist itself is written predominantly in Java 6. The build system is [Apache Ant](http://ant.apache.org/ "The Apache Ant Project").
+
+To build eXist:
+
+- Checkout the Git Repository
+- Execute Ant to compile eXist
+
+```bash
+$ git clone git@github.com:eXist-db/exist.git
+$ cd exist
+$ git checkout master
+$ ./build.sh
+```
+
+**NOTE:**
+In the above example, we switched the current (checked-out) branch from `develop` to `master`. We use the [GitFlow for eXist](#contributing-to-exist) process:
+- `develop` is the current (and stable) work-in-progress (the next release)
+- `master` is the latest release
+The choice of which to use is up to you.
+
+**HINT:**
+In the example above, we use the SSH form of the GitHub repo URL to clone eXist. However, if you're behind a HTTP proxy and your organisation doesn't allow outgoing SSH connections, try the HTTPS URL for our GitHub repo <https://github.com/eXist-db/exist.git>.
+
+From here, you now have a compiled version of eXist that you may use just as you would an installed version of eXist, however it may be desirable to package this up for easy installation elsewhere. If you wish to create a simple ZIP distribution of eXist, run:
+
+```bash
+$ ./build.sh dist-zip
+```
+
+To build a full Installer for eXist, you'll need to have IzPack installed. Set your path to IzPack in `exist/build.properties` and run:
+
+```bash
+$ ./build.sh installer
+```
+
+Otherwise, you may wish to deploy eXist into a Web Application Server as a WAR file. We provide a build for that, too:
+
+```bash
+$ ./build.sh dist-war
+```
+
+For more build options, see the [eXist Build Documentation](http://www.exist-db.org/exist/apps/doc/building.xml "How to build eXist").
+
+
+Contributing to eXist
+---------------------
+We welcome all contributions to eXist!
+
+We strongly suggest that you join the [eXist-development mailing](https://lists.sourceforge.net/lists/listinfo/exist-development "eXist Development Mailing List") list and also subscribe to the [eXist-commits mailing list](https://lists.sourceforge.net/lists/listinfo/exist-commits "eXist SCM Commits Mailing List"), so that you can collaborate with the eXist team and be kept up to date with changes to the codebase.
+
+eXist uses the [GitFlow](http://nvie.com/git-model) branching model for development. Specifically, we're using the [AVH Edition of GitFlow tools](https://github.com/petervanderdoes/gitflow) version.
+
+If you're not familiar with GitFlow, check out some of the good tutorials linked in ["Getting Started"](https://github.com/petervanderdoes/gitflow#getting-started) of the GitFlow AVH Edition page. There's also a very good [git-flow cheatsheet](http://danielkummer.github.io/git-flow-cheatsheet/).
+
+If you wish to contribute, the general approach is:
+
+- Fork the repo on GitHub
+- `git clone` your fork
+- Make sure you've [GitFlow AVH Edition](https://github.com/petervanderdoes/gitflow) installed
+- Run `git flow init` on the cloned repo using [these settings](#our-git-flow-init-settings).
+- Use Git Flow to *start* a hotfix or feature i.e. git flow feature start *my-magic-feature*
+- Do your stuff! :-)
+- Commit to your repo. We like small, atomic commits that don't mix concerns.
+- Use Git Flow to finish the `hotfix` or `feature`. **WARNING:** If you're using a `hotfix`, please don't tag it; there's no way to send an unknown branch from your fork upstream using GitHub's Pull Requests.
+- Push your hotfix or feature branch to your GitHub using GitFlow (`git flow feature publish *my-magic-feature*`)
+- Send us a Pull Request
+
+Pull Requests are reviewed and tested before they're merged by the core development team.
+However, we have one golden rule, even within the core team: **never merge your own pull request**. This simple-but-important rule ensures that at least two people have considered the change.
+
+Although the following are taken from our [Developer Manifesto](http://www.exist-db.org/exist/apps/doc/devguide_manifesto.xml "eXist Project Developer Manifesto") and [Code Review Guide](http://www.exist-db.org/exist/apps/doc/devguide_codereview.xml "eXist Project Code Review Guide"), the main things that get a Pull Request accepted are:
+
+- **Only change what you need to.** If you must reformat code, keep it in a separate commit to any syntax or functionality changes.
+- **Test.** If you fix something prove it, write a test that illustrates the issue before you fix the issue and validate the test. If you add a new feature it needs tests, so that we can understand its intent and try to avoid regressions in future as much as possible.
+- **Make sure the appropriate licence header appears at the top of your source code file.** We use [LGPL v2.1](http://opensource.org/licenses/LGPL-2.1 "The GNU Lesser General Public License, version 2.1") for eXist and *strongly* encourage that, but ultimately any compatible [OSI approved license](http://opensource.org/licenses "Open Source Licenses") without further restrictions may be used.
+- **Run the full eXist test suite.** We don't accept code that causes regressions.
+
+
+Do I work on a bug-fix using a `feature` or a `hotfix`?
+-------------------------------------------------------
+If you want to contribute a *bug-fix*, you need to consider whether this is a `feature` or a `hotfix` in GitFlow terminology.
+
+Making the determination involves considering how the bug-fix is to be applied and how it is to be applied. First, you should carefully read the "Feature branches" and "Hotfix branches" sections from [A successful Git branching model](http://nvie.com/posts/a-successful-git-branching-model/).
+
+If you're still unsure, consider:
+
+- The bug-fix is a hotfix if it is **critical** and needs to go into a very soon to be released revision version i.e. 2.1.n to address an immediate production issue.
+- Otherwise it is a feature, i.e. its just standard development towards the next release of eXist.
+
+Even for a bug-fix you should most probably use a `feature`. If you're certain you want to create a `hotfix`, please consider discussing first via the `exist-development` mailing list.
+
+
+Help! I am a human, what does this all mean?
+--------------------------------------------
+- You work in features using GitFlow in your own fork of our repo.
+- If you want to push your feature to your fork before you have finished it locally, i.e. for the purposes of backup or collaboration, you can use *git flow feature publish my-magic-feature*.
+- You will only ever send Pull Requests between your 'develop' branch and our 'develop' branch. i.e. finished features.
+- If you follow the details above and make it easy for us to accept your Pull Requests, they will get accepted and merged quickly!
+- Your fork will eventually become out of sync with the upstream repo as others contribute to eXist. To pull upstream changes into your fork, see: [Syncing a Fork](https://help.github.com/articles/syncing-a-fork). It is usually a good idea to do this at least before you start working on a new feature, and probably before you send us a Pull Request, as it will make merging for us much simpler!
+
+
+Our `git-flow init` settings
+----------------------------
+When we started working with the eXist repo we needed to configure it for GitFlow:
+
+```bash
+$ git flow init
+
+Which branch should be used for bringing forth production releases?
+ - master
+Branch name for production releases: [master]
+Branch name for "next release" development: [develop]
+
+How to name your supporting branch prefixes?
+Feature branches? [feature/]
+Release branches? [release/]
+Hotfix branches? [hotfix/]
+Support branches? [support/]
+Version tag prefix? [] eXist-
+```
+
+A new `develop` branch is created, and checked out.
+
+Verify it like this:
+
+```bash
+$ git status
+# On branch develop
+```
+
+As we have already started with GitFlow, when you run `git flow init`, you'll get slightly different prompts--but the same answers apply!
+
+You **must** use the following settings:
+
+```bash
+$ git flow init
+
+Which branch should be used for bringing forth production releases?
+ - develop
+Branch name for production releases: [] master
+
+Which branch should be used for integration of the "next release"?
+ - develop
+Branch name for "next release" development: [develop]
+
+How to name your supporting branch prefixes?
+Feature branches? [feature/]
+Release branches? [release/]
+Hotfix branches? [hotfix/]
+Support branches? [support/]
+Version tag prefix? [] eXist-
+
+```
View
2  bin/backup.bat
@@ -56,7 +56,7 @@ goto :eof
set MX=768
rem @WINDOWS_INSTALLER_3@
-set JAVA_ENDORSED_DIRS="%EXIST_HOME%"\lib\endorsed
+set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
%JAVA_RUN% "%JAVA_OPTS%" -Dexist.home="%EXIST_HOME%" -jar "%EXIST_HOME%\start.jar" backup %CMD_LINE_ARGS%
View
2  bin/client.bat
@@ -46,7 +46,7 @@ goto :eof
set MX=1024
rem @WINDOWS_INSTALLER_3@
-set JAVA_ENDORSED_DIRS="%EXIST_HOME%"\lib\endorsed
+set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
set BATCH.D="%EXIST_HOME%\bin\batch.d"
View
2  bin/run.bat
@@ -53,7 +53,7 @@ goto :eof
set MX=768
rem @WINDOWS_INSTALLER_3@
-set JAVA_ENDORSED_DIRS="%EXIST_HOME%"\lib\endorsed
+set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
:gotJavaOpts
View
2  bin/server.bat
@@ -47,7 +47,7 @@ goto :eof
set MX=1024
rem @WINDOWS_INSTALLER_3@
-set JAVA_ENDORSED_DIRS="%EXIST_HOME%"\lib\endorsed
+set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
set BATCH.D="%EXIST_HOME%\bin\batch.d"
View
2  bin/startup.bat
@@ -48,7 +48,7 @@ goto :eof
set MX=1024
rem @WINDOWS_INSTALLER_3@
-set JAVA_ENDORSED_DIRS="%EXIST_HOME%"\lib\endorsed
+set JAVA_ENDORSED_DIRS="%EXIST_HOME%\lib\endorsed"
set JAVA_OPTS="-Xms128m -Xmx%MX%m -Dfile.encoding=UTF-8 -Djava.endorsed.dirs=%JAVA_ENDORSED_DIRS%"
set BATCH.D="%EXIST_HOME%\bin\batch.d"
View
2  build.bat
@@ -21,7 +21,7 @@ set EXIST_HOME=%CD%
:gotExistHome
set ANT_HOME=%EXIST_HOME%\tools\ant
-set _LIBJARS=%CLASSPATH%;%ANT_HOME%\lib\ant-launcher.jar;%EXIST_HOME%\lib\user\svnkit.jar;%EXIST_HOME%\lib\user\svnkit-cli.jar
+set _LIBJARS=%CLASSPATH%;%ANT_HOME%\lib\ant-launcher.jar
set JAVA_ENDORSED_DIRS=%EXIST_HOME%\lib\endorsed
View
6 build.properties
@@ -4,8 +4,8 @@
#
# $Id$
project.name = eXist-db
-project.version = 2.1dev
-project.version.numeric = 2.1.0
+project.version = 2.1
+project.version.numeric = 2.1
project.codename = Ruesselsheim
# build settings
@@ -68,7 +68,7 @@ antlr.traceTreeWalker = false
# You might need to change PermSpace to atleast 84 MB eg -XX:MaxPermSize=84m
# If you only want to point to your own izpack installation directory
# add this in local.build.properties instead so you don't commit it by mistake.
-izpack.dir = /Applications/IzPack-4.3.5/
+izpack.dir = /Applications/IzPack/
# Launch4J is required to create the windows installer
# If you change this property value for a reason,
View
2  build.sh
@@ -30,7 +30,7 @@ fi
ANT_HOME="$EXIST_HOME/tools/ant"
-LOCALCLASSPATH="$ANT_HOME/lib/ant-launcher.jar:$EXIST_HOME/lib/user/svnkit.jar:$EXIST_HOME/lib/user/svnkit-cli.jar"
+LOCALCLASSPATH="$ANT_HOME/lib/ant-launcher.jar"
JAVA_ENDORSED_DIRS="$EXIST_HOME"/lib/endorsed
View
4 build.xml
@@ -2,7 +2,7 @@
<!-- ======================================================================= -->
<!-- eXist 2.x build file -->
<!-- ======================================================================= -->
-<!-- $Id$ -->
+
<project basedir="." default="all" name="eXist-DB">
<description>eXist Open Source Native XML Database</description>
@@ -32,6 +32,4 @@
<import file="build/scripts/performance.xml"/>
<import file="build/scripts/quality.xml"/>
<import file="build/scripts/static-docs.xml"/>
- <import file="build/scripts/subversion.xml"/>
-
</project>
View
24 build/scripts/build-impl.xml
@@ -4,8 +4,6 @@
<!-- eXist build file -->
<!-- ======================================================================= -->
-<!-- $Id$ -->
-
<project basedir="../.." default="all" name="exist">
<!-- setup properties -->
@@ -40,9 +38,11 @@
<property name="xmldb.src" value="undefined"/>
<property name="dist.dir" value="${dist}/${project.name}-${project.version}"/>
+ <condition property="git.commit" value="${git.commit}" else="">
+ <isset property="git.commit" />
+ </condition>
<!-- import common targets -->
<!-- <import file="../../build.xml"/> -->
- <import file="./subversion.xml"/>
<import file="./junit.xml"/>
<import file="./antlr3.xml"/>
@@ -52,7 +52,7 @@
<!-- additional set of ant tasks -->
<property name="asocat-exist.jar" location="${tools.ant}/lib/asocat-exist.jar"/>
-
+
<!-- setup class path -->
<path id="classpath.core">
<fileset dir="${lib.core}">
@@ -115,7 +115,7 @@
<!-- =================================================================== -->
<!-- Prepare the build -->
<!-- =================================================================== -->
- <target name="prepare" depends="svn-prepare">
+ <target name="prepare">
<tstamp/>
<property file="VERSION.txt"/>
@@ -123,7 +123,7 @@
<echo message="-------------------------"/>
<echo message="eXist ${project.version} build"/>
<echo message="-------------------------"/>
- <echo message="SVN revision ${svn.revision}"/>
+ <echo message="GIT revision ${git.commit}"/>
<echo message=""/>
<echo message="${ant.version}"/>
<echo message="-------------------------"/>
@@ -134,7 +134,7 @@
<mkdir dir="${jetty.dir}/logs"/>
<mkdir dir="${jetty.dir}/work"/>
- <filter token="version" value="${project.version}-rev:${svn.revision}-${DSTAMP}"/>
+ <filter token="version" value="${project.version}-:${git.commit}-${DSTAMP}"/>
<filter token="database" value="native"/>
<copy file="${src.webapp}/xqts/config.xml.tmpl" tofile="${src.webapp}/xqts/config.xml"
@@ -274,10 +274,10 @@
<!-- Create jar files -->
<!-- ================================================================== -->
<target name="jar" depends="compile,compile-aspectj"
- description="Create eXist unsigned jar files">
+ description="Create eXist-db unsigned jar files">
<filter token="version" value="${project.version}"/>
<filter token="build" value="${DSTAMP}"/>
- <filter token="revision" value="${svn.revision}"/>
+ <filter token="revision" value="${git.commit}"/>
<!--copy file="${src}/CatalogManager.properties" todir="${build.classes}"/-->
<copy todir="${build.classes}/org/exist/client">
@@ -351,7 +351,7 @@
<attribute name="Project-Version" value="${project.version}"/>
<attribute name="Project-Build" value="${DSTAMP}"/>
<attribute name="Project-CodeName" value="${project.codename}"/>
- <attribute name="SVN-Revision" value="${svn.revision}"/>
+ <attribute name="GIT-Revision" value="${git.commit}"/>
</manifest>
<exclude name="org/exist/*.xsl"/>
<exclude name="org/exist/ant/**"/>
@@ -377,7 +377,7 @@
<attribute name="Project-Version" value="${project.version}"/>
<attribute name="Project-Build" value="${DSTAMP}"/>
<attribute name="Project-CodeName" value="${project.codename}"/>
- <attribute name="SVN-Revision" value="${svn.revision}"/>
+ <attribute name="GIT-Revision" value="${git.commit}"/>
</manifest>
<include name="org/exist/start/**"/>
</jar>
@@ -388,7 +388,7 @@
<attribute name="Project-Version" value="${project.version}"/>
<attribute name="Project-Build" value="${DSTAMP}"/>
<attribute name="Project-CodeName" value="${project.codename}"/>
- <attribute name="SVN-Revision" value="${svn.revision}"/>
+ <attribute name="GIT-Revision" value="${git.commit}"/>
</manifest>
<include name="org/exist/*.xsl"/>
<include name="org/exist/ant/**"/>
View
12 build/scripts/dist.xml
@@ -2,7 +2,7 @@
<!-- $Id$ -->
<project basedir="../.." default="dist" name="dist">
- <description>Create eXist distribution</description>
+ <description>Create eXist-db distribution</description>
<!-- import common targets -->
<import file="../../build.xml"/>
@@ -31,8 +31,8 @@
<!-- ================================================================== -->
<!-- Create .war file -->
<!-- ================================================================== -->
- <target name="dist-war" depends="webapps,svn-prepare" description="Create war file">
- <war destfile="${dist}/exist-${project.version}-rev${svn.revision}.war" webxml="webapp/WEB-INF/web.xml">
+ <target name="dist-war" depends="webapps" description="Create war file">
+ <war destfile="${dist}/exist-${project.version}-rev${git.commit}.war" webxml="webapp/WEB-INF/web.xml">
<!-- Add files to WEB-INF/lib -->
<lib dir=".">
@@ -101,10 +101,6 @@
<lib dir="extensions/modules/lib">
<include name="*.jar"/>
</lib>
- <!-- Include content extraction jars if present -->
- <lib dir="extensions/contentextraction/lib">
- <include name="*.jar"/>
- </lib>
<!-- Add configuration files to WEB-INF -->
@@ -161,7 +157,7 @@
<attribute name="Project-Name" value="${project.name}"/>
<attribute name="Project-Version" value="${project.version}"/>
<attribute name="Project-Build" value="${DSTAMP}"/>
- <attribute name="SVN-Revision" value="${svn.revision}"/>
+ <attribute name="GIT-Revision" value="${git.commit}"/>
</manifest>
</war>
View
35 build/scripts/installer.xml
@@ -2,7 +2,7 @@
<!-- ======================================================================= -->
<!-- eXist build file : Build installer -->
<!-- ======================================================================= -->
-<!-- $Id$ -->
+
<project basedir="../.." default="installer" name="Build installer">
<description>Build installer</description>
@@ -38,12 +38,12 @@
<delete dir="${jetty.dir}/work/Jetty__8080__exist"/>
<touch file="webapp/WEB-INF/logs/exist.log"/>
<touch file="webapp/WEB-INF/logs/xmldb.log"/>
-
<copy file="installer/scripts/eXist-db.mac/Contents/Info.plist.tmpl"
- tofile="installer/scripts/eXist-db.mac/Contents/Info.plist" filtering="true">
+ tofile="installer/scripts/eXist-db.mac/Contents/Info.plist" filtering="true"
+ overwrite="true">
<filterset>
<filter token="vmoptions" value=""/>
- <filter token="classpath" value="$APP_PACKAGE/../start.jar"/>
+ <filter token="classpath" value="$APP_PACKAGE/.."/>
</filterset>
</copy>
</target>
@@ -56,6 +56,13 @@
<mkdir dir="${apps.dir}"/>
<echo message="Downloading xar packages to include in installer ..."/>
<foreach list="${apps}" target="download-xar" param="xar"></foreach>
+
+ <move todir="${apps.dir}">
+ <fileset dir="${apps.dir}">
+ <include name="shared*.xar"/>
+ </fileset>
+ <mapper type="glob" from="*" to="00*"/>
+ </move>
</target>
<target name="download-xar">
@@ -120,7 +127,7 @@
<target depends="prepare-installer,launcher-exe,commandline-installer" name="installer" description="Create installer">
<echo message="Calling IzPack to create installer ..."/>
- <property name="inst-jar" value="installer/${project.name}-setup-${project.version}-rev${svn.revision}.jar"/>
+ <property name="inst-jar" value="installer/${project.name}-setup-${project.version}-rev${git.commit}.jar"/>
<izpack input="installer/install.xml"
output="${inst-jar}"
basedir="." izPackDir="${izpack.dir}"
@@ -150,23 +157,23 @@
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
- <echo message="${svn.revision}"/>
- <launch4j configFile="installer/launch4j-start.xml" fileVersion="${project.version.numeric}.${svn.revision}"
- txtFileVersion="${project.version}-rev${svn.revision}"
- productVersion="${project.version.numeric}.${svn.revision}"/-->
+ <echo message="${git.commit}"/>
+ <launch4j configFile="installer/launch4j-start.xml" fileVersion="${project.version.numeric}.${git.commit}"
+ txtFileVersion="${project.version}-rev${git.commit}"
+ productVersion="${project.version.numeric}.${git.commit}"/-->
</target>
<target depends="installer" name="installer-exe" description="Create .exe from installer">
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
- <property name="inst-jar" value="installer/${project.name}-setup-${project.version}-rev${svn.revision}.jar"/>
- <property name="inst-exe" value="installer/${project.name}-setup-${project.version}-rev${svn.revision}.exe"/>
+ <property name="inst-jar" value="installer/${project.name}-setup-${project.version}-rev${git.commit}.jar"/>
+ <property name="inst-exe" value="installer/${project.name}-setup-${project.version}-rev${git.commit}.exe"/>
<launch4j configFile="installer/launch4j.xml" jar="${inst-jar}"
- outfile="${inst-exe}" fileVersion="${project.version.numeric}.${svn.revision}"
- txtFileVersion="${project.version}-rev${svn.revision}"
- productVersion="${project.version.numeric}.${svn.revision}"/>
+ outfile="${inst-exe}" fileVersion="${project.version.numeric}.${git.commit}"
+ txtFileVersion="${project.version}-rev${git.commit}"
+ productVersion="${project.version.numeric}.${git.commit}"/>
</target>
<target name="copy_scripts">
View
1  build/scripts/junit.xml
@@ -130,6 +130,7 @@
<!--test fork="yes" name="xquery.xmlcalabash.XMLCalabashTests" todir="${junit.reports.dat}"/-->
<!--test fork="yes" name="xquery.xproc.XProcTests" todir="${junit.reports.dat}"/-->
<test fork="yes" name="xquery.xquery3.XQuery3Tests" todir="${junit.reports.dat}"/>
+ <test fork="yes" name="xquery.optimizer.OptimizerTests" todir="${junit.reports.dat}"/>
<!-- //-->
<test fork="yes" name="org.exist.util.SortTests" todir="${junit.reports.dat}"/>
View
4 build/scripts/macosx.xml
@@ -31,10 +31,10 @@
</fileset>
</copy>
<copy file="installer/scripts/eXist-db.mac/Contents/Info.plist.tmpl"
- tofile="${app.dir}/Contents/Info.plist" filtering="true">
+ tofile="${app.dir}/Contents/Info.plist" filtering="true" overwrite="true">
<filterset>
<filter token="vmoptions" value="-Dexist.home=$APP_PACKAGE/Contents/Resources/eXist-db"/>
- <filter token="classpath" value="$APP_PACKAGE/Contents/Resources/eXist-db/start.jar"/>
+ <filter token="classpath" value="$APP_PACKAGE/Contents/Resources/eXist-db"/>
</filterset>
</copy>
<mkdir dir="${app.exist}"/>
View
125 build/scripts/subversion.xml
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ======================================================================= -->
-<!-- eXist build file : Subversion -->
-<!-- ======================================================================= -->
-
-<!-- $Id$ -->
-
-<!--
- Note:
- Both svnkit jar files are written into the user.lib directory. Unfortunately
- not all ant tasks can find the jar files via the classpath. As a work around in
- build.sh and build.xml the jar files are added to the LOCALCLASSPATH variable.
-
- I realize that this is not the best solution, we'll need to think of a better way.
- [e.g. copy jars into both lib/user and ant/lib]
-
-
- Note:
- svnkit 1.7.0 has some more jar-dependancies compared to 1.3.x ; therefore it probably
- a better idea to download the complete jar set using a tool like ivy.
--->
-
-<project basedir="../.." name="SubVersion">
-
- <description>Subversion tasks</description>
-
- <property name="svnkit.repo" value="http://maven.tmatesoft.com/content/repositories/releases"/>
- <property name="svnkit.version" value="1.3.7"/>
-
- <property name="svn.svnkit.jar" value="${lib.user}/svnkit.jar"/>
- <property name="svn.tmp.svnkit.jar" value="${lib.user}/svnkit-${svnkit.version}.jar"/>
-
- <property name="svn.svnkitcli.jar" value="${lib.user}/svnkit-cli.jar"/>
- <property name="svn.tmp.svnkitcli.jar" value="${lib.user}/svnkit-cli-${svnkit.version}.jar"/>
-
- <property name="svn.patch.file" value="exist.patch"/>
-
-
-
- <available classname="org.tmatesoft.svn.cli.SVN" property="svn-present"/>
-
-
- <!--
- Try to read SVN info from entries-file (if file exist).
- Fallback to VERSION.txt if subversion is not available.
- -->
- <target name="svn-prepare" if="svn-present">
- <echo>Determining local SVN revision</echo>
-
- <taskdef name="svninfo" classname="nl.ow.dilemma.ant.svn.SubversionInfoTask"/>
-
- <tstamp/>
-
- <svninfo username="anonymous" password="anonymous"/>
-
- <echo>Updating VERSION.txt</echo>
- <propertyfile file="VERSION.txt" comment="eXist build info (updated using svnkit)">
- <entry key="project.version" value="${project.version}"/>
- <entry key="project.build" value="${DSTAMP}"/>
- <entry key="svn.revision" value="${svn.revision}"/>
- </propertyfile>
- </target>
-
-
- <!--
- Download jar files the author website. This is newest version of the library,
- if the URL is updated in time. The download size is significantly larger.
- -->
- <target name="svn-download" description="Download latest SVN library.">
-
- <taskdef name="fetch" classname="nl.ow.dilemma.ant.fetch.FetchTask"/>
-
- <!-- Get file and rename -->
- <fetch dest="${lib.user}"
- url="${svnkit.repo}/org/tmatesoft/svnkit/svnkit-cli/${svnkit.version}/svnkit-cli-${svnkit.version}.jar"
- classname="org.tmatesoft.svn.cli.SVN"/>
-
- <!-- required to get rid of version-info in filename -->
- <move file="${svn.tmp.svnkitcli.jar}" tofile="${svn.svnkitcli.jar}" failonerror="false"/>
-
- <!-- Get file and rename -->
- <fetch classpathref="classpath.core" dest="${lib.user}"
- url="${svnkit.repo}/org/tmatesoft/svnkit/svnkit/${svnkit.version}/svnkit-${svnkit.version}.jar"
- classname="org.tmatesoft.svn.util.Version"/>
-
- <!-- required to get rid of version-info in filename -->
- <move file="${svn.tmp.svnkit.jar}" tofile="${svn.svnkit.jar}" failonerror="false"/>
- </target>
-
- <!--
- Create patch; unfortunately VERSION.txt is included as well.
- -->
- <target name="svn-diff" description="Make patch.">
-
- <echo>Generating patch file '${svn.patch.file}'....</echo>
- <java classname="org.tmatesoft.svn.cli.SVN" dir="." fork="true" output="${svn.patch.file}">
- <arg value="diff"/>
- <arg value="."/>
- <classpath>
- <pathelement location="${svn.svnkit.jar}"/>
- <pathelement location="${svn.svnkitcli.jar}"/>
- </classpath>
- </java>
- <echo>Reminder: please remove all VERSION.txt diffs from the file '${svn.patch.file}'.</echo>
- </target>
-
- <!--
- Check out / update sources from subversion code archive.
- -->
- <target name="svn-update" description="Update project from SubVersion archive.">
- <property name="source-root" value="."/>
- <property name="repository.URL" value="https://exist.svn.sourceforge.net/svnroot/exist"/>
- <java classname="org.tmatesoft.svn.cli.SVN" dir="." fork="true">
- <arg value="co"/>
- <arg value="${repository.URL}/trunk/eXist"/>
- <arg value="${source-root}"/>
- <classpath>
- <pathelement location="${svn.svnkit.jar}"/>
- <pathelement location="${svn.svnkitcli.jar}"/>
- </classpath>
- </java>
- </target>
-
-</project>
View
2  extensions/contentextraction/ivy.xml
@@ -6,7 +6,7 @@
<ivy-module version="2.0">
<info organisation="org.exist" module="tika"/>
<dependencies>
- <dependency org="org.apache.tika" name="tika-parsers" rev="1.3" conf="*->*,!sources,!javadoc">
+ <dependency org="org.apache.tika" name="tika-parsers" rev="1.4" conf="*->*,!sources,!javadoc">
<exclude module="jdom"/>
<exclude module="slf4j-api"/>
<exclude module="commons-codec"/>
View
6 extensions/modules/src/org/exist/xquery/modules/file/Sync.java
@@ -22,6 +22,7 @@
import org.exist.memtree.MemTreeBuilder;
import org.exist.security.PermissionDeniedException;
import org.exist.storage.lock.Lock;
+import org.exist.storage.serializers.EXistOutputKeys;
import org.exist.storage.serializers.Serializer;
import org.exist.util.serializer.SAXSerializer;
import org.exist.util.serializer.SerializerPool;
@@ -63,6 +64,7 @@
static {
DEFAULT_PROPERTIES.put(OutputKeys.INDENT, "yes");
DEFAULT_PROPERTIES.put(OutputKeys.OMIT_XML_DECLARATION, "no");
+ DEFAULT_PROPERTIES.put(EXistOutputKeys.EXPAND_XINCLUDES, "no");
}
public Sync(XQueryContext context) {
@@ -183,8 +185,8 @@ private void saveXML(File targetDir, DocumentImpl doc, MemTreeBuilder output) {
Serializer serializer = context.getBroker().getSerializer();
serializer.reset();
serializer.setProperties(DEFAULT_PROPERTIES);
- serializer.setReceiver( sax );
-
+
+ serializer.setSAXHandlers(sax, sax);
serializer.toSAX( doc );
writer.close();
View
2  extensions/replication/src/org/exist/replication/jms/publish/JMSMessageSender.java
@@ -210,7 +210,7 @@ public void sendMessage(eXistMessage em) throws TransportException {
} catch (JMSException ex) {
LOG.error(ex.getMessage(), ex);
- throw new TransportException(String.format("Problem during communcation: %s", ex.getMessage()), ex);
+ throw new TransportException(String.format("Problem during communication: %s", ex.getMessage()), ex);
} catch (NamingException ex) {
LOG.error(ex.getMessage(), ex);
View
95 extensions/replication/src/org/exist/replication/jms/publish/ReplicationTrigger.java
@@ -48,17 +48,26 @@
public class ReplicationTrigger extends FilteringTrigger implements DocumentTrigger, CollectionTrigger {
private final static Logger LOG = Logger.getLogger(ReplicationTrigger.class);
+
+ private static final String BLOCKED_MESSAGE = "Blocked replication trigger for %s: was received by replication extension.";
+ public static final String JMS_EXTENSION_PKG = "org.exist.replication.jms";
+
private Map<String, List<?>> parameters;
//
// Document Triggers
//
- private void afterUpdateCreateDocument(DBBroker broker, Txn transaction,
- DocumentImpl document, eXistMessage.ResourceOperation operation) /* throws TriggerException */ {
+ private void afterUpdateCreateDocument(DBBroker broker, Txn transaction, DocumentImpl document,
+ eXistMessage.ResourceOperation operation) /* throws TriggerException */ {
if (LOG.isDebugEnabled()) {
LOG.debug(document.getURI().toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, document.getURI().toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -81,7 +90,8 @@ private void afterUpdateCreateDocument(DBBroker broker, Txn transaction,
msg.setPayload(MessageHelper.gzipSerialize(broker, document));
} catch (Throwable ex) {
- LOG.error(String.format("Problem while serializing document (contentLength=%s) to compressed message:%s", document.getContentLength(), ex.getMessage()), ex);
+ LOG.error(String.format("Problem while serializing document (contentLength=%s) to compressed message:%s",
+ document.getContentLength(), ex.getMessage()), ex);
//throw new TriggerException("Unable to retrieve message payload: " + ex.getMessage());
}
@@ -90,34 +100,46 @@ private void afterUpdateCreateDocument(DBBroker broker, Txn transaction,
}
@Override
- public void afterCreateDocument(DBBroker broker, Txn transaction,
- DocumentImpl document) throws TriggerException {
+ public void afterCreateDocument(DBBroker broker, Txn transaction, DocumentImpl document) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(document.getURI().toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, document.getURI().toString()));
+ return;
+ }
this.afterUpdateCreateDocument(broker, transaction, document, eXistMessage.ResourceOperation.CREATE);
}
@Override
- public void afterUpdateDocument(DBBroker broker, Txn transaction,
- DocumentImpl document) throws TriggerException {
+ public void afterUpdateDocument(DBBroker broker, Txn transaction, DocumentImpl document) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(document.getURI().toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, document.getURI().toString()));
+ return;
+ }
this.afterUpdateCreateDocument(broker, transaction, document, eXistMessage.ResourceOperation.UPDATE);
}
@Override
- public void afterCopyDocument(DBBroker broker, Txn transaction,
- DocumentImpl document, XmldbURI oldUri) throws TriggerException {
+ public void afterCopyDocument(DBBroker broker, Txn transaction, DocumentImpl document, XmldbURI oldUri) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("%s %s", document.getURI().toString(), oldUri.toString()));
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, document.getURI().toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -131,12 +153,16 @@ public void afterCopyDocument(DBBroker broker, Txn transaction,
}
@Override
- public void afterMoveDocument(DBBroker broker, Txn transaction,
- DocumentImpl document, XmldbURI oldUri) throws TriggerException {
+ public void afterMoveDocument(DBBroker broker, Txn transaction, DocumentImpl document, XmldbURI oldUri) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("%s %s", document.getURI().toString(), oldUri.toString()));
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, document.getURI().toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -150,12 +176,16 @@ public void afterMoveDocument(DBBroker broker, Txn transaction,
}
@Override
- public void afterDeleteDocument(DBBroker broker, Txn transaction,
- XmldbURI uri) throws TriggerException {
+ public void afterDeleteDocument(DBBroker broker, Txn transaction, XmldbURI uri) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(uri.toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, uri.toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -171,12 +201,15 @@ public void afterDeleteDocument(DBBroker broker, Txn transaction,
// Collection Triggers
//
@Override
- public void afterCreateCollection(DBBroker broker, Txn transaction,
- Collection collection) throws TriggerException {
+ public void afterCreateCollection(DBBroker broker, Txn transaction, Collection collection) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(collection.getURI().toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, collection.getURI().toString()));
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -192,11 +225,15 @@ public void afterCreateCollection(DBBroker broker, Txn transaction,
}
@Override
- public void afterCopyCollection(DBBroker broker, Txn transaction, Collection collection,
- XmldbURI oldUri) throws TriggerException {
+ public void afterCopyCollection(DBBroker broker, Txn transaction, Collection collection, XmldbURI oldUri) throws TriggerException {
+
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("%s %s", collection.getURI().toString(), oldUri.toString()));
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, collection.getURI().toString()));
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -210,11 +247,16 @@ public void afterCopyCollection(DBBroker broker, Txn transaction, Collection col
}
@Override
- public void afterMoveCollection(DBBroker broker, Txn transaction, Collection collection,
- XmldbURI oldUri) throws TriggerException {
+ public void afterMoveCollection(DBBroker broker, Txn transaction, Collection collection, XmldbURI oldUri) throws TriggerException {
+
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("%s %s", collection.getURI().toString(), oldUri.toString()));
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, collection.getURI().toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -228,11 +270,15 @@ public void afterMoveCollection(DBBroker broker, Txn transaction, Collection col
}
@Override
- public void afterDeleteCollection(DBBroker broker, Txn transaction,
- XmldbURI uri) throws TriggerException {
+ public void afterDeleteCollection(DBBroker broker, Txn transaction, XmldbURI uri) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(uri.toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, uri.toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
@@ -249,11 +295,16 @@ public void afterDeleteCollection(DBBroker broker, Txn transaction,
//
@Override
- public void afterUpdateDocumentMetadata(DBBroker broker, Txn txn, DocumentImpl document) throws TriggerException {
+ public void afterUpdateDocumentMetadata(DBBroker broker, Txn transaction, DocumentImpl document) throws TriggerException {
if (LOG.isDebugEnabled()) {
LOG.debug(document.getURI().toString());
}
+
+ if(transaction.getOriginId()!=null && transaction.getOriginId().startsWith(JMS_EXTENSION_PKG)){
+ LOG.info(String.format(BLOCKED_MESSAGE, document.getURI().toString()));
+ return;
+ }
// Create Message
eXistMessage msg = new eXistMessage();
View
218 extensions/replication/src/org/exist/replication/jms/subscribe/JMSMessageListener.java
@@ -103,13 +103,12 @@ private eXistMessage convertMessage(BytesMessage bm) {
em.setPayload(payload);
} catch (JMSException ex) {
- String errorMessage = "Unable to convert incoming message. ("
- + ex.getErrorCode() + "): " + ex.getMessage();
+ String errorMessage = String.format("Unable to convert incoming message. (%s): %s", ex.getErrorCode(), ex.getMessage());
LOG.error(errorMessage, ex);
throw new MessageReceiveException(errorMessage);
} catch (IllegalArgumentException ex) {
- String errorMessage = "Unable to convert incoming message. " + ex.getMessage();
+ String errorMessage = String.format("Unable to convert incoming message. %s", ex.getMessage());
LOG.error(errorMessage, ex);
throw new MessageReceiveException(errorMessage);
}
@@ -149,7 +148,7 @@ public void onMessage(Message msg) {
handleCollection(em);
break;
default:
- String errorMessage = "Unknown resource type " + em.getResourceType();
+ String errorMessage = String.format("Unknown resource type %s", em.getResourceType());
LOG.error(errorMessage);
throw new MessageReceiveException(errorMessage);
}
@@ -158,20 +157,18 @@ public void onMessage(Message msg) {
} else {
// Only ByteMessage objects supported.
- throw new MessageReceiveException("Could not handle message type "
- + msg.getClass().getSimpleName());
+ throw new MessageReceiveException(String.format("Could not handle message type %s", msg.getClass().getSimpleName()));
}
} catch (MessageReceiveException ex) {
// Thrown by local code. Just make it pass
- LOG.error("Could not handle received message: " + ex.getMessage(), ex);
+ LOG.error(String.format("Could not handle received message: %s", ex.getMessage()), ex);
throw ex;
} catch (Throwable t) {
// Something really unexpected happened. Report
LOG.error(t.getMessage(), t);
- throw new MessageReceiveException("Could not handle received message: "
- + t.getMessage(), t);
+ throw new MessageReceiveException(String.format("Could not handle received message: %s", t.getMessage()), t);
}
}
@@ -205,7 +202,7 @@ private void handleDocument(eXistMessage em) {
break;
default:
- String errorMessage = "Unknown resource type " + em.getResourceOperation();
+ String errorMessage = String.format("Unknown resource type %s", em.getResourceOperation());
LOG.error(errorMessage);
throw new MessageReceiveException(errorMessage);
}
@@ -218,7 +215,6 @@ private void handleDocument(eXistMessage em) {
*/
private void handleCollection(eXistMessage em) {
-
switch (em.getResourceOperation()) {
case CREATE:
case UPDATE:
@@ -251,7 +247,6 @@ private void createDocument(eXistMessage em) {
Map<String, Object> props = em.getMetadata();
-
XmldbURI sourcePath = XmldbURI.create(em.getResourcePath());
XmldbURI colURI = sourcePath.removeLastSegment();
XmldbURI docURI = sourcePath.lastSegment();
@@ -266,8 +261,9 @@ private void createDocument(eXistMessage em) {
mime = MimeType.BINARY_TYPE;
}
-
+ //
// Get OWNER
+ ///
String userName = null;
Object prop = props.get(MessageHelper.EXIST_RESOURCE_OWNER);
if (prop != null && prop instanceof String) {
@@ -276,12 +272,16 @@ private void createDocument(eXistMessage em) {
Account account = securityManager.getAccount(userName);
if (account == null) {
- String errorText = "Username " + userName + " does not exist.";
+ String errorText = String.format("Username %s does not exist.", userName);
LOG.error(errorText);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+ account = securityManager.getSystemSubject();
+ userName = account.getName();
}
+ //
// Get GROUP
+ //
String groupName = null;
prop = props.get(MessageHelper.EXIST_RESOURCE_GROUP);
if (prop != null && prop instanceof String) {
@@ -290,12 +290,16 @@ private void createDocument(eXistMessage em) {
Group group = securityManager.getGroup(groupName);
if (group == null) {
- String errorText = "Group " + groupName + " does not exist.";
+ String errorText = String.format("Group %s does not exist.", groupName);
LOG.error(errorText);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+ group = securityManager.getSystemSubject().getDefaultGroup();
+ groupName = group.getName();
}
+ //
// Get MIME_TYPE
+ //
MimeTable mimeTable = MimeTable.getInstance();
String mimeType = null;
prop = props.get(MessageHelper.EXIST_RESOURCE_MIMETYPE);
@@ -317,8 +321,6 @@ private void createDocument(eXistMessage em) {
mimeType = mT.getName();
}
-
-
// Get/Set permissions
Integer mode = null;
prop = props.get(MessageHelper.EXIST_RESOURCE_MODE);
@@ -327,27 +329,33 @@ private void createDocument(eXistMessage em) {
}
-
-
- // Start transaction
- TransactionManager txnManager = brokerPool.getTransactionManager();
- Txn txn = txnManager.beginTransaction();
-
try {
- // TODO get user
broker = brokerPool.get(securityManager.getSystemSubject());
- // Check if collection exists. not likely to happen since availability is checked
- // by ResourceFactory
collection = broker.openCollection(colURI, Lock.WRITE_LOCK);
-// collection.setTriggersEnabled(false);
+
if (collection == null) {
- String errorMessage = "Collection " + colURI + " does not exist";
+ String errorMessage = String.format("Collection %s does not exist", colURI);
LOG.error(errorMessage);
- txnManager.abort(txn);
- throw new MessageReceiveException(errorMessage);
+
+ // Create collection anyway
+ createCollection(colURI, userName, groupName, Permission.DEFAULT_COLLECTION_PERM);
+ }
+ } catch (Throwable t){
+ if(LOG.isDebugEnabled()){
+ LOG.error(t.getMessage(), t);
+ } else {
+ LOG.error(t.getMessage());
}
+ throw new MessageReceiveException(String.format("Unable to create collection in database: %s", t.getMessage()));
+ }
+ // Start transaction
+ TransactionManager txnManager = brokerPool.getTransactionManager();
+ Txn txn = txnManager.beginTransaction();
+ txn.setOriginId(this.getClass().getName());
+
+ try {
DocumentImpl doc = null;
if (mime.isXMLType()) {
@@ -409,7 +417,7 @@ private void createDocument(eXistMessage em) {
}
txnManager.abort(txn);
- throw new MessageReceiveException("Unable to write document into database: " + ex.getMessage());
+ throw new MessageReceiveException(String.format("Unable to write document into database: %s", ex.getMessage()));
} finally {
@@ -423,9 +431,15 @@ private void createDocument(eXistMessage em) {
}
}
+
+ private void createCollectionWhenRequired(){
+
+ }
/**
* Metadata is updated in database
+ *
+ * TODO not usable yet
*/
private void updateMetadataDocument(eXistMessage em) {
// Permissions
@@ -443,6 +457,7 @@ private void updateMetadataDocument(eXistMessage em) {
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
+ txn.setOriginId(this.getClass().getName());
try {
// TODO get user
@@ -451,19 +466,25 @@ private void updateMetadataDocument(eXistMessage em) {
// Open collection if possible, else abort
collection = broker.openCollection(colURI, Lock.WRITE_LOCK);
if (collection == null) {
- String errorText = "Collection does not exist " + colURI;
+ String errorText = String.format("Collection does not exist %s", colURI);
LOG.error(errorText);
txnManager.abort(txn);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+
+ // be silent
+ return;
}
// Open document if possible, else abort
resource = collection.getDocument(broker, docURI);
if (resource == null) {
- String errorText = "No resource found for path: " + sourcePath;
+ String errorText = String.format("No resource found for path: %s", sourcePath);
LOG.error(errorText);
txnManager.abort(txn);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+
+ // be silent
+ return;
}
DocumentMetadata metadata = resource.getMetadata();
@@ -507,6 +528,7 @@ private void deleteDocument(eXistMessage em) {
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
+ txn.setOriginId(this.getClass().getName());
try {
// TODO get user
@@ -515,19 +537,25 @@ private void deleteDocument(eXistMessage em) {
// Open collection if possible, else abort
collection = broker.openCollection(colURI, Lock.WRITE_LOCK);
if (collection == null) {
- String errorText = "Collection does not exist " + colURI;
+ String errorText = String.format("Collection does not exist %s", colURI);
LOG.error(errorText);
txnManager.abort(txn);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+
+ // silently ignore
+ return;
}
// Open document if possible, else abort
resource = collection.getDocument(broker, docURI);
if (resource == null) {
- String errorText = "No resource found for path: " + sourcePath;
+ String errorText = String.format("No resource found for path: %s", sourcePath);
LOG.error(errorText);
txnManager.abort(txn);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+
+ // silently ignore
+ return;
}
// This delete is based on mime-type /ljo
if (resource.getResourceType() == DocumentImpl.BINARY_FILE) {
@@ -553,7 +581,6 @@ private void deleteDocument(eXistMessage em) {
} finally {
- // TODO: check if can be done earlier
if (collection != null) {
collection.release(Lock.WRITE_LOCK);
}
@@ -579,6 +606,7 @@ private void deleteCollection(eXistMessage em) {
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
+ txn.setOriginId(this.getClass().getName());
try {
// TODO get user
@@ -590,6 +618,7 @@ private void deleteCollection(eXistMessage em) {
collection = broker.openCollection(sourcePath, Lock.WRITE_LOCK);
if (collection == null) {
txnManager.abort(txn);
+ // be silent
return;
}
@@ -645,9 +674,12 @@ private void createCollection(eXistMessage em) {
Account account = securityManager.getAccount(userName);
if (account == null) {
- String errorText = "Username " + userName + " does not exist.";
+ String errorText = String.format("Username %s does not exist.", userName);
LOG.error(errorText);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+
+ account = securityManager.getSystemSubject();
+ userName = account.getName();
}
// Get GROUP
@@ -657,36 +689,47 @@ private void createCollection(eXistMessage em) {
groupName = (String) prop;
}
+ Group group = securityManager.getGroup(groupName);
+ if (group == null) {
+ String errorText = String.format("Group %s does not exist.", groupName);
+ LOG.error(errorText);
+ //throw new MessageReceiveException(errorText);
+ group = securityManager.getSystemSubject().getDefaultGroup();
+ groupName = group.getName();
+ }
+
// Get/Set permissions
Integer mode = null;
prop = props.get(MessageHelper.EXIST_RESOURCE_MODE);
if (prop != null && prop instanceof Integer) {
mode = (Integer) prop;
}
-
-
+
+ createCollection(sourcePath, userName, groupName, mode);
+ }
+
+ private boolean createCollection(XmldbURI sourcePath, String userName, String groupName, Integer mode) throws MessageReceiveException {
DBBroker broker = null;
Collection collection = null;
-
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
-
+ txn.setOriginId(this.getClass().getName());
+
try {
// TODO get user
broker = brokerPool.get(securityManager.getSystemSubject());
-
// TODO ... consider to swallow situation transparently
collection = broker.openCollection(sourcePath, Lock.WRITE_LOCK);
if (collection != null) {
- String errorText = "Collection " + sourcePath + " already exists";
+ String errorText = String.format("Collection %s already exists", sourcePath);
LOG.error(errorText);
txnManager.abort(txn);
- throw new MessageReceiveException(errorText);
+ //throw new MessageReceiveException(errorText);
+ // silently ignore
+ return false;
}
-
// Create collection
Collection newCollection = broker.getOrCreateCollection(txn, sourcePath);
-
// Set owner,group and permissions
Permission permission = newCollection.getPermissions();
if (userName != null) {
@@ -698,27 +741,23 @@ private void createCollection(eXistMessage em) {
if (mode != null) {
permission.setMode(mode);
}
-
-
broker.saveCollection(txn, newCollection);
broker.flush();
-
// Commit change
txnManager.commit(txn);
-
- } catch (Throwable t) {
-
- if(LOG.isDebugEnabled()){
- LOG.error(t.getMessage(), t);
- } else {
- LOG.error(t.getMessage());
- }
- txnManager.abort(txn);
- throw new MessageReceiveException(t.getMessage(), t);
-
- } finally {
-
+ } catch (Throwable t) {
+
+ if(LOG.isDebugEnabled()){
+ LOG.error(t.getMessage(), t);
+ } else {
+ LOG.error(t.getMessage());
+ }
+
+ txnManager.abort(txn);
+ throw new MessageReceiveException(t.getMessage(), t);
+
+ } finally {
// TODO: check if can be done earlier
if (collection != null) {
collection.release(Lock.WRITE_LOCK);
@@ -726,7 +765,9 @@ private void createCollection(eXistMessage em) {
txnManager.close(txn);
brokerPool.release(broker);
}
+ return true;
}
+
private void relocateDocument(eXistMessage em, boolean keepDocument) {
@@ -748,6 +789,7 @@ private void relocateDocument(eXistMessage em, boolean keepDocument) {
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
+ txn.setOriginId(this.getClass().getName());
try {
// TODO get user
@@ -756,28 +798,37 @@ private void relocateDocument(eXistMessage em, boolean keepDocument) {
// Open collection if possible, else abort
srcCollection = broker.openCollection(sourceColURI, Lock.WRITE_LOCK);
if (srcCollection == null) {
- String errorMessage = "Collection not found: " + sourceColURI;
+ String errorMessage = String.format("Collection not found: %s", sourceColURI);
LOG.error(errorMessage);
txnManager.abort(txn);
- throw new MessageReceiveException(errorMessage);
+ //throw new MessageReceiveException(errorMessage);
+
+ // be silent
+ return;
}
// Open document if possible, else abort
srcDocument = srcCollection.getDocument(broker, sourceDocURI);
if (srcDocument == null) {
- String errorMessage = "No resource found for path: " + sourcePath;
+ String errorMessage = String.format("No resource found for path: %s", sourcePath);
LOG.error(errorMessage);
txnManager.abort(txn);
- throw new MessageReceiveException(errorMessage);
+ //throw new MessageReceiveException(errorMessage);
+
+ // be silent
+ return;
}
// Open collection if possible, else abort
destCollection = broker.openCollection(destColURI, Lock.WRITE_LOCK);
if (destCollection == null) {
- String errorMessage = "Destination collection " + destColURI + " does not exist.";
+ String errorMessage = String.format("Destination collection %s does not exist.", destColURI);
LOG.error(errorMessage);
txnManager.abort(txn);
- throw new MessageReceiveException(errorMessage);
+ //throw new MessageReceiveException(errorMessage);
+
+ // be silent
+ return;
}
@@ -835,6 +886,7 @@ private void relocateCollection(eXistMessage em, boolean keepCollection) {
TransactionManager txnManager = brokerPool.getTransactionManager();
Txn txn = txnManager.beginTransaction();
+ txn.setOriginId(this.getClass().getName());
try {
// TODO get user
@@ -843,20 +895,26 @@ private void relocateCollection(eXistMessage em, boolean keepCollection) {
// Open collection if possible, else abort
srcCollection = broker.openCollection(sourcePath, Lock.WRITE_LOCK);
if (srcCollection == null) {
- String errorMessage = "Collection " + sourcePath + " does not exist.";
+ String errorMessage = String.format("Collection %s does not exist.", sourcePath);
LOG.error(errorMessage);
txnManager.abort(txn);
- throw new MessageReceiveException(errorMessage);
+ //throw new MessageReceiveException(errorMessage);
+
+ // be silent
+ return;
}
// Open collection if possible, else abort
destCollection = broker.openCollection(destColURI, Lock.WRITE_LOCK);
if (destCollection == null) {
- String errorMessage = "Destination collection " + destColURI + " does not exist.";
+ String errorMessage = String.format("Destination collection %s does not exist.", destColURI);
LOG.error(errorMessage);
txnManager.abort(txn);
- throw new MessageReceiveException(errorMessage);
+ //throw new MessageReceiveException(errorMessage);
+
+ // be silent
+ return;
}
// Perform actual move/copy
@@ -894,4 +952,6 @@ private void relocateCollection(eXistMessage em, boolean keepCollection) {
}
}
+
+
}
View
23 extensions/replication/src/org/exist/replication/shared/eXistMessage.java
@@ -25,6 +25,7 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* Container class for clustering messages.
@@ -55,6 +56,8 @@
private ResourceOperation resourceOperation;
private ResourceType resourceType;
+ private DocumentType documentType;
+
private String path;
private String destination;
private byte[] payload;
@@ -74,6 +77,13 @@
public enum ResourceType {
DOCUMENT, COLLECTION
}
+
+ /**
+ * Types of exist-db resources
+ */
+ public enum DocumentType {
+ XML, BINARY
+ }
public void setResourceOperation(ResourceOperation type) {
resourceOperation = type;
@@ -137,6 +147,14 @@ public void setMetadata(Map<String, Object> props) {
return metaData;
}
+ public DocumentType getDocumentType() {
+ return documentType;
+ }
+
+ public void setDocumentType(DocumentType documentType) {
+ this.documentType = documentType;
+ }
+
/**
* Get one-liner report of message, including the JMS properties.
*/
@@ -172,4 +190,9 @@ public String getReport() {
return sb.toString();
}
+
+ @Override
+ public String toString(){
+ return ToStringBuilder.reflectionToString(this);
+ }
}
View
2  extensions/xqdoc/build.properties
@@ -7,5 +7,5 @@
#
# $Id$
##########################################################
-extension.run.smoke.tests=true
+extension.run.smoke.tests=false
extension.smoke.tests.class=xquery.xqdoc.RunTests
View
2  installer/apps.properties
@@ -1,2 +1,2 @@
apps.repo=http://demo.exist-db.org/exist/apps/public-repo
-apps=shared,dashboard,eXide,doc,demo,xsltforms-demo,xsltforms,bfDemos,bfReferences,fundocs
+apps=shared,dashboard,eXide,doc,demo,xsltforms-demo,xsltforms,bf-XForms,fundocs
View
8 installer/install.xsl
@@ -36,9 +36,15 @@
<xsl:variable name="name" select="substring-before($file, '.xar')"/>
<xsl:variable name="package" select="document($file)//expath:package"/>
<pack name="{$package/@abbrev}" required="no" preselected="yes" parent="Apps">
+ <xsl:attribute name="required">
+ <xsl:choose>
+ <xsl:when test="$package/@abbrev = 'shared'">yes</xsl:when>
+ <xsl:otherwise>no</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
<description><xsl:value-of select="$package/expath:title"/></description>
<fileset targetdir="$INSTALL_PATH/autodeploy" dir="installer/apps">
- <include name="{$package/@abbrev}*.xar"/>
+ <include name="*{$package/@abbrev}*.xar"/>
</fileset>
</pack>
</xsl:template>
View
2  installer/userInput.xml
@@ -4,7 +4,7 @@
<field size="1.33" bold="false" txt="Set Data Directory" align="left"
type="title"/>
<field
- txt="Please select a directory where eXist-db will keep its data files. On Windows Vista and Windows 7, this should be outside the 'Program Files' directory:"
+ txt="Please select a directory where eXist-db will keep its data files. On Windows, this should be outside the 'Program Files' directory. Please make sure eXist can write to the directory it is installed in."
align="left" type="staticText"/>
<field variable="dataDir" align="center" type="dir">
<spec create="false" mustExist="false" set="$DATA_DIR" size="20"
View
8 installer/vm.properties
@@ -3,7 +3,11 @@
# "java -jar start.jar" without parameters on the shell).
# Minimum and maximum memory
-vmoptions=-Xms64m -Xmx${MAX_MEMORY}m -Dfile.encoding=UTF-8
+memory.max=${MAX_MEMORY}
+memory.min=64
+
+# General vm options
+vmoptions=-Dfile.encoding=UTF-8
# Mac specific properties
-vmoptions.mac=-Xdock:name="eXist-db" -Xdock:icon="icon.png" -Dapple.laf.useScreenMenuBar="true"
+vmoptions.mac=-Xdock:name="eXist-db" -Xdock:icon="icon.png" -Dapple.laf.useScreenMenuBar="true"
View
4 src/org/exist/backup/xquery/RetrieveBackup.java
@@ -54,6 +54,8 @@
new FunctionParameterSequenceType( "name", Type.STRING, Cardinality.EXACTLY_ONE, "The name of the file to retrieve." )
}, new SequenceType( Type.ITEM, Cardinality.EMPTY ) );
+ private final static int CHUNK_SIZE = 512 * 1024;
+
public RetrieveBackup( XQueryContext context )
{
super( context, signature );
@@ -111,7 +113,7 @@ public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathEx
final ResponseWrapper response = (ResponseWrapper)respValue.getObject();
response.setContentType( "application/zip" );
-
+ response.setHeader("Content-Length", String.valueOf(backupFile.length()));
try {
final InputStream is = new FileInputStream( backupFile );
final OutputStream os = response.getOutputStream();
View
34 src/org/exist/client/ConnectionDialog.form
@@ -43,6 +43,7 @@
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
</SyntheticProperties>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
@@ -77,19 +78,19 @@
<Group type="103" groupAlignment="0" attributes="0">
<Component id="panFavourites" min="-2" max="-2" attributes="0"/>
<Component id="tpConnectionType" min="-2" pref="527" max="-2" attributes="0"/>
- <Component id="lblUsername" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="lblConnectionType" alignment="0" min="-2" max="-2" attributes="0"/>
- <Component id="lblPassword" alignment="0" min="-2" max="-2" attributes="0"/>
- </Group>
- <EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
- <Component id="cmbConnectionType" min="-2" pref="122" max="-2" attributes="0"/>
- <Component id="txtUsername" alignment="0" max="32767" attributes="0"/>
- <Component id="txtPassword" alignment="0" min="-2" pref="300" max="-2" attributes="0"/>
+ <Component id="lblPassword" pref="110" max="32767" attributes="0"/>
+ <Component id="lblConnectionType" max="32767" attributes="0"/>
+ </Group>
+ <EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="txtPassword" alignment="0" min="-2" pref="270" max="-2" attributes="0"/>
+ <Component id="txtUsername" min="-2" pref="270" max="-2" attributes="0"/>
+ <Component id="cmbConnectionType" alignment="0" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
</Group>
+ <Component id="lblUsername" alignment="0" min="-2" pref="115" max="-2" attributes="0"/>
</Group>
</Group>
<Component id="jSeparator1" alignment="0" min="-2" pref="666" max="-2" attributes="0"/>
@@ -283,7 +284,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="lblConfiguration" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
- <Component id="txtConfiguration" pref="313" max="32767" attributes="0"/>
+ <Component id="txtConfiguration" pref="279" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnSelectConfiguration" min="-2" pref="33" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@@ -299,7 +300,7 @@
<Component id="txtConfiguration" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnSelectConfiguration" alignment="3" min="-2" pref="28" max="-2" attributes="0"/>
</Group>
- <EmptySpace pref="30" max="32767" attributes="0"/>
+ <EmptySpace pref="38" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -409,7 +410,9 @@
</Container>
<Component class="javax.swing.JButton" name="btnClose">
<Properties>
- <Property name="text" type="java.lang.String" value="Close"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="getLabel(&quot;LoginPanel.51&quot;)" type="code"/>
+ </Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCloseActionPerformed"/>
@@ -417,11 +420,16 @@
</Component>
<Component class="javax.swing.JButton" name="btnConnect">
<Properties>
- <Property name="text" type="java.lang.String" value="Connect"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection code="getLabel(&quot;LoginPanel.50&quot;)" type="code"/>
+ </Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConnectActionPerformed"/>
</Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="btnConnect.addKeyListener(new EnterKeyAdapter());"/>
+ </AuxValues>
</Component>
<Component class="javax.swing.JSeparator" name="jSeparator1">
</Component>
View
28 src/org/exist/client/ConnectionDialog.java
@@ -269,7 +269,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
chkSsl.setSelected(getDefaultConnectionSettings().isSsl());
chkSsl.setText(getLabel("LoginPanel.47"));
- final javax.swing.GroupLayout panRemoteLayout = new javax.swing.GroupLayout(panRemote);
+ javax.swing.GroupLayout panRemoteLayout = new javax.swing.GroupLayout(panRemote);
panRemote.setLayout(panRemoteLayout);
panRemoteLayout.setHorizontalGroup(
panRemoteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -310,7 +310,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
- final javax.swing.GroupLayout panEmbeddedLayout = new javax.swing.GroupLayout(panEmbedded);
+ javax.swing.GroupLayout panEmbeddedLayout = new javax.swing.GroupLayout(panEmbedded);
panEmbedded.setLayout(panEmbeddedLayout);
panEmbeddedLayout.setHorizontalGroup(
panEmbeddedLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -318,7 +318,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addContainerGap()
.addComponent(lblConfiguration)
.addGap(33, 33, 33)
- .addComponent(txtConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
+ .addComponent(txtConfiguration, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnSelectConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
@@ -331,7 +331,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(lblConfiguration)
.addComponent(txtConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btnSelectConfiguration, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(30, Short.MAX_VALUE))
+ .addContainerGap(38, Short.MAX_VALUE))
);
tpConnectionType.addTab("tab2", panEmbedded);
@@ -354,7 +354,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
- final javax.swing.GroupLayout panFavouritesLayout = new javax.swing.GroupLayout(panFavourites);
+ javax.swing.GroupLayout panFavouritesLayout = new javax.swing.GroupLayout(panFavourites);
panFavourites.setLayout(panFavouritesLayout);
panFavouritesLayout.setHorizontalGroup(
panFavouritesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -391,7 +391,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
- final javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -412,16 +412,16 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(panFavourites, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(tpConnectionType, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(lblUsername)
.addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(lblConnectionType)
- .addComponent(lblPassword))
- .addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(cmbConnectionType, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(txtUsername)
- .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)))))
+ .addComponent(lblPassword, javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE)
+ .addComponent(lblConnectionType, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addGap(6, 6, 6)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(txtPassword, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(txtUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(cmbConnectionType, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
+ .addComponent(lblUsername, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 666, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
View
358 src/org/exist/config/Configurator.java
@@ -121,74 +121,91 @@ protected static AFields getConfigurationAnnotatedFields(Class<?> clazz) {
}
}
- public static Method searchForGetMethod(Class<?> clazz, String property) {
+ /**
+ * Finds the Getter Method for the named property of a class
+ *
+ * @param clazz The class of methods to search
+ * @param property The named property in the class to find a getter method for
+ *
+ * @return The Getter method for the property or null
+ */
+ public static Method searchForGetMethod(final Class<?> clazz, final String property) {
try {
- String methodName = "get" + property;
- methodName = methodName.toLowerCase();
+ final String methodName = ("get" + property).toLowerCase();