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
(12) |
3
(1) |
4
(10) |
5
(6) |
6
(19) |
7
(1) |
|
8
(8) |
9
(14) |
10
(10) |
11
(12) |
12
(19) |
13
(15) |
14
(33) |
|
15
(24) |
16
(17) |
17
(18) |
18
(8) |
19
(7) |
20
(6) |
21
|
|
22
(2) |
23
(8) |
24
(16) |
25
(6) |
26
(14) |
27
(4) |
28
(1) |
|
29
|
30
(7) |
31
(5) |
|
|
|
|
|
From: <wol...@us...> - 2006-10-31 21:43:26
|
Revision: 4763
http://svn.sourceforge.net/exist/?rev=4763&view=rev
Author: wolfgang_m
Date: 2006-10-31 13:43:17 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Removed an annoying message to stdout.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/XQueryContext.java
Modified: trunk/eXist/src/org/exist/xquery/XQueryContext.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/XQueryContext.java 2006-10-31 21:40:08 UTC (rev 4762)
+++ trunk/eXist/src/org/exist/xquery/XQueryContext.java 2006-10-31 21:43:17 UTC (rev 4763)
@@ -1114,7 +1114,6 @@
//Sanity check : one may *not* want to bind the module !
if (myModule == null) {
- System.out.println("Module '" + SessionModule.NAMESPACE_URI + "' is not bound");
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2006-10-31 21:40:20
|
Revision: 4762
http://svn.sourceforge.net/exist/?rev=4762&view=rev
Author: brihaye
Date: 2006-10-31 13:40:08 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Fixed bug in util:eval where incoming context sequence wasn't taken into consideration
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/util/Eval.java
trunk/eXist/src/org/exist/xquery/test/XQueryFunctionsTest.java
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Eval.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Eval.java 2006-10-31 18:37:45 UTC (rev 4761)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Eval.java 2006-10-31 21:40:08 UTC (rev 4762)
@@ -42,7 +42,9 @@
import org.exist.xquery.BasicFunction;
import org.exist.xquery.Cardinality;
import org.exist.xquery.CompiledXQuery;
+import org.exist.xquery.Dependency;
import org.exist.xquery.FunctionSignature;
+import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQuery;
import org.exist.xquery.XQueryContext;
@@ -52,7 +54,6 @@
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
-import org.exist.xquery.value.StringValue;
import org.exist.xquery.value.Type;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -166,15 +167,23 @@
/* (non-Javadoc)
* @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[], org.exist.xquery.value.Sequence)
*/
- public Sequence eval(Sequence[] args, Sequence contextSequence)
- throws XPathException {
+ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
+ if (context.getProfiler().isEnabled()) {
+ context.getProfiler().start(this);
+ context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
+ if (contextSequence != null)
+ context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);
+ }
+
int argCount = 0;
- Sequence exprContext = null;
+ Sequence exprContext;
if (isCalledAs("eval-inline")) {
// the current expression context
exprContext = args[argCount++];
- }
+ } else
+ exprContext = contextSequence;
+
// get the query expression
Item expr = args[argCount++].itemAt(0);
Source querySource;
Modified: trunk/eXist/src/org/exist/xquery/test/XQueryFunctionsTest.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/test/XQueryFunctionsTest.java 2006-10-31 18:37:45 UTC (rev 4761)
+++ trunk/eXist/src/org/exist/xquery/test/XQueryFunctionsTest.java 2006-10-31 21:40:08 UTC (rev 4762)
@@ -3,13 +3,18 @@
*/
package org.exist.xquery.test;
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Locale;
+
import junit.framework.TestCase;
import junit.textui.TestRunner;
import org.exist.storage.DBBroker;
+import org.exist.util.Configuration;
import org.exist.xmldb.DatabaseInstanceManager;
import org.exist.xquery.XPathException;
-import org.exist.util.Configuration;
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Collection;
import org.xmldb.api.base.Database;
@@ -19,13 +24,6 @@
import org.xmldb.api.modules.CollectionManagementService;
import org.xmldb.api.modules.XPathQueryService;
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.text.*;
-import java.util.*;
-
/** Tests for various standart XQuery functions
* @author jens
*/
@@ -414,6 +412,20 @@
}
}
+ public void testUtilEval() throws XPathException {
+ ResourceSet result = null;
+ String r = "";
+ try {
+ String query = "<a><b/></a>/util:eval('*')";
+ result = service.query( query );
+ assertEquals( 1, result.getSize());
+
+ } catch (XMLDBException e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
public void testSharedLock() throws XPathException {
ResourceSet result = null;
String r = "";
@@ -468,6 +480,7 @@
fail(e.getMessage());
}
}
+
public void testEncodeForURI() {
ResourceSet result = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-31 18:37:55
|
Revision: 4761
http://svn.sourceforge.net/exist/?rev=4761&view=rev
Author: wolfgang_m
Date: 2006-10-31 10:37:45 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Use exist.home to find sample data for junit test.
Modified Paths:
--------------
trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java
Modified: trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java
===================================================================
--- trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java 2006-10-31 14:59:56 UTC (rev 4760)
+++ trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java 2006-10-31 18:37:45 UTC (rev 4761)
@@ -76,8 +76,8 @@
assertNotNull(test2);
broker.saveCollection(transaction, test2);
- String existHome = System.getProperty("exist.home");
- File existDir = existHome==null ? new File(".") : new File(existHome);
+ String existHome = System.getProperty("exist.home");
+ File existDir = existHome==null ? new File(".") : new File(existHome);
File f = new File(existDir,"samples/shakespeare/r_and_j.xml");
assertNotNull(f);
IndexInfo info = test2.validateXMLResource(transaction, broker, TestConstants.TEST_XML_URI, new InputSource(f.toURI().toASCIIString()));
@@ -160,8 +160,11 @@
assertNotNull(test2);
broker.saveCollection(transaction, test2);
- File f = new File("samples/shakespeare/r_and_j.xml");
- IndexInfo info = test2.validateXMLResource(transaction, broker, XmldbURI.create("new_test2.xml"),
+ String existHome = System.getProperty("exist.home");
+ File existDir = existHome==null ? new File(".") : new File(existHome);
+ File f = new File(existDir,"samples/shakespeare/r_and_j.xml");
+ assertNotNull(f);
+ IndexInfo info = test2.validateXMLResource(transaction, broker, XmldbURI.create("new_test2.xml"),
new InputSource(f.toURI().toASCIIString()));
test2.store(transaction, broker, info, new InputSource(f.toURI()
.toASCIIString()), false);
@@ -235,7 +238,10 @@
if (test2 == null)
test2 = mgr.createCollection("test2");
- File f = new File("samples/shakespeare/r_and_j.xml");
+ String existHome = System.getProperty("exist.home");
+ File existDir = existHome==null ? new File(".") : new File(existHome);
+ File f = new File(existDir,"samples/shakespeare/r_and_j.xml");
+ assertNotNull(f);
Resource res = test2.createResource("test3.xml", "XMLResource");
res.setContent(f);
test2.storeResource(res);
@@ -281,4 +287,4 @@
protected void tearDown() {
BrokerPool.stopAll(false);
}
-}
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-31 15:00:07
|
Revision: 4760
http://svn.sourceforge.net/exist/?rev=4760&view=rev
Author: wolfgang_m
Date: 2006-10-31 06:59:56 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Fixed MoveResourceTest. Some tests were commented out.
Modified Paths:
--------------
trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java
Modified: trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java
===================================================================
--- trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java 2006-10-31 14:58:38 UTC (rev 4759)
+++ trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java 2006-10-31 14:59:56 UTC (rev 4760)
@@ -222,7 +222,7 @@
}
public void testXMLDBStore() throws XMLDBException {
- BrokerPool.FORCE_CORRUPTION = false;
+ BrokerPool.FORCE_CORRUPTION = true;
BrokerPool pool = startDB();
org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", "");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-31 14:58:47
|
Revision: 4759
http://svn.sourceforge.net/exist/?rev=4759&view=rev
Author: wolfgang_m
Date: 2006-10-31 06:58:38 -0800 (Tue, 31 Oct 2006)
Log Message:
-----------
Fixed MoveResourceTest. Some tests were commented out.
Modified Paths:
--------------
trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java
Modified: trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java
===================================================================
--- trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java 2006-10-30 21:04:26 UTC (rev 4758)
+++ trunk/eXist/src/org/exist/storage/test/MoveResourceTest.java 2006-10-31 14:58:38 UTC (rev 4759)
@@ -39,9 +39,13 @@
import org.exist.test.TestConstants;
import org.exist.util.Configuration;
import org.exist.xmldb.XmldbURI;
+import org.exist.xmldb.CollectionManagementServiceImpl;
+import org.exist.EXistException;
import org.xml.sax.InputSource;
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Database;
+import org.xmldb.api.base.Resource;
+import org.xmldb.api.base.XMLDBException;
public class MoveResourceTest extends TestCase {
@@ -79,16 +83,16 @@
IndexInfo info = test2.validateXMLResource(transaction, broker, TestConstants.TEST_XML_URI, new InputSource(f.toURI().toASCIIString()));
assertNotNull(info);
test2.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
-
+
System.out.println("Moving document test.xml to new_test.xml ...");
broker.moveXMLResource(transaction, info.getDocument(), root, XmldbURI.create("new_test.xml"));
broker.saveCollection(transaction, root);
-
+
transact.commit(transaction);
System.out.println("Transaction commited ...");
} catch (Exception e) {
e.printStackTrace();
- fail(e.getMessage());
+ fail(e.getMessage());
} finally {
pool.release(broker);
}
@@ -106,135 +110,155 @@
assertNotNull(broker);
Serializer serializer = broker.getSerializer();
serializer.reset();
-
+
DocumentImpl doc = broker.getXMLResource(XmldbURI.ROOT_COLLECTION_URI.append("test/new_test.xml"), Lock.READ_LOCK);
assertNotNull("Document should not be null", doc);
String data = serializer.serialize(doc);
assertNotNull(data);
// System.out.println(data);
doc.getUpdateLock().release(Lock.READ_LOCK);
-
+
TransactionManager transact = pool.getTransactionManager();
assertNotNull(transact);
Txn transaction = transact.beginTransaction();
assertNotNull(transaction);
System.out.println("Transaction started ...");
-
+
Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
assertNotNull(root);
- transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);
- broker.removeCollection(transaction, root);
-
+ transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);
+ broker.removeCollection(transaction, root);
+
transact.commit(transaction);
System.out.println("Transaction commited ...");
} catch (Exception e) {
e.printStackTrace();
- fail(e.getMessage());
+ fail(e.getMessage());
} finally {
pool.release(broker);
}
}
-
-// public void testStoreAborted() {
-// BrokerPool.FORCE_CORRUPTION = true;
-// BrokerPool pool = startDB();
-//
-// DBBroker broker = null;
-// try {
-// broker = pool.get(SecurityManager.SYSTEM_USER);
-//
-// TransactionManager transact = pool.getTransactionManager();
-// Txn transaction = transact.beginTransaction();
-//
-// System.out.println("Transaction started ...");
-//
-// Collection root = broker.getOrCreateCollection(transaction,
-// DBBroker.ROOT_COLLECTION + "/test");
-// broker.saveCollection(transaction, root);
-//
-// Collection test = broker.getOrCreateCollection(transaction,
-// DBBroker.ROOT_COLLECTION + "/test/test2");
-// broker.saveCollection(transaction, test);
-//
-// File f = new File("samples/shakespeare/r_and_j.xml");
-// IndexInfo info = test.validate(transaction, broker, "test2.xml",
-// new InputSource(f.toURI().toASCIIString()));
-// test.store(transaction, broker, info, new InputSource(f.toURI()
-// .toASCIIString()), false);
-//
-// transact.commit(transaction);
-//
-// transaction = transact.beginTransaction();
-//
-// broker.moveResource(transaction, info.getDocument(), root,
-// "new_test2.xml");
-// broker.saveCollection(transaction, root);
-//
-// pool.getTransactionManager().getLogManager().flushToLog(true);
-// } finally {
-// pool.release(broker);
-// }
-// }
-
-// public void testReadAborted() {
-// BrokerPool.FORCE_CORRUPTION = false;
-// BrokerPool pool = startDB();
-//
-// System.out.println("testRead() ...\n");
-//
-// DBBroker broker = null;
-// try {
-// broker = pool.get(SecurityManager.SYSTEM_USER);
-// Serializer serializer = broker.getSerializer();
-// serializer.reset();
-//
-// DocumentImpl doc;
-// String data;
-//
-// doc = broker.openDocument(DBBroker.ROOT_COLLECTION + "/test/test2/test2.xml", Lock.READ_LOCK);
-// assertNotNull("Document should not be null", doc);
-// data = serializer.serialize(doc);
+
+ public void testStoreAborted() throws Exception {
+ BrokerPool.FORCE_CORRUPTION = true;
+ BrokerPool pool = startDB();
+
+ DBBroker broker = null;
+ try {
+ broker = pool.get(SecurityManager.SYSTEM_USER);
+
+ TransactionManager transact = pool.getTransactionManager();
+ Txn transaction = transact.beginTransaction();
+
+ System.out.println("Transaction started ...");
+
+ Collection root = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI);
+ assertNotNull(root);
+ broker.saveCollection(transaction, root);
+
+ Collection test2 = broker.getOrCreateCollection(transaction,TestConstants.TEST_COLLECTION_URI2);
+ assertNotNull(test2);
+ broker.saveCollection(transaction, test2);
+
+ File f = new File("samples/shakespeare/r_and_j.xml");
+ IndexInfo info = test2.validateXMLResource(transaction, broker, XmldbURI.create("new_test2.xml"),
+ new InputSource(f.toURI().toASCIIString()));
+ test2.store(transaction, broker, info, new InputSource(f.toURI()
+ .toASCIIString()), false);
+
+ transact.commit(transaction);
+
+ transaction = transact.beginTransaction();
+
+ broker.moveXMLResource(transaction, info.getDocument(), root,
+ XmldbURI.create("new_test2.xml"));
+ broker.saveCollection(transaction, root);
+
+ pool.getTransactionManager().getJournal().flushToLog(true);
+ } finally {
+ pool.release(broker);
+ }
+ }
+
+public void testReadAborted() {
+ BrokerPool.FORCE_CORRUPTION = false;
+ BrokerPool pool = null;
+ DBBroker broker = null;
+ try {
+ System.out.println("testRead() ...\n");
+ pool = startDB();
+ assertNotNull(pool);
+ broker = pool.get(SecurityManager.SYSTEM_USER);
+ assertNotNull(broker);
+ Serializer serializer = broker.getSerializer();
+ serializer.reset();
+
+ DocumentImpl doc = broker.getXMLResource(TestConstants.TEST_COLLECTION_URI2.append("new_test2.xml"), Lock.READ_LOCK);
+ assertNotNull("Document should not be null", doc);
+ String data = serializer.serialize(doc);
+ assertNotNull(data);
// System.out.println(data);
-// doc.getUpdateLock().release(Lock.READ_LOCK);
-//
-// doc = broker.openDocument(DBBroker.ROOT_COLLECTION + "/test/new_test2.xml", Lock.READ_LOCK);
-// assertNull("Document should not exist", doc);
-// } finally {
-// pool.release(broker);
-// }
-// }
-//
-// public void testXMLDBStore() {
-// BrokerPool.FORCE_CORRUPTION = false;
-// BrokerPool pool = startDB();
-//
-// org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION + , "admin", "");
-// CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl)
-// root.getService("CollectionManagementService", "1.0");
-// org.xmldb.api.base.Collection test = root.getChildCollection("test");
-// if (test == null)
-// test = mgr.createCollection("test");
-// org.xmldb.api.base.Collection test2 = test.getChildCollection("test2");
-// if (test2 == null)
-// test2 = mgr.createCollection("test2");
-//
-// File f = new File("samples/shakespeare/r_and_j.xml");
-// Resource res = test2.createResource("test3.xml", "XMLResource");
-// res.setContent(f);
-// test2.storeResource(res);
-//
-// mgr.moveResource(DBBroker.ROOT_COLLECTION + "/test/test2/test3.xml", TestConstants.TEST_COLLECTION_URI, "new_test3.xml");
-// }
-//
-// public void testXMLDBRead() {
-// BrokerPool.FORCE_CORRUPTION = false;
-// BrokerPool pool = startDB();
-//
-// org.xmldb.api.base.Collection test = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION + "/test", "admin", "");
-// Resource res = test.getResource("new_test3.xml");
-// assertNotNull("Document should not be null", res);
-// System.out.println(res.getContent());
-// }
+ doc.getUpdateLock().release(Lock.READ_LOCK);
+
+ TransactionManager transact = pool.getTransactionManager();
+ assertNotNull(transact);
+ Txn transaction = transact.beginTransaction();
+ assertNotNull(transaction);
+ System.out.println("Transaction started ...");
+
+ Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
+ assertNotNull(root);
+ transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);
+ broker.removeCollection(transaction, root);
+
+ transact.commit(transaction);
+ System.out.println("Transaction commited ...");
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ } finally {
+ pool.release(broker);
+ }
+ }
+
+ public void testXMLDBStore() throws XMLDBException {
+ BrokerPool.FORCE_CORRUPTION = false;
+ BrokerPool pool = startDB();
+
+ org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", "");
+ CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl)
+ root.getService("CollectionManagementService", "1.0");
+ org.xmldb.api.base.Collection test = root.getChildCollection("test");
+ if (test == null)
+ test = mgr.createCollection("test");
+ org.xmldb.api.base.Collection test2 = test.getChildCollection("test2");
+ if (test2 == null)
+ test2 = mgr.createCollection("test2");
+
+ File f = new File("samples/shakespeare/r_and_j.xml");
+ Resource res = test2.createResource("test3.xml", "XMLResource");
+ res.setContent(f);
+ test2.storeResource(res);
+
+ mgr.moveResource(XmldbURI.create(DBBroker.ROOT_COLLECTION + "/test2/test3.xml"),
+ TestConstants.TEST_COLLECTION_URI, XmldbURI.create("new_test3.xml"));
+ }
+
+ public void testXMLDBRead() throws XMLDBException {
+ BrokerPool.FORCE_CORRUPTION = false;
+ BrokerPool pool = startDB();
+
+ org.xmldb.api.base.Collection test = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION + "/test", "admin", "");
+ Resource res = test.getResource("new_test3.xml");
+ assertNotNull("Document should not be null", res);
+ System.out.println(res.getContent());
+
+ org.xmldb.api.base.Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, "admin", "");
+ CollectionManagementServiceImpl mgr = (CollectionManagementServiceImpl)
+ root.getService("CollectionManagementService", "1.0");
+ mgr.removeCollection(XmldbURI.create("test"));
+ mgr.removeCollection(XmldbURI.create("test2"));
+ }
protected BrokerPool startDB() {
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 21:04:34
|
Revision: 4758
http://svn.sourceforge.net/exist/?rev=4758&view=rev
Author: wolfgang_m
Date: 2006-10-30 13:04:26 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
/trunk/eXist is now the main line of development. /trunk/eXist-1.0 is discontinued
Added Paths:
-----------
trunk/eXist/
Copied: trunk/eXist (from rev 4757, trunk/eXist-1.0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 20:48:46
|
Revision: 4757
http://svn.sourceforge.net/exist/?rev=4757&view=rev
Author: wolfgang_m
Date: 2006-10-30 12:48:36 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Copying branches/DLN/eXist-1.0/src into trunk as new src/ directory.
Added Paths:
-----------
trunk/eXist-1.0/src/
Copied: trunk/eXist-1.0/src (from rev 4756, branches/DLN/eXist-1.0/src)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 20:46:25
|
Revision: 4756
http://svn.sourceforge.net/exist/?rev=4756&view=rev
Author: wolfgang_m
Date: 2006-10-30 12:46:20 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Deleted old src/ directory in trunk. To be replaced with branches/DLN/eXist-1.0/src.
Removed Paths:
-------------
trunk/eXist-1.0/src/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 20:27:29
|
Revision: 4755
http://svn.sourceforge.net/exist/?rev=4755&view=rev
Author: wolfgang_m
Date: 2006-10-30 12:27:18 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Moving 1.0 trunk to branches/eXist-1.0.
Added Paths:
-----------
branches/eXist-1.0/
Copied: branches/eXist-1.0 (from rev 4754, trunk/eXist-1.0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 20:23:09
|
Revision: 4754
http://svn.sourceforge.net/exist/?rev=4754&view=rev
Author: wolfgang_m
Date: 2006-10-30 12:22:56 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Imported revisions 4723 to 4751 from DLN branch. This is the final sync before moving trunk to a branch
Modified Paths:
--------------
trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java
trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java
trunk/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java
Modified: trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java 2006-10-30 20:05:51 UTC (rev 4753)
+++ trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java 2006-10-30 20:22:56 UTC (rev 4754)
@@ -1,23 +1,21 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * Extended and slightly adopted version of the original XMLDBSource found in Apache Cocoon.
+ * The original license is:
+ *
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.cocoon;
Modified: trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java 2006-10-30 20:05:51 UTC (rev 4753)
+++ trunk/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java 2006-10-30 20:22:56 UTC (rev 4754)
@@ -1,23 +1,21 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * Extended and slightly adopted version of the original XMLDBSource found in Apache Cocoon.
+ * The original license is:
+ *
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.cocoon;
Modified: trunk/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java 2006-10-30 20:05:51 UTC (rev 4753)
+++ trunk/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java 2006-10-30 20:22:56 UTC (rev 4754)
@@ -996,7 +996,7 @@
// @see http://sourceforge.net/tracker/index.php?func=detail&aid=1488303&group_id=17691&atid=117691
- public void bugtestPredicateBUG1488303() throws Exception {
+ public void testPredicateBUG1488303() throws Exception {
XQueryService service = getQueryService();
ResourceSet rs=null;
@@ -1079,7 +1079,7 @@
*
* @see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestPredicateBUG_wiki_1() throws Exception {
+ public void testPredicateBUG_wiki_1() throws Exception {
String xQuery = "let $dum := <dummy><el>1</el><el>2</el></dummy> return $dum/el[2]";
XQueryService service = getQueryService();
@@ -1118,7 +1118,7 @@
* @see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestVirtualNodesetBUG_wiki_3() {
+ public void testVirtualNodesetBUG_wiki_3() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $node := (<c id=\"OK\"><b id=\"cool\"/></c>)"
+"/descendant::*/attribute::id return <a>{$node}</a>";
@@ -1141,7 +1141,7 @@
*
*@see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestVirtualNodesetBUG_wiki_4() {
+ public void testVirtualNodesetBUG_wiki_4() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $node := (<c id=\"OK\">"
+"<b id=\"cool\"/></c>)/descendant-or-self::*/child::b "
@@ -1165,7 +1165,7 @@
*
*@see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestVirtualNodesetBUG_wiki_5() {
+ public void testVirtualNodesetBUG_wiki_5() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $node := (<c id=\"OK\"><b id=\"cool\"/>"
+"</c>)/descendant-or-self::*/descendant::b return <a>{$node}</a>";
@@ -1223,7 +1223,7 @@
* Miscomputation of the expression context in where clause when no
* wrapper expression is used. Using, e.g. where data($x/@id) eq "id" works !
*/
- public void bugtestComputationBug_wiki_8() {
+ public void testComputationBug_wiki_8() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $a := element node1 { attribute id {'id'}, "
+"element node1 { '1'},element node2 { '2'} }"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 20:23:08
|
Revision: 4753
http://svn.sourceforge.net/exist/?rev=4753&view=rev
Author: wolfgang_m
Date: 2006-10-30 12:05:51 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Deleted old branch.
Removed Paths:
-------------
branches/IR_Framework/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-30 19:56:16
|
Revision: 4752
http://svn.sourceforge.net/exist/?rev=4752&view=rev
Author: wolfgang_m
Date: 2006-10-30 11:56:00 -0800 (Mon, 30 Oct 2006)
Log Message:
-----------
Imported revisions 4723 to 4746 from trunk.
Modified Paths:
--------------
branches/DLN/eXist-1.0/src/org/exist/http/SOAPServer.java
branches/DLN/eXist-1.0/src/org/exist/http/test/RESTServiceTest.java
branches/DLN/eXist-1.0/src/org/exist/xquery/ExternalModuleImpl.java
Modified: branches/DLN/eXist-1.0/src/org/exist/http/SOAPServer.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/http/SOAPServer.java 2006-10-28 15:34:44 UTC (rev 4751)
+++ branches/DLN/eXist-1.0/src/org/exist/http/SOAPServer.java 2006-10-30 19:56:00 UTC (rev 4752)
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: RESTServer.java 3567 2006-05-19 13:37:34 +0000 (Fri, 19 May 2006) wolfgang_m $
+ * $Id$
*/
package org.exist.http;
@@ -89,6 +89,21 @@
/**
* @author Adam Retter (ada...@de...)
+ *
+ * @serial 20061025T00:17:00
+ *
+ * The SOAPServer allows Web Services to be written in XQuery; it translates a
+ * SOAP Request to an XQuery function call and then translates the result of the
+ * XQuery function to a SOAP Response.
+ *
+ * This is done by managing an internal representation of an XQWS (XQuery Web Service),
+ * through this it is able to provide enough information to an XSLT proccessor to
+ * generate WSDL and human readable descriptions of the web service and individual
+ * functions.
+ *
+ * XSLT's are provided for document-oriented Web Service's and are located
+ * in $EXIST_HOME/tools/SOAPServer
+ *
*/
public class SOAPServer
{
@@ -216,14 +231,15 @@
*/
private CompiledXQuery XQueryExecuteXQWSFunction(DBBroker broker, Node xqwsSOAPFunction, XQWSDescription xqwsDescription, HttpServletRequest request, HttpServletResponse response) throws XPathException
{
- String query = "xquery version \"1.0\";" + SEPERATOR;
- query += SEPERATOR;
- query += "import module namespace " + xqwsDescription.getNamespace().getLocalName() + "=\"" + xqwsDescription.getNamespace().getNamespaceURI() + "\" at \"" + xqwsDescription.getFileURI().toString() + "\";" + SEPERATOR;
- query += SEPERATOR;
+ StringBuffer query = new StringBuffer();
+ query.append("xquery version \"1.0\";" + SEPERATOR);
+ query.append(SEPERATOR);
+ query.append("import module namespace " + xqwsDescription.getNamespace().getLocalName() + "=\"" + xqwsDescription.getNamespace().getNamespaceURI() + "\" at \"" + xqwsDescription.getFileURI().toString() + "\";" + SEPERATOR);
+ query.append(SEPERATOR);
//add the function call to the xquery
String functionName = xqwsSOAPFunction.getNodeName();
- query += xqwsDescription.getNamespace().getLocalName() + ":" + functionName + "(";
+ query.append(xqwsDescription.getNamespace().getLocalName() + ":" + functionName + "(");
//add the arguments for the function call if any
NodeList xqwsSOAPFunctionParams = xqwsSOAPFunction.getChildNodes();
@@ -236,21 +252,23 @@
Node nSOAPFunctionParam = xqwsSOAPFunctionParams.item(i);
if(nSOAPFunctionParam.getNodeType() == Node.ELEMENT_NODE)
{
- query += writeXQueryFunctionParameter(xqwsDescription.getFunctionParameterType(nlInternalFunctionParams.item(j)), xqwsDescription.getFunctionParameterCardinality(nlInternalFunctionParams.item(j)), nSOAPFunctionParam.getFirstChild().getNodeValue());
+ query.append(writeXQueryFunctionParameter(xqwsDescription.getFunctionParameterType(nlInternalFunctionParams.item(j)), xqwsDescription.getFunctionParameterCardinality(nlInternalFunctionParams.item(j)), nSOAPFunctionParam));
+ query.append(","); //add function seperator
- //add a comma if this isnt the last parameter
- if(j != nlInternalFunctionParams.getLength()-1)
- {
- query += ",";
- }
j++;
}
}
- query += ")";
+ //remove last superflurous seperator
+ if(query.charAt(query.length()-1) == ',')
+ {
+ query.deleteCharAt(query.length()-1);
+ }
+ query.append(")");
+
//compile the query
- return compileXQuery(broker, new StringSource(query), new XmldbURI[] { xqwsDescription.getCollectionURI() }, xqwsDescription.getCollectionURI(), request, response);
+ return compileXQuery(broker, new StringSource(query.toString()), new XmldbURI[] { xqwsDescription.getCollectionURI() }, xqwsDescription.getCollectionURI(), request, response);
}
/**
@@ -262,7 +280,7 @@
*
* @return A String representation of the parameter, suitable for use in the function call
*/
- private String writeXQueryFunctionParameter(String paramType, int paramCardinality, String strSOAPParamValue) throws XPathException
+ private String writeXQueryFunctionParameter(String paramType, int paramCardinality, Node nSOAPParam) throws XPathException
{
String prefix = new String();
String postfix = new String();
@@ -294,8 +312,45 @@
default:
}
-
- return prefix + strSOAPParamValue + postfix;
+
+ //determine the cardinality of the parameter
+ if(paramCardinality >= Cardinality.MANY)
+ {
+ //sequence
+ StringBuffer param = new StringBuffer();
+
+ param.append("(");
+
+ NodeList nlParamSequenceItems = nSOAPParam.getChildNodes();
+ for(int i=0; i < nlParamSequenceItems.getLength(); i++)
+ {
+ Node nParamSeqItem = nlParamSequenceItems.item(i);
+ if(nParamSeqItem.getNodeType() == Node.ELEMENT_NODE)
+ {
+ param.append(prefix);
+ param.append(nParamSeqItem.getFirstChild().getNodeValue());
+ param.append(postfix);
+
+ param.append(","); //seperator for next item in sequence
+
+ }
+ }
+
+ //remove last superflurous seperator
+ if(param.charAt(param.length()-1) == ',')
+ {
+ param.deleteCharAt(param.length()-1);
+ }
+
+ param.append(")");
+
+ return param.toString();
+ }
+ else
+ {
+ //atomic value
+ return prefix + nSOAPParam.getFirstChild().getNodeValue() + postfix;
+ }
}
/**
@@ -1159,7 +1214,7 @@
* <path/>
* <URL/>
* <functions>
- * @see org.exist.http.SOAPServer#describeWebServiceFunction(org.exist.xquery.FunctionSignature, org.exist.memtree.MemTreeBuilder)
+ * <function/> { unbounded } { @see org.exist.http.SOAPServer#describeWebServiceFunction(org.exist.xquery.FunctionSignature, org.exist.memtree.MemTreeBuilder) }
* </functions>
* </webservice>
*
@@ -1224,7 +1279,7 @@
* <name/>
* <description/>
* <parameters>
- * <parameter>
+ * <parameter> { unbounded }
* <name/>
* <type/>
* <cardinality/>
@@ -1233,7 +1288,14 @@
* <return>
* <type/>
* <cardinality/>
- * <result/> //Only displayed if this is after the function has been executed
+ * <result> { Only displayed if this is after the function has been executed }
+ * either {
+ * <value/> or
+ * <sequence>
+ * <value/> { unbounded }
+ * </sequence>
+ * }
+ * </result>
* </return>
* </function>
*
@@ -1275,16 +1337,37 @@
builderFunction.startElement(new QName("type",null, null), null);
builderFunction.characters(Type.getTypeName(signature.getReturnType().getPrimaryType()));
builderFunction.endElement();
+ int iReturnCardinality = signature.getReturnType().getCardinality();
builderFunction.startElement(new QName("cardinality",null, null), null);
- builderFunction.characters(Integer.toString(signature.getReturnType().getCardinality()));
+ builderFunction.characters(Integer.toString(iReturnCardinality));
builderFunction.endElement();
if(functionResult != null)
{
builderFunction.startElement(new QName("result", null, null), null);
-
- //TODO: this will work for a single string result, but need to add much more logic for other types and complex cardinalities
- builderFunction.characters(functionResult.itemAt(0).getStringValue());
+ //determine result cardinality
+ if(iReturnCardinality >= Cardinality.MANY)
+ {
+ //sequence of values
+ builderFunction.startElement(new QName("sequence", null, null), null);
+
+ for(int i=0; i < functionResult.getLength(); i++)
+ {
+ builderFunction.startElement(new QName("value", null, null), null);
+ builderFunction.characters(functionResult.itemAt(i).getStringValue());
+ builderFunction.endElement();
+ }
+
+ builderFunction.endElement();
+ }
+ else
+ {
+ //atomic value
+ builderFunction.startElement(new QName("value", null, null), null);
+ builderFunction.characters(functionResult.itemAt(0).getStringValue());
+ builderFunction.endElement();
+ }
+
builderFunction.endElement();
}
builderFunction.endElement();
Modified: branches/DLN/eXist-1.0/src/org/exist/http/test/RESTServiceTest.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/http/test/RESTServiceTest.java 2006-10-28 15:34:44 UTC (rev 4751)
+++ branches/DLN/eXist-1.0/src/org/exist/http/test/RESTServiceTest.java 2006-10-30 19:56:00 UTC (rev 4752)
@@ -91,6 +91,19 @@
"return\n" +
" ($param, ' ', $t:VAR)";
+ private final static String TEST_XQUERY_PARAMETER =
+ "xquery version \"1.0\";\n" +
+ "declare namespace request=\"http://exist-db.org/xquery/request\";\n" +
+ "import module namespace requestparametermod=\"http://exist-db.org/xquery/requestparametermod\" at \"requestparametermod.xqm\";\n" +
+ "concat(\"xql=\", request:get-parameter(\"doc\",())),\n" +
+ "concat(\"xqm=\", $requestparametermod:request)";
+
+ private final static String TEST_XQUERY_PARAMETER_MODULE =
+ "module namespace requestparametermod = \"http://exist-db.org/xquery/requestparametermod\";\n" +
+ "declare namespace request=\"http://exist-db.org/xquery/request\";\n" +
+ "declare variable $requestparametermod:request { request:get-parameter(\"doc\",())};\n";
+
+
private String credentials;
public RESTServiceTest(String name) {
@@ -275,6 +288,51 @@
fail(e.getMessage());
}
}
+
+ public void testRequestGetParameterFromModule()
+ {
+ try
+ {
+ /* store the documents that we need for this test */
+ System.out.println("--- Storing xquery and module ---");
+ doPut(TEST_XQUERY_PARAMETER, "requestparameter.xql");
+ doPut(TEST_XQUERY_PARAMETER_MODULE, "requestparametermod.xqm");
+
+ /* execute the stored xquery a few times */
+ HttpURLConnection connect;
+ int iHttpResult;
+ for(int i=0; i < 5; i++)
+ {
+ System.out.println("--- Executing stored xquery, iteration=" + i + " ---");
+ connect = getConnection(COLLECTION_URI + "/requestparameter.xql?doc=somedoc" + i);
+ connect.setRequestMethod("GET");
+ connect.connect();
+
+ iHttpResult = connect.getResponseCode();
+ assertEquals("Server returned response code " + iHttpResult, 200, iHttpResult);
+ String contentType = connect.getContentType();
+ int semicolon = contentType.indexOf(';');
+ if (semicolon > 0) {
+ contentType = contentType.substring(0, semicolon).trim();
+ }
+ assertEquals("Server returned content type " + contentType, "text/html", contentType);
+
+ //get the response of the query
+ String response = readResponse(connect.getInputStream());
+
+ String strXQLRequestParameter = response.substring("xql=".length(), response.indexOf("xqm="));
+ String strXQMRequestParameter = response.substring(response.indexOf("xqm=") + "xqm=".length(), response.lastIndexOf("\r\n"));
+
+ //check the responses
+ assertEquals("XQuery Request Parameter is: \"" + strXQLRequestParameter + "\" expected: \"somedoc"+i + "\"", "somedoc"+i, strXQLRequestParameter);
+ assertEquals("XQuery Module Request Parameter is: \"" + strXQMRequestParameter + "\" expected: \"somedoc"+i + "\"", "somedoc"+i, strXQMRequestParameter);
+ }
+ }
+ catch(Exception e)
+ {
+ fail(e.getMessage());
+ }
+ }
public void testStoredQuery() {
try {
Modified: branches/DLN/eXist-1.0/src/org/exist/xquery/ExternalModuleImpl.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/xquery/ExternalModuleImpl.java 2006-10-28 15:34:44 UTC (rev 4751)
+++ branches/DLN/eXist-1.0/src/org/exist/xquery/ExternalModuleImpl.java 2006-10-30 19:56:00 UTC (rev 4752)
@@ -184,6 +184,7 @@
}
public void reset() {
- mContext.reset();
- }
+ mContext.reset();
+ mStaticVariables.clear();
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2006-10-28 15:34:55
|
Revision: 4751
http://svn.sourceforge.net/exist/?rev=4751&view=rev
Author: wolfgang_m
Date: 2006-10-28 08:34:44 -0700 (Sat, 28 Oct 2006)
Log Message:
-----------
Modified source files should preserve the original Apache license header.
Modified Paths:
--------------
branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java
branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java
Modified: branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java 2006-10-27 18:14:52 UTC (rev 4750)
+++ branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSource.java 2006-10-28 15:34:44 UTC (rev 4751)
@@ -1,23 +1,21 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * Extended and slightly adopted version of the original XMLDBSource found in Apache Cocoon.
+ * The original license is:
+ *
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.cocoon;
Modified: branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java 2006-10-27 18:14:52 UTC (rev 4750)
+++ branches/DLN/eXist-1.0/src/org/exist/cocoon/XMLDBSourceFactory.java 2006-10-28 15:34:44 UTC (rev 4751)
@@ -1,23 +1,21 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * Extended and slightly adopted version of the original XMLDBSource found in Apache Cocoon.
+ * The original license is:
+ *
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.cocoon;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-27 18:15:03
|
Revision: 4750
http://svn.sourceforge.net/exist/?rev=4750&view=rev
Author: dizzzz
Date: 2006-10-27 11:14:52 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
uncommented bugtest methods (6x) for regression
Modified Paths:
--------------
branches/DLN/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java
Modified: branches/DLN/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java 2006-10-27 16:11:46 UTC (rev 4749)
+++ branches/DLN/eXist-1.0/src/org/exist/xquery/test/XPathQueryTest.java 2006-10-27 18:14:52 UTC (rev 4750)
@@ -997,7 +997,7 @@
// @see http://sourceforge.net/tracker/index.php?func=detail&aid=1488303&group_id=17691&atid=117691
- public void bugtestPredicateBUG1488303() throws Exception {
+ public void testPredicateBUG1488303() throws Exception {
XQueryService service = getQueryService();
ResourceSet rs=null;
@@ -1080,7 +1080,7 @@
*
* @see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestPredicateBUG_wiki_1() throws Exception {
+ public void testPredicateBUG_wiki_1() throws Exception {
String xQuery = "let $dum := <dummy><el>1</el><el>2</el></dummy> return $dum/el[2]";
XQueryService service = getQueryService();
@@ -1119,7 +1119,7 @@
* @see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestVirtualNodesetBUG_wiki_3() {
+ public void testVirtualNodesetBUG_wiki_3() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $node := (<c id=\"OK\"><b id=\"cool\"/></c>)"
+"/descendant::*/attribute::id return <a>{$node}</a>";
@@ -1142,7 +1142,7 @@
*
*@see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestVirtualNodesetBUG_wiki_4() {
+ public void testVirtualNodesetBUG_wiki_4() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $node := (<c id=\"OK\">"
+"<b id=\"cool\"/></c>)/descendant-or-self::*/child::b "
@@ -1166,7 +1166,7 @@
*
*@see http://wiki.exist-db.org/space/XQueryBugs
*/
- public void bugtestVirtualNodesetBUG_wiki_5() {
+ public void testVirtualNodesetBUG_wiki_5() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $node := (<c id=\"OK\"><b id=\"cool\"/>"
+"</c>)/descendant-or-self::*/descendant::b return <a>{$node}</a>";
@@ -1224,7 +1224,7 @@
* Miscomputation of the expression context in where clause when no
* wrapper expression is used. Using, e.g. where data($x/@id) eq "id" works !
*/
- public void bugtestComputationBug_wiki_8() {
+ public void testComputationBug_wiki_8() {
String xQuery = "declare option exist:serialize \"method=xml indent=no\"; "
+"let $a := element node1 { attribute id {'id'}, "
+"element node1 { '1'},element node2 { '2'} }"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <br...@us...> - 2006-10-27 16:11:57
|
Revision: 4749
http://svn.sourceforge.net/exist/?rev=4749&view=rev
Author: brihaye
Date: 2006-10-27 09:11:46 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
Added the system time when the XQTS tests are executed.
Added an ugly formula to compute the total execution time (problems with min()/max() ?)
Modified Paths:
--------------
trunk/eXist-1.0/webapp/xqts/collectresults.xql
trunk/eXist-1.0/webapp/xqts/xqts.xql
Modified: trunk/eXist-1.0/webapp/xqts/collectresults.xql
===================================================================
--- trunk/eXist-1.0/webapp/xqts/collectresults.xql 2006-10-27 11:28:48 UTC (rev 4748)
+++ trunk/eXist-1.0/webapp/xqts/collectresults.xql 2006-10-27 16:11:46 UTC (rev 4749)
@@ -65,7 +65,8 @@
<p>No unusual comparisons</p>
</comparison>
<otherComments>
- <p>The test run took n seconds.</p>
+ <p>The test run took {let $b := for $a in $cases//@dateRun order by xs:time($a) return xs:time($a)
+return ($b[last()] - $b[1]) div xs:dayTimeDuration('PT1S')} seconds.</p>
</otherComments>
</test-run>
Modified: trunk/eXist-1.0/webapp/xqts/xqts.xql
===================================================================
--- trunk/eXist-1.0/webapp/xqts/xqts.xql 2006-10-27 11:28:48 UTC (rev 4748)
+++ trunk/eXist-1.0/webapp/xqts/xqts.xql 2006-10-27 16:11:46 UTC (rev 4749)
@@ -124,7 +124,7 @@
declare function xqts:print-result($test-name as xs:string, $passed as xs:boolean, $query as xs:string,
$result as item()*, $expected as item()*, $case as element(catalog:test-case)) as element() {
- <test-case name="{$test-name}" result="{if ($passed) then 'pass' else 'fail'}">
+ <test-case name="{$test-name}" result="{if ($passed) then 'pass' else 'fail'}" dateRun="{util:system-time()}">
{
if (not($passed)) then (
<result>{$result}</result>,
@@ -156,7 +156,7 @@
return
(: Expected an error, but got a result :)
if (exists($case/catalog:expected-error)) then
- <test-case name="{$case/@name}" result="fail">
+ <test-case name="{$case/@name}" result="fail" dateRun="{util:system-time()}">
<expected-error>{string-join($case/catalog:expected-error/text(), ";")}</expected-error>
<result>{$result}</result>
<query>{$query}</query>
@@ -178,7 +178,7 @@
return
xqts:print-result($case/@name, $test, $query, $result, $expected, $case),
(: Handle unexpected exceptions :)
- <test-case name="{$case/@name}" result="fail">
+ <test-case name="{$case/@name}" result="fail" dateRun="{util:system-time()}">
<exception>Exception while loading expected result: {$util:exception-message}</exception>
<query>{$query}</query>
</test-case>
@@ -195,7 +195,7 @@
return
xqts:print-result($case/@name, $test, $query, $result, $expected, $case),
(: Handle unexpected exceptions :)
- <test-case name="{$case/@name}" result="fail">
+ <test-case name="{$case/@name}" result="fail" dateRun="{util:system-time()}">
<exception>Exception while loading expected result fragment: {$util:exception-message}</exception>
<query>{$query}</query>
</test-case>
@@ -247,15 +247,15 @@
return
xqts:check-output($query, $result, $testCase),
if ($testCase//catalog:expected-error) then
- <test-case name="{$testCase/@name}" result="pass">
+ <test-case name="{$testCase/@name}" result="pass" dateRun="{util:system-time()}">
<exception>{$util:exception-message}</exception>
<expected-error>{string-join($testCase//catalog:expected-error/text(),";")}</expected-error>
<query>{$query}</query>
</test-case>
else
- <test-case name="{$testCase/@name}" result="fail">
+ <test-case name="{$testCase/@name}" result="fail" dateRun="{util:system-time()}">
<exception>{$util:exception-message}</exception>
- (: TODO : insert expected result here :)
+ <!-- TODO : insert expected result here -->
<query>{$query}</query>
</test-case>
)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-27 11:29:01
|
Revision: 4748
http://svn.sourceforge.net/exist/?rev=4748&view=rev
Author: dizzzz
Date: 2006-10-27 04:28:48 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
Made output of collectresults more useable for w3c website
Modified Paths:
--------------
trunk/eXist-1.0/webapp/xqts/collectresults.xql
Modified: trunk/eXist-1.0/webapp/xqts/collectresults.xql
===================================================================
--- trunk/eXist-1.0/webapp/xqts/collectresults.xql 2006-10-27 10:09:58 UTC (rev 4747)
+++ trunk/eXist-1.0/webapp/xqts/collectresults.xql 2006-10-27 11:28:48 UTC (rev 4748)
@@ -1,81 +1,81 @@
declare option exist:serialize "method=xml indent=yes";
declare option exist:output-size-limit "-1";
-declare namespace response="http://exist-db.org/xquery/response";
-declare namespace empty="";
-
+declare namespace response="http://exist-db.org/xquery/response";
+declare namespace empty="";
+
let $product-version := util:system-property("product-version")
let $product-build := util:system-property("product-build")
+let $revision := system:get-revision()
let $test-suite := doc('/db/XQTS/XQTSCatalog.xml')/*:test-suite/@version
let $dummy := response:set-header("Content-Disposition", concat(
"attachment; filename="results_XQTS-" , $test-suite , "_eXist-" ,
- $product-version , '_' , $product-build , ".xml"" ) )
-
-let $cases := fn:collection( '/db/XQTS' )//test-case
+ $product-version , '_' , $product-build , ".xml"" ) )
+
+let $cases := fn:collection( '/db/XQTS' )//test-case
return
-<test-suite-result xmlns="http://www.w3.org/2005/02/query-test-XQTSResult">
- <implementation name="eXist-{$product-version}" version="{$product-build}" anonymous-result-column="false">
+<test-suite-result xmlns="http://www.w3.org/2005/02/query-test-XQTSResult">
+ <implementation name="eXist-db" version="{$product-version} (revision {$revision} {$product-build})" anonymous-result-column="false">
- <organization name="eXist Open Source native XML database" website="http://www.exist-db.org" anonymous="false"/>
+ <organization name="eXist Open Source Native XML database" website="http://www.exist-db.org" anonymous="false"/>
- <submittor name="eXist XQTS testsuite runner" email="eXi...@gm..."/>
+ <submittor name="eXist XQTS testsuite runner" email="eXi...@gm..."/>
- <description>
- <p>eXist is an Open Source native XML database featuring efficient,
- index-based XQuery processing, automatic indexing, extensions for full-text
- search, XUpdate support and tight integration with existing XML development tools.</p>
- </description>
+ <description>
+ <p>eXist is an Open Source native XML database featuring efficient,
+ index-based XQuery processing, automatic indexing, extensions for full-text
+ search, XUpdate support and tight integration with existing XML development tools.</p>
+ </description>
- <implementation-defined-items>
- <!--implementation-defined-item name="implicit timezone" value="Z"/>
- <implementation-defined-item name="DTD validation or schema validation for fn:doc"
- value="schema validation"/-->
- </implementation-defined-items>
+ <implementation-defined-items>
+ <!--implementation-defined-item name="implicit timezone" value="Z"/>
+ <implementation-defined-item name="DTD validation or schema validation for fn:doc"
+ value="schema validation"/-->
+ </implementation-defined-items>
- <features>
-<!-- { for $feature in doc('/db/XQTS/XQTSCatalog.xml')/*:test-suite/*:features/*:feature
- return
- <feature name="{$feature/@name}" supported="true"/> } -->
- <feature name="Minimal Conformance" supported="true"/>
- <feature name="Schema Import" supported="false"/>
- <feature name="Schema Validation" supported="false"/>
- <feature name="Static Typing" supported="false"/>
- <feature name="Static Typing Extensions" supported="false"/>
- <feature name="Full Axis" supported="true"/>
- <feature name="Module" supported="true"/>
- <feature name="Serialization" supported="true"/>
- <feature name="Trivial XML Embedding" supported="false"/>
- </features>
+ <features>
+ <!-- { (: for $feature in doc('/db/XQTS/XQTSCatalog.xml')/*:test-suite/*:features/*:feature return
+ <feature name="{$feature/@name}" supported="true"/> :) } -->
+ <feature name="Minimal Conformance" supported="true"/>
+ <feature name="Schema Import" supported="false"/>
+ <feature name="Schema Validation" supported="false"/>
+ <feature name="Static Typing" supported="false"/>
+ <feature name="Static Typing Extensions" supported="false"/>
+ <feature name="Full Axis" supported="true"/>
+ <feature name="Module" supported="true"/>
+ <feature name="Serialization" supported="true"/>
+ <feature name="Trivial XML Embedding" supported="false"/>
+ </features>
- <context-properties>
- <!--context-property name="Default collation" context-type="static" value="not overwritten"/>
- <context-property name="Statically known namespaces" context-type="static" value="augmented with xmlns:ac='http://www.ac.com/xquery'"/-->
- </context-properties>
+ <context-properties>
+ <!--context-property name="Default collation" context-type="static" value="not overwritten"/>
+ <context-property name="Statically known namespaces" context-type="static" value="augmented with xmlns:ac='http://www.ac.com/xquery'"/-->
+ </context-properties>
- </implementation>
+ </implementation>
- <syntax>XQuery</syntax>
+ <syntax>XQuery</syntax>
- <test-run dateRun="{fn:current-dateTime()}">
- <test-suite version="{$test-suite}"/>
- <transformation>
- <p>No unusual transformations.</p>
- </transformation>
- <comparison>
- <p>No unusual comparisons</p>
- </comparison>
- <otherComments>
- <p>The test run took n seconds.</p>
- </otherComments>
- </test-run>
+ <test-run dateRun="{fn:current-dateTime()}">
+ <test-suite version="{$test-suite}"/>
+ <transformation>
+ <p>No unusual transformations.</p>
+ </transformation>
+ <comparison>
+ <p>No unusual comparisons</p>
+ </comparison>
+ <otherComments>
+ <p>The test run took n seconds.</p>
+ </otherComments>
+ </test-run>
- <!-- Results below here -->
+<!-- Results below here -->
+
{
- (: for $case in fn:collection( '/db/XQTS' )//*:test-case :)
- for $case in $cases
+ for $case in $cases
order by $case/@name
return <test-case name="{$case/@name}" result="{$case/@result}" />
}
</test-suite-result>
-
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-27 10:10:07
|
Revision: 4747
http://svn.sourceforge.net/exist/?rev=4747&view=rev
Author: dizzzz
Date: 2006-10-27 03:09:58 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
Merge of latest "Descriptor" changes from 1.0 to 1.1
Modified Paths:
--------------
branches/DLN/eXist-1.0/src/org/exist/http/RESTServer.java
branches/DLN/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java
Modified: branches/DLN/eXist-1.0/src/org/exist/http/RESTServer.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/http/RESTServer.java 2006-10-26 19:34:56 UTC (rev 4746)
+++ branches/DLN/eXist-1.0/src/org/exist/http/RESTServer.java 2006-10-27 10:09:58 UTC (rev 4747)
@@ -293,12 +293,9 @@
else
{
//we are not allowed to show the source - query not allowed in descriptor.xml
- //TODO: is this the correct exception to throw or should we return a http response?
- //DWES: this must be a 403 !!!
- //response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
- throw new PermissionDeniedException("Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+ return;
}
-
}
else
{
Modified: branches/DLN/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java 2006-10-26 19:34:56 UTC (rev 4746)
+++ branches/DLN/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java 2006-10-27 10:09:58 UTC (rev 4747)
@@ -26,7 +26,6 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
-import java.net.URI;
import java.net.URISyntaxException;
import javax.servlet.ServletConfig;
@@ -248,11 +247,9 @@
output.flush();
return;
} else {
- //we are not allowed to show the source - query not allowed in descriptor.xml
- //TODO: is this the correct exception to throw or should we return a http response?
- //DWES: this must be a 403 !!!
- //response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");return;
- throw new ServletException("Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+ return;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <del...@us...> - 2006-10-26 19:35:15
|
Revision: 4746
http://svn.sourceforge.net/exist/?rev=4746&view=rev
Author: deliriumsky
Date: 2006-10-26 12:34:56 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Throw the 403 for descriptor when source viewing is not allowed instead of 500. Thanks Dannes :-)
Modified Paths:
--------------
trunk/eXist-1.0/src/org/exist/http/RESTServer.java
trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java
Modified: trunk/eXist-1.0/src/org/exist/http/RESTServer.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/http/RESTServer.java 2006-10-26 19:18:13 UTC (rev 4745)
+++ trunk/eXist-1.0/src/org/exist/http/RESTServer.java 2006-10-26 19:34:56 UTC (rev 4746)
@@ -293,12 +293,9 @@
else
{
//we are not allowed to show the source - query not allowed in descriptor.xml
- //TODO: is this the correct exception to throw or should we return a http response?
- //DWES: this must be a 403 !!!
- //response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
- throw new PermissionDeniedException("Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+ return;
}
-
}
else
{
Modified: trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java 2006-10-26 19:18:13 UTC (rev 4745)
+++ trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java 2006-10-26 19:34:56 UTC (rev 4746)
@@ -26,7 +26,6 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
-import java.net.URI;
import java.net.URISyntaxException;
import javax.servlet.ServletConfig;
@@ -248,11 +247,9 @@
output.flush();
return;
} else {
- //we are not allowed to show the source - query not allowed in descriptor.xml
- //TODO: is this the correct exception to throw or should we return a http response?
- //DWES: this must be a 403 !!!
- //response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");return;
- throw new ServletException("Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+
+ response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
+ return;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <del...@us...> - 2006-10-26 19:18:26
|
Revision: 4745
http://svn.sourceforge.net/exist/?rev=4745&view=rev
Author: deliriumsky
Date: 2006-10-26 12:18:13 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Fix for mapping path and add sandbox to the list of viewable source by default
Modified Paths:
--------------
trunk/eXist-1.0/descriptor.xml.tmpl
Modified: trunk/eXist-1.0/descriptor.xml.tmpl
===================================================================
--- trunk/eXist-1.0/descriptor.xml.tmpl 2006-10-26 17:59:09 UTC (rev 4744)
+++ trunk/eXist-1.0/descriptor.xml.tmpl 2006-10-26 19:18:13 UTC (rev 4745)
@@ -27,7 +27,9 @@
BEWARE the security consequences of enabling this for your queries!
REST XQuery paths (EXistServlet/RESTServer) start from the db location e.g. /db/mycollection/myquery.xql
- FileSystem XQuery paths (XQueryServlet) start from the root filesystem location e.g. $EXIST_HOME/webapp/myapp/myquery.xql and end with a .xql suffix
+ FileSystem XQuery paths (XQueryServlet) start from the root filesystem location e.g. $EXIST_HOME/webapp/myapp/myquery.xql
+ and end with a .xql suffix. However ${WEBAPP_HOME} may be used for convenience to represent eXist's webapp folder without
+ the need to know the specific path.
Cocoon XQuery Paths (XQueryGenerator) are not yet supported!
-->
@@ -35,6 +37,7 @@
<!-- NB - Not Yet Supported -->
<!-- Allow viewing of Source for eXist XQuery examples (XQueryServlet) -->
+ <xquery path="${WEBAPP_HOME}/sandbox/sandbox.xql"/>
<xquery path="${WEBAPP_HOME}/xquery/guess.xql"/>
<xquery path="${WEBAPP_HOME}/xquery/transform.xql"/>
<xquery path="${WEBAPP_HOME}/xquery/login.xql"/>
@@ -53,7 +56,7 @@
-->
<!-- Maps the virtual fibo.xql to fibo.xq. Here the XQueryServlet executes what would normally be executed by XQueryGenerator -->
- <map path="${WEBAPP_HOME}/xquery/fibo.xql" view="${WEBAPP_HOME}/webapp/xquery/fibo.xq"/>
+ <map path="${WEBAPP_HOME}/xquery/fibo.xql" view="${WEBAPP_HOME}/xquery/fibo.xq"/>
<!-- Default Document like example for REST
<map path="/db/myCollection" view="/db/myCollection/index.xql"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-26 17:59:26
|
Revision: 4744
http://svn.sourceforge.net/exist/?rev=4744&view=rev
Author: dizzzz
Date: 2006-10-26 10:59:09 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Merged descriptor code from 1.1 to 1.0 ; should work under win32 now
Modified Paths:
--------------
trunk/eXist-1.0/src/org/exist/http/Descriptor.java
trunk/eXist-1.0/src/org/exist/http/RESTServer.java
trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java
trunk/eXist-1.0/src/org/exist/util/Configuration.java
trunk/eXist-1.0/src/org/exist/webstart/JnlpHelper.java
trunk/eXist-1.0/src/org/exist/xmldb/RemoteCollection.java
trunk/eXist-1.0/src/org/exist/xquery/test/XQueryTest.java
Modified: trunk/eXist-1.0/src/org/exist/http/Descriptor.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/http/Descriptor.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/http/Descriptor.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -64,17 +64,15 @@
public class Descriptor implements ErrorHandler
{
private static final String SYSTEM_LINE_SEPARATOR = System.getProperty("line.separator");
- private final static String EXIST_HOME_VAR_NAME = "${EXIST_HOME}";
-
//References
private static Descriptor singletonRef;
private final static Logger LOG = Logger.getLogger(Descriptor.class); //Logger
/** descriptor file (descriptor.xml) */
private final static String file = "descriptor.xml";
-
+
//Data
private BufferedWriter bufWriteReplayLog = null; //Should a replay log of requests be created
- private String allowSourceXQueryList[] = null; //Array of xql files to allow source to be viewed
+ private String allowSourceXQueryList[] = null; //Array of xql files to allow source to be viewed
private String mapList[][] = null; //Array of Mappings
/**
@@ -213,14 +211,9 @@
LOG.warn("Error element 'xquery' requires an attribute 'path'");
return;
}
-
- //Does the path contain ${EXIST_HOME}?
- if(path.startsWith(EXIST_HOME_VAR_NAME))
- {
- //Replace ${EXIST_HOME} with the actual path
- path = Configuration.getExistHome().getAbsolutePath() + path.substring(EXIST_HOME_VAR_NAME.length());
- }
-
+ path=path.replaceAll("\\$\\{WEBAPP_HOME\\}",
+ Configuration.getWebappHome().getAbsolutePath().replace('\\','/') );
+
//store the path
allowSourceXQueryList[i] = path;
}
@@ -256,29 +249,19 @@
{
LOG.warn("Error element 'map' requires an attribute 'path' or an attribute 'pattern'");
return;
- }
+ }
+ path=path.replaceAll("\\$\\{WEBAPP_HOME\\}",
+ Configuration.getWebappHome().getAbsolutePath().replace('\\','/') );
- //Does the path contain $EXIST_HOME?
- if(path.startsWith(EXIST_HOME_VAR_NAME))
- {
- //Replace $EXIST_HOME with the actual path
- path = Configuration.getExistHome().getAbsolutePath() + path.substring(EXIST_HOME_VAR_NAME.length());
- }
-
//must be a view to map to
if(view == null)
{
LOG.warn("Error element 'map' requires an attribute 'view'");
return;
}
+ view=view.replaceAll("\\$\\{WEBAPP_HOME\\}",
+ Configuration.getWebappHome().getAbsolutePath().replace('\\','/') );
- //Does the view contain $EXIST_HOME?
- if(view.startsWith(EXIST_HOME_VAR_NAME))
- {
- //Replace $EXIST_HOME with the actual path
- view = Configuration.getExistHome().getAbsolutePath() + view.substring(EXIST_HOME_VAR_NAME.length());
- }
-
//store what to map from
/* if(path != null)
{*/
@@ -311,6 +294,9 @@
//Iterate through the xqueries that source viewing is allowed for
for(int i = 0; i < allowSourceXQueryList.length; i++)
{
+ // DWES: this helps a lot. quickfix not the final solution
+ path=path.replace('\\','/');
+
//does the path match the <allow-source><xquery path=""/></allow-source> path
if((allowSourceXQueryList[i].equals(path)) || (path.indexOf(allowSourceXQueryList[i]) > -1))
{
Modified: trunk/eXist-1.0/src/org/exist/http/RESTServer.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/http/RESTServer.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/http/RESTServer.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -294,6 +294,8 @@
{
//we are not allowed to show the source - query not allowed in descriptor.xml
//TODO: is this the correct exception to throw or should we return a http response?
+ //DWES: this must be a 403 !!!
+ //response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
throw new PermissionDeniedException("Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
}
Modified: trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/http/servlets/XQueryServlet.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -238,6 +238,7 @@
//show the source
//check are we allowed to show the xquery source - descriptor.xml
+// System.out.println("path="+path);
if(descriptor.allowSourceXQuery(path)) {
//Show the source of the XQuery
//writeResourceAs(resource, broker, stylesheet, encoding, "text/plain", outputProperties, response);
@@ -249,6 +250,8 @@
} else {
//we are not allowed to show the source - query not allowed in descriptor.xml
//TODO: is this the correct exception to throw or should we return a http response?
+ //DWES: this must be a 403 !!!
+ //response.sendError(HttpServletResponse.SC_FORBIDDEN, "Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");return;
throw new ServletException("Permission to view XQuery source for: " + path + " denied. Must be explicitly defined in descriptor.xml");
}
}
@@ -346,7 +349,7 @@
private void sendError(PrintWriter out, String message, XMLDBException e) {
out.print("<html><head>");
out.print("<title>XQueryServlet Error</title>");
- out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"error.css\"></head>");
+ out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"error.css\"></link></head>");
out.print("<body><div id=\"container\"><h1>Error found</h1>");
Throwable t = e.getCause();
if (t instanceof XPathException) {
@@ -370,7 +373,7 @@
private void sendError(PrintWriter out, String message, String description) {
out.print("<html><head>");
out.print("<title>XQueryServlet Error</title>");
- out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"error.css\"></head>");
+ out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"error.css\"></link></head>");
out.println("<body><h1>Error found</h1>");
out.print("<div class='message'><b>Message: </b>");
out.print(message);
Modified: trunk/eXist-1.0/src/org/exist/util/Configuration.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/util/Configuration.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/util/Configuration.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -1114,9 +1114,61 @@
existHome = null;
return existHome;
- }
+ }
/**
+ * Check wether exist runs in Servlet container (as war file).
+ * @return TRUE if exist runs in servlet container.
+ */
+ public static boolean isInWarFile(){
+
+ boolean retVal =true;
+
+ // if existHome is not set,try to do so.
+ if (existHome == null){
+ getExistHome();
+ }
+
+ if( new File(existHome, "lib/core").isDirectory() ) {
+ retVal=false;
+ }
+ return retVal;
+ }
+
+ /**
+ * Get folder in which the exist webapplications are found.
+ * For default install ("jar install") and in webcontainer ("war install")
+ * the location is different. (EXIST_HOME/webapps vs. TOMCAT/webapps/exist)
+ *
+ * @return folder.
+ */
+ public static File getWebappHome(){
+
+ File webappFolder =null;
+
+ // if existHome is not set,try to do so.
+ if (existHome == null){
+ getExistHome();
+ }
+
+ if(isInWarFile()){
+ webappFolder= new File(existHome, "..");
+ } else {
+ webappFolder= new File(existHome, "webapp");
+ }
+
+ // convert to real path
+ try {
+ File tmpFolder = webappFolder.getCanonicalFile();
+ webappFolder=tmpFolder;
+ } catch (IOException ex) {
+ // oops ; use previous path
+ }
+
+ return webappFolder;
+ }
+
+ /**
* Returns <code>true</code> if the directory <code>dir</code> contains a file
* named <tt>conf.xml</tt>.
*
Modified: trunk/eXist-1.0/src/org/exist/webstart/JnlpHelper.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/webstart/JnlpHelper.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/webstart/JnlpHelper.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -44,37 +44,38 @@
public JnlpHelper() {
// Setup path based on installation (in jetty, container)
- if(isInWarFile()){
+ if(Configuration.isInWarFile()){
// all files mixed in existHome/lib/
logger.debug("eXist is running in container (.war).");
coreJarsFolder= new File(existHome, "lib/");
existJarFolder= new File(existHome, "lib/");
- webappFolder= new File(existHome, "..");
} else {
// all files located in existHome/lib/core/
logger.debug("eXist is running private jetty server.");
coreJarsFolder= new File(existHome, "lib/core");
existJarFolder= existHome;
- webappFolder= new File(existHome, "webapp");
}
+
+ webappFolder=Configuration.getWebappHome();
+
logger.debug("CORE jars location="+coreJarsFolder.getAbsolutePath());
logger.debug("EXIST jars location="+existJarFolder.getAbsolutePath());
logger.debug("WEBAPP location="+webappFolder.getAbsolutePath());
}
- /**
- * Check wether exist runs in Servlet container (as war file).
- * @return TRUE if exist runs in servlet container.
- */
- public boolean isInWarFile(){
-
- boolean retVal =true;
- if( new File(existHome, "lib/core").isDirectory() ) {
- retVal=false;
- }
- return retVal;
- }
+// /**
+// * Check wether exist runs in Servlet container (as war file).
+// * @return TRUE if exist runs in servlet container.
+// */
+// public boolean isInWarFile(){
+//
+// boolean retVal =true;
+// if( new File(existHome, "lib/core").isDirectory() ) {
+// retVal=false;
+// }
+// return retVal;
+// }
public File getWebappFolder(){
Modified: trunk/eXist-1.0/src/org/exist/xmldb/RemoteCollection.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/xmldb/RemoteCollection.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/xmldb/RemoteCollection.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ *
* $Id$
*/
package org.exist.xmldb;
@@ -48,27 +48,29 @@
import org.xmldb.api.base.XMLDBException;
/**
- * A remote implementation of the Collection interface. This
+ * A remote implementation of the Collection interface. This
* implementation communicates with the server through the XMLRPC
* protocol.
- *
+ *
* @author wolf
+ * Updated Andy Foster - Updated code to allow child collection cache to
+ * resync with the remote collection.
*/
public class RemoteCollection implements CollectionImpl {
-
+
// max size of a resource to be send to the server
// if the resource exceeds this limit, the data is split into
// junks and uploaded to the server via the update() call
private static final int MAX_CHUNK_LENGTH = 512 * 1024;
private static final int MAX_UPLOAD_CHUNK = 10 * 1024 * 1024;
-
+
protected Map childCollections = null;
protected XmldbURI path;
protected Permission permissions = null;
protected RemoteCollection parent = null;
protected XmlRpcClient rpcClient = null;
protected Properties properties = null;
-
+
public RemoteCollection(XmlRpcClient client, XmldbURI path)
throws XMLDBException {
this(client, null, path);
@@ -142,17 +144,37 @@
}
public Collection getChildCollection(XmldbURI name) throws XMLDBException {
- if (childCollections == null)
- readCollection();
+ // AF get the child collection refreshing cache from server if not found
+ return getChildCollection(name,true);
+ }
+
+ // AF - NEW METHOD
+ protected Collection getChildCollection(XmldbURI name, boolean refreshCacheIfNotFound) throws XMLDBException {
+ if (childCollections == null) {
+ readCollection();
+ refreshCacheIfNotFound = false;
+ }
+
+ // stores reference to the collection found
+ Collection foundCollection = null;
if (name.numSegments()>1)
- return (Collection) childCollections.get(name);
+ foundCollection = (Collection) childCollections.get(name);
else
- return (Collection) childCollections.get(getPathURI().append(name));
+ foundCollection = (Collection) childCollections.get(getPathURI().append(name));
+
+ // if we did not find collection in cache set cache back to null to force full refresh
+ if (foundCollection == null && refreshCacheIfNotFound) {
+ childCollections = null;
+ return getChildCollection(name,false);
+ }
+ // return the found collection
+ return foundCollection;
}
+
public int getChildCollectionCount() throws XMLDBException {
- if (childCollections == null)
- readCollection();
+ // AF Always refresh cache for latest set - if (childCollections == null)
+ readCollection();
return childCollections.size();
}
@@ -244,8 +266,8 @@
}
protected boolean hasChildCollection(String name) throws XMLDBException {
- if (childCollections == null)
- readCollection();
+ // AF Always refresh cache for latest set - if (childCollections == null)
+ readCollection();
try {
return childCollections.containsKey(XmldbURI.xmldbUriFor(name));
} catch(URISyntaxException e) {
@@ -266,8 +288,8 @@
*@exception XMLDBException Description of the Exception
*/
public String[] listChildCollections() throws XMLDBException {
- if (childCollections == null)
- readCollection();
+ // Always refresh cache for latest set - if (childCollections == null)
+ readCollection();
String coll[] = new String[childCollections.size()];
int j = 0;
XmldbURI uri;
@@ -281,7 +303,7 @@
public String[] getChildCollections() throws XMLDBException {
return listChildCollections();
}
-
+
public String[] listResources() throws XMLDBException {
Vector params = new Vector();
params.addElement(getPath());
@@ -302,7 +324,7 @@
public String[] getResources() throws XMLDBException {
return listResources();
}
-
+
public Resource getResource(String name) throws XMLDBException {
Vector params = new Vector();
XmldbURI docUri;
@@ -323,7 +345,7 @@
String docName = (String) hash.get("name");
if(docName == null)
return null; // resource does not exist!
- int p;
+ int p;
try {
docUri = XmldbURI.xmldbUriFor(docName).lastSegment();
} catch(URISyntaxException e) {
@@ -358,7 +380,7 @@
return r;
}
}
-
+
private void readCollection() throws XMLDBException {
childCollections = new HashMap();
Vector params = new Vector();
@@ -468,17 +490,17 @@
} else if(res.getResourceType().equals("BinaryResource"))
{
((RemoteBinaryResource)res).dateCreated =a;
- ((RemoteBinaryResource)res).dateModified =b;
+ ((RemoteBinaryResource)res).dateModified =b;
store((RemoteBinaryResource)res);
- }
+ }
else {
((RemoteXMLResource)res).dateCreated =a;
((RemoteXMLResource)res).dateModified =b;
store((RemoteXMLResource)res);
}
}
-
+
private void store(RemoteXMLResource res) throws XMLDBException {
byte[] data = res.getData();
Vector params = new Vector();
@@ -489,12 +511,12 @@
throw new XMLDBException(ErrorCodes.INVALID_URI,e);
}
params.addElement(new Integer(1));
-
+
if (res.dateCreated != null) {
params.addElement(res.dateCreated );
- params.addElement(res.dateModified );
+ params.addElement(res.dateModified );
}
-
+
try {
rpcClient.execute("parse", params);
} catch (XmlRpcException xre) {
@@ -518,18 +540,18 @@
}
params.addElement(res.getMimeType());
params.addElement(Boolean.TRUE);
-
-
+
+
if ((Date)res.dateCreated != null) {
params.addElement((Date)res.dateCreated );
- params.addElement((Date)res.dateModified );
+ params.addElement((Date)res.dateModified );
}
-
+
try {
rpcClient.execute("storeBinary", params);
} catch (XmlRpcException xre) {
/* the error code previously was INVALID_RESOURCE, but this was also thrown
- * in case of insufficient persmissions. As you cannot tell here any more what the
+ * in case of insufficient persmissions. As you cannot tell here any more what the
* error really was, use UNKNOWN_ERROR. The reason is in XmlRpcResponseProcessor#processException
* which will only pass on the error message.
*/
@@ -541,7 +563,7 @@
throw new XMLDBException(ErrorCodes.VENDOR_ERROR, ioe.getMessage(), ioe);
}
}
-
+
private void uploadAndStore(Resource res) throws XMLDBException {
File file = (File) res.getContent();
byte[] chunk = new byte[MAX_UPLOAD_CHUNK];
@@ -568,10 +590,10 @@
throw new XMLDBException(ErrorCodes.INVALID_URI,e);
}
params.addElement(Boolean.TRUE);
-
+
if ( ((RemoteXMLResource)res).dateCreated != null ) {
params.addElement( ((RemoteXMLResource)res).dateCreated );
- params.addElement( ((RemoteXMLResource)res).dateModified );
+ params.addElement( ((RemoteXMLResource)res).dateModified );
}
rpcClient.execute("parseLocal", params);
@@ -608,10 +630,10 @@
//TODO : get the name from client
accessor.append("exist");
accessor.append("://");
- accessor.append(rpcClient.getURL().getHost());
+ accessor.append(rpcClient.getURL().getHost());
if (rpcClient.getURL().getPort() != -1)
- accessor.append(":").append(rpcClient.getURL().getPort());
- accessor.append(rpcClient.getURL().getPath());
+ accessor.append(":").append(rpcClient.getURL().getPort());
+ accessor.append(rpcClient.getURL().getPath());
try {
//TODO : cache it when constructed
return XmldbURI.create(accessor.toString(), getPath());
@@ -621,3 +643,4 @@
}
}
}
+
Modified: trunk/eXist-1.0/src/org/exist/xquery/test/XQueryTest.java
===================================================================
--- trunk/eXist-1.0/src/org/exist/xquery/test/XQueryTest.java 2006-10-26 15:56:45 UTC (rev 4743)
+++ trunk/eXist-1.0/src/org/exist/xquery/test/XQueryTest.java 2006-10-26 17:59:09 UTC (rev 4744)
@@ -332,6 +332,83 @@
}
}
+ // Testcase by Gev
+ public void bugtestInMemoryNodeSequences() {
+ ResourceSet result;
+ String query;
+
+ try {
+ XPathQueryService service =
+ (XPathQueryService) testCollection.getService(
+ "XPathQueryService",
+ "1.0");
+
+ System.out.println("testInMemoryNodeSequences 1: ========" );
+ query = "let $c := (<a/>,<b/>) return <t>text{$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 2: ========" );
+ query = "let $c := (<a/>,<b/>) return <t><text/>{$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t><text/><a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 3: ========" );
+ query = "let $c := (<a/>,<b/>) return <t>{\"text\"}{$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 4: ========" );
+ query = "let $c := (<a/>,\"b\") return <t>text{$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 5: ========" );
+ query = "let $c := (<a/>,\"b\") return <t><text/>{$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t><text/><a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 6: ========" );
+ query = "let $c := (<a/>,\"b\") return <t>{\"text\"}{$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 7: ========" );
+ query = "let $c := (<a/>,<b/>) return <t>{<text/>,$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 8: ========" );
+ query = "let $c := (<a/>,<b/>) return <t>{\"text\",$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 9: ========" );
+ query = "let $c := (<a/>,\"b\") return <t>{<text/>,$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ System.out.println("testInMemoryNodeSequences 10: ========" );
+ query = "let $c := (<a/>,\"b\") return <t>{\"text\",$c[1]}</t>";
+ result = service.query(query);
+ printResult(result);
+ assertEquals( "XQuery: " + query, "<t>text<a/></t>", ((XMLResource)result.getResource(0)).getContent());
+
+ } catch (XMLDBException e) {
+ System.out.println("testInMemoryNodeSequences(): XMLDBException: "+e);
+ fail(e.getMessage());
+ }
+ }
+
public void testVariable() {
ResourceSet result;
String query;
@@ -1519,7 +1596,37 @@
fail(e.getMessage());
}
}
+
+ public void bugtestAttributeNamespace() {
+ String query = "declare function local:copy($nodes as node()*) as node()* {"
+ +"for $n in $nodes return "
+ +"if ($n instance of element()) then "
+ +" element {node-name($n)} {(local:copy($n/@*), local:copy($n/node()))} "
+ +"else if ($n instance of attribute()) then "
+ +" attribute {node-name($n)} {$n} "
+ +"else if ($n instance of text()) then "
+ +" text {$n} "
+ +"else "
+ +" <Other/>"
+ +"};"
+ +"let $c :="
+ +"<c:C xmlns:c=\"http://c\" xmlns:d=\"http://d\" d:d=\"ddd\">"
+ +"ccc"
+ +"</c:C>"
+ +"return local:copy($c)";
+ try {
+ XPathQueryService service = (XPathQueryService) testCollection.getService(
+ "XPathQueryService", "1.0");
+ ResourceSet result = service.query(query);
+ assertEquals(1, result.getSize());
+ assertEquals("<c:C xmlns:c=\"http://c\" xmlns:d=\"http://d\" d:d=\"ddd\">"
+ +"ccc"+"</c:C>", result.getResource(0).getContent().toString());
+ } catch (XMLDBException e) {
+ fail(e.getMessage());
+ }
+ }
+
public void testNameConflicts() {
String query = "let $a := <name name=\"Test\"/> return <wrap>{$a//@name}</wrap>";
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-26 15:56:55
|
Revision: 4743
http://svn.sourceforge.net/exist/?rev=4743&view=rev
Author: dizzzz
Date: 2006-10-26 08:56:45 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Fixed code that passed java5 compiler, but fails on 1.4
Modified Paths:
--------------
branches/DLN/eXist-1.0/src/org/exist/http/Descriptor.java
Modified: branches/DLN/eXist-1.0/src/org/exist/http/Descriptor.java
===================================================================
--- branches/DLN/eXist-1.0/src/org/exist/http/Descriptor.java 2006-10-26 15:37:10 UTC (rev 4742)
+++ branches/DLN/eXist-1.0/src/org/exist/http/Descriptor.java 2006-10-26 15:56:45 UTC (rev 4743)
@@ -211,8 +211,9 @@
LOG.warn("Error element 'xquery' requires an attribute 'path'");
return;
}
- path=path.replaceAll("\\$\\{WEBAPP_HOME\\}", Configuration.getWebappHome().getAbsolutePath().replace("\\","/") );
-// System.out.println(path);
+ path=path.replaceAll("\\$\\{WEBAPP_HOME\\}",
+ Configuration.getWebappHome().getAbsolutePath().replace('\\','/') );
+
//store the path
allowSourceXQueryList[i] = path;
}
@@ -249,7 +250,8 @@
LOG.warn("Error element 'map' requires an attribute 'path' or an attribute 'pattern'");
return;
}
- path=path.replaceAll("\\$\\{WEBAPP_HOME\\}", Configuration.getWebappHome().getAbsolutePath().replace("\\","/") );
+ path=path.replaceAll("\\$\\{WEBAPP_HOME\\}",
+ Configuration.getWebappHome().getAbsolutePath().replace('\\','/') );
//must be a view to map to
if(view == null)
@@ -257,7 +259,8 @@
LOG.warn("Error element 'map' requires an attribute 'view'");
return;
}
- view=view.replaceAll("\\$\\{WEBAPP_HOME\\}", Configuration.getWebappHome().getAbsolutePath().replace("\\","/") );
+ view=view.replaceAll("\\$\\{WEBAPP_HOME\\}",
+ Configuration.getWebappHome().getAbsolutePath().replace('\\','/') );
//store what to map from
/* if(path != null)
@@ -292,7 +295,7 @@
for(int i = 0; i < allowSourceXQueryList.length; i++)
{
// DWES: this helps a lot. quickfix not the final solution
- path=path.replace("\\","/");
+ path=path.replace('\\','/');
//does the path match the <allow-source><xquery path=""/></allow-source> path
if((allowSourceXQueryList[i].equals(path)) || (path.indexOf(allowSourceXQueryList[i]) > -1))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <del...@us...> - 2006-10-26 15:38:07
|
Revision: 4742
http://svn.sourceforge.net/exist/?rev=4742&view=rev
Author: deliriumsky
Date: 2006-10-26 08:37:10 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
server.xml for dist build
Modified Paths:
--------------
trunk/eXist-1.0/build/scripts/dist.xml
Modified: trunk/eXist-1.0/build/scripts/dist.xml
===================================================================
--- trunk/eXist-1.0/build/scripts/dist.xml 2006-10-26 14:44:33 UTC (rev 4741)
+++ trunk/eXist-1.0/build/scripts/dist.xml 2006-10-26 15:37:10 UTC (rev 4742)
@@ -145,7 +145,8 @@
<include name="README"/>
<include name="*.bat"/>
<include name="*.sh"/>
- <include name="conf.xml"/>
+ <include name="conf.xml"/>
+ <include name="server.xml"/>
<include name="*.tmpl"/>
<include name="descriptor.xml"/>
<include name="build.xml"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-26 14:44:40
|
Revision: 4741
http://svn.sourceforge.net/exist/?rev=4741&view=rev
Author: dizzzz
Date: 2006-10-26 07:44:33 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Modified build.properties for next release
Modified Paths:
--------------
trunk/eXist-1.0/build.properties
Modified: trunk/eXist-1.0/build.properties
===================================================================
--- trunk/eXist-1.0/build.properties 2006-10-26 14:25:39 UTC (rev 4740)
+++ trunk/eXist-1.0/build.properties 2006-10-26 14:44:33 UTC (rev 4741)
@@ -1,5 +1,5 @@
project.name = eXist
-project.version = 1.0.1
+project.version = 1.0.2dev
# build settings
build.debug = on
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-26 14:25:58
|
Revision: 4740
http://svn.sourceforge.net/exist/?rev=4740&view=rev
Author: dizzzz
Date: 2006-10-26 07:25:39 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
Repaired 'dist'..... added tmpl files, added log4j.dtd
What about the installer directory?
Modified Paths:
--------------
trunk/eXist-1.0/build/scripts/dist.xml
Modified: trunk/eXist-1.0/build/scripts/dist.xml
===================================================================
--- trunk/eXist-1.0/build/scripts/dist.xml 2006-10-26 13:55:31 UTC (rev 4739)
+++ trunk/eXist-1.0/build/scripts/dist.xml 2006-10-26 14:25:39 UTC (rev 4740)
@@ -146,10 +146,11 @@
<include name="*.bat"/>
<include name="*.sh"/>
<include name="conf.xml"/>
- <include name="conf.xml.tmpl"/>
+ <include name="*.tmpl"/>
<include name="descriptor.xml"/>
<include name="build.xml"/>
<include name="log4j.xml"/>
+ <include name="log4j.dtd"/>
<include name="examples-setup.xml"/>
<include name="stopword"/>
<include name="*.properties"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2006-10-26 13:55:40
|
Revision: 4739
http://svn.sourceforge.net/exist/?rev=4739&view=rev
Author: dizzzz
Date: 2006-10-26 06:55:31 -0700 (Thu, 26 Oct 2006)
Log Message:
-----------
- Added log4j.dtd to war file
- Adjusted xslt script that generates log4j.xml to preserve doctype def.
- Cleaned up war file; old log files could still be included.
Modified Paths:
--------------
trunk/eXist-1.0/build/scripts/dist-war-log4j.xsl
trunk/eXist-1.0/build/scripts/dist.xml
Modified: trunk/eXist-1.0/build/scripts/dist-war-log4j.xsl
===================================================================
--- trunk/eXist-1.0/build/scripts/dist-war-log4j.xsl 2006-10-26 13:14:36 UTC (rev 4738)
+++ trunk/eXist-1.0/build/scripts/dist-war-log4j.xsl 2006-10-26 13:55:31 UTC (rev 4739)
@@ -3,7 +3,7 @@
<!-- $Id$ -->
<!-- Convert log4j.xml for use in war-file -->
- <xsl:output method="xml"/>
+ <xsl:output method="xml" doctype-system="log4j.dtd"/>
<xsl:template match="category[@name='org.mortbay']">
</xsl:template>
Modified: trunk/eXist-1.0/build/scripts/dist.xml
===================================================================
--- trunk/eXist-1.0/build/scripts/dist.xml 2006-10-26 13:14:36 UTC (rev 4738)
+++ trunk/eXist-1.0/build/scripts/dist.xml 2006-10-26 13:55:31 UTC (rev 4739)
@@ -64,6 +64,7 @@
<include name="server.xml"/>
<include name="mime-types.xml"/>
<include name="descriptor.xml"/>
+ <include name="log4j.dtd"/>
</webinf>
<!-- Add files context root ('/') -->
@@ -72,7 +73,7 @@
<exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/data/*.dbx"/>
<exclude name="WEB-INF/data/*.lck"/>
- <exclude name="**/*.log"/>
+ <exclude name="**/*.log*"/>
</fileset>
<zipfileset dir="samples" prefix="samples">
<include name="**"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|