Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:eXist-db/exist into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dizzzz committed Feb 1, 2014
2 parents bbb26eb + 2131cd9 commit 67db2f6
Show file tree
Hide file tree
Showing 72 changed files with 832 additions and 961 deletions.
10 changes: 5 additions & 5 deletions .classpath
Expand Up @@ -39,8 +39,8 @@
<classpathentry kind="lib" path="lib/endorsed/xercesImpl-2.11.0.jar"/> <classpathentry kind="lib" path="lib/endorsed/xercesImpl-2.11.0.jar"/>
<classpathentry kind="lib" path="lib/endorsed/xml-resolver-1.2.jar"/> <classpathentry kind="lib" path="lib/endorsed/xml-resolver-1.2.jar"/>
<classpathentry kind="lib" path="lib/endorsed/xalan-2.7.1.jar"/> <classpathentry kind="lib" path="lib/endorsed/xalan-2.7.1.jar"/>
<classpathentry kind="lib" path="extensions/fluent/lib/hamcrest-core-1.1.jar"/> <classpathentry kind="lib" path="lib/test/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="extensions/fluent/lib/hamcrest-library-1.1.jar"/> <classpathentry kind="lib" path="extensions/fluent/lib/hamcrest-library-1.3.jar"/>
<classpathentry kind="lib" path="extensions/fluent/lib/jmock-2.4.0.jar"/> <classpathentry kind="lib" path="extensions/fluent/lib/jmock-2.4.0.jar"/>
<classpathentry kind="lib" path="extensions/fluent/lib/jmock-junit4-2.4.0.jar"/> <classpathentry kind="lib" path="extensions/fluent/lib/jmock-junit4-2.4.0.jar"/>
<classpathentry kind="lib" path="lib/core/commons-pool-1.6.jar"/> <classpathentry kind="lib" path="lib/core/commons-pool-1.6.jar"/>
Expand Down Expand Up @@ -75,7 +75,7 @@
<classpathentry kind="lib" path="lib/optional/saaj-1.2.jar"/> <classpathentry kind="lib" path="lib/optional/saaj-1.2.jar"/>
<classpathentry kind="lib" path="lib/optional/wsdl4j-1.5.1.jar"/> <classpathentry kind="lib" path="lib/optional/wsdl4j-1.5.1.jar"/>
<classpathentry kind="lib" path="tools/ant/lib/ant.jar"/> <classpathentry kind="lib" path="tools/ant/lib/ant.jar"/>
<classpathentry kind="lib" path="lib/test/junit-4.8.2.jar"/> <classpathentry kind="lib" path="lib/test/junit-4.11.jar"/>
<classpathentry kind="lib" path="tools/ircbot/lib/pircbot.jar"/> <classpathentry kind="lib" path="tools/ircbot/lib/pircbot.jar"/>
<classpathentry kind="lib" path="tools/wrapper/lib/wrapper.jar"/> <classpathentry kind="lib" path="tools/wrapper/lib/wrapper.jar"/>
<classpathentry kind="lib" path="lib/core/jta-1.1.jar"/> <classpathentry kind="lib" path="lib/core/jta-1.1.jar"/>
Expand All @@ -91,8 +91,8 @@
<classpathentry kind="lib" path="tools/ant/lib/xmlunit-1.3.jar"/> <classpathentry kind="lib" path="tools/ant/lib/xmlunit-1.3.jar"/>
<classpathentry kind="lib" path="lib/user/activation-1.1.1.jar"/> <classpathentry kind="lib" path="lib/user/activation-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/user/nekohtml-1.9.15.jar"/> <classpathentry kind="lib" path="lib/user/nekohtml-1.9.15.jar"/>
<classpathentry kind="lib" path="lib/test/easymock-2.5.2.jar"/> <classpathentry kind="lib" path="lib/test/easymock-3.2.jar"/>
<classpathentry kind="lib" path="lib/test/easymockclassextension-2.5.2.jar"/> <classpathentry kind="lib" path="lib/test/easymockclassextension-3.2.jar"/>
<classpathentry kind="lib" path="extensions/webdav/lib/jdom-1.1.jar"/> <classpathentry kind="lib" path="extensions/webdav/lib/jdom-1.1.jar"/>
<classpathentry kind="lib" path="extensions/webdav/lib/mime-util-2.1.3.jar"/> <classpathentry kind="lib" path="extensions/webdav/lib/mime-util-2.1.3.jar"/>
<classpathentry kind="lib" path="lib/optional/commons-compress-1.4.1.jar"/> <classpathentry kind="lib" path="lib/optional/commons-compress-1.4.1.jar"/>
Expand Down
3 changes: 1 addition & 2 deletions conf.xml.tmpl
Expand Up @@ -865,7 +865,6 @@
<module uri="http://exist-db.org/xquery/versioning/svn" class="org.exist.versioning.svn.xquery.SVNModule" /> <module uri="http://exist-db.org/xquery/versioning/svn" class="org.exist.versioning.svn.xquery.SVNModule" />
<module uri="http://exist-db.org/xquery/xmldiff" class="org.exist.xquery.modules.xmldiff.XmlDiffModule" /> <module uri="http://exist-db.org/xquery/xmldiff" class="org.exist.xquery.modules.xmldiff.XmlDiffModule" />
<module uri="http://exist-db.org/xquery/xmpp" class="org.exist.xquery.modules.xmpp.XMPPModule" /> <module uri="http://exist-db.org/xquery/xmpp" class="org.exist.xquery.modules.xmpp.XMPPModule" />
<module uri="http://xmlcalabash.com" class="org.exist.xquery.modules.xmlcalabash.XMLCalabashModule" />
--> -->


<!-- <!--
Expand Down Expand Up @@ -912,6 +911,6 @@
containing valid nodes. containing valid nodes.
--> -->
<xupdate allowed-fragmentation="100" enable-consistency-checks="no"/> <xupdate allowed-fragmentation="10000" enable-consistency-checks="no"/>


</exist> </exist>
3 changes: 0 additions & 3 deletions eXist.ipr
Expand Up @@ -103,9 +103,6 @@
<option name="OPEN_IN_BROWSER" value="false" /> <option name="OPEN_IN_BROWSER" value="false" />
<option name="OUTPUT_DIRECTORY" /> <option name="OUTPUT_DIRECTORY" />
</component> </component>
<component name="GradleSettings">
<option name="gradleHome" value="$USER_HOME$/Apps/gradle" />
</component>
<component name="IdProvider" IDEtalkID="EDCB317F9C51C9BBC9F54E158B17D480" /> <component name="IdProvider" IDEtalkID="EDCB317F9C51C9BBC9F54E158B17D480" />
<component name="JavacSettings"> <component name="JavacSettings">
<option name="DEPRECATION" value="false" /> <option name="DEPRECATION" value="false" />
Expand Down
541 changes: 164 additions & 377 deletions eXist.iws

Large diffs are not rendered by default.

Binary file removed extensions/fluent/lib/hamcrest-core-1.1.jar
Binary file not shown.
Binary file removed extensions/fluent/lib/hamcrest-library-1.1.jar
Binary file not shown.
Binary file added extensions/fluent/lib/hamcrest-library-1.3.jar
Binary file not shown.
Expand Up @@ -349,6 +349,7 @@ protected void removeNodes() {
LOG.warn("Error while deleting lucene index entries: " + e.getMessage(), e); LOG.warn("Error while deleting lucene index entries: " + e.getMessage(), e);
} finally { } finally {
index.releaseWriter(writer); index.releaseWriter(writer);
nodesToRemove = null;
} }
} }


Expand Down
Expand Up @@ -255,8 +255,8 @@ public int getMode() {


@Override @Override
public StoredNode getReindexRoot(StoredNode node, NodePath path, boolean includeSelf) { public StoredNode getReindexRoot(StoredNode node, NodePath path, boolean includeSelf) {
if (node.getNodeType() == Node.ATTRIBUTE_NODE) // if (node.getNodeType() == Node.ATTRIBUTE_NODE)
return null; // return null;
if (config == null) if (config == null)
return null; return null;
NodePath p = new NodePath(path); NodePath p = new NodePath(path);
Expand Down Expand Up @@ -387,6 +387,7 @@ protected void removeNodes() {
} catch (IOException e) { } catch (IOException e) {
LOG.warn("Error while deleting lucene index entries: " + e.getMessage(), e); LOG.warn("Error while deleting lucene index entries: " + e.getMessage(), e);
} finally { } finally {
nodesToRemove = null;
index.releaseWriter(writer); index.releaseWriter(writer);
} }
} }
Expand Down
8 changes: 8 additions & 0 deletions extensions/indexes/range/test/src/xquery/suite-updates.xql
@@ -0,0 +1,8 @@
xquery version "3.0";

import module namespace test="http://exist-db.org/xquery/xqsuite"
at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";

import module namespace rtt="http://exist-db.org/xquery/range/test/updates" at "file:extensions/indexes/range/test/src/xquery/updates.xql";

test:suite(util:list-functions(xs:anyURI("http://exist-db.org/xquery/range/test/updates")))
232 changes: 232 additions & 0 deletions extensions/indexes/range/test/src/xquery/updates.xql
@@ -0,0 +1,232 @@
xquery version "3.0";

module namespace rt="http://exist-db.org/xquery/range/test/updates";

import module namespace test="http://exist-db.org/xquery/xqsuite" at "resource:org/exist/xquery/lib/xqsuite/xqsuite.xql";

declare namespace mods="http://www.loc.gov/mods/v3";

declare variable $rt:COLLECTION := "/db/rangetest";

declare variable $rt:COLLECTION_CONFIG :=
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:vra="http://www.vraweb.org/vracore4.htm" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mods="http://www.loc.gov/mods/v3">
<fulltext default="none" attributes="false"/>
<lucene>
<analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>

<!--MODS-->
<text qname="mods:title"/>
</lucene>
<range>
<create qname="mods:name">
<field name="name-type" match="@type" type="xs:string"/>
<field name="name-part" match="mods:namePart" type="xs:string" case="yes"/>
</create>
<create qname="mods:mods">
<field name="mods-dateIssued" match="mods:originInfo/mods:dateIssued" type="xs:string"/>
<field name="mods-id" match="@ID" type="xs:string"/>
<field name="mods-authority" match="@authority" type="xs:string"/>
<field name="mods-lang" match="@lang" type="xs:string"/>
</create>
</range>
</index>
</collection>;

declare variable $rt:DATA :=
<mods:modsCollection>
<mods:mods ID="books/aw/Knuth86a">
<mods:titleInfo>
<mods:title>TeX: The Program</mods:title>
</mods:titleInfo>
<mods:name type="personal">
<mods:namePart>Donald E. Knuth</mods:namePart>
</mods:name>
<mods:originInfo>
<mods:dateIssued>1986</mods:dateIssued>
<mods:publisher>Addison-Wesley</mods:publisher>
</mods:originInfo>
<mods:identifier type="isbn">0-201-13437-3</mods:identifier>
</mods:mods>
<mods:mods ID="books/aw/Lamport86">
<mods:titleInfo>
<mods:title>LaTeX: User's Guide &amp; Reference Manual</mods:title>
</mods:titleInfo>
<mods:name type="personal">
<mods:namePart>Leslie Lamport</mods:namePart>
</mods:name>
<mods:originInfo>
<mods:dateIssued>1986</mods:dateIssued>
<mods:publisher>Addison-Wesley</mods:publisher>
</mods:originInfo>
<mods:identifier type="isbn">0-201-15790-X</mods:identifier>
</mods:mods>
</mods:modsCollection>
;
declare
%test:setUp
function rt:setup() {
xmldb:create-collection("/db/system/config/db", "rangetest"),
xmldb:store("/db/system/config/db/rangetest", "collection.xconf", $rt:COLLECTION_CONFIG),
xmldb:create-collection("/db", "rangetest"),
xmldb:store($rt:COLLECTION, "test.xml", $rt:DATA)
};
(:declare
%test:tearDown
function rt:cleanup() {
xmldb:remove($rt:COLLECTION, "test.xml"),
xmldb:remove($rt:COLLECTION),
xmldb:remove("/db/system/config/db/rangetest")
};:)
declare
%test:assertEquals(1)
function rt:t00_query() {
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Leslie Lamport")])
};
declare
%test:assertEquals(1, 1)
function rt:t01_replaceTitle() {
update replace
collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "latex")]
/mods:titleInfo/mods:title
with
<mods:title>The best text processor ever</mods:title>,
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "'text processor'")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Leslie Lamport")])
};
declare
%test:assertEquals(1, 1, 1)
function rt:t02_insertName() {
update insert
<mods:name type="personal">
<mods:namePart>Hansi Reiher</mods:namePart>
</mods:name>
into
collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")],
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Hansi Reiher")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Donald E. Knuth")])
};
declare
%test:assertEquals(1, 1, 1, 1)
function rt:t03_insertAfter() {
update insert
<mods:name type="personal">
<mods:namePart>Gerda Schwan</mods:namePart>
</mods:name>
following
collection($rt:COLLECTION)//mods:mods/range:field-eq("name-part", "Donald E. Knuth"),
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Hansi Reiher")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Donald E. Knuth")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Gerda Schwan")])
};
declare
%test:assertEquals(1, 1, 1, 1, 1)
function rt:t04_insertBefore() {
update insert
<mods:name type="personal">
<mods:namePart>Susi Spatz</mods:namePart>
</mods:name>
preceding
collection($rt:COLLECTION)//mods:mods/range:field-eq("name-part", "Donald E. Knuth"),
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Hansi Reiher")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Donald E. Knuth")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Gerda Schwan")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Susi Spatz")])
};
declare
%test:assertEquals(1, 0, 1)
function rt:t05_replaceName() {
update replace
collection($rt:COLLECTION)//mods:mods/range:field-eq("name-part", "Susi Spatz")
with
<mods:name>
<mods:namePart>Manfred Specht</mods:namePart>
</mods:name>,
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Susi Spatz")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Manfred Specht")])
};
declare
%test:assertEquals(1, 1, 0)
function rt:t06_replaceName() {
update replace
collection($rt:COLLECTION)//mods:mods/mods:name[mods:namePart = "Manfred Specht"]/mods:namePart
with
<mods:namePart>Doris Drossel</mods:namePart>,
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[mods:name[mods:namePart = "Doris Drossel"]]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Manfred Specht")])
};
declare
%test:assertEquals(1, 1, 0)
function rt:t07_updateName() {
update value
collection($rt:COLLECTION)//mods:mods/mods:name[mods:namePart = "Doris Drossel"]/mods:namePart
with
"Adolf Adler",
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[mods:name[mods:namePart = "Adolf Adler"]]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Doris Drossel")])
};
declare
%test:assertEquals(1, 1, 1, 0)
function rt:t08_updateIDAttrib() {
update value
collection($rt:COLLECTION)//mods:mods[@ID = "books/aw/Lamport86"]/@ID
with
"CHANGED_ID",
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "'text processor'")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Leslie Lamport")]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_ID"]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "books/aw/Lamport86"])
};
declare
%test:assertEquals(1, 1, 1, 0)
function rt:t09_replaceIDAttrib() {
update replace
collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_ID"]/@ID
with
attribute ID { "CHANGED_2" },
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "'text processor'")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Leslie Lamport")]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_2"]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_ID"])
};
declare
%test:assertEquals(1, 1, 1, 0)
function rt:t10_updateYear() {
update replace
collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_2"]/mods:originInfo/mods:dateIssued
with
<mods:dateIssued>2014</mods:dateIssued>,
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "'text processor'")]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_2"][range:field-eq("name-part", "Leslie Lamport")]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_2"][mods:originInfo/mods:dateIssued = "2014"]),
count(collection($rt:COLLECTION)//mods:mods[@ID = "CHANGED_2"][mods:originInfo/mods:dateIssued = "1986"])
};
declare
%test:assertEquals(1, 1, 0)
function rt:t11_deleteName() {
update delete
collection($rt:COLLECTION)//mods:mods/mods:name[mods:namePart = "Donald E. Knuth"],
count(collection($rt:COLLECTION)//mods:mods[ft:query(mods:titleInfo/mods:title, "program")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Hansi Reiher")]),
count(collection($rt:COLLECTION)//mods:mods[range:field-eq("name-part", "Donald E. Knuth")])
};
27 changes: 1 addition & 26 deletions extensions/modules/build.xml
Expand Up @@ -35,10 +35,6 @@
</and> </and>
</condition> </condition>


<condition property="libs.available.calabash">
<available file="${modules.lib}/calabash.jar"/>
</condition>

<condition property="include.module.oracle_ext"> <condition property="include.module.oracle_ext">
<and> <and>
<istrue value="${include.module.oracle}"/> <istrue value="${include.module.oracle}"/>
Expand Down Expand Up @@ -129,23 +125,6 @@


</target> </target>


<!--
Special targets for xmlcalabash module
-->
<target name="prepare-xmlcalabash"
unless="libs.available.calabash" if="${include.module.xmlcalabash}" >
<echo message="------------------------------------------------------"/>
<echo message="Downloading libraries required by the xmlcalabash module"/>
<echo message="------------------------------------------------------"/>
<echo message="Calabash: ${libs.available.calabash}"/>
<fetch classpathref="classpath.core" dest="${modules.lib}"
url="${include.module.xmlcalabash.url}">
<patternset>
<include name="**/calabash.jar"/>
</patternset>
</fetch>
</target>

<!-- <!--
Special targets for simpleql module Special targets for simpleql module
--> -->
Expand Down Expand Up @@ -243,7 +222,7 @@
<ivy:retrieve xmlns:ivy="antlib:org.apache.ivy.ant" sync="false"/> <ivy:retrieve xmlns:ivy="antlib:org.apache.ivy.ant" sync="false"/>
</target> </target>


<target name="prepare" depends="prepare-ivy,prepare-xslfo,prepare-simpleql,prepare-jfreechart,prepare-memcached,prepare-xmpp,prepare-xmlcalabash,prepare-expathrepo,prepare-cqlparser"> <target name="prepare" depends="prepare-ivy,prepare-xslfo,prepare-simpleql,prepare-jfreechart,prepare-memcached,prepare-xmpp,prepare-expathrepo,prepare-cqlparser">
<mkdir dir="${classes}"/> <mkdir dir="${classes}"/>
</target> </target>


Expand Down Expand Up @@ -286,7 +265,6 @@
<exclude name="org/exist/xquery/modules/xmldiff/**" unless="${include.module.xmldiff}"/> <exclude name="org/exist/xquery/modules/xmldiff/**" unless="${include.module.xmldiff}"/>
<exclude name="org/exist/xquery/modules/xmpp/**" unless="${include.module.xmpp}"/> <exclude name="org/exist/xquery/modules/xmpp/**" unless="${include.module.xmpp}"/>
<exclude name="org/exist/xquery/modules/xslfo/**" unless="${include.module.xslfo}"/> <exclude name="org/exist/xquery/modules/xslfo/**" unless="${include.module.xslfo}"/>
<exclude name="org/exist/xquery/modules/xmlcalabash/**" unless="${include.module.xmlcalabash}"/>
<exclude name="org/exist/xquery/modules/expathrepo/**" unless="${include.module.expathrepo}"/> <exclude name="org/exist/xquery/modules/expathrepo/**" unless="${include.module.expathrepo}"/>
<exclude name="org/exist/xquery/modules/process/**" unless="${include.module.process}"/> <exclude name="org/exist/xquery/modules/process/**" unless="${include.module.process}"/>
<exclude name="org/exist/xquery/modules/persistentlogin/**" unless="${include.module.persistentlogin}"/> <exclude name="org/exist/xquery/modules/persistentlogin/**" unless="${include.module.persistentlogin}"/>
Expand All @@ -311,8 +289,5 @@
</target> </target>


<target name="clean-all"> <target name="clean-all">
<delete file="${modules.lib}/calabash.jar" failonerror="false"/>
</target> </target>


</project> </project>

0 comments on commit 67db2f6

Please sign in to comment.