You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
(57) |
Apr
(103) |
May
(164) |
Jun
(139) |
Jul
(173) |
Aug
(196) |
Sep
(221) |
Oct
(333) |
Nov
(214) |
Dec
(88) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(163) |
Feb
(165) |
Mar
(98) |
Apr
(93) |
May
(199) |
Jun
(118) |
Jul
(200) |
Aug
(212) |
Sep
(185) |
Oct
(297) |
Nov
(437) |
Dec
(272) |
| 2006 |
Jan
(542) |
Feb
(329) |
Mar
(267) |
Apr
(332) |
May
(267) |
Jun
(130) |
Jul
(161) |
Aug
(348) |
Sep
(166) |
Oct
(305) |
Nov
(173) |
Dec
(173) |
| 2007 |
Jan
(199) |
Feb
(118) |
Mar
(133) |
Apr
(200) |
May
(208) |
Jun
(146) |
Jul
(198) |
Aug
(146) |
Sep
(187) |
Oct
(182) |
Nov
(181) |
Dec
(83) |
| 2008 |
Jan
(252) |
Feb
(124) |
Mar
(124) |
Apr
(101) |
May
(143) |
Jun
(122) |
Jul
(129) |
Aug
(60) |
Sep
(80) |
Oct
(89) |
Nov
(54) |
Dec
(112) |
| 2009 |
Jan
(88) |
Feb
(145) |
Mar
(105) |
Apr
(164) |
May
(123) |
Jun
(154) |
Jul
(374) |
Aug
(341) |
Sep
(219) |
Oct
(137) |
Nov
(373) |
Dec
(240) |
| 2010 |
Jan
(197) |
Feb
(270) |
Mar
(253) |
Apr
(150) |
May
(102) |
Jun
(51) |
Jul
(300) |
Aug
(512) |
Sep
(254) |
Oct
(258) |
Nov
(288) |
Dec
(143) |
| 2011 |
Jan
(238) |
Feb
(179) |
Mar
(253) |
Apr
(332) |
May
(248) |
Jun
(255) |
Jul
(216) |
Aug
(282) |
Sep
(146) |
Oct
(77) |
Nov
(86) |
Dec
(69) |
| 2012 |
Jan
(172) |
Feb
(234) |
Mar
(229) |
Apr
(101) |
May
(212) |
Jun
(267) |
Jul
(129) |
Aug
(210) |
Sep
(239) |
Oct
(271) |
Nov
(368) |
Dec
(220) |
| 2013 |
Jan
(179) |
Feb
(155) |
Mar
(59) |
Apr
(47) |
May
(99) |
Jun
(158) |
Jul
(185) |
Aug
(16) |
Sep
(16) |
Oct
(7) |
Nov
(20) |
Dec
(12) |
| 2014 |
Jan
(21) |
Feb
(17) |
Mar
(18) |
Apr
(13) |
May
(27) |
Jun
(15) |
Jul
(19) |
Aug
(22) |
Sep
(30) |
Oct
(16) |
Nov
(19) |
Dec
(16) |
| 2015 |
Jan
(14) |
Feb
(24) |
Mar
(33) |
Apr
(41) |
May
(14) |
Jun
(80) |
Jul
(53) |
Aug
(8) |
Sep
(7) |
Oct
(15) |
Nov
(13) |
Dec
(2) |
| 2016 |
Jan
(22) |
Feb
(12) |
Mar
(30) |
Apr
(6) |
May
(33) |
Jun
(16) |
Jul
(8) |
Aug
(20) |
Sep
(12) |
Oct
(18) |
Nov
(12) |
Dec
(11) |
| 2017 |
Jan
(24) |
Feb
(26) |
Mar
(47) |
Apr
(23) |
May
(19) |
Jun
(14) |
Jul
(28) |
Aug
(30) |
Sep
(17) |
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
(73) |
Mar
(90) |
Apr
(42) |
May
(116) |
Jun
(90) |
Jul
(127) |
Aug
(103) |
Sep
(56) |
Oct
(42) |
Nov
(95) |
Dec
(58) |
| 2020 |
Jan
(102) |
Feb
(31) |
Mar
(93) |
Apr
(60) |
May
(57) |
Jun
(45) |
Jul
(29) |
Aug
(32) |
Sep
(44) |
Oct
(86) |
Nov
(51) |
Dec
(71) |
| 2021 |
Jan
(44) |
Feb
(25) |
Mar
(78) |
Apr
(130) |
May
(64) |
Jun
(74) |
Jul
(21) |
Aug
(64) |
Sep
(40) |
Oct
(43) |
Nov
(21) |
Dec
(99) |
| 2022 |
Jan
(154) |
Feb
(64) |
Mar
(45) |
Apr
(95) |
May
(62) |
Jun
(48) |
Jul
(73) |
Aug
(37) |
Sep
(71) |
Oct
(27) |
Nov
(40) |
Dec
(65) |
| 2023 |
Jan
(89) |
Feb
(130) |
Mar
(124) |
Apr
(50) |
May
(93) |
Jun
(46) |
Jul
(45) |
Aug
(68) |
Sep
(62) |
Oct
(71) |
Nov
(108) |
Dec
(82) |
| 2024 |
Jan
(53) |
Feb
(76) |
Mar
(64) |
Apr
(75) |
May
(36) |
Jun
(54) |
Jul
(98) |
Aug
(137) |
Sep
(58) |
Oct
(177) |
Nov
(84) |
Dec
(52) |
| 2025 |
Jan
(70) |
Feb
(53) |
Mar
(72) |
Apr
(47) |
May
(88) |
Jun
(49) |
Jul
(86) |
Aug
(51) |
Sep
(65) |
Oct
(91) |
Nov
(18) |
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
(2) |
|
2
(7) |
3
(7) |
4
(9) |
5
(3) |
6
(4) |
7
(2) |
8
(4) |
|
9
(3) |
10
|
11
(7) |
12
(6) |
13
(1) |
14
(1) |
15
(3) |
|
16
|
17
(1) |
18
(1) |
19
|
20
(3) |
21
|
22
|
|
23
|
24
|
25
(4) |
26
|
27
|
28
|
29
(1) |
|
30
(10) |
31
(4) |
|
|
|
|
|
|
From: <wol...@us...> - 2007-12-31 17:25:41
|
Revision: 7090
http://exist.svn.sourceforge.net/exist/?rev=7090&view=rev
Author: wolfgang_m
Date: 2007-12-31 09:25:35 -0800 (Mon, 31 Dec 2007)
Log Message:
-----------
On db shutdown, properly unregister all JMX MBeans which were configured for the db instance. Otherwise the JMX interface will continue to use the old instance classes, thus producing wrong reports.
Modified Paths:
--------------
trunk/eXist/src/org/exist/management/Agent.java
trunk/eXist/src/org/exist/management/DummyAgent.java
trunk/eXist/src/org/exist/storage/BrokerPool.java
trunk/eXist/src/org/exist/storage/DefaultCacheManager.java
trunk/eXist/tools/jmx/src/org/exist/management/impl/JMXAgent.java
Modified: trunk/eXist/src/org/exist/management/Agent.java
===================================================================
--- trunk/eXist/src/org/exist/management/Agent.java 2007-12-31 16:53:07 UTC (rev 7089)
+++ trunk/eXist/src/org/exist/management/Agent.java 2007-12-31 17:25:35 UTC (rev 7090)
@@ -25,11 +25,14 @@
import org.exist.storage.BrokerPool;
/**
+ * Interface to allow the JMX classes to be plugged in on systems which
+ * support it. A dummy implementation will be used if JMX is not available.
*/
public interface Agent {
void initDBInstance(BrokerPool instance);
- void addMBean(String name, Object mbean) throws DatabaseConfigurationException;
+ void closeDBInstance(BrokerPool instance);
+ void addMBean(String dbInstance, String name, Object mbean) throws DatabaseConfigurationException;
}
Modified: trunk/eXist/src/org/exist/management/DummyAgent.java
===================================================================
--- trunk/eXist/src/org/exist/management/DummyAgent.java 2007-12-31 16:53:07 UTC (rev 7089)
+++ trunk/eXist/src/org/exist/management/DummyAgent.java 2007-12-31 17:25:35 UTC (rev 7090)
@@ -34,7 +34,11 @@
// do nothing
}
- public void addMBean(String name, Object mbean) throws DatabaseConfigurationException {
+ public void closeDBInstance(BrokerPool instance) {
+ // nothing to do
+ }
+
+ public void addMBean(String dbInstance, String name, Object mbean) throws DatabaseConfigurationException {
// just do nothing
}
}
Modified: trunk/eXist/src/org/exist/storage/BrokerPool.java
===================================================================
--- trunk/eXist/src/org/exist/storage/BrokerPool.java 2007-12-31 16:53:07 UTC (rev 7089)
+++ trunk/eXist/src/org/exist/storage/BrokerPool.java 2007-12-31 17:25:35 UTC (rev 7090)
@@ -1480,7 +1480,10 @@
transactionManager.shutdown();
- //Invalidate the configuration
+ // deregister JMX MBeans
+ AgentFactory.getInstance().closeDBInstance(this);
+
+ //Invalidate the configuration
conf = null;
//Clear the living instances container
instances.remove(instanceName);
Modified: trunk/eXist/src/org/exist/storage/DefaultCacheManager.java
===================================================================
--- trunk/eXist/src/org/exist/storage/DefaultCacheManager.java 2007-12-31 16:53:07 UTC (rev 7089)
+++ trunk/eXist/src/org/exist/storage/DefaultCacheManager.java 2007-12-31 17:25:35 UTC (rev 7090)
@@ -278,9 +278,8 @@
private void registerMBean() {
Agent agent = AgentFactory.getInstance();
try {
- agent.addMBean("org.exist.management." + instanceName +
- ":type=CacheManager",
- new org.exist.management.CacheManager(this));
+ agent.addMBean(instanceName, "org.exist.management." + instanceName +
+ ":type=CacheManager", new org.exist.management.CacheManager(this));
} catch (DatabaseConfigurationException e) {
LOG.warn("Exception while registering cache mbean.", e);
}
@@ -289,7 +288,7 @@
private void registerMBean(Cache cache) {
Agent agent = AgentFactory.getInstance();
try {
- agent.addMBean("org.exist.management." + instanceName + ":type=CacheManager.Cache,name=" +
+ agent.addMBean(instanceName, "org.exist.management." + instanceName + ":type=CacheManager.Cache,name=" +
cache.getFileName() + ",cache-type=" + cache.getType(),
new org.exist.management.Cache(cache));
} catch (DatabaseConfigurationException e) {
Modified: trunk/eXist/tools/jmx/src/org/exist/management/impl/JMXAgent.java
===================================================================
--- trunk/eXist/tools/jmx/src/org/exist/management/impl/JMXAgent.java 2007-12-31 16:53:07 UTC (rev 7089)
+++ trunk/eXist/tools/jmx/src/org/exist/management/impl/JMXAgent.java 2007-12-31 17:25:35 UTC (rev 7090)
@@ -28,13 +28,13 @@
import javax.management.*;
import java.util.ArrayList;
+import java.util.Stack;
+import java.util.Map;
+import java.util.HashMap;
/**
- * Created by IntelliJ IDEA.
- * User: wolf
- * Date: Jun 9, 2007
- * Time: 8:53:41 PM
- * To change this template use File | Settings | File Templates.
+ * Real implementation of interface {@link org.exist.management.Agent}
+ * which registers MBeans with the MBeanServer.
*/
public class JMXAgent implements Agent {
@@ -49,7 +49,8 @@
}
private MBeanServer server;
-
+ private Map registeredMBeans = new HashMap();
+
public JMXAgent() {
if (LOG.isDebugEnabled())
LOG.debug("Creating the JMX MBeanServer.");
@@ -83,16 +84,40 @@
public void initDBInstance(BrokerPool instance) {
try {
- addMBean("org.exist.management." + instance.getId() + ":type=Database",
+ addMBean(instance.getId(), "org.exist.management." + instance.getId() + ":type=Database",
new org.exist.management.impl.Database(instance));
} catch (DatabaseConfigurationException e) {
LOG.warn("Exception while registering database mbean.", e);
}
}
- public synchronized void addMBean(String name, Object mbean) throws DatabaseConfigurationException {
+ public synchronized void closeDBInstance(BrokerPool instance) {
try {
- addMBean(new ObjectName(name), mbean);
+ Stack stack = (Stack) registeredMBeans.get(instance.getId());
+ while (!stack.isEmpty()) {
+ ObjectName on = (ObjectName) stack.pop();
+ LOG.debug("deregistering JMX MBean: " + on);
+ server.unregisterMBean(on);
+ }
+ } catch (InstanceNotFoundException e) {
+ LOG.warn("Problem found while unregistering JMX", e);
+ } catch (MBeanRegistrationException e) {
+ LOG.warn("Problem found while unregistering JMX", e);
+ }
+ }
+
+ public synchronized void addMBean(String dbInstance, String name, Object mbean) throws DatabaseConfigurationException {
+ try {
+ ObjectName on = new ObjectName(name);
+ addMBean(on, mbean);
+ if (dbInstance != null) {
+ Stack stack = (Stack) registeredMBeans.get(dbInstance);
+ if (stack == null) {
+ stack = new Stack();
+ registeredMBeans.put(dbInstance, stack);
+ }
+ stack.push(on);
+ }
} catch (MalformedObjectNameException e) {
LOG.warn("Problem registering mbean: " + e.getMessage(), e);
throw new DatabaseConfigurationException("Exception while registering JMX mbean: " + e.getMessage());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-31 16:53:09
|
Revision: 7089
http://exist.svn.sourceforge.net/exist/?rev=7089&view=rev
Author: dizzzz
Date: 2007-12-31 08:53:07 -0800 (Mon, 31 Dec 2007)
Log Message:
-----------
Removed Java5 dependancies. To be removed for 1.3.0 (marked)
Modified Paths:
--------------
trunk/eXist/src/org/exist/util/XMLReaderPool.java
trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java
Modified: trunk/eXist/src/org/exist/util/XMLReaderPool.java
===================================================================
--- trunk/eXist/src/org/exist/util/XMLReaderPool.java 2007-12-31 16:05:04 UTC (rev 7088)
+++ trunk/eXist/src/org/exist/util/XMLReaderPool.java 2007-12-31 16:53:07 UTC (rev 7089)
@@ -56,7 +56,8 @@
try {
return (XMLReader) borrowObject();
} catch (Exception e) {
- throw new IllegalStateException("error while returning XMLReader: " + e.getMessage(), e);
+ // TODO DIZ fix java5
+ throw new IllegalStateException("error while returning XMLReader: " + e.getMessage() /* , e */);
}
}
@@ -79,7 +80,8 @@
returnObject(reader);
} catch (Exception e) {
- throw new IllegalStateException("error while returning XMLReader: " + e.getMessage(), e);
+ // TODO DIZ fix java5
+ throw new IllegalStateException("error while returning XMLReader: " + e.getMessage() /*, e*/);
}
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java 2007-12-31 16:05:04 UTC (rev 7088)
+++ trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java 2007-12-31 16:53:07 UTC (rev 7089)
@@ -50,7 +50,8 @@
* - node names become path names
* - attributes become predicates
*/
- StringBuffer buf = new StringBuffer(nodeToXPath(n));
+ // TODO DIZZZZ Java5 remove toString()
+ StringBuffer buf = new StringBuffer(nodeToXPath(n).toString());
while((n = n.getParentNode()) != null)
{
if(n.getNodeType() == Node.ELEMENT_NODE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-31 16:05:10
|
Revision: 7088
http://exist.svn.sourceforge.net/exist/?rev=7088&view=rev
Author: wolfgang_m
Date: 2007-12-31 08:05:04 -0800 (Mon, 31 Dec 2007)
Log Message:
-----------
Added some ngram index tests to performance test suite.
Modified Paths:
--------------
trunk/eXist/build/scripts/performance.xml
trunk/eXist/test/src/org/exist/performance/actions/XQuery.java
trunk/eXist/test/src/org/exist/performance/test.xml
Modified: trunk/eXist/build/scripts/performance.xml
===================================================================
--- trunk/eXist/build/scripts/performance.xml 2007-12-31 15:48:53 UTC (rev 7087)
+++ trunk/eXist/build/scripts/performance.xml 2007-12-31 16:05:04 UTC (rev 7088)
@@ -41,9 +41,6 @@
<test:benchmark outputFile="${benchmark.output}/ft-tests-result.xml"
source="${benchmark.src}/org/exist/performance/test.xml"
group="ft-tests"/>
- <test:benchmark outputFile="${benchmark.output}/large-optimized-result.xml"
- source="${benchmark.src}/org/exist/performance/test.xml"
- group="large-documents-optimized"/>
<test:benchmark outputFile="${benchmark.output}/large-docs-result.xml"
source="${benchmark.src}/org/exist/performance/test.xml"
group="large-documents"/>
Modified: trunk/eXist/test/src/org/exist/performance/actions/XQuery.java
===================================================================
--- trunk/eXist/test/src/org/exist/performance/actions/XQuery.java 2007-12-31 15:48:53 UTC (rev 7087)
+++ trunk/eXist/test/src/org/exist/performance/actions/XQuery.java 2007-12-31 16:05:04 UTC (rev 7088)
@@ -37,13 +37,20 @@
public class XQuery extends AbstractAction {
+ private final static String OPTIMIZE = "declare option exist:optimize 'enable=yes';\n";
+
private String query = null;
private String collectionPath;
private boolean retrieve = false;
+ private boolean forceOptimize = false;
private int lastResult = 0;
public void configure(Runner runner, Action parent, Element config) throws EXistException {
super.configure(runner, parent, config);
+ if (config.hasAttribute("optimize"))
+ forceOptimize = getBooleanValue(config, "optimize", false);
+ else
+ forceOptimize = getBooleanValue((Element) config.getParentNode(), "optimize", false);
if (config.hasAttribute("query"))
query = config.getAttribute("query");
else {
@@ -71,7 +78,7 @@
if (collection == null)
throw new EXistException("collection " + collectionPath + " not found");
XQueryService service = (XQueryService) collection.getService("XQueryService", "1.0");
- ResourceSet result = service.query(query);
+ ResourceSet result = service.query(forceOptimize ? OPTIMIZE + query : query);
lastResult = (int) result.getSize();
if (retrieve) {
for (ResourceIterator i = result.getIterator(); i.hasMoreResources(); ) {
Modified: trunk/eXist/test/src/org/exist/performance/test.xml
===================================================================
--- trunk/eXist/test/src/org/exist/performance/test.xml 2007-12-31 15:48:53 UTC (rev 7087)
+++ trunk/eXist/test/src/org/exist/performance/test.xml 2007-12-31 16:05:04 UTC (rev 7088)
@@ -76,7 +76,8 @@
<group name="ft-tests">
<setup connection="con">
<create-collection parent="/db/system/config" name="db"/>
- <store collection="/db/system/config/db" name="collection.xconf">
+ <store collection="/db/system/config/db" name="collection.xconf"
+ overwrite="yes">
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index>
<fulltext default="none" attributes="false">
@@ -174,10 +175,11 @@
<!--remove-collection parent="/db" collection="jgoethe" description="remove /db/jgoethe"/-->
</tear-down>
</group>
- <group name="large-documents-optimized">
+ <group name="large-documents">
<setup connection="con">
<create-collection parent="/db/system/config" name="db"/>
- <store collection="/db/system/config/db" name="collection.xconf">
+ <store collection="/db/system/config/db" name="collection.xconf"
+ overwrite="yes">
<collection xmlns="http://exist-db.org/collection-config/1.0">
<index>
<fulltext default="none" attributes="false">
@@ -189,67 +191,9 @@
<create qname="title" type="xs:string"/>
<create qname="author" type="xs:string"/>
<create qname="year" type="xs:integer"/>
- </index>
- </collection>
- </store>
- </setup>
- <thread connection="con" name="main">
- <create-collection parent="/db" name="library"/>
- <store-files dir="test/benchmark/data/dblp" includes="*.xml" collection="/db/library"
- description="storing DBLP library data" overwrite="no"/>
- <sequence repeat="15" description="Fulltext queries">
- <xquery collection="/db/library" query="//((#exist:optimize#) { book[author &= 'kernighan'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { book[author &= 'brian kernighan'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[author &= 'brian kernighan'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { book[author &= 'kernighan'] })/title"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[title &= 'xml'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[title &= 'xml xquery'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[title &= 'xslt'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[title &= 'xslt'] })"/>
- </sequence>
- <sequence repeat="15" description="General comparisons/regular expressions">
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[author = 'Bjarne Stroustrup'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { article[author = 'Linus Torvalds'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[author = 'Bjarne Stroustrup'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[author = 'Linus Torvalds'] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[starts-with(author, 'Bjarne')] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { article[starts-with(author, 'Erich')] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[ends-with(author, 'strup')] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[matches(author, '^Bjarne.*')] })"/>
- <!--xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[matches(title, 'xml', 'i')] })"/-->
- <!--xquery collection="/db/library" query="//((#exist:optimize#) { *[matches(title, 'xml', 'i')] })"/-->
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[matches(title, '^XML')] })"/>
-
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[year = 2002] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[year > 2005] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[year < 2000] })"/>
-
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[title &= 'xslt'][year = 2006] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { inproceedings[title &= 'xml'][year = 2005] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[title &= 'xml'][year = 2005] })"/>
- <xquery collection="/db/library" query="//((#exist:optimize#) { *[author &= 'brian kernighan'][title &= 'C'] })"/>
- </sequence>
- </thread>
- <tear-down connection="con">
- <remove-collection parent="/db" collection="library" description="remove /db/library"/>
- </tear-down>
- </group>
- <group name="large-documents">
- <setup connection="con">
- <create-collection parent="/db/system/config" name="db"/>
- <store collection="/db/system/config/db" name="collection.xconf">
- <collection xmlns="http://exist-db.org/collection-config/1.0">
- <index>
- <fulltext default="none" attributes="false">
- <include path="author"/>
- <include path="title"/>
- <include path="booktitle"/>
- </fulltext>
-
- <create path="//title" type="xs:string"/>
- <create path="//author" type="xs:string"/>
- <create path="//year" type="xs:int"/>
+ <ngram qname="title"/>
+ <ngram qname="author"/>
</index>
</collection>
</store>
@@ -258,7 +202,7 @@
<create-collection parent="/db" name="library"/>
<store-files dir="test/benchmark/data/dblp" includes="*.xml" collection="/db/library"
description="storing DBLP library data" overwrite="no"/>
- <sequence repeat="15" description="Fulltext queries">
+ <sequence repeat="15" description="Fulltext queries" optimize="yes">
<xquery collection="/db/library" query="//book[author &= 'kernighan']"/>
<xquery collection="/db/library" query="//book[author &= 'brian kernighan']"/>
<xquery collection="/db/library" query="//*[author &= 'brian kernighan']"/>
@@ -268,7 +212,7 @@
<xquery collection="/db/library" query="//inproceedings[title &= 'xslt']"/>
<xquery collection="/db/library" query="//*[title &= 'xslt']"/>
</sequence>
- <sequence repeat="15" description="General comparisons/regular expressions">
+ <sequence repeat="15" description="General comparisons/regular expressions" optimize="yes">
<xquery collection="/db/library" query="//inproceedings[author = 'Bjarne Stroustrup'] "/>
<xquery collection="/db/library" query="//article[author = 'Linus Torvalds']"/>
<xquery collection="/db/library" query="//inproceedings[starts-with(author, 'Bjarne')]"/>
@@ -289,6 +233,21 @@
<xquery collection="/db/library" query="//*[title &= 'xml'][year = 2005]"/>
<xquery collection="/db/library" query="//*[author &= 'brian kernighan'][title &= 'C']"/>
</sequence>
+ <sequence repeat="15" description="NGram index" optimize="yes">
+ <xquery collection="/db/library" query="//*[ngram:contains(author, 'Bjarne')]"/>
+ <xquery collection="/db/library" query="//inproceedings[ngram:contains(author, 'bjarne')]"/>
+ <xquery collection="/db/library" query="//inproceedings[ngram:starts-with(author, 'bjarne')]"/>
+ <xquery collection="/db/library" query="//*[ngram:contains(author, 'erich')]"/>
+ <xquery collection="/db/library" query="//book[ngram:contains(author, 'erich')]"/>
+ <xquery collection="/db/library" query="//book[ngram:contains(author, 'kernighan')]"/>
+ <xquery collection="/db/library" query="//book[ngram:contains(author, 'brian w. kernighan')]"/>
+ <xquery collection="/db/library" query="//*[ngram:contains(author, 'brian w. kernighan')]"/>
+ <xquery collection="/db/library" query="//inproceedings[ngram:contains(title, 'xml')]"/>
+ <xquery collection="/db/library" query="//*[ngram:contains(title, 'xml')]"/>
+ <xquery collection="/db/library" query="//inproceedings[ngram:contains(title, 'xquery')]"/>
+ <xquery collection="/db/library" query="//*[ngram:contains(title, 'xquery')]"/>
+ <xquery collection="/db/library" query="//*[ngram:contains(title, 'xml')][year = 2005]"/>
+ </sequence>
</thread>
</group>
<group name="updates">
@@ -376,4 +335,4 @@
]]></xquery>
</thread>
</group>
-</test>
\ No newline at end of file
+</test>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-31 15:48:57
|
Revision: 7087
http://exist.svn.sourceforge.net/exist/?rev=7087&view=rev
Author: wolfgang_m
Date: 2007-12-31 07:48:53 -0800 (Mon, 31 Dec 2007)
Log Message:
-----------
NGram index page cache did not grow.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndex.java
Modified: trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndex.java
===================================================================
--- trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndex.java 2007-12-30 21:44:48 UTC (rev 7086)
+++ trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndex.java 2007-12-31 15:48:53 UTC (rev 7087)
@@ -68,7 +68,7 @@
public void open() throws DatabaseConfigurationException {
try {
- db = new BFile(pool, (byte) 0, false, dataFile, pool.getCacheManager(), 0.1, 0.1, 0.1);
+ db = new BFile(pool, (byte) 0, false, dataFile, pool.getCacheManager(), 1.4, 0.01, 0.07);
} catch (DBException e) {
throw new DatabaseConfigurationException("Failed to create index file: " + dataFile.getAbsolutePath() + ": " +
e.getMessage());
@@ -78,10 +78,12 @@
}
public void close() throws DBException {
+ LOG.debug("SYNC NGRAM");
db.close();
}
public void sync() throws DBException {
+ LOG.debug("SYNC NGRAM");
db.flush();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-30 21:44:49
|
Revision: 7086
http://exist.svn.sourceforge.net/exist/?rev=7086&view=rev
Author: wolfgang_m
Date: 2007-12-30 13:44:48 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Always build JMX interface automatically if Java5 is available.
Modified Paths:
--------------
trunk/eXist/build/scripts/build-impl.xml
trunk/eXist/tools/jmx/build.xml
Modified: trunk/eXist/build/scripts/build-impl.xml
===================================================================
--- trunk/eXist/build/scripts/build-impl.xml 2007-12-30 20:52:26 UTC (rev 7085)
+++ trunk/eXist/build/scripts/build-impl.xml 2007-12-30 21:44:48 UTC (rev 7086)
@@ -395,7 +395,7 @@
<!-- ================================================================== -->
<!-- Build all -->
<!-- ================================================================== -->
- <target name="all" depends="jar,wrapper,extension-modules,extension-indexes,extension-fluent,test-compile"
+ <target name="all" depends="jar,wrapper,extension-modules,extension-indexes,extension-fluent,tools-jmx,test-compile"
description="Build all">
<antcall target="sign"/>
</target>
@@ -566,7 +566,11 @@
<ant antfile="build.xml" dir="extensions/fluent"/>
</target>
- <target name="cleandocs">
+ <target name="tools-jmx" depends="jar">
+ <ant antfile="build.xml" dir="tools/jmx"/>
+ </target>
+
+ <target name="cleandocs">
<replaceregexp>
<regexp pattern="/\*.*Description of the Method.*\*/"/>
<substitution expression=""/>
Modified: trunk/eXist/tools/jmx/build.xml
===================================================================
--- trunk/eXist/tools/jmx/build.xml 2007-12-30 20:52:26 UTC (rev 7085)
+++ trunk/eXist/tools/jmx/build.xml 2007-12-30 21:44:48 UTC (rev 7086)
@@ -1,4 +1,4 @@
-<project basedir="." default="jar" name="JMX">
+<project basedir="." default="all" name="JMX">
<property name="src" value="./src"/>
<property name="classes" value="./classes"/>
@@ -12,13 +12,31 @@
</fileset>
</path>
- <available classname="javax.management.MBeanServer" property="jmx.present"/>
-
- <target name="prepare">
+ <condition property="java14-only">
+ <and>
+ <not><equals arg1="${ant.java.version}" arg2="1.4"/></not>
+ <available classname="javax.management.MBeanServer"/>
+ </and>
+ </condition>
+
+ <target name="check-java-version" unless="java14-only">
+ <echo message="Java version warning"/>
+ <echo message="--------------------"/>
+ <echo message="Java 5 is required to use eXist's management extensions (JMX) "/>
+ <echo message="interface. Your version is ${ant.java.version}. The JMX interface "/>
+ <echo message="will be disabled."/>
+ </target>
+
+ <target name="all">
+ <antcall target="check-java-version"/>
+ <antcall target="jar"/>
+ </target>
+
+ <target name="prepare" if="java14-only">
<mkdir dir="${classes}"/>
</target>
- <target name="compile" depends="prepare">
+ <target name="compile" depends="prepare" if="java14-only">
<echo message="Compiling JMX agent and client tools"/>
<echo message="-----------------------------------------"/>
<javac debug="true" destdir="${classes}" encoding="UTF-8"
@@ -30,7 +48,7 @@
</javac>
</target>
- <target name="jar" depends="compile">
+ <target name="jar" depends="compile" if="java14-only">
<echo message="Don't forget to resign the jar files when needed:"/>
<echo message="./build.sh -f build/scripts/jarsigner.xml jnlp-sign-exist"/>
<echo message="-----------------------------------------"/>
@@ -38,9 +56,4 @@
<jar destfile="${server.dir}/lib/extensions/exist-jmx.jar" basedir="${classes}"
keepcompression="true" update="true"/>
</target>
-
- <target name="jmx-check" unless="jmx.present">
- <echo message="The javax.managment package does not seem to be available."/>
- <echo message="You are probably using a Java version < 1.5. JMX will be disabled."/>
- </target>
-</project>
\ No newline at end of file
+</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-30 20:52:34
|
Revision: 7085
http://exist.svn.sourceforge.net/exist/?rev=7085&view=rev
Author: wolfgang_m
Date: 2007-12-30 12:52:26 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Bug fix: cached password for remote XMLDB API connection is not properly reset after a user's password was changed. In particular, this led to annoying "permission denied" failures when using the admin client to restore from a backup.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xmldb/DatabaseImpl.java
Modified: trunk/eXist/src/org/exist/xmldb/DatabaseImpl.java
===================================================================
--- trunk/eXist/src/org/exist/xmldb/DatabaseImpl.java 2007-12-30 19:29:34 UTC (rev 7084)
+++ trunk/eXist/src/org/exist/xmldb/DatabaseImpl.java 2007-12-30 20:52:26 UTC (rev 7085)
@@ -280,7 +280,7 @@
* RpcClients are cached by address+user. The password is transparently changed.
* @param user
* @param password
- * @param address
+ * @param url
* @throws XMLDBException
*/
private XmlRpcClient getRpcClient(String user, String password, URL url) throws XMLDBException {
@@ -288,11 +288,9 @@
XmlRpcClient client = (XmlRpcClient) rpcClients.get(key);
if (client == null) {
client = new XmlRpcClient(url);
- if (client != null) {
- client.setBasicAuthentication(user, password);
- rpcClients.put(key, client);
- }
- }
+ rpcClients.put(key, client);
+ }
+ client.setBasicAuthentication(user, password);
return client;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-30 19:29:55
|
Revision: 7084
http://exist.svn.sourceforge.net/exist/?rev=7084&view=rev
Author: wolfgang_m
Date: 2007-12-30 11:29:34 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Fixed in-memory DOM tree construction bug: in some very specific cases,
constructed nodes were skipped during serialization and did not show
up in the output. I have been hunting this bug since quite a while ;-)
Modified Paths:
--------------
trunk/eXist/src/org/exist/memtree/MemTreeBuilder.java
Modified: trunk/eXist/src/org/exist/memtree/MemTreeBuilder.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/MemTreeBuilder.java 2007-12-30 15:31:52 UTC (rev 7083)
+++ trunk/eXist/src/org/exist/memtree/MemTreeBuilder.java 2007-12-30 19:29:34 UTC (rev 7084)
@@ -90,7 +90,7 @@
* @return the node number of the created element
*/
public int startElement(String namespaceURI, String localName, String qname, Attributes attributes) {
- int p = qname.indexOf(':');
+ int p = qname.indexOf(':');
String prefix = null;
if(context != null) {
prefix = context.getPrefixForURI(namespaceURI);
@@ -107,8 +107,8 @@
* @return the node number of the created element
*/
public int startElement(QName qn, Attributes attributes) {
- int nodeNr = doc.addNode(Node.ELEMENT_NODE, level, qn);
- if(attributes != null) {
+ int nodeNr = doc.addNode(Node.ELEMENT_NODE, level, qn);
+ if(attributes != null) {
// parse attributes
for (int i = 0; i < attributes.getLength(); i++) {
String attrNS = attributes.getURI(i);
@@ -127,7 +127,7 @@
// update links
if (level + 1 >= prevNodeInLevel.length) {
int[] t = new int[level + 2];
- System.arraycopy(prevNodeInLevel, 0, t, 0, level);
+ System.arraycopy(prevNodeInLevel, 0, t, 0, prevNodeInLevel.length);
prevNodeInLevel = t;
}
int prevNr = prevNodeInLevel[level];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 15:31:53
|
Revision: 7083
http://exist.svn.sourceforge.net/exist/?rev=7083&view=rev
Author: dizzzz
Date: 2007-12-30 07:31:52 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Enabled xquery-execution example
Modified Paths:
--------------
trunk/eXist/samples/ant/build.xml
Modified: trunk/eXist/samples/ant/build.xml
===================================================================
--- trunk/eXist/samples/ant/build.xml 2007-12-30 13:51:51 UTC (rev 7082)
+++ trunk/eXist/samples/ant/build.xml 2007-12-30 15:31:52 UTC (rev 7083)
@@ -36,18 +36,16 @@
<antcall target="xpath"/>
<antcall target="copy"/>
<antcall target="move"/>
+ <antcall target="xquery"/>
<!--
- <antcall target="xquery"/>
<antcall target="xupdate"/>
-->
<antcall target="backup"/>
<antcall target="remove"/>
<antcall target="groups"/>
<antcall target="users"/>
- <!--
<antcall target="adduser"/>
<antcall target="rmuser"/>
- -->
<antcall target="restore"/>
</target>
@@ -144,10 +142,14 @@
</target>
<target name="xquery" description="test xquery task">
- <xdb:xquery user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test" query=""/>
- <xdb:xquery user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test"> </xdb:xquery>
+ <xdb:xquery user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}"
+ query="collection('/db/test')//*:publisher" outputproperty="query1"/>
+ <echo>${query1}</echo>
+ <!--
<xdb:xquery user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test"
- queryFile="../xquery/"/>
+ queryUri=".. .. .." outputproperty="query2"/>
+ <echo>${query2}</echo>
+ -->
</target>
<target name="xupdate" description="test xupdate task">
@@ -186,15 +188,18 @@
outputproperty="groups"/>
<echo message="groups=${groups}"/>
</target>
+
<target name="users" description="test users task">
<xdb:users user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}"
outputproperty="users"/>
<echo message="users=${users}"/>
</target>
+
<target name="adduser" description="test add user task">
<xdb:adduser user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}" name="test"
secret="test" primarygroup="guest"/>
</target>
+
<target name="rmuser" description="test remove user task">
<xdb:rmuser user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}" name="test"/>
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 13:51:53
|
Revision: 7082
http://exist.svn.sourceforge.net/exist/?rev=7082&view=rev
Author: dizzzz
Date: 2007-12-30 05:51:51 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
ignore directories
Property Changed:
----------------
trunk/eXist/samples/ant/
Property changes on: trunk/eXist/samples/ant
___________________________________________________________________
Name: svn:ignore
+ backup
data
tmp
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 13:44:57
|
Revision: 7081
http://exist.svn.sourceforge.net/exist/?rev=7081&view=rev
Author: dizzzz
Date: 2007-12-30 05:44:56 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Re-indenting
Modified Paths:
--------------
trunk/eXist/samples/ant/build.xml
Modified: trunk/eXist/samples/ant/build.xml
===================================================================
--- trunk/eXist/samples/ant/build.xml 2007-12-30 13:39:27 UTC (rev 7080)
+++ trunk/eXist/samples/ant/build.xml 2007-12-30 13:44:56 UTC (rev 7081)
@@ -168,8 +168,8 @@
</target>
<target name="restore" description="test restore task">
- <xdb:restore user="${xmldb.user}" password="${xmldb.passwd}"
- uri="${xmldb.url}" dir="backup/db/test"/>
+ <xdb:restore user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}"
+ dir="backup/db/test"/>
<!--
<xdb:restore user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 13:39:37
|
Revision: 7080
http://exist.svn.sourceforge.net/exist/?rev=7080&view=rev
Author: dizzzz
Date: 2007-12-30 05:39:27 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Re-enabled move-collection example
Modified Paths:
--------------
trunk/eXist/samples/ant/build.xml
Modified: trunk/eXist/samples/ant/build.xml
===================================================================
--- trunk/eXist/samples/ant/build.xml 2007-12-30 13:35:04 UTC (rev 7079)
+++ trunk/eXist/samples/ant/build.xml 2007-12-30 13:39:27 UTC (rev 7080)
@@ -7,12 +7,14 @@
<fileset dir="../../lib/core">
<include name="*.jar"/>
</fileset>
- <!-- <fileset dir="../../lib/endorsed">
+ <!--
+ <fileset dir="../../lib/endorsed">
<include name="*.jar"/>
</fileset>
<fileset dir="../../lib/optional">
<include name="*.jar"/>
- </fileset>-->
+ </fileset>
+ -->
<pathelement location="../../exist.jar"/>
<pathelement location="../../exist-optional.jar"/>
</classpath>
@@ -34,14 +36,18 @@
<antcall target="xpath"/>
<antcall target="copy"/>
<antcall target="move"/>
- <!--antcall target="xquery"/>
- <antcall target="xupdate"/-->
+ <!--
+ <antcall target="xquery"/>
+ <antcall target="xupdate"/>
+ -->
<antcall target="backup"/>
<antcall target="remove"/>
<antcall target="groups"/>
<antcall target="users"/>
- <!--antcall target="adduser"/>
- <antcall target="rmuser"/-->
+ <!--
+ <antcall target="adduser"/>
+ <antcall target="rmuser"/>
+ -->
<antcall target="restore"/>
</target>
@@ -133,8 +139,8 @@
<target name="move" description="test move task">
<xdb:move user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test/sub1"
resource="new.xml" destination="sub11" name="moved.xml"/>
- <!--xdb:move user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test"
- collection="sub2" destination="sub1" name="moved"/-->
+ <xdb:move user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test"
+ collection="sub2" destination="sub1" name="moved"/>
</target>
<target name="xquery" description="test xquery task">
@@ -165,11 +171,13 @@
<xdb:restore user="${xmldb.user}" password="${xmldb.passwd}"
uri="${xmldb.url}" dir="backup/db/test"/>
- <!--xdb:restore user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}">
+ <!--
+ <xdb:restore user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}">
<dirset dir="backup/db">
<include name="*"/>
</dirset>
- </xdb:restore-->
+ </xdb:restore>
+ -->
</target>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 13:35:07
|
Revision: 7079
http://exist.svn.sourceforge.net/exist/?rev=7079&view=rev
Author: dizzzz
Date: 2007-12-30 05:35:04 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Fixed NPE from samples directory
the samples/ant stuff should run now, although there are some targets commented. Why?
Modified Paths:
--------------
trunk/eXist/samples/ant/build.xml
Modified: trunk/eXist/samples/ant/build.xml
===================================================================
--- trunk/eXist/samples/ant/build.xml 2007-12-30 13:01:04 UTC (rev 7078)
+++ trunk/eXist/samples/ant/build.xml 2007-12-30 13:35:04 UTC (rev 7079)
@@ -133,8 +133,8 @@
<target name="move" description="test move task">
<xdb:move user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test/sub1"
resource="new.xml" destination="sub11" name="moved.xml"/>
- <xdb:move user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test"
- collection="sub2" destination="sub1" name="moved"/>
+ <!--xdb:move user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}/test"
+ collection="sub2" destination="sub1" name="moved"/-->
</target>
<target name="xquery" description="test xquery task">
@@ -163,12 +163,14 @@
<target name="restore" description="test restore task">
<xdb:restore user="${xmldb.user}" password="${xmldb.passwd}"
- uri="xmldb:exist://${xmldb.host}:${xmldb.port}/exist/xmlrpc/" dir="backup/db/test"/>
+ uri="${xmldb.url}" dir="backup/db/test"/>
+
<!--xdb:restore user="${xmldb.user}" password="${xmldb.passwd}" uri="${xmldb.url}">
<dirset dir="backup/db">
<include name="*"/>
</dirset>
</xdb:restore-->
+
</target>
<target name="groups" description="test groups task">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 13:01:07
|
Revision: 7078
http://exist.svn.sourceforge.net/exist/?rev=7078&view=rev
Author: dizzzz
Date: 2007-12-30 05:01:04 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Prevented NPE's in ant tasks.
http://sourceforge.net/support/tracker.php?aid=1690816
Modified Paths:
--------------
trunk/eXist/src/org/exist/ant/UserTask.java
trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java
trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java
trunk/eXist/src/org/exist/ant/XMLDBExistTask.java
trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java
trunk/eXist/src/org/exist/ant/XMLDBListTask.java
trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java
trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java
trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java
trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java
trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java
trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java
trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java
trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java
Modified: trunk/eXist/src/org/exist/ant/UserTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/UserTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/UserTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -37,8 +37,10 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
base = DatabaseManager.getCollection(uri, user, password);
- if (base == null)
- throw new BuildException("collection " + uri + " not found");
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
service = (UserManagementService) base.getService("UserManagementService", "1.0");
} catch (XMLDBException e)
Modified: trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -58,6 +58,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
log("Create collection management service for collection " + base.getName(), Project.MSG_DEBUG);
CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) base.getService("CollectionManagementService", "1.0");
if (resource != null)
Modified: trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -54,9 +54,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager.getCollection(uri, user, password);
- if (base == null)
- throw new BuildException("collection " + uri + " not found");
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
Collection root = null;
if (collection != null)
{
Modified: trunk/eXist/src/org/exist/ant/XMLDBExistTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBExistTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBExistTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -57,11 +57,13 @@
{
log("Checking collection: " + uri, Project.MSG_INFO);
Collection base = DatabaseManager.getCollection(uri, user, password);
+
if (base != null)
{
log("Base collection found", Project.MSG_DEBUG);
exist = true;
}
+
if (base != null && resource != null)
{
log("Checking resource: " + resource, Project.MSG_INFO);
@@ -72,6 +74,7 @@
exist = false;
}
}
+
} catch (XMLDBException e)
{
// ignore is false already
Modified: trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -50,8 +50,10 @@
try
{
Collection base = DatabaseManager.getCollection(uri, user, password);
- if (base == null)
- throw new BuildException("Collection " + uri + " not found.");
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
if (resource != null)
{
Modified: trunk/eXist/src/org/exist/ant/XMLDBListTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBListTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBListTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -56,6 +56,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
StringBuffer buf = new StringBuffer();
if (collections)
{
Modified: trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -58,6 +58,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
log("Create collection management service for collection " + base.getName(), Project.MSG_DEBUG);
CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) base.getService("CollectionManagementService", "1.0");
if (resource != null)
Modified: trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -63,7 +63,12 @@
registerDatabase();
try {
Collection collection = DatabaseManager.getCollection(uri, user, password);
- XPathQueryService service = (XPathQueryService)
+
+ if(collection==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
+ XPathQueryService service = (XPathQueryService)
collection.getService("XPathQueryService", "1.0");
ResourceSet results = service.query(query);
log("Found " + results.getSize());
Modified: trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -59,6 +59,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
if (resource != null)
{
log("Removing resource: " + resource, Project.MSG_INFO);
Modified: trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -53,6 +53,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection root = DatabaseManager.getCollection(uri, user, password);
+
+ if(root==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
log("Shutdown database instance", Project.MSG_INFO);
mgr.shutdown();
Modified: trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -96,9 +96,11 @@
root = mkcol(root, baseURI, DBBroker.ROOT_COLLECTION, path);
} else
root = DatabaseManager.getCollection(uri, user, password);
- if (root == null)
- throw new BuildException("collection " + uri + " not found");
+ if(root==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
MimeType mime = null;
if (type != null) {
if (type.equals("xml"))
Modified: trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -90,6 +90,11 @@
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager
.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
XPathQueryService service = (XPathQueryService) base.getService(
"XPathQueryService", "1.0");
// set pretty-printing on
Modified: trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -115,6 +115,11 @@
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager
.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
XQueryService service = (XQueryService) base.getService(
"XQueryService", "1.0");
// set pretty-printing on
Modified: trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java 2007-12-30 12:34:20 UTC (rev 7077)
+++ trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java 2007-12-30 13:01:04 UTC (rev 7078)
@@ -55,6 +55,11 @@
{
log("Get base collection: " + uri, Project.MSG_DEBUG);
Collection base = DatabaseManager.getCollection(uri, user, password);
+
+ if(base==null){
+ throw new BuildException("Collection " + uri + " could not be found.");
+ }
+
XUpdateQueryService service = (XUpdateQueryService) base.getService("XUpdateQueryService", "1.0");
if (resource != null)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-30 12:34:23
|
Revision: 7077
http://exist.svn.sourceforge.net/exist/?rev=7077&view=rev
Author: dizzzz
Date: 2007-12-30 04:34:20 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
moveResource invoked wrong 'worker' method.
Found it while preparing release (code in samples/ant)
Modified Paths:
--------------
trunk/eXist/src/org/exist/xmldb/RemoteCollectionManagementService.java
Modified: trunk/eXist/src/org/exist/xmldb/RemoteCollectionManagementService.java
===================================================================
--- trunk/eXist/src/org/exist/xmldb/RemoteCollectionManagementService.java 2007-12-29 18:56:06 UTC (rev 7076)
+++ trunk/eXist/src/org/exist/xmldb/RemoteCollectionManagementService.java 2007-12-30 12:34:20 UTC (rev 7077)
@@ -190,7 +190,7 @@
public void moveResource(String resourcePath, String destinationPath,
String newName) throws XMLDBException {
try{
- move(XmldbURI.xmldbUriFor(resourcePath), XmldbURI.xmldbUriFor(destinationPath),XmldbURI.xmldbUriFor(newName));
+ moveResource(XmldbURI.xmldbUriFor(resourcePath), XmldbURI.xmldbUriFor(destinationPath),XmldbURI.xmldbUriFor(newName));
} catch(URISyntaxException e) {
throw new XMLDBException(ErrorCodes.INVALID_URI,e);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2007-12-29 18:56:08
|
Revision: 7076
http://exist.svn.sourceforge.net/exist/?rev=7076&view=rev
Author: brihaye
Date: 2007-12-29 10:56:06 -0800 (Sat, 29 Dec 2007)
Log Message:
-----------
Fixed bug in xs:anyURI comparison spotted by Xin Wang. The test case is probably not where is should be but... anyway
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/value/AnyURIValue.java
trunk/eXist/test/src/org/exist/xquery/EntitiesTest.java
Modified: trunk/eXist/src/org/exist/xquery/value/AnyURIValue.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/value/AnyURIValue.java 2007-12-25 18:37:58 UTC (rev 7075)
+++ trunk/eXist/src/org/exist/xquery/value/AnyURIValue.java 2007-12-29 18:56:06 UTC (rev 7076)
@@ -282,7 +282,7 @@
case Constants.LT :
return cmp < 0;
case Constants.LTEQ :
- return cmp >= 0;
+ return cmp <= 0;
default :
throw new XPathException(
"XPTY0004: cannot apply operator "
Modified: trunk/eXist/test/src/org/exist/xquery/EntitiesTest.java
===================================================================
--- trunk/eXist/test/src/org/exist/xquery/EntitiesTest.java 2007-12-25 18:37:58 UTC (rev 7075)
+++ trunk/eXist/test/src/org/exist/xquery/EntitiesTest.java 2007-12-29 18:56:06 UTC (rev 7076)
@@ -254,6 +254,10 @@
result = queryAndAssert(service, "xs:anyURI(\"index.xql?a=1&b=2\")", 1, null);
// TODO: could check result
+ result = queryAndAssert(service, "xs:anyURI('a') le xs:anyURI('b')", 1, null);
+ assertEquals("true",result.getResource(0).getContent());
+
+
} catch (XMLDBException e) {
fail(e.getMessage());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-25 18:38:02
|
Revision: 7075
http://exist.svn.sourceforge.net/exist/?rev=7075&view=rev
Author: wolfgang_m
Date: 2007-12-25 10:37:58 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
Updated WikiModel to latest SVN build.
Modified Paths:
--------------
trunk/AtomicWiki/java/lib/tools/WikiModelV2.jar
trunk/AtomicWiki/java/src/org/exist/xquery/modules/wiki/XHTMLListener.java
Modified: trunk/AtomicWiki/java/lib/tools/WikiModelV2.jar
===================================================================
(Binary files differ)
Modified: trunk/AtomicWiki/java/src/org/exist/xquery/modules/wiki/XHTMLListener.java
===================================================================
--- trunk/AtomicWiki/java/src/org/exist/xquery/modules/wiki/XHTMLListener.java 2007-12-25 18:33:42 UTC (rev 7074)
+++ trunk/AtomicWiki/java/src/org/exist/xquery/modules/wiki/XHTMLListener.java 2007-12-25 18:37:58 UTC (rev 7075)
@@ -274,7 +274,7 @@
builder.characters(NEWLINE, 0, NEWLINE.length);
}
- public void onReference(String href) {
+ public void onReference(String href, boolean explicitLink) {
String link = WikiPageUtil.escapeXmlAttribute(href);
AttributesImpl attribs = new AttributesImpl();
attribs.addAttribute("", "href", "href", "CDATA", link);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-25 18:33:44
|
Revision: 7074
http://exist.svn.sourceforge.net/exist/?rev=7074&view=rev
Author: wolfgang_m
Date: 2007-12-25 10:33:42 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
Added collection.xconf to speed up some queries.
Modified Paths:
--------------
trunk/AtomicWiki/build.xml
Added Paths:
-----------
trunk/AtomicWiki/etc/collection.xconf
Modified: trunk/AtomicWiki/build.xml
===================================================================
--- trunk/AtomicWiki/build.xml 2007-12-25 18:31:24 UTC (rev 7073)
+++ trunk/AtomicWiki/build.xml 2007-12-25 18:33:42 UTC (rev 7074)
@@ -133,6 +133,10 @@
<xdb:adduser uri="${xmldb.uri}/db" user="admin" password="${admin.password}" name="wolf" secret="atom"
primarygroup="bloggers"/>
+ <xdb:store uri="${xmldb.uri}/db/system/config${configuration.root}" user="admin"
+ password="${admin.password}" initdb="true"
+ createcollection="true" srcfile="etc/collection.xconf" targetFile="collection.xconf"/>
+
<xdb:store uri="${wiki.root}" user="blogadmin" password="atom" initdb="true"
createcollection="true" srcfile="${data.dir}/root.feed.atom" targetFile=".feed.atom"/>
<xdb:store uri="${wiki.root}/blogs/eXist" user="blogadmin" password="atom"
Added: trunk/AtomicWiki/etc/collection.xconf
===================================================================
--- trunk/AtomicWiki/etc/collection.xconf (rev 0)
+++ trunk/AtomicWiki/etc/collection.xconf 2007-12-25 18:33:42 UTC (rev 7074)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<collection xmlns="http://exist-db.org/collection-config/1.0">
+ <index xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:wiki="http://exist-db.org/xquery/wiki">
+ <fulltext default="none" attributes="no">
+ <create qname="atom:title"/>
+ <create qname="atom:content"/>
+ <create qname="atom:name"/>
+ </fulltext>
+ <create qname="atom:id" type="xs:string"/>
+ <create qname="wiki:id" type="xs:string"/>
+ <create qname="@type" type="xs:string"/>
+ <create qname="@scheme" type="xs:string"/>
+ <create qname="@term" type="xs:string"/>
+ </index>
+</collection>
Property changes on: trunk/AtomicWiki/etc/collection.xconf
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-25 18:31:26
|
Revision: 7073
http://exist.svn.sourceforge.net/exist/?rev=7073&view=rev
Author: wolfgang_m
Date: 2007-12-25 10:31:24 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
Changed CollectionConfiguration: reading collection.xconf is now fail safe. Errors in the configuration document will not cause an exception. Instead the error is logged as a warning. This change was necessary as the collection configuration depends on too many factors, e.g. the availability of index or trigger classes. A configuration should be loadable even if a single trigger or index class is missing.
Modified Paths:
--------------
trunk/eXist/test/src/org/exist/xmldb/CollectionConfigurationTest.java
Modified: trunk/eXist/test/src/org/exist/xmldb/CollectionConfigurationTest.java
===================================================================
--- trunk/eXist/test/src/org/exist/xmldb/CollectionConfigurationTest.java 2007-12-25 18:30:26 UTC (rev 7072)
+++ trunk/eXist/test/src/org/exist/xmldb/CollectionConfigurationTest.java 2007-12-25 18:31:24 UTC (rev 7073)
@@ -88,6 +88,16 @@
+ " </index>"
+ "</collection>";
+ private String INVALID_CONFIG1 = "<collection xmlns=\"http://exist-db.org/collection-config/1.0\">\n"
+ + " <triggers>\n"
+ + " <trigger event=\"store,update,remove\" class=\"org.exist.NonExistingTrigger\">\n"
+ + " </trigger>\n"
+ + " </triggers>\n"
+ + " <index>\n"
+ + " <create foo=\"a\" type=\"xs:integer\"/>\n"
+ + " </index>\n"
+ + "</collection>";
+
private Collection testCollection;
protected void setUp() {
@@ -701,6 +711,35 @@
}
}
+ public void testInvalidConfiguration1() {
+ ResourceSet result;
+ try {
+ CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
+ Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
+
+ IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
+ idxConf.configureCollection(INVALID_CONFIG1);
+
+ //... then index document
+ XMLResource doc = (XMLResource)
+ sub2.createResource(TestConstants.TEST_XML_URI.toString(), "XMLResource");
+ doc.setContent(DOCUMENT_CONTENT);
+ sub2.storeResource(doc);
+
+ XPathQueryService service = (XPathQueryService) sub2.getService("XPathQueryService", "1.0");
+
+ // index should be empty since configuration was invalid
+ result = service.query("util:index-key-occurrences(/test/a, 1)");
+ assertEquals(0, result.getSize());
+
+ result = service.query("util:qname-index-lookup(xs:QName(\"a\"), 1 ) ");
+ assertEquals(0, result.getSize());
+ } catch(Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
public void testRangeIndex1() {
ResourceSet result;
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2007-12-25 18:30:27
|
Revision: 7072
http://exist.svn.sourceforge.net/exist/?rev=7072&view=rev
Author: wolfgang_m
Date: 2007-12-25 10:30:26 -0800 (Tue, 25 Dec 2007)
Log Message:
-----------
Changed CollectionConfiguration: reading collection.xconf is now fail safe. Errors in the configuration document will not cause an exception. Instead the error is logged as a warning. This change was necessary as the collection configuration depends on too many factors, e.g. the availability of index or trigger classes. A configuration should be loadable even if a single trigger or index class is missing.
Modified Paths:
--------------
trunk/eXist/src/org/exist/collections/CollectionConfiguration.java
trunk/eXist/src/org/exist/collections/CollectionConfigurationManager.java
Modified: trunk/eXist/src/org/exist/collections/CollectionConfiguration.java
===================================================================
--- trunk/eXist/src/org/exist/collections/CollectionConfiguration.java 2007-12-20 16:12:21 UTC (rev 7071)
+++ trunk/eXist/src/org/exist/collections/CollectionConfiguration.java 2007-12-25 18:30:26 UTC (rev 7072)
@@ -103,22 +103,32 @@
* @param doc collection configuration document
* @throws CollectionConfigurationException
*/
- protected void read(DBBroker broker, DocumentImpl doc, XmldbURI srcCollectionURI, XmldbURI docName) throws CollectionConfigurationException {
- doc.setBroker(broker);
+ protected void read(DBBroker broker, Document doc, boolean checkOnly, XmldbURI srcCollectionURI, XmldbURI docName) throws CollectionConfigurationException {
+ if (doc instanceof DocumentImpl)
+ ((DocumentImpl)doc).setBroker(broker);
+
+ if (!checkOnly) {
+ this.docName = docName;
+ this.srcCollectionURI = srcCollectionURI;
+ }
+
Element root = doc.getDocumentElement();
- if (root == null)
- throw new CollectionConfigurationException("Configuration document can not be parsed");
- if (!ROOT_ELEMENT.equals(root.getLocalName()))
- throw new CollectionConfigurationException("Expected element '" + ROOT_ELEMENT +
- "' in configuration document. Got element '" + root.getLocalName() + "'");
- if(!NAMESPACE.equals(root.getNamespaceURI()))
- throw new CollectionConfigurationException("Expected namespace '" + NAMESPACE +
+ if (root == null) {
+ throwOrLog("Configuration document can not be parsed", checkOnly);
+ return;
+ }
+ if (!ROOT_ELEMENT.equals(root.getLocalName())) {
+ throwOrLog("Expected element '" + ROOT_ELEMENT +
+ "' in configuration document. Got element '" + root.getLocalName() + "'", checkOnly);
+ return;
+ }
+ if(!NAMESPACE.equals(root.getNamespaceURI())) {
+ throwOrLog("Expected namespace '" + NAMESPACE +
"' for element '" + PARAMETER_ELEMENT +
- "' in configuration document. Got '" + root.getNamespaceURI() + "'");
+ "' in configuration document. Got '" + root.getNamespaceURI() + "'", checkOnly);
+ return;
+ }
- this.docName = docName;
- this.srcCollectionURI = srcCollectionURI;
-
NodeList childNodes = root.getChildNodes();
Node node;
for(int i = 0; i < childNodes.getLength(); i++) {
@@ -129,7 +139,7 @@
for(int j = 0; j < triggers.getLength(); j++) {
node = triggers.item(j);
if(node.getNodeType() == Node.ELEMENT_NODE)
- createTrigger(broker, (Element)node);
+ createTrigger(broker, (Element)node, checkOnly);
}
} else if(INDEX_ELEMENT.equals(node.getLocalName())) {
@@ -140,7 +150,10 @@
else
indexSpec.read(broker, elem);
} catch (DatabaseConfigurationException e) {
- throw new CollectionConfigurationException(e.getMessage(), e);
+ if (checkOnly)
+ throw new CollectionConfigurationException(e.getMessage(), e);
+ else
+ LOG.warn(e.getMessage(), e);
}
} else if (PERMISSIONS_ELEMENT.equals(node.getLocalName())) {
@@ -151,9 +164,13 @@
try {
defResPermissions = Integer.parseInt(permsOpt, 8);
} catch (NumberFormatException e) {
- throw new CollectionConfigurationException("Ilegal value for permissions in configuration document : " +
- e.getMessage(), e);
- }
+ if (checkOnly)
+ throw new CollectionConfigurationException("Ilegal value for permissions in configuration document : " +
+ e.getMessage(), e);
+ else
+ LOG.warn("Ilegal value for permissions in configuration document : " +
+ e.getMessage(), e);
+ }
}
permsOpt = elem.getAttribute(COLLECTION_PERMISSIONS_ATTR);
if (permsOpt != null && permsOpt.length() > 0) {
@@ -161,8 +178,12 @@
try {
defCollPermissions = Integer.parseInt(permsOpt, 8);
} catch (NumberFormatException e) {
- throw new CollectionConfigurationException("Ilegal value for permissions in configuration document : " +
- e.getMessage(), e);
+ if (checkOnly)
+ throw new CollectionConfigurationException("Ilegal value for permissions in configuration document : " +
+ e.getMessage(), e);
+ else
+ LOG.warn("Ilegal value for permissions in configuration document : " +
+ e.getMessage(), e);
}
}
@@ -178,16 +199,23 @@
}
} else {
- LOG.info("Ignored node '" + node.getLocalName() + "' in configuration document");
+ throwOrLog("Ignored node '" + node.getLocalName() + "' in configuration document", checkOnly);
//TODO : throw an exception like above ? -pb
}
} else if (node.getNodeType() == Node.ELEMENT_NODE) {
- LOG.info("Ignored node '" + node.getLocalName() + "' in namespace '" +
- node.getNamespaceURI() + "' in configuration document");
+ throwOrLog("Ignored node '" + node.getLocalName() + "' in namespace '" +
+ node.getNamespaceURI() + "' in configuration document", checkOnly);
}
}
}
-
+
+ private void throwOrLog(String message, boolean throwExceptions) throws CollectionConfigurationException {
+ if (throwExceptions)
+ throw new CollectionConfigurationException(message);
+ else
+ LOG.warn(message);
+ }
+
public XmldbURI getDocName() {
return docName;
}
@@ -226,63 +254,67 @@
return triggers[eventType];
}
- private void createTrigger(DBBroker broker, Element node)
+ private void createTrigger(DBBroker broker, Element node, boolean testConfig)
throws CollectionConfigurationException {
String eventAttr = node.getAttribute(EVENT_ATTRIBUTE);
- if(eventAttr == null)
- throw new CollectionConfigurationException("'" + node.getNodeName() +
- "' requires an attribute '"+ EVENT_ATTRIBUTE + "'");
- String classAttr = node.getAttribute(CLASS_ATTRIBUTE);
- if(classAttr == null)
- throw new CollectionConfigurationException("'" + node.getNodeName() +
- "' requires an attribute '"+ CLASS_ATTRIBUTE + "'");
+ if(eventAttr == null) {
+ throwOrLog("'" + node.getNodeName() +
+ "' requires an attribute '"+ EVENT_ATTRIBUTE + "'", testConfig);
+ return;
+ }
+ String classAttr = node.getAttribute(CLASS_ATTRIBUTE);
+ if(classAttr == null) {
+ throwOrLog("'" + node.getNodeName() +
+ "' requires an attribute '"+ CLASS_ATTRIBUTE + "'", testConfig);
+ return;
+ }
- TriggerConfig trigger = instantiate(broker, node, classAttr);
-
- StringTokenizer tok = new StringTokenizer(eventAttr, ", ");
- String event;
- while(tok.hasMoreTokens()) {
- event = tok.nextToken();
- LOG.debug("Registering trigger '" + classAttr + "' for event '" + event + "'");
- if(event.equalsIgnoreCase("store")) {
- if (triggers[Trigger.STORE_DOCUMENT_EVENT] != null)
- throw new CollectionConfigurationException("Trigger '" + classAttr + "' already registered");
- triggers[Trigger.STORE_DOCUMENT_EVENT] = trigger;
- } else if(event.equalsIgnoreCase("update")) {
- if (triggers[Trigger.UPDATE_DOCUMENT_EVENT] != null)
- throw new CollectionConfigurationException("Trigger '" + classAttr + "' already registered");
- triggers[Trigger.UPDATE_DOCUMENT_EVENT] = trigger;
- } else if(event.equalsIgnoreCase("remove")) {
- if (triggers[Trigger.REMOVE_DOCUMENT_EVENT] != null)
- throw new CollectionConfigurationException("Trigger '" + classAttr + "' already registered");
- triggers[Trigger.REMOVE_DOCUMENT_EVENT] = trigger;
- } else if(event.equalsIgnoreCase("create-collection")) {
- if (triggers[Trigger.CREATE_COLLECTION_EVENT] != null)
- throw new CollectionConfigurationException("Trigger '" + classAttr + "' already registered");
- triggers[Trigger.CREATE_COLLECTION_EVENT] = trigger;
- } else if(event.equalsIgnoreCase("rename-collection")) {
- if (triggers[Trigger.RENAME_COLLECTION_EVENT] != null)
- throw new CollectionConfigurationException("Trigger '" + classAttr + "' already registered");
- triggers[Trigger.RENAME_COLLECTION_EVENT] = trigger;
- } else if(event.equalsIgnoreCase("delete-collection")) {
- if (triggers[Trigger.DELETE_COLLECTION_EVENT] != null)
- throw new CollectionConfigurationException("Trigger '" + classAttr + "' already registered");
- triggers[Trigger.DELETE_COLLECTION_EVENT] = trigger;
- } else
- throw new CollectionConfigurationException("Unknown event type '" + event +
- "' in trigger '" + classAttr + "'");
- }
- }
+ TriggerConfig trigger = instantiate(broker, node, classAttr, testConfig);
+ if (!testConfig) {
+ StringTokenizer tok = new StringTokenizer(eventAttr, ", ");
+ String event;
+ while(tok.hasMoreTokens()) {
+ event = tok.nextToken();
+ LOG.debug("Registering trigger '" + classAttr + "' for event '" + event + "'");
+ if(event.equalsIgnoreCase("store")) {
+ if (triggers[Trigger.STORE_DOCUMENT_EVENT] != null)
+ LOG.warn("Trigger '" + classAttr + "' already registered");
+ triggers[Trigger.STORE_DOCUMENT_EVENT] = trigger;
+ } else if(event.equalsIgnoreCase("update")) {
+ if (triggers[Trigger.UPDATE_DOCUMENT_EVENT] != null)
+ LOG.warn("Trigger '" + classAttr + "' already registered");
+ triggers[Trigger.UPDATE_DOCUMENT_EVENT] = trigger;
+ } else if(event.equalsIgnoreCase("remove")) {
+ if (triggers[Trigger.REMOVE_DOCUMENT_EVENT] != null)
+ LOG.warn("Trigger '" + classAttr + "' already registered");
+ triggers[Trigger.REMOVE_DOCUMENT_EVENT] = trigger;
+ } else if(event.equalsIgnoreCase("create-collection")) {
+ if (triggers[Trigger.CREATE_COLLECTION_EVENT] != null)
+ LOG.warn("Trigger '" + classAttr + "' already registered");
+ triggers[Trigger.CREATE_COLLECTION_EVENT] = trigger;
+ } else if(event.equalsIgnoreCase("rename-collection")) {
+ if (triggers[Trigger.RENAME_COLLECTION_EVENT] != null)
+ LOG.warn("Trigger '" + classAttr + "' already registered");
+ triggers[Trigger.RENAME_COLLECTION_EVENT] = trigger;
+ } else if(event.equalsIgnoreCase("delete-collection")) {
+ if (triggers[Trigger.DELETE_COLLECTION_EVENT] != null)
+ LOG.warn("Trigger '" + classAttr + "' already registered");
+ triggers[Trigger.DELETE_COLLECTION_EVENT] = trigger;
+ } else
+ LOG.warn("Unknown event type '" + event + "' in trigger '" + classAttr + "'");
+ }
+ }
+ }
- private TriggerConfig instantiate(DBBroker broker, Element node, String classname)
+ private TriggerConfig instantiate(DBBroker broker, Element node, String classname, boolean testOnly)
throws CollectionConfigurationException {
try {
Class clazz = Class.forName(classname);
- if(!Trigger.class.isAssignableFrom(clazz))
- throw new CollectionConfigurationException("Trigger's class '" + classname +
- "' is not assignable from '" + Trigger.class + "'");
-// Trigger trigger = (Trigger)clazz.newInstance();
+ if(!Trigger.class.isAssignableFrom(clazz)) {
+ throwOrLog("Trigger's class '" + classname + "' is not assignable from '" + Trigger.class + "'", testOnly);
+ return null;
+ }
TriggerConfig triggerConf = new TriggerConfig(clazz);
NodeList nodes = node.getElementsByTagNameNS(NAMESPACE, PARAMETER_ELEMENT);
//TODO : rely on schema-driven validation -pb
@@ -292,23 +324,26 @@
Element param = (Element)nodes.item(i);
//TODO : rely on schema-driven validation -pb
String name = param.getAttribute(PARAM_NAME_ATTRIBUTE);
- if(name == null)
- throw new CollectionConfigurationException("Expected attribute '" + PARAM_NAME_ATTRIBUTE +
- "' for element '" + PARAMETER_ELEMENT + "' in trigger's configuration.");
- String value = param.getAttribute(PARAM_VALUE_ATTRIBUTE);
- if(value == null)
- throw new CollectionConfigurationException("Expected attribute '" + PARAM_VALUE_ATTRIBUTE +
- "' for element '" + PARAMETER_ELEMENT + "' in trigger's configuration.");
-
- parameters.put(name, value);
+ if(name == null) {
+ throwOrLog("Expected attribute '" + PARAM_NAME_ATTRIBUTE +
+ "' for element '" + PARAMETER_ELEMENT + "' in trigger's configuration.", testOnly);
+ } else {
+ String value = param.getAttribute(PARAM_VALUE_ATTRIBUTE);
+ if(value == null) {
+ throwOrLog("Expected attribute '" + PARAM_VALUE_ATTRIBUTE +
+ "' for element '" + PARAMETER_ELEMENT + "' in trigger's configuration.", testOnly);
+ } else
+ parameters.put(name, value);
+ }
}
triggerConf.setParameters(parameters);
}
-// trigger.configure(broker, collection, parameters);
return triggerConf;
} catch (ClassNotFoundException e) {
- LOG.warn("Trigger class not found: " + e.getMessage(), e);
-// throw new CollectionConfigurationException(e.getMessage(), e);
+ if (testOnly)
+ throw new CollectionConfigurationException(e.getMessage(), e);
+ else
+ LOG.warn("Trigger class not found: " + e.getMessage(), e);
}
return null;
}
Modified: trunk/eXist/src/org/exist/collections/CollectionConfigurationManager.java
===================================================================
--- trunk/eXist/src/org/exist/collections/CollectionConfigurationManager.java 2007-12-20 16:12:21 UTC (rev 7071)
+++ trunk/eXist/src/org/exist/collections/CollectionConfigurationManager.java 2007-12-25 18:30:26 UTC (rev 7072)
@@ -25,6 +25,7 @@
import org.exist.EXistException;
import org.exist.collections.triggers.TriggerException;
import org.exist.dom.DocumentImpl;
+import org.exist.memtree.SAXAdapter;
import org.exist.security.PermissionDeniedException;
import org.exist.storage.BrokerPool;
import org.exist.storage.DBBroker;
@@ -34,9 +35,16 @@
import org.exist.util.LockException;
import org.exist.util.sanity.SanityCheck;
import org.exist.xmldb.XmldbURI;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
import java.io.IOException;
+import java.io.StringReader;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -74,8 +82,8 @@
defaultConfig = new CollectionConfiguration(broker.getBrokerPool());
defaultConfig.setIndexConfiguration(broker.getIndexConfiguration());
}
-
- /**
+
+ /**
* Add a new collection configuration. The XML document is passed as a string.
*
* @param transaction The transaction that will hold the WRITE locks until they are released by commit()/abort()
@@ -84,9 +92,9 @@
* @param config the xconf document as a String.
* @throws CollectionConfigurationException
*/
- public void addConfiguration(Txn transaction, DBBroker broker, Collection collection, String config)
+ public void addConfiguration(Txn transaction, DBBroker broker, Collection collection, String config)
throws CollectionConfigurationException {
- try {
+ try {
//TODO : use XmldbURI.resolve() !
XmldbURI path = XmldbURI.CONFIG_COLLECTION_URI.append(collection.getURI());
Collection confCol = broker.getOrCreateCollection(transaction, path);
@@ -116,8 +124,6 @@
throw new CollectionConfigurationException("Failed to store collection configuration: " + e.getMessage(), e);
} catch (PermissionDeniedException e) {
throw new CollectionConfigurationException("Failed to store collection configuration: " + e.getMessage(), e);
- } catch (CollectionConfigurationException e) {
- throw new CollectionConfigurationException("Failed to store collection configuration: " + e.getMessage(), e);
} catch (EXistException e) {
throw new CollectionConfigurationException("Failed to store collection configuration: " + e.getMessage(), e);
} catch (TriggerException e) {
@@ -128,8 +134,40 @@
throw new CollectionConfigurationException("Failed to store collection configuration: " + e.getMessage(), e);
}
}
-
+
/**
+ * Check the passed collection configuration. Throws an exception if errors are detected in the
+ * configuration document. Note: some configuration settings depend on the current environment, in particular
+ * the availability of trigger or index classes.
+ *
+ * @param broker DBBroker
+ * @param config the configuration to test
+ * @throws CollectionConfigurationException if errors were detected
+ */
+ public void testConfiguration(DBBroker broker, String config) throws CollectionConfigurationException {
+ try {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ InputSource src = new InputSource(new StringReader(config));
+ SAXParser parser = factory.newSAXParser();
+ XMLReader reader = parser.getXMLReader();
+ SAXAdapter adapter = new SAXAdapter();
+ reader.setContentHandler(adapter);
+ reader.parse(src);
+
+ Document doc = adapter.getDocument();
+ CollectionConfiguration conf = new CollectionConfiguration(broker.getBrokerPool());
+ conf.read(broker, doc, true, null, null);
+ } catch (ParserConfigurationException e) {
+ throw new CollectionConfigurationException(e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new CollectionConfigurationException(e.getMessage(), e);
+ } catch (IOException e) {
+ throw new CollectionConfigurationException(e.getMessage(), e);
+ }
+ }
+
+ /**
* Retrieve the collection configuration instance for the given collection. This
* creates a new CollectionConfiguration object and recursively scans the collection
* hierarchy for available configurations.
@@ -197,7 +235,7 @@
// [ 1807744 ] Invalid collection.xconf causes a non startable database
// http://sourceforge.net/tracker/index.php?func=detail&aid=1807744&group_id=17691&atid=117691
try {
- conf.read(broker, confDoc, configCollection.getURI(), confDoc.getFileURI());
+ conf.read(broker, confDoc, false, configCollection.getURI(), confDoc.getFileURI());
} catch (CollectionConfigurationException e) {
String message = "Failed to read configuration document " + confDoc.getFileURI() + " in "
+ configCollection.getURI() + ". "
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-20 16:12:23
|
Revision: 7071
http://exist.svn.sourceforge.net/exist/?rev=7071&view=rev
Author: dizzzz
Date: 2007-12-20 08:12:21 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
changes ant target "dist-war"
-do not compile, just generate jar files
-do not include javadoc, reducing war file with 5 mb
Modified Paths:
--------------
trunk/eXist/build/scripts/dist.xml
Modified: trunk/eXist/build/scripts/dist.xml
===================================================================
--- trunk/eXist/build/scripts/dist.xml 2007-12-20 15:56:01 UTC (rev 7070)
+++ trunk/eXist/build/scripts/dist.xml 2007-12-20 16:12:21 UTC (rev 7071)
@@ -10,7 +10,8 @@
<!-- ================================================================== -->
<!-- Prepare webapp -->
<!-- ================================================================== -->
- <target depends="all,samples,javadocs" name="webapps">
+ <target depends="prepare" name="webapps">
+
<mkdir dir="dist"/>
<!-- When there are no java docs, create empty file -->
@@ -20,10 +21,7 @@
<mkdir dir="webapp/WEB-INF/data"/>
<mkdir dir="webapp/WEB-INF/logs"/>
-<!--
- <chmod file="webapp/bin/client.sh" perm="+x"/>
--->
-
+ <!-- create war specific configuration files -->
<xslt in="conf.xml" out="webapp/WEB-INF/conf.xml" style="${build.scripts}/dist-war-conf.xsl"/>
<xslt in="log4j.xml" out="webapp/WEB-INF/log4j.xml" style="${build.scripts}/dist-war-log4j.xsl"/>
@@ -76,6 +74,7 @@
<!-- Add files context root ('/') -->
<fileset dir="webapp">
<exclude name="**/*~"/>
+ <exclude name="api/**"/>
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/data/*.dbx"/>
<exclude name="WEB-INF/data/*.lck"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-20 15:56:06
|
Revision: 7070
http://exist.svn.sourceforge.net/exist/?rev=7070&view=rev
Author: dizzzz
Date: 2007-12-20 07:56:01 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
changes ant target "dist-war"
-do not compile, just generate jar files
-do not include javadoc, reducing war file with 5 mb
Modified Paths:
--------------
trunk/eXist/build/scripts/build-impl.xml
Modified: trunk/eXist/build/scripts/build-impl.xml
===================================================================
--- trunk/eXist/build/scripts/build-impl.xml 2007-12-20 15:12:52 UTC (rev 7069)
+++ trunk/eXist/build/scripts/build-impl.xml 2007-12-20 15:56:01 UTC (rev 7070)
@@ -443,7 +443,7 @@
<link href="http://jline.sourceforge.net/javadoc/"/>
<link href="http://jug.safehaus.org/curr/javadoc/"/>
<link href="http://logging.apache.org/log4j/1.2/apidocs/"/>
- <link href="http://people.apache.org/~andyc/neko/doc/html/javadoc/"/>
+ <link href="http://nekohtml.sourceforge.net/javadoc/"/>
<link href="http://quartz.sourceforge.net/javadoc/"/>
<link href="http://sunxacml.sourceforge.net/javadoc/"/>
<link href="http://ws.apache.org/axis/java/apiDocs/"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2007-12-20 15:12:54
|
Revision: 7069
http://exist.svn.sourceforge.net/exist/?rev=7069&view=rev
Author: dizzzz
Date: 2007-12-20 07:12:52 -0800 (Thu, 20 Dec 2007)
Log Message:
-----------
changes ant target "dist-war"
-do not compile, just generate jar files
-do not include javadoc, reducing war file with 5 mb
Modified Paths:
--------------
trunk/eXist/build/scripts/installer.xml
Modified: trunk/eXist/build/scripts/installer.xml
===================================================================
--- trunk/eXist/build/scripts/installer.xml 2007-12-18 05:52:50 UTC (rev 7068)
+++ trunk/eXist/build/scripts/installer.xml 2007-12-20 15:12:52 UTC (rev 7069)
@@ -103,12 +103,12 @@
</target>
- <target depends="prepare-installer" name="cvs-build">
+ <!--target depends="prepare-installer" name="cvs-build">
<echo message="Calling IzPack to create installer ..."/>
<izpack input="installer/install.xml"
output="installer/${project.name}-cvs-${DSTAMP}.jar"
basedir="." izPackDir="${izpack.dir}"
installerType="standard"/>
- </target>
+ </target-->
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pka...@us...> - 2007-12-18 05:52:59
|
Revision: 7068
http://exist.svn.sourceforge.net/exist/?rev=7068&view=rev
Author: pkaminsk2
Date: 2007-12-17 21:52:50 -0800 (Mon, 17 Dec 2007)
Log Message:
-----------
Added test for deep-equal of elements with different namespace attributes.
Modified Paths:
--------------
trunk/eXist/test/src/org/exist/xquery/DeepEqualTest.java
Modified: trunk/eXist/test/src/org/exist/xquery/DeepEqualTest.java
===================================================================
--- trunk/eXist/test/src/org/exist/xquery/DeepEqualTest.java 2007-12-17 05:58:12 UTC (rev 7067)
+++ trunk/eXist/test/src/org/exist/xquery/DeepEqualTest.java 2007-12-18 05:52:50 UTC (rev 7068)
@@ -427,6 +427,11 @@
createDocument("test", "<test xmlns:p='urn:foo' xmlns:q='urn:bar'><p:a/><q:a/></test>");
assertQuery(false, "deep-equal(/test/*[1], /test/*[2])");
}
+
+ public void testNSElements3() {
+ createDocument("test", "<test><a/><a xmlns:z='foo'/></test>");
+ assertQuery(true, "deep-equal(/test/*[1], /test/*[2])");
+ }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pka...@us...> - 2007-12-17 05:58:18
|
Revision: 7067
http://exist.svn.sourceforge.net/exist/?rev=7067&view=rev
Author: pkaminsk2
Date: 2007-12-16 21:58:12 -0800 (Sun, 16 Dec 2007)
Log Message:
-----------
Fixed wrong namespace being assigned to xmlns attributes in ElementImpl.getAttributes().
Modified Paths:
--------------
trunk/eXist/src/org/exist/dom/ElementImpl.java
Modified: trunk/eXist/src/org/exist/dom/ElementImpl.java
===================================================================
--- trunk/eXist/src/org/exist/dom/ElementImpl.java 2007-12-15 22:41:55 UTC (rev 7066)
+++ trunk/eXist/src/org/exist/dom/ElementImpl.java 2007-12-17 05:58:12 UTC (rev 7067)
@@ -21,49 +21,23 @@
*/
package org.exist.dom;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeSet;
+import java.io.*;
+import java.util.*;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.*;
import org.exist.Namespaces;
import org.exist.indexing.StreamListener;
import org.exist.numbering.NodeId;
import org.exist.stax.EmbeddedXMLStreamReader;
-import org.exist.storage.ElementValue;
-import org.exist.storage.NodePath;
-import org.exist.storage.RangeIndexSpec;
-import org.exist.storage.Signatures;
+import org.exist.storage.*;
import org.exist.storage.btree.Value;
-import org.exist.storage.txn.TransactionException;
-import org.exist.storage.txn.TransactionManager;
-import org.exist.storage.txn.Txn;
-import org.exist.util.ByteArrayPool;
-import org.exist.util.ByteConversion;
-import org.exist.util.UTF8;
+import org.exist.storage.txn.*;
+import org.exist.util.*;
import org.exist.util.pool.NodePool;
import org.exist.xquery.Constants;
import org.exist.xquery.value.StringValue;
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.ProcessingInstruction;
-import org.w3c.dom.Text;
-import org.w3c.dom.TypeInfo;
-import org.w3c.dom.UserDataHandler;
+import org.w3c.dom.*;
/**
* ElementImpl.java
@@ -653,7 +627,7 @@
Map.Entry entry = (Map.Entry) i.next();
String prefix = entry.getKey().toString();
String ns = entry.getValue().toString();
- QName attrName = new QName(prefix, Namespaces.XML_NS, "xmlns");
+ QName attrName = new QName(prefix, Namespaces.XMLNS_NS, "xmlns");
AttrImpl attr = new AttrImpl(attrName, ns);
map.setNamedItem(attr);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pka...@us...> - 2007-12-15 22:42:05
|
Revision: 7066
http://exist.svn.sourceforge.net/exist/?rev=7066&view=rev
Author: pkaminsk2
Date: 2007-12-15 14:41:55 -0800 (Sat, 15 Dec 2007)
Log Message:
-----------
New tests for "removing" the root collection. One fails and is set to @Ignore for now.
Added Paths:
-----------
trunk/eXist/test/src/org/exist/storage/RemoveRootCollectionTest.java
Added: trunk/eXist/test/src/org/exist/storage/RemoveRootCollectionTest.java
===================================================================
--- trunk/eXist/test/src/org/exist/storage/RemoveRootCollectionTest.java (rev 0)
+++ trunk/eXist/test/src/org/exist/storage/RemoveRootCollectionTest.java 2007-12-15 22:41:55 UTC (rev 7066)
@@ -0,0 +1,80 @@
+package org.exist.storage;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+
+import org.exist.collections.*;
+import org.exist.security.SecurityManager;
+import org.exist.storage.txn.*;
+import org.exist.util.Configuration;
+import org.exist.xmldb.XmldbURI;
+import org.junit.*;
+import org.xml.sax.InputSource;
+
+
+public class RemoveRootCollectionTest {
+
+ private BrokerPool pool;
+ private DBBroker broker;
+ private TransactionManager transact;
+ Collection root;
+
+ @Test public void removeEmptyRootCollection() throws Exception {
+ Txn transaction = transact.beginTransaction();
+ broker.removeCollection(transaction, root);
+ transact.commit(transaction);
+ assertEquals(0, root.getChildCollectionCount());
+ assertEquals(0, root.getDocumentCount());
+ }
+
+ @Test public void removeRootCollectionWithChildCollection() throws Exception {
+ addChildToRoot();
+ Txn transaction = transact.beginTransaction();
+ broker.removeCollection(transaction, root);
+ transact.commit(transaction);
+ assertEquals(0, root.getChildCollectionCount());
+ assertEquals(0, root.getDocumentCount());
+ }
+
+ @Ignore @Test public void removeRootCollectionWithDocument() throws Exception {
+ addDocumentToRoot();
+ Txn transaction = transact.beginTransaction();
+ broker.removeCollection(transaction, root);
+ transact.commit(transaction);
+ assertEquals(0, root.getChildCollectionCount());
+ assertEquals(0, root.getDocumentCount());
+ }
+
+
+ @Before public void startDB() throws Exception {
+ Configuration config = new Configuration();
+ BrokerPool.configure(1, 1, config);
+ pool = BrokerPool.getInstance(); assertNotNull(pool);
+ broker = pool.get(SecurityManager.SYSTEM_USER); assertNotNull(broker);
+ transact = pool.getTransactionManager(); assertNotNull(transact);
+ root = broker.getCollection(XmldbURI.ROOT_COLLECTION_URI); assertNotNull(root);
+ }
+
+ @After public void stopDB() {
+ pool.release(broker);
+ BrokerPool.stopAll(false);
+ }
+
+ private void addDocumentToRoot() throws Exception {
+ Txn transaction = transact.beginTransaction();
+ InputSource is = new InputSource(new File("samples/shakespeare/hamlet.xml").toURI().toASCIIString());
+ assertNotNull(is);
+ IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("hamlet.xml"), is);
+ assertNotNull(info);
+ root.store(transaction, broker, info, is, false);
+ transact.commit(transaction);
+ }
+
+ private void addChildToRoot() throws Exception {
+ Txn transaction = transact.beginTransaction();
+ Collection child = broker.getOrCreateCollection(transaction, XmldbURI.ROOT_COLLECTION_URI.append("child"));
+ broker.saveCollection(transaction, child);
+ transact.commit(transaction);
+ }
+}
Property changes on: trunk/eXist/test/src/org/exist/storage/RemoveRootCollectionTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|