Skip to content

Commit

Permalink
Merge branch 'develop' into feature/recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangmm committed Dec 18, 2013
2 parents 549d898 + 4fca85d commit fc9ab96
Show file tree
Hide file tree
Showing 164 changed files with 22,107 additions and 28,156 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -9,9 +9,12 @@ dist/
exist.jar
exist-optional.jar
extensions/**/build/
extensions/contentextraction/lib/
extensions/lib/
extensions/modules/lib/
lib/extensions/
lib/user/svnkit*.jar
lib/user/icu4j*.jar
local.*
mime-types.xml
start.jar
Expand Down
8 changes: 4 additions & 4 deletions build/scripts/build-impl.xml
Expand Up @@ -123,7 +123,7 @@
<echo message="-------------------------"/>
<echo message="eXist ${project.version} build"/>
<echo message="-------------------------"/>
<echo message="GIT revision ${git.commit}"/>
<echo message="Git revision ${git.commit}"/>
<echo message=""/>
<echo message="${ant.version}"/>
<echo message="-------------------------"/>
Expand Down Expand Up @@ -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="GIT-Revision" value="${git.commit}"/>
<attribute name="Git-Revision" value="${git.commit}"/>
</manifest>
<exclude name="org/exist/*.xsl"/>
<exclude name="org/exist/ant/**"/>
Expand All @@ -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="GIT-Revision" value="${git.commit}"/>
<attribute name="Git-Revision" value="${git.commit}"/>
</manifest>
<include name="org/exist/start/**"/>
</jar>
Expand All @@ -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="GIT-Revision" value="${git.commit}"/>
<attribute name="Git-Revision" value="${git.commit}"/>
</manifest>
<include name="org/exist/*.xsl"/>
<include name="org/exist/ant/**"/>
Expand Down
9 changes: 3 additions & 6 deletions build/scripts/dist.xml
Expand Up @@ -64,7 +64,7 @@
<include name="*.jar"/>
</lib>
<!-- Include spatial jars, when available -->
<lib dir="extensions/indexes/spatial/lib">
<lib dir="extensions/indexes/spatial/lib" erroronmissingdir="false">
<include name="*.jar"/>
</lib>
<!-- Include xqdoc jar, needed for xquery function documentation -->
Expand Down Expand Up @@ -133,10 +133,7 @@
<exclude name="WEB-INF/expathrepo/**"/>
<exclude name="**/*.log*"/>
</fileset>
<!-- Betterform -->
<zipfileset dir="extensions/betterform/main/xrx/" prefix="betterform/samples/xrx">
<include name="**/*"/>
</zipfileset>

<zipfileset dir="samples" prefix="samples">
<include name="**"/>
<exclude name="**/*~"/>
Expand All @@ -157,7 +154,7 @@
<attribute name="Project-Name" value="${project.name}"/>
<attribute name="Project-Version" value="${project.version}"/>
<attribute name="Project-Build" value="${DSTAMP}"/>
<attribute name="GIT-Revision" value="${git.commit}"/>
<attribute name="Git-Revision" value="${git.commit}"/>
</manifest>

</war>
Expand Down
36 changes: 26 additions & 10 deletions build/scripts/installer.xml
Expand Up @@ -9,21 +9,43 @@

<!-- import common targets -->
<import file="../../build.xml"/>

<import file="../../build/scripts/macosx.xml"/>

<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="tools/ant/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>

<property name="apps.dir" value="installer/apps"/>
<property name="installer.scripts" value="installer/scripts"/>
<property name="installer.mac.icon" value="${installer.scripts}/icon.icns"/>

<property file="installer/apps.properties"/>

<target name="commandline-installer">
<!--ant antfile="build.xml" dir="tools/izpack"/-->
</target>

<target depends="all,samples,xars,copy_scripts" name="prepare-installer">
<target name="macosx" depends="install-appbundler">
<taskdef
name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${appbundler.jar}" />
<bundleapp
outputdirectory="${installer.scripts}"
name="eXist-db"
displayname="eXist-db"
identifier="org.exist.start.Main"
mainclassname="org.exist.start.Main"
shortversion="${project.version.numeric}"
icon="${installer.mac.icon}">
<classpath file="start.jar"/>
<option value="-Dexist.home=$APP_ROOT/.."/>
</bundleapp>
</target>

<target depends="all,samples,xars,copy_scripts,macosx" name="prepare-installer">
<path id="izpackdeps">
<fileset dir="${izpack.dir}/lib/">
<include name="*.jar"/>
Expand All @@ -38,14 +60,6 @@
<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"
overwrite="true">
<filterset>
<filter token="vmoptions" value=""/>
<filter token="classpath" value="$APP_PACKAGE/.."/>
</filterset>
</copy>
</target>

<target name="clean-installer-xars-dir" description="Remove installer apps.dir directory">
Expand Down Expand Up @@ -131,6 +145,8 @@
<izpack input="installer/install.xml"
output="${inst-jar}"
basedir="." izPackDir="${izpack.dir}"
compression="bzip2"
compressionlevel="9"
installerType="standard"/>

<!--mkdir dir="installer/temp"/>
Expand Down
75 changes: 52 additions & 23 deletions build/scripts/macosx.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Call target "dmg" to create dmg file -->
<!-- ======================================================================= -->
<!-- $Id$ -->
<project basedir="../.." default="dmg" name="Mac OS App">
<project basedir="../.." default="all" name="Mac OS App">

<description>Build installer</description>

Expand All @@ -15,31 +15,51 @@
<property name="app.dir" value="${dist}/eXist-db.app"/>
<property name="app.resources" value="${app.dir}/Contents/Resources"/>
<property name="app.exist" value="${app.resources}/eXist-db"/>
<property name="app.icon" value="installer/scripts/icon.icns"/>
<property name="codesign.identity" value="Lars Windauer"/>
<property name="appbundler.jar" value="${tools.ant}/lib/appbundler-1.0.jar"/>
<property name="appbundler.url" value="http://java.net/downloads/appbundler/appbundler-1.0.jar"/>

<target name="package" depends="jar,create-skeleton,copy-all"/>
<available property="appbundler.available" file="${appbundler.jar}"/>

<target name="app" description="Build Mac OS X dmg (unsigned)" depends="bundle,copy-all,dmg"/>

<target name="app-signed" description="Build Mac OS X dmg (signed)" depends="bundle,copy-all,codesign,dmg"/>

<target name="install-appbundler" unless="appbundler.available">
<taskdef name="fetch" classname="nl.ow.dilemma.ant.fetch.FetchTask">
<classpath>
<pathelement location="${tools.ant}/lib/asocat-exist.jar"/>
</classpath>
</taskdef>

<fetch dest="${tools.ant}/lib" url="${appbundler.url}"
failonerror="false" maxtime="120"/>
</target>

<target name="bundle" depends="prepare-app">
<taskdef
name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${appbundler.jar}" />
<bundleapp
outputdirectory="${dist}"
name="eXist-db"
displayname="eXist-db"
identifier="org.exist.start.Main"
mainclassname="org.exist.start.Main"
shortversion="${project.version.numeric}"
icon="${app.icon}">
<classpath file="start.jar"/>
<option value="-Dexist.home=$APP_ROOT/Contents/Resources/eXist-db"/>
</bundleapp>
</target>

<target name="prepare" depends="xars">
<target name="prepare-app" depends="install-appbundler,xars">
<delete failonerror="false" dir="${app.dir}"/>
<mkdir dir="${dist}"/>
</target>

<target name="create-skeleton" depends="prepare">
<copy todir="${app.dir}">
<fileset dir="installer/scripts/eXist-db.mac">
<exclude name=".svn"/>
<exclude name="Info.plist.tmpl"/>
</fileset>
</copy>
<copy file="installer/scripts/eXist-db.mac/Contents/Info.plist.tmpl"
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"/>
</filterset>
</copy>
<mkdir dir="${app.exist}"/>
</target>

<target name="copy-apps">
<copy todir="${app.exist}/autodeploy">
<fileset dir="${basedir}/installer/apps">
Expand Down Expand Up @@ -73,7 +93,6 @@
<include name="exist-modules.jar"/>
<include name="exist-fluent.jar"/>
<include name="start.jar"/>
<include name="start.exe"/>
<include name="examples.jar"/>
<include name="mime-types.xml.tmpl"/>
<include name="mime-types.xml"/>
Expand Down Expand Up @@ -124,7 +143,8 @@
<exclude name="jetty/tmp/*"/>
<exclude name="jetty/work/*"/>
<exclude name="ircbot/**"/>
<include name="aspectj/**"/>
<exclude name="aspectj/lib/aspectjtools*.jar"/>
<exclude name="aspectj/lib/aspectjweaver*.jar"/>
<exclude name="izpack/**"/>
<exclude name="ant/lib/svnkit*.jar"/>
<include name="jmx/**"/>
Expand Down Expand Up @@ -163,8 +183,17 @@
</chmod>
</target>

<target name="codesign" description="Codesign .app">
<exec executable="/usr/bin/codesign" os="Mac OS X" failonerror="true">
<arg value="-f"/>
<arg value="-s"/>
<arg value="${codesign.identity}"/>
<arg value="${app.dir}"/>
</exec>
</target>

<!-- Create a DMG - This only works on MacOSX (requires hdiutil) -->
<target name="dmg" depends="package" description="Create a DMG package for MacOSX (only works on MacOSX)">
<target name="dmg" description="Create a DMG package for MacOSX (only works on MacOSX)">

<!-- Set this property value to your application name -->
<property name="app.name" value="${project.name}"/>
Expand Down
2 changes: 1 addition & 1 deletion conf.xml.tmpl
Expand Up @@ -156,7 +156,7 @@
you have some more memory to waste. If you deal with lots of
collections, you can also increase the collectionCacheSize value
-->
<db-connection cacheSize="@cacheSize@M" checkMaxCacheSize="true" collectionCache="24M" database="@database@"
<db-connection cacheSize="@cacheSize@M" checkMaxCacheSize="true" collectionCache="48M" database="@database@"
files="@dataDir@" pageSize="4096" nodesBuffer="1000" cacheShrinkThreshold="10000"
doc-ids="default" minDiskSpace="128M">

Expand Down
2 changes: 2 additions & 0 deletions eXist.ipr
Expand Up @@ -368,12 +368,14 @@
<root url="file://$PROJECT_DIR$/lib/extensions" />
<root url="file://$PROJECT_DIR$/extensions/xqdoc/lib" />
<root url="file://$PROJECT_DIR$/extensions/webdav/lib" />
<root url="file://$PROJECT_DIR$/extensions/modules/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/extensions/fluent/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/extensions/indexes/lucene/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/extensions/indexes/spatial/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/extensions/modules/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/extensions/webdav/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/extensions/xqdoc/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/extensions" recursive="false" />
Expand Down
Binary file modified extensions/betterform/main/lib/betterform.jar
Binary file not shown.
3 changes: 0 additions & 3 deletions extensions/build.properties
Expand Up @@ -51,9 +51,6 @@ include.feature.metadata.sleepycat = false
# via REST
include.feature.netedit = false

# Clustering extension for reliable document replication
include.feature.replication = false

# Security ActiveDirectory extension for eXist (requires LDAP extension)
include.feature.security.activedirectory = false

Expand Down
Binary file modified extensions/exquery/lib/exquery-xquery-1.0-SNAPSHOT.jar
Binary file not shown.
Expand Up @@ -62,6 +62,7 @@
import org.exquery.restxq.impl.AbstractRestXqService;
import org.exquery.xdm.type.SequenceImpl;
import org.exquery.xquery.Sequence;
import org.exquery.xquery.Type;
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
Expand Down Expand Up @@ -236,12 +237,27 @@ public String getCacheClass() {
}
}

//dont close the stream if its a binary value, because we will need it later for serialization
if(is != null && !(result instanceof BinaryValue)) {
try {
is.close();
} catch(final IOException ioe) {
LOG.error(ioe.getMessage(), ioe);
if(is != null) {
/*
* Do NOT close the stream if its a binary value,
* because we will need it later for serialization
*/
boolean isBinaryType = false;
if(result != null) {
try {
final Type type = result.head().getType();
isBinaryType = (type == Type.BASE64_BINARY || type == Type.HEX_BINARY);
} catch(final IndexOutOfBoundsException ioe) {
LOG.warn("Called head on an empty HTTP Request body sequence", ioe);
}
}

if(!isBinaryType) {
try {
is.close();
} catch(final IOException ioe) {
LOG.error(ioe.getMessage(), ioe);
}
}
}
}
Expand Down
Expand Up @@ -45,16 +45,6 @@ public class RestXqTrigger extends FilteringTrigger {

protected final static Logger LOG = Logger.getLogger(RestXqTrigger.class);

@Override
public void prepare(final int event, final DBBroker broker, final Txn transaction, final XmldbURI documentPath, final DocumentImpl existingDocument) throws TriggerException {

}

@Override
public void finish(final int event, final DBBroker broker, final Txn transaction, final XmldbURI documentPath, final DocumentImpl document) {

}

@Override
public void beforeCreateDocument(final DBBroker broker, final Txn transaction, final XmldbURI uri) throws TriggerException {
}
Expand Down

0 comments on commit fc9ab96

Please sign in to comment.