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
(1) |
|
2
(12) |
3
(16) |
4
(11) |
5
(11) |
6
(11) |
7
(5) |
8
(3) |
|
9
(1) |
10
(1) |
11
(1) |
12
(22) |
13
(5) |
14
(4) |
15
(22) |
|
16
(18) |
17
(10) |
18
(3) |
19
(3) |
20
(11) |
21
(8) |
22
(3) |
|
23
(10) |
24
(17) |
25
(26) |
26
(11) |
27
(11) |
28
(14) |
29
(11) |
|
30
(10) |
31
(5) |
|
|
|
|
|
|
From: Pierrick B. <br...@us...> - 2005-10-31 10:46:08
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12899/src/org/exist/xquery/functions Modified Files: ModuleImpl.java Added Files: FunCompare.java Log Message: Added fn:compare --- NEW FILE: FunCompare.java --- /* eXist Open Source Native XML Database * Copyright (C) 2000-03, Wolfgang M. Meier (me...@if...) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This library 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 Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ */ package org.exist.xquery.functions; import java.text.Collator; import org.exist.dom.QName; import org.exist.util.Collations; import org.exist.xquery.Cardinality; import org.exist.xquery.FunctionSignature; import org.exist.xquery.Module; import org.exist.xquery.XQueryContext; import org.exist.xquery.XPathException; import org.exist.xquery.value.IntegerValue; import org.exist.xquery.value.Item; import org.exist.xquery.value.Sequence; import org.exist.xquery.value.SequenceType; import org.exist.xquery.value.Type; public class FunCompare extends CollatingFunction { public final static FunctionSignature signatures[] = { new FunctionSignature ( new QName("compare", Module.BUILTIN_FUNCTION_NS), new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE) }, new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE)), new FunctionSignature ( new QName("compare", Module.BUILTIN_FUNCTION_NS), new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE) }, new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE)) }; public FunCompare(XQueryContext context, FunctionSignature signature) { super(context, signature); } public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException { if(contextItem != null) contextSequence = contextItem.toSequence(); String s1 = getArgument(0).eval(contextSequence).getStringValue(); String s2 = getArgument(1).eval(contextSequence).getStringValue(); if(s1.length() == 0 || s2.length() == 0) return Sequence.EMPTY_SEQUENCE; Collator collator = getCollator(contextSequence, contextItem, 3); int result = Collations.compare(collator, s1, s2); if (result == 0) return new IntegerValue(0); else if (result < 0) return new IntegerValue(-1); else return new IntegerValue(1); } } Index: ModuleImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ModuleImpl.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ModuleImpl.java 31 Oct 2005 08:52:57 -0000 1.19 --- ModuleImpl.java 31 Oct 2005 10:45:58 -0000 1.20 *************** *** 43,46 **** --- 43,48 ---- new FunctionDef(FunCeiling.signature, FunCeiling.class), new FunctionDef(FunCodepointsToString.signature, FunCodepointsToString.class), + new FunctionDef(FunCompare.signatures[0], FunCompare.class), + new FunctionDef(FunCompare.signatures[1], FunCompare.class), new FunctionDef(FunConcat.signature, FunConcat.class), new FunctionDef(FunContains.signatures[0], FunContains.class), |
|
From: Pierrick B. <br...@us...> - 2005-10-31 10:46:08
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12899/src/org/exist/xquery/test Modified Files: XQueryFunctionsTest.java Log Message: Added fn:compare Index: XQueryFunctionsTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/test/XQueryFunctionsTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** XQueryFunctionsTest.java 20 Oct 2005 18:58:45 -0000 1.11 --- XQueryFunctionsTest.java 31 Oct 2005 10:45:58 -0000 1.12 *************** *** 145,148 **** --- 145,164 ---- } + public void testCompare() throws XPathException { + ResourceSet result = null; + String r = ""; + try { + result = service.query("fn:compare(\"Strasse\", \"Stra\u00DFe\")"); + r = (String) result.getResource(0).getContent(); + assertEquals( "-1", r ); + //result = service.query("fn:compare(\"Strasse\", \"Stra\u00DFe\", \"java:GermanCollator\")"); + //r = (String) result.getResource(0).getContent(); + //assertEquals( "0", r ); + } catch (XMLDBException e) { + System.out.println("testTokenize(): " + e); + fail(e.getMessage()); + } + } + public void testDistinctValues() throws XPathException { ResourceSet result = null; |
|
From: Pierrick B. <br...@us...> - 2005-10-31 09:22:04
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26774/src/org/exist/xmldb/test Modified Files: IndexingTest.java DOMTest.java DOMTestJUnit.java ContentAsDOMTest.java DTMHandleTest.java CopyMoveTest.java CreateCollectionsTest.java MultiDBTest.java Log Message: Using named constants in collection names : daily commit. Index: MultiDBTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/MultiDBTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MultiDBTest.java 3 Aug 2005 18:13:50 -0000 1.3 --- MultiDBTest.java 31 Oct 2005 09:21:49 -0000 1.4 *************** *** 25,28 **** --- 25,29 ---- import java.io.FileOutputStream; + import org.exist.storage.DBBroker; import org.exist.util.MimeTable; import org.exist.util.MimeType; *************** *** 62,66 **** public void testStore() throws Exception { for (int i = 0; i < INSTANCE_COUNT; i++) { ! Collection root = DatabaseManager.getCollection("xmldb:test" + i + ":///db"); Collection test = root.getChildCollection("test"); if (test == null) { --- 63,67 ---- public void testStore() throws Exception { for (int i = 0; i < INSTANCE_COUNT; i++) { ! Collection root = DatabaseManager.getCollection("xmldb:test" + i + "://" + DBBroker.ROOT_COLLECTION); Collection test = root.getChildCollection("test"); if (test == null) { *************** *** 134,138 **** long total = rt.totalMemory() / 1024; for (int i = 0; i < INSTANCE_COUNT; i++) { ! Collection root = DatabaseManager.getCollection("xmldb:test" + i + ":///db", "admin", null); CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0"); --- 135,139 ---- long total = rt.totalMemory() / 1024; for (int i = 0; i < INSTANCE_COUNT; i++) { ! Collection root = DatabaseManager.getCollection("xmldb:test" + i + "://" + DBBroker.ROOT_COLLECTION, "admin", null); CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0"); Index: IndexingTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/IndexingTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IndexingTest.java 3 Aug 2004 16:47:34 -0000 1.3 --- IndexingTest.java 31 Oct 2005 09:21:49 -0000 1.4 *************** *** 17,20 **** --- 17,21 ---- import junit.framework.TestCase; + import org.exist.storage.DBBroker; import org.exist.xmldb.DatabaseInstanceManager; import org.w3c.dom.Document; *************** *** 43,47 **** private static String driver = "org.exist.xmldb.DatabaseImpl"; ! private static String baseURI = "xmldb:exist:///db"; private static String username = "admin"; --- 44,48 ---- private static String driver = "org.exist.xmldb.DatabaseImpl"; ! private static String baseURI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private static String username = "admin"; Index: CopyMoveTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/CopyMoveTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CopyMoveTest.java 19 Sep 2004 16:02:57 -0000 1.2 --- CopyMoveTest.java 31 Oct 2005 09:21:49 -0000 1.3 *************** *** 1,6 **** package org.exist.xmldb.test; import org.exist.xmldb.CollectionManagementServiceImpl; - import org.exist.xmldb.RemoteCollectionManagementService; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.*; --- 1,6 ---- package org.exist.xmldb.test; + import org.exist.storage.DBBroker; import org.exist.xmldb.CollectionManagementServiceImpl; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.*; *************** *** 17,21 **** public class CopyMoveTest extends TestCase { ! private final static String URI = "xmldb:exist:///db"; private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; --- 17,21 ---- public class CopyMoveTest extends TestCase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; Index: DOMTestJUnit.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/DOMTestJUnit.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DOMTestJUnit.java 25 Aug 2005 17:42:27 -0000 1.5 --- DOMTestJUnit.java 31 Oct 2005 09:21:49 -0000 1.6 *************** *** 12,15 **** --- 12,16 ---- import org.exist.StandaloneServer; + import org.exist.storage.DBBroker; import org.mortbay.util.MultiException; import org.w3c.dom.Document; *************** *** 31,35 **** private static StandaloneServer server = null; private static String driver = "org.exist.xmldb.DatabaseImpl"; ! private static String baseURI = "xmldb:exist://localhost:8088/xmlrpc/db"; private static String username = "admin"; --- 32,36 ---- private static StandaloneServer server = null; private static String driver = "org.exist.xmldb.DatabaseImpl"; ! private static String baseURI = "xmldb:exist://localhost:8088/xmlrpc" + DBBroker.ROOT_COLLECTION; private static String username = "admin"; Index: ContentAsDOMTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/ContentAsDOMTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ContentAsDOMTest.java 29 Jan 2005 18:53:36 -0000 1.2 --- ContentAsDOMTest.java 31 Oct 2005 09:21:49 -0000 1.3 *************** *** 31,34 **** --- 31,35 ---- import junit.textui.TestRunner; + import org.exist.storage.DBBroker; import org.exist.xmldb.DatabaseInstanceManager; import org.w3c.dom.Node; *************** *** 51,55 **** private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; ! private final static String ROOT_URI = "xmldb:exist:///db"; private final static String XML = --- 52,56 ---- private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; ! private final static String ROOT_URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private final static String XML = Index: DTMHandleTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/DTMHandleTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DTMHandleTest.java 22 Dec 2004 16:55:29 -0000 1.3 --- DTMHandleTest.java 31 Oct 2005 09:21:49 -0000 1.4 *************** *** 10,13 **** --- 10,14 ---- import org.apache.xpath.objects.XObject; import org.xmldb.api.base.CompiledExpression; + import org.exist.storage.DBBroker; import org.exist.xmldb.XQueryService; import org.w3c.dom.Node; *************** *** 132,136 **** query.append("xquery version \"1.0\";"); query.append("declare namespace xdb=\"http://exist-db.org/xquery/xmldb\";"); ! query.append("let $root := xdb:collection(\"" + eXistUrl + "/db\", \"admin\", \"admin\"),"); query.append("$doc := xdb:store($root, $document, $survey)"); query.append("return <result/>"); --- 133,137 ---- query.append("xquery version \"1.0\";"); query.append("declare namespace xdb=\"http://exist-db.org/xquery/xmldb\";"); ! query.append("let $root := xdb:collection(\"" + eXistUrl + DBBroker.ROOT_COLLECTION + "\", \"admin\", \"admin\"),"); query.append("$doc := xdb:store($root, $document, $survey)"); query.append("return <result/>"); *************** *** 152,156 **** StringBuffer query = new StringBuffer(); query.append("xquery version \"1.0\";"); ! query.append("let $survey := document(concat(\"/db/\", $document))"); query.append("return ($survey)"); --- 153,157 ---- StringBuffer query = new StringBuffer(); query.append("xquery version \"1.0\";"); ! query.append("let $survey := document(concat(\"" + DBBroker.ROOT_COLLECTION + "/\", $document))"); query.append("return ($survey)"); *************** *** 200,204 **** */ private final XQueryService getXQueryService(Database db) throws XMLDBException { ! Collection collection = DatabaseManager.getCollection(eXistUrl + "/db", "admin", "admin"); if (collection != null) { XQueryService service = (XQueryService)collection.getService("XQueryService", "1.0"); --- 201,205 ---- */ private final XQueryService getXQueryService(Database db) throws XMLDBException { ! Collection collection = DatabaseManager.getCollection(eXistUrl + DBBroker.ROOT_COLLECTION, "admin", "admin"); if (collection != null) { XQueryService service = (XQueryService)collection.getService("XQueryService", "1.0"); Index: DOMTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/DOMTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DOMTest.java 29 Jan 2005 14:57:34 -0000 1.5 --- DOMTest.java 31 Oct 2005 09:21:49 -0000 1.6 *************** *** 11,14 **** --- 11,15 ---- import javax.xml.transform.sax.SAXResult; + import org.exist.storage.DBBroker; import org.exist.xmldb.DatabaseInstanceManager; import org.w3c.dom.Document; *************** *** 33,37 **** private static String driver = "org.exist.xmldb.DatabaseImpl"; ! private static String baseURI = "xmldb:exist:///db"; private static String username = "admin"; --- 34,38 ---- private static String driver = "org.exist.xmldb.DatabaseImpl"; ! private static String baseURI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private static String username = "admin"; Index: CreateCollectionsTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/CreateCollectionsTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CreateCollectionsTest.java 25 Oct 2005 11:07:02 -0000 1.10 --- CreateCollectionsTest.java 31 Oct 2005 09:21:49 -0000 1.11 *************** *** 7,17 **** import java.util.ArrayList; import java.util.Arrays; - import java.util.Collections; import java.util.HashSet; - import java.util.Iterator; import junit.framework.TestCase; import org.exist.dom.XMLUtil; import org.exist.util.XMLFilenameFilter; import org.xmldb.api.*; --- 7,16 ---- import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import junit.framework.TestCase; import org.exist.dom.XMLUtil; + import org.exist.storage.DBBroker; import org.exist.util.XMLFilenameFilter; import org.xmldb.api.*; *************** *** 21,25 **** public class CreateCollectionsTest extends TestCase { ! private final static String URI = "xmldb:exist:///db"; private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; --- 20,24 ---- public class CreateCollectionsTest extends TestCase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; *************** *** 198,202 **** public void testMultipleCreates() { try { ! Collection rootColl = DatabaseManager.getCollection("xmldb:exist:///db"); CollectionManagementService cms = (CollectionManagementService) rootColl.getService("CollectionManagementService", "1.0"); --- 197,201 ---- public void testMultipleCreates() { try { ! Collection rootColl = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION); CollectionManagementService cms = (CollectionManagementService) rootColl.getService("CollectionManagementService", "1.0"); |
|
From: Pierrick B. <br...@us...> - 2005-10-31 09:21:57
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/memtree/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26774/src/org/exist/memtree/test Modified Files: DOMIndexerTest.java Log Message: Using named constants in collection names : daily commit. Index: DOMIndexerTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/memtree/test/DOMIndexerTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DOMIndexerTest.java 26 Jul 2005 07:15:12 -0000 1.4 --- DOMIndexerTest.java 31 Oct 2005 09:21:49 -0000 1.5 *************** *** 91,95 **** " <title>Section 2</title>" + " <para>First paragraph in second section.</para>" + ! " {collection('/db/test')//f:item[@itemno='2']/f:name}" + " </section>" + " ) " + --- 91,95 ---- " <title>Section 2</title>" + " <para>First paragraph in second section.</para>" + ! " {collection('" + DBBroker.ROOT_COLLECTION + "/test')//f:item[@itemno='2']/f:name}" + " </section>" + " ) " + |
|
From: Pierrick B. <br...@us...> - 2005-10-31 08:53:07
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19341/src/org/exist/xquery/functions Modified Files: FunStartsWith.java FunEndsWith.java ModuleImpl.java FunDistinctValues.java FunDeepEqual.java Log Message: Added $collation arguments to some standard XPath/XQuery functions Index: ModuleImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ModuleImpl.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ModuleImpl.java 15 Oct 2005 17:06:27 -0000 1.18 --- ModuleImpl.java 31 Oct 2005 08:52:57 -0000 1.19 *************** *** 57,61 **** new FunctionDef(FunDocumentURI.signature, FunDocumentURI.class), new FunctionDef(FunEmpty.signature, FunEmpty.class), ! new FunctionDef(FunEndsWith.signature, FunEndsWith.class), new FunctionDef(FunError.signature[0], FunError.class), new FunctionDef(FunError.signature[1], FunError.class), --- 57,62 ---- new FunctionDef(FunDocumentURI.signature, FunDocumentURI.class), new FunctionDef(FunEmpty.signature, FunEmpty.class), ! new FunctionDef(FunEndsWith.signatures[0], FunEndsWith.class), ! new FunctionDef(FunEndsWith.signatures[1], FunEndsWith.class), new FunctionDef(FunError.signature[0], FunError.class), new FunctionDef(FunError.signature[1], FunError.class), *************** *** 131,135 **** new FunctionDef(FunRoundHalfToEven.signatures[0], FunRoundHalfToEven.class), new FunctionDef(FunRoundHalfToEven.signatures[1], FunRoundHalfToEven.class), ! new FunctionDef(FunStartsWith.signature, FunStartsWith.class), new FunctionDef(FunString.signatures[0], FunString.class), new FunctionDef(FunString.signatures[1], FunString.class), --- 132,137 ---- new FunctionDef(FunRoundHalfToEven.signatures[0], FunRoundHalfToEven.class), new FunctionDef(FunRoundHalfToEven.signatures[1], FunRoundHalfToEven.class), ! new FunctionDef(FunStartsWith.signatures[0], FunStartsWith.class), ! new FunctionDef(FunStartsWith.signatures[1], FunStartsWith.class), new FunctionDef(FunString.signatures[0], FunString.class), new FunctionDef(FunString.signatures[1], FunString.class), Index: FunDistinctValues.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/FunDistinctValues.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FunDistinctValues.java 25 Oct 2005 06:22:23 -0000 1.9 --- FunDistinctValues.java 31 Oct 2005 08:52:57 -0000 1.10 *************** *** 55,58 **** --- 55,59 ---- new SequenceType[] { new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)}, new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)); + // TODO: collation as argument public FunDistinctValues(XQueryContext context) { Index: FunEndsWith.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/FunEndsWith.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FunEndsWith.java 23 Sep 2004 22:00:13 -0000 1.3 --- FunEndsWith.java 31 Oct 2005 08:52:57 -0000 1.4 *************** *** 21,24 **** --- 21,26 ---- package org.exist.xquery.functions; + import java.text.Collator; + import org.exist.dom.QName; import org.exist.util.Collations; *************** *** 35,41 **** import org.exist.xquery.value.Type; ! public class FunEndsWith extends Function { ! public final static FunctionSignature signature = new FunctionSignature( new QName("ends-with", Module.BUILTIN_FUNCTION_NS), --- 37,43 ---- import org.exist.xquery.value.Type; ! public class FunEndsWith extends CollatingFunction { ! public final static FunctionSignature signatures [] = { new FunctionSignature( new QName("ends-with", Module.BUILTIN_FUNCTION_NS), *************** *** 43,49 **** new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)}, ! new SequenceType(Type.BOOLEAN, Cardinality.ONE)); ! public FunEndsWith(XQueryContext context) { super(context, signature); } --- 45,60 ---- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)}, ! new SequenceType(Type.BOOLEAN, Cardinality.ONE)), ! new FunctionSignature ( ! new QName("ends-with", Module.BUILTIN_FUNCTION_NS), ! new SequenceType[] { ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), ! new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE) ! }, ! new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE)) ! }; ! public FunEndsWith(XQueryContext context, FunctionSignature signature) { super(context, signature); } *************** *** 60,68 **** contextSequence = contextItem.toSequence(); ! Sequence s1 = getArgument(0).eval(contextSequence); ! Sequence s2 = getArgument(1).eval(contextSequence); ! if (s1.getLength() == 0 || s2.getLength() == 0) return Sequence.EMPTY_SEQUENCE; ! if (Collations.endsWith(context.getDefaultCollator(), s1.getStringValue(), s2.getStringValue())) return BooleanValue.TRUE; else --- 71,80 ---- contextSequence = contextItem.toSequence(); ! String s1 = getArgument(0).eval(contextSequence).getStringValue(); ! String s2 = getArgument(1).eval(contextSequence).getStringValue(); ! if (s1.length() == 0 || s2.length() == 0) return Sequence.EMPTY_SEQUENCE; ! Collator collator = getCollator(contextSequence, contextItem, 3); ! if (Collations.endsWith(collator, s1, s2)) return BooleanValue.TRUE; else Index: FunStartsWith.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/FunStartsWith.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FunStartsWith.java 23 Sep 2004 22:00:13 -0000 1.3 --- FunStartsWith.java 31 Oct 2005 08:52:57 -0000 1.4 *************** *** 21,24 **** --- 21,26 ---- package org.exist.xquery.functions; + import java.text.Collator; + import org.exist.dom.QName; import org.exist.util.Collations; *************** *** 35,50 **** import org.exist.xquery.value.Type; ! public class FunStartsWith extends Function { ! public final static FunctionSignature signature = ! new FunctionSignature( ! new QName("starts-with", Module.BUILTIN_FUNCTION_NS), ! new SequenceType[] { ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE) ! }, ! new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE)); ! public FunStartsWith(XQueryContext context) { super(context, signature); } --- 37,61 ---- import org.exist.xquery.value.Type; ! public class FunStartsWith extends CollatingFunction { ! public final static FunctionSignature signatures[] = { ! new FunctionSignature ( ! new QName("starts-with", Module.BUILTIN_FUNCTION_NS), ! new SequenceType[] { ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE) ! }, ! new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE)), ! new FunctionSignature ( ! new QName("starts-with", Module.BUILTIN_FUNCTION_NS), ! new SequenceType[] { ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), ! new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE), ! new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE) ! }, ! new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE)) ! }; ! public FunStartsWith(XQueryContext context, FunctionSignature signature) { super(context, signature); } *************** *** 54,62 **** contextSequence = contextItem.toSequence(); ! Sequence s1 = getArgument(0).eval(contextSequence); ! Sequence s2 = getArgument(1).eval(contextSequence); ! if(s1.getLength() == 0 || s2.getLength() == 0) return Sequence.EMPTY_SEQUENCE; ! if(Collations.startsWith(context.getDefaultCollator(), s1.getStringValue(), s2.getStringValue())) return BooleanValue.TRUE; else --- 65,74 ---- contextSequence = contextItem.toSequence(); ! String s1 = getArgument(0).eval(contextSequence).getStringValue(); ! String s2 = getArgument(1).eval(contextSequence).getStringValue(); ! if(s1.length() == 0 || s2.length() == 0) return Sequence.EMPTY_SEQUENCE; ! Collator collator = getCollator(contextSequence, contextItem, 3); ! if(Collations.startsWith(collator, s1, s2)) return BooleanValue.TRUE; else Index: FunDeepEqual.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/FunDeepEqual.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FunDeepEqual.java 2 Aug 2005 18:23:45 -0000 1.6 --- FunDeepEqual.java 31 Oct 2005 08:52:57 -0000 1.7 *************** *** 45,48 **** --- 45,49 ---- }, new SequenceType(Type.BOOLEAN, Cardinality.ONE)); + // TODO: collation as argument public FunDeepEqual(XQueryContext context) { |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-30 12:06:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9571/src/org/exist/storage Modified Files: DBBroker.java Log Message: symbols.dbx also needs to be backed up. Index: DBBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/DBBroker.java,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** DBBroker.java 26 Oct 2005 14:44:08 -0000 1.65 --- DBBroker.java 30 Oct 2005 12:06:35 -0000 1.66 *************** *** 29,32 **** --- 29,33 ---- import java.io.FileOutputStream; import java.io.IOException; + import java.io.OutputStream; import java.text.Collator; import java.util.Iterator; *************** *** 150,153 **** --- 151,164 ---- } + public void backupSymbolsTo(OutputStream os) throws IOException { + FileInputStream fis = new FileInputStream(symbols.getFile()); + byte[] buf = new byte[1024]; + int len; + while ((len = fis.read(buf)) > 0) { + os.write(buf, 0, len); + } + fis.close(); + } + public SymbolTable getSymbols() { return symbols; |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-30 12:06:23
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9421/src/org/exist/storage Modified Files: DataBackup.java Log Message: symbols.dbx also needs to be backed up. Index: DataBackup.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/DataBackup.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DataBackup.java 30 Oct 2005 11:42:08 -0000 1.6 --- DataBackup.java 30 Oct 2005 12:06:15 -0000 1.7 *************** *** 101,104 **** --- 101,109 ---- } + // backup the symbols.dbx file (not included above) + out.putNextEntry(new ZipEntry(broker.getSymbols().getFile().getName())); + broker.backupSymbolsTo(out); + out.closeEntry(); + // close the zip file out.close(); |
|
From: Dannes W. <di...@us...> - 2005-10-30 11:50:54
|
Update of /cvsroot/exist/eXist-1.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5683 Modified Files: build.xml Log Message: Added start.jar to WEB-INF/lib Index: build.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/build.xml,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** build.xml 28 Oct 2005 14:42:13 -0000 1.111 --- build.xml 30 Oct 2005 11:50:46 -0000 1.112 *************** *** 618,621 **** --- 618,622 ---- <!-- Add files to WEB-INF/lib --> <lib dir="."> + <include name="start.jar"/> <include name="exist.jar"/> <include name="exist-optional.jar"/> *************** *** 623,633 **** </lib> <lib dir="${lib.core}"> ! <include name="*"/> <exclude name="javax.servlet.jar"/> - <exclude name="*.so"/> </lib> <lib dir="${lib.optional}"> <include name="*.jar"/> </lib> <lib dir="${lib.endorsed}"> <include name="*.jar"/> --- 624,634 ---- </lib> <lib dir="${lib.core}"> ! <include name="*.jar"/> <exclude name="javax.servlet.jar"/> </lib> <lib dir="${lib.optional}"> <include name="*.jar"/> </lib> + <!-- The following jars should not be here, but in 'endorsed' --> <lib dir="${lib.endorsed}"> <include name="*.jar"/> |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-30 11:45:00
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4660/src/org/exist/storage/dom Modified Files: DOMFile.java Log Message: Fixed an issue that may cause a recovery failure. Index: DOMFile.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/dom/DOMFile.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DOMFile.java 23 Oct 2005 21:18:49 -0000 1.8 --- DOMFile.java 30 Oct 2005 11:44:45 -0000 1.9 *************** *** 2018,2022 **** DOMPage page = getCurrentPage(loggable.pageNum); DOMFilePageHeader ph = page.getPageHeader(); ! if (requiresRedo(loggable, page)) { RecordPos rec = page.findRecord(ItemId.getId(loggable.tid)); SanityCheck.THROW_ASSERT(rec != null, "tid " + ItemId.getId(loggable.tid) + " not found on page " + page.getPageNum() + --- 2018,2022 ---- DOMPage page = getCurrentPage(loggable.pageNum); DOMFilePageHeader ph = page.getPageHeader(); ! if (ph.getLsn() > -1 && requiresRedo(loggable, page)) { RecordPos rec = page.findRecord(ItemId.getId(loggable.tid)); SanityCheck.THROW_ASSERT(rec != null, "tid " + ItemId.getId(loggable.tid) + " not found on page " + page.getPageNum() + |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-30 11:43:16
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4372/src/org/exist/storage Modified Files: NativeBroker.java Log Message: The DataBackup system task did no longer work, at least on windows. eXist now puts a lock on the database files. The backup task could thus not copy the files as long as the lock was active. Changed the code so backup uses the already open random access streams. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.201 retrieving revision 1.202 diff -C2 -d -r1.201 -r1.202 *** NativeBroker.java 28 Oct 2005 11:01:41 -0000 1.201 --- NativeBroker.java 30 Oct 2005 11:42:57 -0000 1.202 *************** *** 27,30 **** --- 27,31 ---- import java.io.IOException; import java.io.UnsupportedEncodingException; + import java.nio.channels.WritableByteChannel; import java.text.Collator; import java.util.ArrayList; *************** *** 135,138 **** --- 136,144 ---- private static final String WORDS_DBX = "words.dbx"; + private static final byte[] ALL_STORAGE_FILES = { + COLLECTIONS_DBX_ID, ELEMENTS_DBX_ID, VALUES_DBX_ID, + VALUES_QNAME_DBX_ID, WORDS_DBX_ID, DOM_DBX_ID + }; + private static final String TEMP_FRAGMENT_REMOVE_ERROR = "Could not remove temporary fragment"; *************** *** 1875,1879 **** "; docId = " + p.getDocument().getDocId()); // LOG.debug(domDb.debugPages(p.doc)); - Thread.dumpStack(); // return null; return objectWith(p.getDocument(), p.gid); // retry? --- 1881,1884 ---- *************** *** 3148,3153 **** --- 3153,3164 ---- case COLLECTIONS_DBX_ID : return collectionsDb; + case ELEMENTS_DBX_ID : + return elementsDb; + case WORDS_DBX_ID : + return dbWords; case VALUES_DBX_ID : return valuesDb; + case VALUES_QNAME_DBX_ID : + return valuesDbQname; case DOM_DBX_ID : return domDb; *************** *** 3157,3160 **** --- 3168,3175 ---- } + public byte[] getStorageFileIds() { + return ALL_STORAGE_FILES; + } + /* * if the currentPath is null return the parentPath else |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-30 11:42:47
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/btree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4332/src/org/exist/storage/btree Modified Files: Paged.java Log Message: The DataBackup system task did no longer work, at least on windows. eXist now puts a lock on the database files. The backup task could thus not copy the files as long as the lock was active. Changed the code so backup uses the already open random access streams. Index: Paged.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/btree/Paged.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Paged.java 20 Oct 2005 16:17:15 -0000 1.8 --- Paged.java 30 Oct 2005 11:42:30 -0000 1.9 *************** *** 74,77 **** --- 74,78 ---- import java.io.File; import java.io.IOException; + import java.io.OutputStream; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; *************** *** 228,231 **** --- 229,249 ---- /** + * Backup the entire contents of the underlying file to + * an output stream. + * + * @param os + * @throws IOException + */ + public void backupToStream(OutputStream os) throws IOException { + raf.seek(0); + + byte[] buf = new byte[1024]; + int len; + while ((len = raf.read(buf)) > 0) { + os.write(buf, 0, len); + } + } + + /** * getFile returns the file object for this Paged. * *************** *** 235,239 **** return file; } ! /** * getFileHeader returns the FileHeader --- 253,257 ---- return file; } ! /** * getFileHeader returns the FileHeader |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-30 11:42:16
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4263/src/org/exist/storage Modified Files: DataBackup.java Log Message: The DataBackup system task did no longer work, at least on windows. eXist now puts a lock on the database files. The backup task could thus not copy the files as long as the lock was active. Changed the code so backup uses the already open random access streams. Index: DataBackup.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/DataBackup.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DataBackup.java 3 Aug 2005 18:13:49 -0000 1.5 --- DataBackup.java 30 Oct 2005 11:42:08 -0000 1.6 *************** *** 26,29 **** --- 26,30 ---- import org.apache.log4j.Logger; import org.exist.EXistException; + import org.exist.storage.btree.Paged; import org.exist.util.Configuration; *************** *** 34,38 **** import java.util.zip.ZipOutputStream; import java.util.zip.ZipEntry; - import java.io.File; import java.io.*; --- 35,38 ---- *************** *** 74,132 **** public void execute(DBBroker broker) throws EXistException { ! Configuration config = broker.getConfiguration(); - String dataDir = (String) config.getProperty("db-connection.data-dir"); LOG.debug("Backing up data files ..."); ! ! File dir = new File(dataDir); ! FilenameFilter filter = new FilenameFilter() { ! public boolean accept(File dir, String name) { ! return name.endsWith(".dbx"); ! } ! }; ! String[] filenames = dir.list(filter); ! try { ! compressFiles(dataDir + File.separatorChar,filenames); ! } catch (Exception e) { ! e.printStackTrace(); } } - - void compressFiles(String datadir, String[] filenames) throws IOException { - String creationDate = creationDateFormat.format(new Date()); - String outFilename = dest + File.separatorChar + creationDate + ".zip"; - - // Create a buffer for reading the files - byte[] buf = new byte[1024]; - - try { - // Create the ZIP file - LOG.debug("Archiving data files into: " + outFilename); - - ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename)); - - // Compress the files - for (int i=0; i<filenames.length; i++) { - FileInputStream in = new FileInputStream(datadir+filenames[i]); - - // Add ZIP entry to output stream. - out.putNextEntry(new ZipEntry(filenames[i])); - - // Transfer bytes from the file to the ZIP file - int len; - while ((len = in.read(buf)) > 0) { - out.write(buf, 0, len); - } - - // Complete the entry - out.closeEntry(); - in.close(); - } - - // Complete the ZIP file - out.close(); - } catch (IOException e) { - } - } } --- 74,110 ---- public void execute(DBBroker broker) throws EXistException { ! if (!(broker instanceof NativeBroker)) ! throw new EXistException("DataBackup system task can only be used " + ! "with the native storage backend"); ! NativeBroker nbroker = (NativeBroker) broker; LOG.debug("Backing up data files ..."); ! ! String creationDate = creationDateFormat.format(new Date()); ! String outFilename = dest + File.separatorChar + creationDate + ".zip"; ! ! // Create the ZIP file ! LOG.debug("Archiving data files into: " + outFilename); ! ! try { ! ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename)); ! byte[] fileIds = nbroker.getStorageFileIds(); ! for (int i = 0; i < fileIds.length; i++) { ! Paged paged = nbroker.getStorage(fileIds[i]); ! ! // create a new entry and copy the paged file contents to it ! out.putNextEntry(new ZipEntry(paged.getFile().getName())); ! paged.backupToStream(out); ! ! // Complete the entry ! out.closeEntry(); ! } ! ! // close the zip file ! out.close(); ! } catch (IOException e) { ! LOG.warn("An IO error occurred while backing up data files: " + e.getMessage(), e); } } } |
|
From: Dannes W. <di...@us...> - 2005-10-30 11:24:09
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/validation/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1519/test Modified Files: ApacheXmlComponentsTest.java Log Message: Added xerces version test; the code relies on a certain xerces version..... Index: ApacheXmlComponentsTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/validation/test/ApacheXmlComponentsTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ApacheXmlComponentsTest.java 23 Oct 2005 15:51:50 -0000 1.2 --- ApacheXmlComponentsTest.java 30 Oct 2005 11:23:52 -0000 1.3 *************** *** 27,30 **** --- 27,31 ---- import junit.framework.TestCase; import junit.framework.TestSuite; + import org.exist.validation.Validator; /** *************** *** 35,39 **** public class ApacheXmlComponentsTest extends TestCase { - public static String XERCESVERSION = "Xerces-J 2.7.1"; public static String XALANVERSION = "Xalan Java 2.7.0"; --- 36,39 ---- *************** *** 64,73 **** System.out.println("Xerces"); ! System.out.println("Required version '"+XERCESVERSION+"'"); System.out.println("Found version '"+version+"'"); Assert.assertEquals("Incorrect Xerces version! "+ "Please put correct jar in endorsed folder", ! XERCESVERSION, version); } --- 64,73 ---- System.out.println("Xerces"); ! System.out.println("Required version '"+Validator.XERCESVERSION+"'"); System.out.println("Found version '"+version+"'"); Assert.assertEquals("Incorrect Xerces version! "+ "Please put correct jar in endorsed folder", ! Validator.XERCESVERSION, version); } |
|
From: Dannes W. <di...@us...> - 2005-10-30 11:24:09
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/validation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1519 Modified Files: Validator.java Log Message: Added xerces version test; the code relies on a certain xerces version..... Index: Validator.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/validation/Validator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Validator.java 16 Oct 2005 11:02:24 -0000 1.2 --- Validator.java 30 Oct 2005 11:23:52 -0000 1.3 *************** *** 61,65 **** private static BrokerPool brokerPool ; ! // Xerces feature and property names final static String FEATURE_DYNAMIC ="http://apache.org/xml/features/validation/dynamic"; --- 61,68 ---- private static BrokerPool brokerPool ; ! // Required Xerces version. ! public final static String XERCESVERSION = "Xerces-J 2.7.1"; ! ! // Xerces feature and property names final static String FEATURE_DYNAMIC ="http://apache.org/xml/features/validation/dynamic"; *************** *** 81,84 **** --- 84,104 ---- } + // Check xerces version + try{ + String version = org.apache.xerces.impl.Version.getVersion(); + + if(!XERCESVERSION.equals(version)){ + logger.error("Xerces version mismatch! eXist requires '" + + XERCESVERSION+"' but found '"+version+"'. " + + "Please add correct Xerces libraries to the " + + "endorsed folder of your JRE or webcontainer."); + } + + } catch (Exception ex){ + logger.error("Could not determine Xerces version. " + + "Please add correct Xerces libraries to the " + + "endorsed folder of your JRE or webcontainer."); + } + // setup access to grammars ; be sure just one instance! |
|
From: Ben G. F. <fat...@gm...> - 2005-10-30 03:16:53
|
hello all, I m trying to connect to eXist with an interface php, I m trying to do it with the example here http://bmuskalla.de/DB_eXist/ i installed php5 and eXist and then when I install the package with the pear-executable like this: $ pear install http://www.bmuskalla.de/DB_eXist/files/current.tgz a error appear : U need php version >=3D5.0 :( please help -- Fatmaa |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-29 21:25:25
|
Update of /cvsroot/exist/eXist-1.0/webapp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25245/webapp Modified Files: xquery.xml Log Message: Fixed: wildcards ('*', '?') were no longer working with near. Changed the function to again behave like &= if just a single token is specified in the search string. Index: xquery.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xquery.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** xquery.xml 29 Oct 2005 21:23:30 -0000 1.17 --- xquery.xml 29 Oct 2005 21:25:16 -0000 1.18 *************** *** 275,279 **** in the optional third argument. As a special case, if the string in the second argument contains only one token, any distance value in the third and fourth argument are ignored, and the function performs ! identically to the &= operator. An example:</para> <synopsis format="linespecific">document()//SPEECH[near(., 'love marriage', 25)</synopsis> <para>will return any SPEECH elements containing the words "love" and "marriage" and less --- 275,279 ---- in the optional third argument. As a special case, if the string in the second argument contains only one token, any distance value in the third and fourth argument are ignored, and the function performs ! identically to the &= operator. An example:</para> <synopsis format="linespecific">document()//SPEECH[near(., 'love marriage', 25)</synopsis> <para>will return any SPEECH elements containing the words "love" and "marriage" and less |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-29 21:23:37
|
Update of /cvsroot/exist/eXist-1.0/webapp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24870/webapp Modified Files: xquery.xml Log Message: Fixed: wildcards ('*', '?') were no longer working with near. Changed the function to again behave like &= if just a single token is specified in the search string. Index: xquery.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/xquery.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** xquery.xml 27 Sep 2005 18:42:08 -0000 1.16 --- xquery.xml 29 Oct 2005 21:23:30 -0000 1.17 *************** *** 270,277 **** attention to the order of search terms and their distance in the source document. The syntax is:</para> <synopsis format="linespecific">near(node-list, 'string of keywords' [, max-distance])</synopsis> ! <para>The functions measures the distance between two search terms by counting the words in between them. A maximum distance of 1 is assumed by default, which means that the search terms ! should occur next to each other. Other values may be specified in the optional third argument, ! e.g.:</para> <synopsis format="linespecific">document()//SPEECH[near(., 'love marriage', 25)</synopsis> <para>will return any SPEECH elements containing the words "love" and "marriage" and less --- 270,279 ---- attention to the order of search terms and their distance in the source document. The syntax is:</para> <synopsis format="linespecific">near(node-list, 'string of keywords' [, max-distance])</synopsis> ! <para>The function measures the distance between two search terms by counting the words in between them. A maximum distance of 1 is assumed by default, which means that the search terms ! should occur next to each other. Other values for the maximum and minimal distance may be specified ! in the optional third argument. As a special case, if the string in the second argument contains only ! one token, any distance value in the third and fourth argument are ignored, and the function performs ! identically to the &= operator. An example:</para> <synopsis format="linespecific">document()//SPEECH[near(., 'love marriage', 25)</synopsis> <para>will return any SPEECH elements containing the words "love" and "marriage" and less |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-29 21:23:28
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24765/src/org/exist/xquery/functions Modified Files: ExtNear.java Log Message: Fixed: wildcards ('*', '?') were no longer working with near. Changed the function to again behave like &= if just a single token is specified in the search string. Index: ExtNear.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/ExtNear.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ExtNear.java 4 Oct 2005 13:51:47 -0000 1.11 --- ExtNear.java 29 Oct 2005 21:23:12 -0000 1.12 *************** *** 46,270 **** /** ! * near() function. ! * ! *@author Wolfgang Meier <wol...@ex...> ! *@created July 31, 2002 */ public class ExtNear extends ExtFulltext { ! private int min_distance = 1; ! private int max_distance = 1; ! private Expression minDistance = null; ! private Expression maxDistance = null; ! public ExtNear(XQueryContext context) { ! super(context, Constants.FULLTEXT_AND); ! } ! /* (non-Javadoc) ! * @see org.exist.xquery.functions.ExtFulltext#analyze(org.exist.xquery.Expression) ! */ ! public void analyze(Expression parent, int flags) throws XPathException { ! super.analyze(parent, flags); ! if(maxDistance != null) { ! maxDistance.analyze(this, flags); ! } ! if(minDistance != null) { ! minDistance.analyze(this, flags); ! } ! } ! ! public Sequence evalQuery( ! String searchArg, ! NodeSet nodes) ! throws XPathException { ! if(maxDistance != null) { ! max_distance = ((IntegerValue) maxDistance.eval(nodes).convertTo(Type.INTEGER)).getInt(); ! } ! if(minDistance != null) { ! min_distance = ((IntegerValue) minDistance.eval(nodes).convertTo(Type.INTEGER)).getInt(); ! } ! try { ! getSearchTerms(context, searchArg); ! } catch (EXistException e) { ! throw new XPathException(e.getMessage(), e); } ! NodeSet hits = processQuery(nodes); ! if (hits == null) ! return Sequence.EMPTY_SEQUENCE; ! ! boolean hasWildcards = false; ! for(int i = 0; i < terms.length; i++) { ! hasWildcards |= ! NativeTextEngine.containsWildcards(terms[i]); } - return hasWildcards - ? patternMatch(context, hits) - : exactMatch(context, hits); - } ! private Sequence exactMatch(XQueryContext context, NodeSet result) { ! // walk through hits and calculate term-distances ! String value; ! String term; ! String word; ! TextToken token; ! NodeProxy current; ! NodeSet r = new ExtArrayNodeSet(); ! Tokenizer tok = context.getBroker().getTextEngine().getTokenizer(); ! int j; ! int current_distance; ! for (Iterator i = result.iterator(); i.hasNext();) { ! current = (NodeProxy) i.next(); ! value = current.getNodeValueSeparated(); ! tok.setText(value); ! j = 0; ! if (j < terms.length) { ! term = terms[j]; ! } else { ! break; ! } ! current_distance = -1; ! ! while ((token = tok.nextToken()) != null) { ! word = token.getText().toLowerCase(); ! if (current_distance > max_distance) { ! // reset ! j = 0; ! term = terms[j]; ! current_distance = -1; ! ! } // that else would cause some words to be ignored in the matching ! if (word.equalsIgnoreCase(term)) { ! boolean withIn = current_distance >= min_distance ? true : false; ! current_distance = 0; ! j++; ! if (j == terms.length) { ! // all terms found ! if (withIn) { ! r.add(current); } - break; - } else { - term = terms[j]; - } ! } else if (j > 0 && word.equalsIgnoreCase(terms[0])) { ! // first search term found: start again ! j = 1; ! term = terms[j]; ! current_distance = 0; ! continue; ! } // that else MAY cause the distance counts to be off by one but i'm not sure ! if (-1 < current_distance) { ! ++current_distance; } ! } } - // LOG.debug("found " + r.getLength()); - return r; - } ! private Sequence patternMatch(XQueryContext context, NodeSet result) { ! // generate list of search term patterns ! Pattern patterns[] = new Pattern[terms.length]; ! Matcher matchers[] = new Matcher[terms.length]; ! for (int i = 0; i < patterns.length; i++) ! try { ! patterns[i] = Pattern.compile(GlobToRegex.globToRegexp(terms[i]), ! Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE); ! matchers[i] = patterns[i].matcher(""); ! } catch (PatternSyntaxException e) { ! LOG.warn("malformed pattern", e); ! return Sequence.EMPTY_SEQUENCE; ! } ! ! // walk through hits and calculate term-distances ! String value; ! Pattern term; ! String word; ! TextToken token; ! NodeProxy current; ! ExtArrayNodeSet r = new ExtArrayNodeSet(100); ! Matcher matcher; ! Tokenizer tok = context.getBroker().getTextEngine().getTokenizer(); ! int j; ! int current_distance; ! for (Iterator i = result.iterator(); i.hasNext();) { ! current = (NodeProxy) i.next(); ! value = current.getNodeValueSeparated(); ! tok.setText(value); ! j = 0; ! if (j < patterns.length) { ! term = patterns[j]; ! matcher = matchers[j]; ! } else { ! break; ! } - current_distance = -1; - - while ((token = tok.nextToken()) != null) { - word = token.getText().toLowerCase(); - if (current_distance > max_distance) { - // reset - j = 0; - term = patterns[j]; - matcher = matchers[j]; - current_distance = -1; - continue; - } - matcher.reset(word); - matchers[0].reset(word); - if (matcher.matches()) { - boolean withIn = current_distance >= min_distance ? true : false; - current_distance = 0; - j++; - if (j == patterns.length) { - // all terms found - if (withIn) { - r.add(current); } - break; - } else { - term = patterns[j]; - matcher = matchers[j]; - } - } else if (j > 0 && matchers[0].matches()) { - // first search term found: start again - j = 1; - term = patterns[j]; - matcher = matchers[j]; - current_distance = 0; - continue; - } else if (-1 < current_distance) { - ++current_distance; } ! ! } } - return r; - } - - /* (non-Javadoc) - * @see org.exist.xquery.functions.ExtFulltext#dump(org.exist.xquery.util.ExpressionDumper) - */ - public void dump(ExpressionDumper dumper) { - dumper.display("near("); - path.dump(dumper); - dumper.display(", "); - searchTerm.dump(dumper); - dumper.display(")"); - } - - public void setMaxDistance(Expression expr) { - maxDistance = expr; - } - - public void setMinDistance(Expression expr) { - minDistance = expr; - } } --- 46,283 ---- /** ! * near() function. ! * ! * @author Wolfgang Meier <wol...@ex...> ! * @created July 31, 2002 */ public class ExtNear extends ExtFulltext { ! private int min_distance = 1; ! private int max_distance = 1; ! private Expression minDistance = null; ! private Expression maxDistance = null; ! ! public ExtNear(XQueryContext context) { ! super(context, Constants.FULLTEXT_AND); } ! ! /* ! * (non-Javadoc) ! * ! * @see org.exist.xquery.functions.ExtFulltext#analyze(org.exist.xquery.Expression) ! */ ! public void analyze(Expression parent, int flags) throws XPathException { ! super.analyze(parent, flags); ! ! if (maxDistance != null) { ! maxDistance.analyze(this, flags); ! } ! if (minDistance != null) { ! minDistance.analyze(this, flags); ! } } ! public Sequence evalQuery(String searchArg, NodeSet nodes) ! throws XPathException { ! if (maxDistance != null) { ! max_distance = ((IntegerValue) maxDistance.eval(nodes).convertTo( ! Type.INTEGER)).getInt(); ! } ! if (minDistance != null) { ! min_distance = ((IntegerValue) minDistance.eval(nodes).convertTo( ! Type.INTEGER)).getInt(); ! } ! try { ! getSearchTerms(context, searchArg); ! } catch (EXistException e) { ! throw new XPathException(e.getMessage(), e); ! } ! NodeSet hits = processQuery(nodes); ! if (hits == null) ! return Sequence.EMPTY_SEQUENCE; ! if (terms.length == 1) ! return hits; ! ! boolean hasWildcards = false; ! for (int i = 0; i < terms.length; i++) { ! hasWildcards |= NativeTextEngine.containsWildcards(terms[i]); ! } ! return hasWildcards ? patternMatch(context, hits) : exactMatch(context, ! hits); ! } ! private Sequence exactMatch(XQueryContext context, NodeSet result) { ! // walk through hits and calculate term-distances ! String value; ! String term; ! String word; ! TextToken token; ! NodeProxy current; ! NodeSet r = new ExtArrayNodeSet(); ! Tokenizer tok = context.getBroker().getTextEngine().getTokenizer(); ! int j; ! int current_distance; ! for (Iterator i = result.iterator(); i.hasNext();) { ! current = (NodeProxy) i.next(); ! value = current.getNodeValueSeparated(); ! tok.setText(value); ! j = 0; ! if (j < terms.length) { ! term = terms[j]; ! } else { ! break; } ! current_distance = -1; ! ! while ((token = tok.nextToken()) != null) { ! word = token.getText().toLowerCase(); ! ! if (current_distance > max_distance) { ! // reset ! j = 0; ! term = terms[j]; ! current_distance = -1; ! ! } // that else would cause some words to be ignored in the ! // matching ! if (word.equalsIgnoreCase(term)) { ! boolean withIn = current_distance >= min_distance ? true ! : false; ! current_distance = 0; ! j++; ! if (j == terms.length) { ! // all terms found ! if (withIn) { ! r.add(current); ! } ! break; ! } else { ! term = terms[j]; ! } ! ! } else if (j > 0 && word.equalsIgnoreCase(terms[0])) { ! // first search term found: start again ! j = 1; ! term = terms[j]; ! current_distance = 0; ! continue; ! } // that else MAY cause the distance counts to be off by one ! // but i'm not sure ! if (-1 < current_distance) { ! ++current_distance; ! } ! } } ! // LOG.debug("found " + r.getLength()); ! return r; } ! private Sequence patternMatch(XQueryContext context, NodeSet result) { ! // generate list of search term patterns ! Pattern patterns[] = new Pattern[terms.length]; ! Matcher matchers[] = new Matcher[terms.length]; ! for (int i = 0; i < patterns.length; i++) ! try { ! patterns[i] = Pattern.compile(GlobToRegex ! .globToRegexp(terms[i]), Pattern.CASE_INSENSITIVE ! | Pattern.UNICODE_CASE); ! matchers[i] = patterns[i].matcher(""); ! } catch (PatternSyntaxException e) { ! LOG.warn("malformed pattern", e); ! return Sequence.EMPTY_SEQUENCE; ! } ! ! // walk through hits and calculate term-distances ! String value; ! Pattern term; ! String word; ! TextToken token; ! NodeProxy current; ! ExtArrayNodeSet r = new ExtArrayNodeSet(100); ! Matcher matcher; ! Tokenizer tok = context.getBroker().getTextEngine().getTokenizer(); ! int j; ! int current_distance; ! for (Iterator i = result.iterator(); i.hasNext();) { ! current = (NodeProxy) i.next(); ! value = current.getNodeValueSeparated(); ! tok.setText(value); ! j = 0; ! if (j < patterns.length) { ! term = patterns[j]; ! matcher = matchers[j]; ! } else { ! break; ! } ! ! current_distance = -1; ! ! while ((token = tok.nextToken()) != null) { ! word = token.getText().toLowerCase(); ! if (current_distance > max_distance) { ! // reset ! j = 0; ! term = patterns[j]; ! matcher = matchers[j]; ! current_distance = -1; ! } ! matcher.reset(word); ! matchers[0].reset(word); ! if (matcher.matches()) { ! boolean withIn = current_distance >= min_distance ? true ! : false; ! current_distance = 0; ! j++; ! if (j == patterns.length) { ! // all terms found ! if (withIn) { ! r.add(current); ! } ! break; ! } else { ! term = patterns[j]; ! matcher = matchers[j]; ! } ! } else if (j > 0 && matchers[0].matches()) { ! // first search term found: start again ! j = 1; ! term = patterns[j]; ! matcher = matchers[j]; ! current_distance = 0; ! continue; ! } ! if (-1 < current_distance) { ! ++current_distance; ! } } } ! return r; ! } ! ! /* ! * (non-Javadoc) ! * ! * @see org.exist.xquery.functions.ExtFulltext#dump(org.exist.xquery.util.ExpressionDumper) ! */ ! public void dump(ExpressionDumper dumper) { ! dumper.display("near("); ! path.dump(dumper); ! dumper.display(", "); ! searchTerm.dump(dumper); ! dumper.display(")"); ! } ! ! public void setMaxDistance(Expression expr) { ! maxDistance = expr; ! } ! ! public void setMinDistance(Expression expr) { ! minDistance = expr; } } |
|
From: Wolfgang M. M. <wol...@us...> - 2005-10-29 20:06:01
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/dom In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4513/src/org/exist/dom Modified Files: NodeProxy.java Log Message: Fix NPE in NodeProxy.compareTo Index: NodeProxy.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/dom/NodeProxy.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** NodeProxy.java 30 Sep 2005 21:30:21 -0000 1.64 --- NodeProxy.java 29 Oct 2005 20:05:51 -0000 1.65 *************** *** 28,31 **** --- 28,32 ---- import org.exist.storage.StorageAddress; import org.exist.storage.serializers.Serializer; + import org.exist.util.sanity.SanityCheck; import org.exist.xquery.Cardinality; import org.exist.xquery.XPathException; *************** *** 185,189 **** public int compareTo(Object other) { if(!(other instanceof NodeProxy)) ! throw new RuntimeException("cannot compare NodeProxy with " + other.getClass().getName()); return compareTo((NodeProxy) other); } --- 186,190 ---- public int compareTo(Object other) { if(!(other instanceof NodeProxy)) ! return 1; return compareTo((NodeProxy) other); } |
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/concurrent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20351/src/org/exist/xmldb/test/concurrent Modified Files: ConcurrentResourceTest.java ConcurrentResourceTest2.java ConcurrentQueryTest.java ConcurrentAttrUpdateTest.java ComplexUpdateTest.java Log Message: Using named constants in collection names : daily commit. Index: ConcurrentAttrUpdateTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/concurrent/ConcurrentAttrUpdateTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ConcurrentAttrUpdateTest.java 12 Oct 2004 21:10:54 -0000 1.3 --- ConcurrentAttrUpdateTest.java 29 Oct 2005 16:45:47 -0000 1.4 *************** *** 9,12 **** --- 9,14 ---- import java.io.File; + import org.exist.storage.DBBroker; + /** * @author wolf *************** *** 17,21 **** public class ConcurrentAttrUpdateTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist:///db"; private final static String QUERY = --- 19,23 ---- public class ConcurrentAttrUpdateTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private final static String QUERY = Index: ConcurrentResourceTest2.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/concurrent/ConcurrentResourceTest2.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConcurrentResourceTest2.java 26 Jul 2005 07:15:36 -0000 1.4 --- ConcurrentResourceTest2.java 29 Oct 2005 16:45:47 -0000 1.5 *************** *** 22,25 **** --- 22,26 ---- package org.exist.xmldb.test.concurrent; + import org.exist.storage.DBBroker; import org.xmldb.api.base.Collection; *************** *** 29,41 **** public class ConcurrentResourceTest2 extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist:///db"; private final static String QUERY0 = "declare default element namespace 'http://www.loc.gov/mods/v3';" + ! "collection(\"/db\")//mods[titleInfo/title &= 'germany']"; private final static String QUERY1 = "declare default element namespace 'http://www.loc.gov/mods/v3';" + ! "<result>{for $t in distinct-values(collection('/db')//mods/subject/topic) order by $t return <topic>{$t}</topic>}</result>"; public static void main(String[] args) { --- 30,42 ---- public class ConcurrentResourceTest2 extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private final static String QUERY0 = "declare default element namespace 'http://www.loc.gov/mods/v3';" + ! "collection(\"" + DBBroker.ROOT_COLLECTION + "\")//mods[titleInfo/title &= 'germany']"; private final static String QUERY1 = "declare default element namespace 'http://www.loc.gov/mods/v3';" + ! "<result>{for $t in distinct-values(\"" + DBBroker.ROOT_COLLECTION + "\")//mods/subject/topic) order by $t return <topic>{$t}</topic>}</result>"; public static void main(String[] args) { Index: ConcurrentResourceTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/concurrent/ConcurrentResourceTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConcurrentResourceTest.java 26 Jul 2005 07:15:36 -0000 1.7 --- ConcurrentResourceTest.java 29 Oct 2005 16:45:47 -0000 1.8 *************** *** 24,27 **** --- 24,28 ---- import java.io.File; + import org.exist.storage.DBBroker; import org.xmldb.api.base.Collection; *************** *** 33,37 **** public class ConcurrentResourceTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist:///db"; public static void main(String[] args) { --- 34,38 ---- public class ConcurrentResourceTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; public static void main(String[] args) { Index: ConcurrentQueryTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/concurrent/ConcurrentQueryTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ConcurrentQueryTest.java 3 Jan 2005 20:08:36 -0000 1.7 --- ConcurrentQueryTest.java 29 Oct 2005 16:45:47 -0000 1.8 *************** *** 24,27 **** --- 24,28 ---- import java.io.File; + import org.exist.storage.DBBroker; import org.exist.storage.NativeElementIndex; *************** *** 31,35 **** public class ConcurrentQueryTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist:///db"; public static void main(String[] args) { --- 32,36 ---- public class ConcurrentQueryTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; public static void main(String[] args) { Index: ComplexUpdateTest.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/test/concurrent/ComplexUpdateTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ComplexUpdateTest.java 17 Oct 2004 20:29:05 -0000 1.3 --- ComplexUpdateTest.java 29 Oct 2005 16:45:47 -0000 1.4 *************** *** 1,4 **** --- 1,5 ---- package org.exist.xmldb.test.concurrent; + import org.exist.storage.DBBroker; import org.xmldb.api.modules.XMLResource; *************** *** 8,12 **** public class ComplexUpdateTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist:///db"; private final static String XML = --- 9,13 ---- public class ComplexUpdateTest extends ConcurrentTestBase { ! private final static String URI = "xmldb:exist://" + DBBroker.ROOT_COLLECTION; private final static String XML = |
|
From: Pierrick B. <br...@us...> - 2005-10-29 16:45:56
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20351/src/org/exist/xmldb Modified Files: LocalCollection.java DatabaseImpl.java RemoteIndexQueryService.java RemoteCollectionManagementService.java LocalIndexQueryService.java RemoteCollection.java LocalCollectionManagementService.java Log Message: Using named constants in collection names : daily commit. Index: RemoteCollectionManagementService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/RemoteCollectionManagementService.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RemoteCollectionManagementService.java 24 Oct 2005 17:13:57 -0000 1.10 --- RemoteCollectionManagementService.java 29 Oct 2005 16:45:46 -0000 1.11 *************** *** 6,9 **** --- 6,10 ---- import org.apache.xmlrpc.XmlRpcClient; import org.apache.xmlrpc.XmlRpcException; + import org.exist.storage.DBBroker; import org.exist.storage.NativeBroker; import org.w3c.dom.Document; *************** *** 30,34 **** public Collection createCollection( String collName, Date created) throws XMLDBException { String name = collName; ! if ( ( !collName.startsWith( "/db" ) ) && parent != null ) name = parent.getPath() + "/" + collName; --- 31,35 ---- public Collection createCollection( String collName, Date created) throws XMLDBException { String name = collName; ! if ( ( !collName.startsWith( DBBroker.ROOT_COLLECTION ) ) && parent != null ) name = parent.getPath() + "/" + collName; *************** *** 119,128 **** */ public void move(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /* if(!collectionPath.startsWith("/db/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); /*if(destinationPath != null) { ! if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath; } --- 120,129 ---- */ public void move(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /* if(!collectionPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); /*if(destinationPath != null) { ! if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath; } *************** *** 157,166 **** */ public void moveResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*if(!resourcePath.startsWith("/db/")) resourcePath = parent.getPath() + '/' + resourcePath;*/ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); /*if(destinationPath != null) { ! if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath; } --- 158,167 ---- */ public void moveResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*if(!resourcePath.startsWith(DBBroker.ROOT_COLLECTION + "/")) resourcePath = parent.getPath() + '/' + resourcePath;*/ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); /*if(destinationPath != null) { ! if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath; } *************** *** 196,203 **** public void copy(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /*if(!collectionPath.startsWith("/db/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); ! /*if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath;*/ destinationPath = NativeBroker.checkPath(destinationPath, parent.getPath()); --- 197,204 ---- public void copy(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /*if(!collectionPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); ! /*if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath;*/ destinationPath = NativeBroker.checkPath(destinationPath, parent.getPath()); *************** *** 229,236 **** public void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*if(!resourcePath.startsWith("/db/")) resourcePath = parent.getPath() + '/' + resourcePath;*/ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); ! /*if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath;*/ destinationPath = NativeBroker.checkPath(destinationPath, parent.getPath()); --- 230,237 ---- public void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*if(!resourcePath.startsWith(DBBroker.ROOT_COLLECTION+ "/")) resourcePath = parent.getPath() + '/' + resourcePath;*/ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); ! /*if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath;*/ destinationPath = NativeBroker.checkPath(destinationPath, parent.getPath()); Index: LocalIndexQueryService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalIndexQueryService.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LocalIndexQueryService.java 24 Oct 2005 17:13:57 -0000 1.13 --- LocalIndexQueryService.java 29 Oct 2005 16:45:46 -0000 1.14 *************** *** 81,85 **** */ public void reindexCollection(String collectionPath) throws XMLDBException { ! /*String path = (collectionPath.startsWith("/db/") ? collectionPath : parent.getPath() + '/' + collectionPath);*/ String path = NativeBroker.checkPath(collectionPath, parent.getPath()); --- 81,85 ---- */ public void reindexCollection(String collectionPath) throws XMLDBException { ! /*String path = (collectionPath.startsWith(DBBroker.ROOT_COLLECTION + "/") ? collectionPath : parent.getPath() + '/' + collectionPath);*/ String path = NativeBroker.checkPath(collectionPath, parent.getPath()); Index: DatabaseImpl.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/DatabaseImpl.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** DatabaseImpl.java 29 Sep 2005 08:35:05 -0000 1.25 --- DatabaseImpl.java 29 Oct 2005 16:45:46 -0000 1.26 *************** *** 31,34 **** --- 31,35 ---- import org.exist.EXistException; import org.exist.security.User; + import org.exist.storage.DBBroker; import org.exist.storage.BrokerPool; import org.exist.util.Configuration; *************** *** 186,190 **** // try to figure out server address int p = 0; ! if ( ( p = c.indexOf( "/db", 2 ) ) > -1 ) { address = "http://" + c.substring( 2, p ); if(address.charAt(address.length() - 1) == '/') --- 187,191 ---- // try to figure out server address int p = 0; ! if ( ( p = c.indexOf( DBBroker.ROOT_COLLECTION, 2 ) ) > -1 ) { address = "http://" + c.substring( 2, p ); if(address.charAt(address.length() - 1) == '/') Index: LocalCollection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalCollection.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** LocalCollection.java 25 Oct 2005 17:43:57 -0000 1.60 --- LocalCollection.java 29 Oct 2005 16:45:46 -0000 1.61 *************** *** 129,133 **** this.path = name; if (path == null) ! path = "/db"; getCollection(); } --- 129,133 ---- this.path = name; if (path == null) ! path = DBBroker.ROOT_COLLECTION; getCollection(); } *************** *** 302,306 **** public org.xmldb.api.base.Collection getParentCollection() throws XMLDBException { ! if (getName().equals("/db")) return null; if (parent == null) { --- 302,306 ---- public org.xmldb.api.base.Collection getParentCollection() throws XMLDBException { ! if (getName().equals(DBBroker.ROOT_COLLECTION)) return null; if (parent == null) { Index: RemoteIndexQueryService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/RemoteIndexQueryService.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RemoteIndexQueryService.java 24 Oct 2005 17:13:57 -0000 1.12 --- RemoteIndexQueryService.java 29 Oct 2005 16:45:46 -0000 1.13 *************** *** 28,31 **** --- 28,32 ---- import org.apache.xmlrpc.XmlRpcException; import org.exist.dom.QName; + import org.exist.storage.DBBroker; import org.exist.storage.NativeBroker; import org.exist.util.Occurrences; *************** *** 53,57 **** /** @see org.exist.xmldb.IndexQueryService#reindexCollection(java.lang.String) */ public void reindexCollection(String collectionPath) throws XMLDBException { ! /*String path = (collectionPath.startsWith("/db") ? collectionPath : parent.getPath() + '/' + collectionPath);*/ String path = NativeBroker.checkPath(collectionPath, parent.getPath()); --- 54,58 ---- /** @see org.exist.xmldb.IndexQueryService#reindexCollection(java.lang.String) */ public void reindexCollection(String collectionPath) throws XMLDBException { ! /*String path = (collectionPath.startsWith(DBBroker.ROOT_COLLECTION) ? collectionPath : parent.getPath() + '/' + collectionPath);*/ String path = NativeBroker.checkPath(collectionPath, parent.getPath()); Index: LocalCollectionManagementService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/LocalCollectionManagementService.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** LocalCollectionManagementService.java 24 Oct 2005 17:13:57 -0000 1.21 --- LocalCollectionManagementService.java 29 Oct 2005 16:45:46 -0000 1.22 *************** *** 120,124 **** public void removeCollection( String collName ) throws XMLDBException { ! //String path = (collName.startsWith("/db/") ? collName : // parent.getPath() + '/' + collName); String path = NativeBroker.checkPath(collName, parent.getPath()); --- 120,124 ---- public void removeCollection( String collName ) throws XMLDBException { ! //String path = (collName.startsWith(DBBroker.ROOT_COLLECTION + "/") ? collName : // parent.getPath() + '/' + collName); String path = NativeBroker.checkPath(collName, parent.getPath()); *************** *** 159,163 **** public void move(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /*if(!collectionPath.startsWith("/db/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); --- 159,163 ---- public void move(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /*if(!collectionPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); *************** *** 165,169 **** if(destinationPath != null) { ! if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath; } --- 165,169 ---- if(destinationPath != null) { ! if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath; } *************** *** 216,225 **** public void moveResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*if(!resourcePath.startsWith("/db/")) resourcePath = parent.getPath() + '/' + resourcePath;*/ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); /*if(destinationPath != null) { ! if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath; } --- 216,225 ---- public void moveResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*if(!resourcePath.startsWith(DBBroker.ROOT_COLLECTION + "/")) resourcePath = parent.getPath() + '/' + resourcePath;*/ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); /*if(destinationPath != null) { ! if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath; } *************** *** 284,292 **** public void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*(if(!resourcePath.startsWith("/db/")) resourcePath = parent.getPath() + '/' + resourcePath; */ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); ! /*if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath;*/ destinationPath = NativeBroker.checkPath(destinationPath, parent.getPath()); --- 284,292 ---- public void copyResource(String resourcePath, String destinationPath, String newName) throws XMLDBException { ! /*(if(!resourcePath.startsWith(DBBroker.ROOT_COLLECTION + "/")) resourcePath = parent.getPath() + '/' + resourcePath; */ resourcePath = NativeBroker.checkPath(resourcePath, parent.getPath()); ! /*if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath;*/ destinationPath = NativeBroker.checkPath(destinationPath, parent.getPath()); *************** *** 343,350 **** public void copy(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /*if(!collectionPath.startsWith("/db/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); ! /*if(!destinationPath.startsWith("/db/")) destinationPath = parent.getPath() + '/' + destinationPath; */ --- 343,350 ---- public void copy(String collectionPath, String destinationPath, String newName) throws XMLDBException { ! /*if(!collectionPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) collectionPath = parent.getPath() + '/' + collectionPath;*/ collectionPath = NativeBroker.checkPath(collectionPath, parent.getPath()); ! /*if(!destinationPath.startsWith(DBBroker.ROOT_COLLECTION + "/")) destinationPath = parent.getPath() + '/' + destinationPath; */ Index: RemoteCollection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/RemoteCollection.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** RemoteCollection.java 25 Oct 2005 17:43:57 -0000 1.26 --- RemoteCollection.java 29 Oct 2005 16:45:46 -0000 1.27 *************** *** 39,42 **** --- 39,43 ---- import org.apache.xmlrpc.XmlRpcException; import org.exist.security.Permission; + import org.exist.storage.DBBroker; import org.exist.validation.service.RemoteValidationService; import org.exist.xmlrpc.RpcServer; *************** *** 147,151 **** public Collection getParentCollection() throws XMLDBException { ! if(parent == null && !name.equals("/db")) { String parentName = name.substring(0, name.lastIndexOf('/')); return new RemoteCollection(rpcClient, null, parentName); --- 148,152 ---- public Collection getParentCollection() throws XMLDBException { ! if(parent == null && !name.equals(DBBroker.ROOT_COLLECTION)) { String parentName = name.substring(0, name.lastIndexOf('/')); return new RemoteCollection(rpcClient, null, parentName); *************** *** 159,163 **** return name; else ! return "/db"; } return name; --- 160,164 ---- return name; else ! return DBBroker.ROOT_COLLECTION; } return name; |
|
From: Pierrick B. <br...@us...> - 2005-10-29 13:36:12
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19201/src/org/exist/xquery/value Modified Files: ValueSequence.java EmptySequence.java Log Message: Added toString() methods to XPath exressions in order to simplify debugging (at least for me). Index: ValueSequence.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/ValueSequence.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ValueSequence.java 17 Feb 2005 11:46:36 -0000 1.12 --- ValueSequence.java 29 Oct 2005 13:35:59 -0000 1.13 *************** *** 230,233 **** --- 230,250 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("("); + boolean morethanOne = false; + for (SequenceIterator i = iterate(); i.hasNext(); ) { + Item next = i.nextItem(); + if (morethanOne) { + result.append(", "); + morethanOne = true; + } + result.append(next.toString()); + } + result.append(")"); + return result.toString(); + + } + private class ValueSequenceIterator implements SequenceIterator { Index: EmptySequence.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/value/EmptySequence.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EmptySequence.java 7 Nov 2004 16:06:03 -0000 1.3 --- EmptySequence.java 29 Oct 2005 13:35:59 -0000 1.4 *************** *** 87,89 **** --- 87,93 ---- // nothing to do } + + public String toString() { + return "()"; + } } |
|
From: Pierrick B. <br...@us...> - 2005-10-29 13:36:12
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19201/src/org/exist/xquery Modified Files: Variable.java Dependency.java Log Message: Added toString() methods to XPath exressions in order to simplify debugging (at least for me). Index: Dependency.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Dependency.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Dependency.java 20 Dec 2004 20:29:07 -0000 1.3 --- Dependency.java 29 Oct 2005 13:35:59 -0000 1.4 *************** *** 53,56 **** --- 53,76 ---- */ public final static int DEFAULT_DEPENDENCIES = CONTEXT_SET; + + public final static String getDependenciesName(int dependencies) { + if (dependencies == NO_DEPENDENCY) return + "NO_DEPENDENCY"; + StringBuffer result = new StringBuffer(); + result.append("["); + if ((dependencies & CONTEXT_SET) != 0) + result.append("CONTEXT_SET | "); + if ((dependencies & CONTEXT_ITEM) != 0) + result.append("CONTEXT_ITEM | "); + if ((dependencies & LOCAL_VARS) != 0) + result.append("LOCAL_VARS | "); + if ((dependencies & CONTEXT_VARS) != 0) + result.append("CONTEXT_VARS | "); + if ((dependencies & CONTEXT_POSITION) != 0) + result.append("CONTEXT_POSITION | "); + result.delete(result.length() - 3, result.length()); + result.append("]"); + return result.toString(); + } } Index: Variable.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Variable.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Variable.java 24 Sep 2005 13:18:00 -0000 1.15 --- Variable.java 29 Oct 2005 13:35:59 -0000 1.16 *************** *** 93,97 **** public String toString() { ! return "$" + qname.toString(); } --- 93,102 ---- public String toString() { ! StringBuffer result = new StringBuffer(); ! result.append("$" + qname.toString()); ! result.append(" "); ! result.append(Type.getTypeName(getType())); ! result.append(Cardinality.toString(getCardinality())); ! return result.toString(); } |
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20795/src/org/exist/xquery Modified Files: Union.java DynamicAttributeConstructor.java Except.java GeneralComparison.java ForExpr.java AttributeConstructor.java OpOr.java DynamicCardinalityCheck.java PathExpr.java RootNode.java CommentConstructor.java LetExpr.java VariableReference.java OpAnd.java NamespaceConstructor.java ElementConstructor.java LiteralValue.java ConditionalExpression.java CastableExpression.java EnclosedExpr.java CDATAConstructor.java Intersection.java DynamicTextConstructor.java AtomicToString.java Step.java DocumentConstructor.java InstanceOfExpression.java VariableDeclaration.java FilteredExpression.java QuantifiedExpression.java DynamicPIConstructor.java Atomize.java Function.java OpNumeric.java DynamicCommentConstructor.java CastExpression.java UntypedValueCheck.java DynamicNameCheck.java SequenceConstructor.java TextConstructor.java DynamicTypeCheck.java PIConstructor.java NodeComparison.java Log Message: Added toString() methods to XPath exressions in order to simplify debugging (at least for me). Index: DynamicNameCheck.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicNameCheck.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DynamicNameCheck.java 6 Jan 2005 17:53:38 -0000 1.1 --- DynamicNameCheck.java 29 Oct 2005 10:51:12 -0000 1.2 *************** *** 103,106 **** --- 103,115 ---- dumper.display(')'); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(Type.getTypeName(test.nodeType)); + result.append('('); + result.append(expression.toString()); + result.append(')'); + return result.toString(); + } } Index: Union.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Union.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Union.java 26 Oct 2005 17:48:13 -0000 1.8 --- Union.java 29 Oct 2005 10:51:11 -0000 1.9 *************** *** 69,71 **** --- 69,79 ---- right.dump(dumper); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(left.toString()); + result.append(" union "); + result.append(right.toString()); + return result.toString(); + } } Index: DocumentConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DocumentConstructor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DocumentConstructor.java 14 Nov 2004 22:15:11 -0000 1.3 --- DocumentConstructor.java 29 Oct 2005 10:51:12 -0000 1.4 *************** *** 124,127 **** --- 124,135 ---- dumper.nl().display('}'); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("document { "); + result.append(content.toString()); + result.append(" }"); + return result.toString(); + } } Index: Step.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Step.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Step.java 16 Nov 2004 15:47:04 -0000 1.4 --- Step.java 29 Oct 2005 10:51:12 -0000 1.5 *************** *** 85,88 **** --- 85,89 ---- dumper.display( "::" ); if ( test != null ) + //TODO : toString() or... dump ? dumper.display( test.toString() ); else *************** *** 96,99 **** --- 97,118 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + if ( axis > -1 ) + result.append( Constants.AXISSPECIFIERS[axis] ); + result.append( "::" ); + if ( test != null ) + result.append( test.toString() ); + else + result.append( "node()" ); + if ( predicates.size() > 0 ) + for ( Iterator i = predicates.iterator(); i.hasNext(); ) { + result.append( '[' ); + result.append(( (Predicate) i.next() ).toString()); + result.append( ']' ); + } + return result.toString(); + } + public int returnsType() { return Type.NODE; Index: DynamicTypeCheck.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicTypeCheck.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DynamicTypeCheck.java 6 Jan 2005 17:53:38 -0000 1.7 --- DynamicTypeCheck.java 29 Oct 2005 10:51:12 -0000 1.8 *************** *** 86,89 **** --- 86,98 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(Type.getTypeName(requiredType)); + result.append('('); + result.append(expression.toString()); + result.append(')'); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: GeneralComparison.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/GeneralComparison.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** GeneralComparison.java 15 Oct 2005 16:59:32 -0000 1.43 --- GeneralComparison.java 29 Oct 2005 10:51:11 -0000 1.44 *************** *** 562,565 **** --- 562,573 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(getLeft().toString()); + result.append(' ').append(Constants.OPS[relation]).append(' '); + result.append(getRight().toString()); + return result.toString(); + } + protected void switchOperands() { switch (relation) { Index: Except.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Except.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Except.java 26 Oct 2005 17:48:13 -0000 1.6 --- Except.java 29 Oct 2005 10:51:11 -0000 1.7 *************** *** 80,82 **** --- 80,90 ---- right.dump(dumper); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(left.toString()); + result.append(" except "); + result.append(right.toString()); + return result.toString(); + } } Index: DynamicTextConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicTextConstructor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DynamicTextConstructor.java 14 Nov 2004 22:15:11 -0000 1.2 --- DynamicTextConstructor.java 29 Oct 2005 10:51:12 -0000 1.3 *************** *** 88,91 **** --- 88,99 ---- dumper.nl().display("}"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("text { "); + result.append(content.toString()); + result.append(" }"); + return result.toString(); + } } Index: Function.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Function.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Function.java 20 Jun 2005 10:44:28 -0000 1.17 --- Function.java 29 Oct 2005 10:51:12 -0000 1.18 *************** *** 403,406 **** --- 403,420 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(getName()); + result.append('('); + for (Iterator i = steps.iterator(); i.hasNext();) { + Expression e = (Expression) i.next(); + result.append(e.toString()); + if(i.hasNext()) + result.append(", "); + } + result.append(')'); + return result.toString(); + } + public void setASTNode(XQueryAST ast) { this.astNode = ast; Index: CastableExpression.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/CastableExpression.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CastableExpression.java 14 Nov 2004 22:15:11 -0000 1.2 --- CastableExpression.java 29 Oct 2005 10:51:12 -0000 1.3 *************** *** 110,113 **** --- 110,121 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(expression.toString()); + result.append(" castable as "); + result.append(Type.getTypeName(requiredType)); + return result.toString(); + } + public void resetState() { expression.resetState(); Index: CommentConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/CommentConstructor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CommentConstructor.java 28 Oct 2005 16:53:42 -0000 1.4 --- CommentConstructor.java 29 Oct 2005 10:51:11 -0000 1.5 *************** *** 64,66 **** --- 64,71 ---- dumper.nl().display("comment { ").display(data).display(" }"); } + + public String toString() { + return "comment { " + data.toString() + " }"; + } + } Index: LiteralValue.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/LiteralValue.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LiteralValue.java 14 Nov 2004 22:15:11 -0000 1.4 --- LiteralValue.java 29 Oct 2005 10:51:11 -0000 1.5 *************** *** 81,84 **** --- 81,95 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + if(Type.subTypeOf(value.getType(), Type.STRING)) { + result.append("\""); + result.append(value.toString()); + result.append("\""); + } else + result.append(value.toString()); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: NodeComparison.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/NodeComparison.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NodeComparison.java 20 Feb 2005 12:27:55 -0000 1.4 --- NodeComparison.java 29 Oct 2005 10:51:12 -0000 1.5 *************** *** 124,126 **** --- 124,134 ---- getRight().dump(dumper); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(getLeft().toString()); + result.append(' ').append(Constants.OPS[relation]).append(' '); + result.append(getRight().toString()); + return result.toString(); + } } Index: OpOr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/OpOr.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OpOr.java 29 Oct 2005 07:40:48 -0000 1.5 --- OpOr.java 29 Oct 2005 10:51:11 -0000 1.6 *************** *** 74,76 **** --- 74,88 ---- } } + + public String toString() { + if (getLength() == 0) + return ""; + StringBuffer result = new StringBuffer(); + result.append(getExpression(0).toString()); + for (int i = 1; i < getLength(); i++) { + result.append(") or ("); + result.append(getExpression(i).toString()); + } + return result.toString(); + } } Index: AtomicToString.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/AtomicToString.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AtomicToString.java 14 Nov 2004 22:15:11 -0000 1.3 --- AtomicToString.java 29 Oct 2005 10:51:12 -0000 1.4 *************** *** 82,85 **** --- 82,93 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("xs:string("); + result.append(expression.toString()); + result.append(")"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: DynamicCommentConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicCommentConstructor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DynamicCommentConstructor.java 14 Nov 2004 22:15:11 -0000 1.2 --- DynamicCommentConstructor.java 29 Oct 2005 10:51:12 -0000 1.3 *************** *** 88,90 **** --- 88,99 ---- dumper.nl().display("}"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("comment { "); + result.append(content.toString()); + result.append(" }"); + return result.toString(); + } + } Index: DynamicCardinalityCheck.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicCardinalityCheck.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DynamicCardinalityCheck.java 20 Feb 2005 12:27:55 -0000 1.7 --- DynamicCardinalityCheck.java 29 Oct 2005 10:51:11 -0000 1.8 *************** *** 89,92 **** --- 89,100 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("#cardinality( "); + result.append(expression.toString()); + result.append(" )"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: OpNumeric.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/OpNumeric.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OpNumeric.java 22 Jul 2005 19:10:39 -0000 1.4 --- OpNumeric.java 29 Oct 2005 10:51:12 -0000 1.5 *************** *** 151,154 **** --- 151,162 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(getLeft().toString()); + result.append(' ').append(Constants.OPS[operator]).append(' '); + result.append(getRight()); + return result.toString(); + } + // excerpt from operator mapping table in XQuery 1.0 section B.2 // http://www.w3.org/TR/xquery/#mapping Index: ForExpr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ForExpr.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ForExpr.java 26 Oct 2005 16:41:04 -0000 1.24 --- ForExpr.java 29 Oct 2005 10:51:11 -0000 1.25 *************** *** 27,30 **** --- 27,31 ---- import org.exist.dom.NodeSet; import org.exist.dom.QName; + import org.exist.xquery.parser.XQueryAST; import org.exist.xquery.util.ExpressionDumper; import org.exist.xquery.value.IntegerValue; *************** *** 285,288 **** --- 286,321 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("for "); + result.append("$").append(varName); + if(positionalVariable != null) + result.append(" at ").append(positionalVariable); + if(sequenceType != null) + result.append(" as ").append(sequenceType); + result.append(" in "); + result.append(inputSequence.toString()); + result.append(" "); + if(whereExpr != null) { + result.append("where"); + result.append(" "); + result.append(whereExpr.toString()); + result.append(" "); + } + if(orderSpecs != null) { + result.append("order by "); + for(int i = 0; i < orderSpecs.length; i++) { + if(i > 0) + result.append(", "); + result.append(orderSpecs[i].toString()); + } + result.append(" "); + } + result.append("return"); + result.append(" "); + result.append(returnExpr.toString()); + result.append(""); + return result.toString(); + } /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: VariableDeclaration.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/VariableDeclaration.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VariableDeclaration.java 16 Oct 2005 09:43:12 -0000 1.8 --- VariableDeclaration.java 29 Oct 2005 10:51:12 -0000 1.9 *************** *** 129,132 **** --- 129,144 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("declare variable $").append(qname); + if(sequenceType != null) { + result.append(" as ").append(sequenceType.toString()); + } + result.append("{ "); + result.append(expression.toString()); + result.append(" }"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: ConditionalExpression.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ConditionalExpression.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConditionalExpression.java 27 Sep 2005 15:31:28 -0000 1.5 --- ConditionalExpression.java 29 Oct 2005 10:51:11 -0000 1.6 *************** *** 118,121 **** --- 118,132 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("if ( "); + result.append(testExpr.toString()); + result.append(" ) then "); + result.append(thenExpr.toString()); + result.append(" else "); + result.append(elseExpr.toString()); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: PathExpr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/PathExpr.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PathExpr.java 29 Oct 2005 07:40:48 -0000 1.21 --- PathExpr.java 29 Oct 2005 10:51:11 -0000 1.22 *************** *** 214,217 **** --- 214,240 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + Expression next = null; + int count = 0; + for (Iterator iter = steps.iterator(); iter.hasNext(); count++) { + next = (Expression) iter.next(); + // Open a first parenthesis + if (next instanceof LogicalOp) + result.append('('); + if(count > 0) { + if(next instanceof Step) + result.append('/'); + else + result.append(' '); + } + result.append(next.toString()); + } + // Close the last parenthesis + if (next instanceof LogicalOp) + result.append(')'); + return result.toString(); + } + public int returnsType() { if (steps.size() == 0) return Type.NODE; Index: CDATAConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/CDATAConstructor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CDATAConstructor.java 26 Dec 2004 16:40:29 -0000 1.1 --- CDATAConstructor.java 29 Oct 2005 10:51:12 -0000 1.2 *************** *** 69,71 **** --- 69,76 ---- dumper.display("<![CDATA[").display(cdata).display("]]>"); } + + public String toString() { + return "<![CDATA[" + cdata.toString() + "]]>"; + } + } Index: InstanceOfExpression.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/InstanceOfExpression.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** InstanceOfExpression.java 6 Jan 2005 17:53:38 -0000 1.3 --- InstanceOfExpression.java 29 Oct 2005 10:51:12 -0000 1.4 *************** *** 89,92 **** --- 89,100 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(expression); + result.append(" instance of "); + result.append(type.toString()); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: QuantifiedExpression.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/QuantifiedExpression.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** QuantifiedExpression.java 29 Oct 2005 07:40:48 -0000 1.13 --- QuantifiedExpression.java 29 Oct 2005 10:51:12 -0000 1.14 *************** *** 104,107 **** --- 104,121 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(mode == SOME ? "some" : "every"); + result.append(" $").append(varName).append(" in"); + result.append(" "); + result.append(inputSequence.toString()); + result.append(" "); + result.append("satisfies"); + result.append(" "); + result.append(returnExpr.toString()); + result.append(" "); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: CastExpression.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/CastExpression.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CastExpression.java 2 Jan 2005 12:51:57 -0000 1.6 --- CastExpression.java 29 Oct 2005 10:51:12 -0000 1.7 *************** *** 106,109 **** --- 106,117 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(expression.toString()); + result.append(" cast as "); + result.append(Type.getTypeName(requiredType)); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: AttributeConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/AttributeConstructor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AttributeConstructor.java 14 Nov 2004 22:15:11 -0000 1.5 --- AttributeConstructor.java 29 Oct 2005 10:51:11 -0000 1.6 *************** *** 143,146 **** --- 143,162 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("attribute { ").append(qname); + result.append(" } {"); + Object next; + for(Iterator i = contents.iterator(); i.hasNext(); ) { + next = i.next(); + if(next instanceof Expression) + result.append(((Expression)next).toString()); + else + result.append(next.toString()); + } + result.append(" }"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.NodeConstructor#resetState() Index: LetExpr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/LetExpr.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** LetExpr.java 26 Oct 2005 16:41:04 -0000 1.16 --- LetExpr.java 29 Oct 2005 10:51:11 -0000 1.17 *************** *** 163,166 **** --- 163,167 ---- if(i > 0) dumper.display(", "); + //TODO : toString() or... dump ? dumper.display(orderSpecs[i].toString()); } *************** *** 171,173 **** --- 172,197 ---- dumper.endIndent(); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("let "); + result.append("$").append(varName); + result.append(" := "); + result.append(inputSequence.toString()); + if(whereExpr != null) { + result.append(" where "); + result.append(whereExpr.toString()); + } + if(orderSpecs != null) { + result.append(" order by "); + for(int i = 0; i < orderSpecs.length; i++) { + if(i > 0) + result.append(", "); + result.append(orderSpecs[i].toString()); + } + } + result.append("return "); + result.append(returnExpr.toString()); + return result.toString(); + } } Index: VariableReference.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/VariableReference.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** VariableReference.java 28 Jan 2005 20:19:45 -0000 1.8 --- VariableReference.java 29 Oct 2005 10:51:11 -0000 1.9 *************** *** 83,86 **** --- 83,90 ---- } + public String toString() { + return "$" + qname; + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: Intersection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Intersection.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Intersection.java 26 Oct 2005 17:48:13 -0000 1.6 --- Intersection.java 29 Oct 2005 10:51:12 -0000 1.7 *************** *** 84,86 **** --- 84,94 ---- right.dump(dumper); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(left.toString()); + result.append(" intersect "); + result.append(right.toString()); + return result.toString(); + } } Index: Atomize.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/Atomize.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Atomize.java 2 Jan 2005 18:17:07 -0000 1.6 --- Atomize.java 29 Oct 2005 10:51:12 -0000 1.7 *************** *** 82,85 **** --- 82,93 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("#atomize("); + result.append(expression.toString()); + result.append(")"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: OpAnd.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/OpAnd.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** OpAnd.java 29 Oct 2005 07:40:48 -0000 1.6 --- OpAnd.java 29 Oct 2005 10:51:11 -0000 1.7 *************** *** 80,82 **** --- 80,94 ---- } } + + public String toString() { + if (getLength() == 0) + return ""; + StringBuffer result = new StringBuffer(); + result.append(getExpression(0).toString()); + for (int i = 1; i < getLength(); i++) { + result.append(") and ("); + result.append(getExpression(i).toString()); + } + return result.toString(); + } } Index: DynamicPIConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicPIConstructor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DynamicPIConstructor.java 14 Nov 2004 22:15:11 -0000 1.2 --- DynamicPIConstructor.java 29 Oct 2005 10:51:12 -0000 1.3 *************** *** 112,114 **** --- 112,124 ---- dumper.endIndent().nl().display("}"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("processing-instruction { "); + result.append(name.toString()); + result.append(" } { "); + result.append(content.toString()); + result.append(" }"); + return result.toString(); + } } Index: NamespaceConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/NamespaceConstructor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NamespaceConstructor.java 14 Nov 2004 22:15:11 -0000 1.3 --- NamespaceConstructor.java 29 Oct 2005 10:51:11 -0000 1.4 *************** *** 96,98 **** --- 96,107 ---- dumper.display(" }"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("namespace ").append(prefix); + result.append("{ "); + result.append(uri.toString()); + result.append(" }"); + return result.toString(); + } } Index: EnclosedExpr.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/EnclosedExpr.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EnclosedExpr.java 14 Nov 2004 22:15:11 -0000 1.8 --- EnclosedExpr.java 29 Oct 2005 10:51:12 -0000 1.9 *************** *** 111,113 **** --- 111,121 ---- dumper.nl().display("}"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("{ "); + result.append(super.toString()); + result.append(" }"); + return result.toString(); + } } Index: DynamicAttributeConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/DynamicAttributeConstructor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DynamicAttributeConstructor.java 14 Nov 2004 22:15:11 -0000 1.4 --- DynamicAttributeConstructor.java 29 Oct 2005 10:51:11 -0000 1.5 *************** *** 111,113 **** --- 111,123 ---- dumper.nl().display("}"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("attribute { "); + result.append(qnameExpr.toString()); + result.append(" } { "); + result.append(valueExpr.toString()); + result.append(" }"); + return result.toString(); + } } Index: UntypedValueCheck.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/UntypedValueCheck.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** UntypedValueCheck.java 20 Feb 2005 12:27:55 -0000 1.7 --- UntypedValueCheck.java 29 Oct 2005 10:51:12 -0000 1.8 *************** *** 107,110 **** --- 107,119 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("#type:").append(Type.getTypeName(requiredType)); + result.append('('); + result.append(expression.toString()); + result.append(')'); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: TextConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/TextConstructor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TextConstructor.java 14 Nov 2004 22:15:11 -0000 1.5 --- TextConstructor.java 29 Oct 2005 10:51:12 -0000 1.6 *************** *** 84,87 **** --- 84,95 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("text { "); + result.append(text.toString()); + result.append(" }"); + return result.toString(); + } + protected final static boolean isWhiteSpace(char ch) { return (ch == 0x20) || (ch == 0x09) || (ch == 0xD) || (ch == 0xA); Index: FilteredExpression.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/FilteredExpression.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FilteredExpression.java 14 Nov 2004 22:15:11 -0000 1.4 --- FilteredExpression.java 29 Oct 2005 10:51:12 -0000 1.5 *************** *** 98,101 **** --- 98,112 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append(expression.toString()); + for (Iterator i = predicates.iterator(); i.hasNext();) { + result.append('['); + result.append(((Expression)i.next()).toString()); + result.append(']'); + } + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: PIConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/PIConstructor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PIConstructor.java 14 Nov 2004 22:15:11 -0000 1.3 --- PIConstructor.java 29 Oct 2005 10:51:12 -0000 1.4 *************** *** 80,82 **** --- 80,92 ---- dumper.endIndent().nl().display("}"); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("processing-instruction { "); + result.append(target.toString()); + result.append(" } { "); + result.append(data.toString()); + result.append(" }"); + return result.toString(); + } } Index: SequenceConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/SequenceConstructor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SequenceConstructor.java 14 Nov 2004 22:15:11 -0000 1.6 --- SequenceConstructor.java 29 Oct 2005 10:51:12 -0000 1.7 *************** *** 77,80 **** --- 77,91 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("( "); + for(Iterator i = steps.iterator(); i.hasNext(); ) { + result.append(((Expression) i.next()).toString()); + result.append(", "); + } + result.append(" )"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.Expression#returnsType() Index: ElementConstructor.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/ElementConstructor.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ElementConstructor.java 24 Sep 2005 20:41:39 -0000 1.13 --- ElementConstructor.java 29 Oct 2005 10:51:11 -0000 1.14 *************** *** 207,210 **** --- 207,236 ---- } + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("element { "); + result.append(qnameExpr.toString()); + result.append(" } { "); + if(attributes != null) { + AttributeConstructor attr; + for(int i = 0; i < attributes.length; i++) { + if(i > 0) + result.append(" "); + attr = (AttributeConstructor)attributes[i]; + result.append(attr.toString()); + } + } + if(content != null) { + for(Iterator i = content.steps.iterator(); i.hasNext(); ) { + Expression expr = (Expression) i.next(); + result.append(expr.toString()); + if(i.hasNext()) + result.append(" "); + } + } + result.append(" }"); + return result.toString(); + } + /* (non-Javadoc) * @see org.exist.xquery.AbstractExpression#setPrimaryAxis(int) Index: RootNode.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/RootNode.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RootNode.java 27 May 2005 20:56:06 -0000 1.10 --- RootNode.java 29 Oct 2005 10:51:11 -0000 1.11 *************** *** 97,100 **** --- 97,104 ---- } + public String toString() { + return "/ROOT"; + } + /* * (non-Javadoc) |
|
From: Pierrick B. <br...@us...> - 2005-10-29 10:51:20
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/update In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20795/src/org/exist/xquery/update Modified Files: Update.java Delete.java Rename.java Insert.java Replace.java Log Message: Added toString() methods to XPath exressions in order to simplify debugging (at least for me). Index: Insert.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/update/Insert.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Insert.java 26 Jul 2005 06:59:17 -0000 1.3 --- Insert.java 29 Oct 2005 10:51:12 -0000 1.4 *************** *** 176,178 **** --- 176,197 ---- dumper.nl().endIndent(); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("update insert "); + result.append(value.toString()); + switch (mode) { + case INSERT_AFTER: + result.append(" following "); + break; + case INSERT_BEFORE: + result.append(" preceding "); + break; + case INSERT_APPEND: + result.append(" into "); + break; + } + result.append(select.toString()); + return result.toString(); + } } Index: Replace.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/update/Replace.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Replace.java 16 Aug 2005 17:11:34 -0000 1.5 --- Replace.java 29 Oct 2005 10:51:12 -0000 1.6 *************** *** 158,160 **** --- 158,169 ---- dumper.nl().endIndent(); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("update replace "); + result.append(select.toString()); + result.append(" with "); + result.append(value.toString()); + return result.toString(); + } } Index: Update.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/update/Update.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Update.java 26 Jul 2005 06:59:17 -0000 1.5 --- Update.java 29 Oct 2005 10:51:12 -0000 1.6 *************** *** 160,162 **** --- 160,171 ---- dumper.nl().endIndent(); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("update value" ); + result.append(select.toString()); + result.append(" with "); + result.append(value.toString()); + return result.toString(); + } } Index: Delete.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/update/Delete.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Delete.java 26 Jul 2005 06:59:17 -0000 1.3 --- Delete.java 29 Oct 2005 10:51:12 -0000 1.4 *************** *** 127,130 **** --- 127,134 ---- } + + public String toString() { + return "'Delete' string representation"; + } } Index: Rename.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/update/Rename.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Rename.java 21 Aug 2005 20:50:54 -0000 1.5 --- Rename.java 29 Oct 2005 10:51:12 -0000 1.6 *************** *** 153,156 **** --- 153,165 ---- dumper.nl().endIndent(); } + + public String toString() { + StringBuffer result = new StringBuffer(); + result.append("update rename "); + result.append(select.toString()); + result.append(" to "); + result.append(value.toString()); + return result.toString(); + } } |