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
(3) |
2
(5) |
3
(8) |
|
4
|
5
|
6
(2) |
7
|
8
(16) |
9
(5) |
10
(5) |
|
11
(3) |
12
(5) |
13
(4) |
14
|
15
|
16
(2) |
17
|
|
18
(1) |
19
(3) |
20
(4) |
21
(11) |
22
(2) |
23
(9) |
24
(2) |
|
25
(1) |
26
(4) |
27
(10) |
28
(5) |
29
(10) |
30
(3) |
31
(14) |
|
From: <wol...@us...> - 2009-10-31 22:50:58
|
Revision: 10307
http://exist.svn.sourceforge.net/exist/?rev=10307&view=rev
Author: wolfgang_m
Date: 2009-10-31 22:50:51 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] Bug 2848390: TimerPragma's "Invalid content" error message is wrong.
https://sourceforge.net/tracker/?func=detail&aid=2848390&group_id=17691&atid=117691
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/pragmas/TimerPragma.java
Modified: trunk/eXist/src/org/exist/xquery/pragmas/TimerPragma.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/pragmas/TimerPragma.java 2009-10-31 22:41:57 UTC (rev 10306)
+++ trunk/eXist/src/org/exist/xquery/pragmas/TimerPragma.java 2009-10-31 22:50:51 UTC (rev 10307)
@@ -43,7 +43,8 @@
for (int i = 0; i < options.length; i++) {
String param[] = Option.parseKeyValuePair(options[i]);
if (param == null)
- throw new XPathException("Invalid content found for pragma exist:optimize: " + contents);
+ throw new XPathException("Invalid content found for pragma " + TIMER_PRAGMA.getStringValue() +
+ ": " + contents);
if ("verbose".equals(param[0])) {
verbose = "yes".equals(param[1]);
} else if ("logger".equals(param[0])) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 22:42:08
|
Revision: 10306
http://exist.svn.sourceforge.net/exist/?rev=10306&view=rev
Author: wolfgang_m
Date: 2009-10-31 22:41:57 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] fixed bug 2848380: Flaw in Regex used to parse Option class getPragma content
https://sourceforge.net/tracker/?func=detail&aid=2848380&group_id=17691&atid=117691
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/Option.java
Modified: trunk/eXist/src/org/exist/xquery/Option.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/Option.java 2009-10-31 22:24:51 UTC (rev 10305)
+++ trunk/eXist/src/org/exist/xquery/Option.java 2009-10-31 22:41:57 UTC (rev 10306)
@@ -44,7 +44,7 @@
public final static QName CURRENT_DATETIME = new QName("current-dateTime", Namespaces.EXIST_NS);
private final static String paramPattern =
- "\\s*([\\w\\.-]+)\\s*=\\s*('[^']*'|\"[^\"]*\"|[^\\s]+)";
+ "\\s*([\\w\\.-]+)\\s*=\\s*('[^']*'|\"[^\"]*\"|[^\"\'\\s][^\\s]*)";
private final static Pattern pattern = Pattern.compile(paramPattern);
private final static Matcher matcher = pattern.matcher("");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 22:25:00
|
Revision: 10305
http://exist.svn.sourceforge.net/exist/?rev=10305&view=rev
Author: wolfgang_m
Date: 2009-10-31 22:24:51 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] another fix for position predicates on the following and preceding axes. too many nodes returned.
Modified Paths:
--------------
trunk/eXist/src/org/exist/memtree/NodeImpl.java
trunk/eXist/test/src/xquery/axes.xml
Modified: trunk/eXist/src/org/exist/memtree/NodeImpl.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/NodeImpl.java 2009-10-31 21:24:20 UTC (rev 10304)
+++ trunk/eXist/src/org/exist/memtree/NodeImpl.java 2009-10-31 22:24:51 UTC (rev 10305)
@@ -844,8 +844,9 @@
for (int i = nodeNumber - 1; i > 0; i--) {
NodeImpl n = document.getNode(i);
if (!myNodeId.isDescendantOf(n.getNodeId()) && test.matches(n)) {
- result.add(n);
- if (-1 < position && ++count == position)
+ if (position < 0 || ++count == position)
+ result.add(n);
+ if (count == position)
break;
}
}
@@ -897,8 +898,9 @@
while (nextNode < document.size) {
NodeImpl n = document.getNode(nextNode);
if (!n.getNodeId().isDescendantOf(myNodeId) && test.matches(n)) {
- result.add(n);
- if (-1 < position && ++count == position)
+ if (position < 0 || ++count == position)
+ result.add(n);
+ if (count == position)
break;
}
nextNode++;
Modified: trunk/eXist/test/src/xquery/axes.xml
===================================================================
--- trunk/eXist/test/src/xquery/axes.xml 2009-10-31 21:24:20 UTC (rev 10304)
+++ trunk/eXist/test/src/xquery/axes.xml 2009-10-31 22:24:51 UTC (rev 10305)
@@ -334,7 +334,7 @@
<test output="text">
<task>Simple preceding axis test on in-memory doc 1</task>
<code>for $i in (1 to 5) return $input1//line/word[. = 'working']/preceding::word[$i]</code>
- <expected>XPath developers enjoy</expected>
+ <expected>enjoy developers XPath</expected>
</test>
<test output="xml">
<task>Simple preceding axis test on in-memory doc 2</task>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 21:24:34
|
Revision: 10304
http://exist.svn.sourceforge.net/exist/?rev=10304&view=rev
Author: wolfgang_m
Date: 2009-10-31 21:24:20 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[ignore] admin interface was broken due to xhtml namespace.
Modified Paths:
--------------
trunk/eXist/webapp/admin/admin.xql
Modified: trunk/eXist/webapp/admin/admin.xql
===================================================================
--- trunk/eXist/webapp/admin/admin.xql 2009-10-31 20:10:37 UTC (rev 10303)
+++ trunk/eXist/webapp/admin/admin.xql 2009-10-31 21:24:20 UTC (rev 10304)
@@ -175,7 +175,7 @@
)
return (
<?css-conversion no?>,
- <html xmlns="http://www.w3.org/1999/xhtml">
+ <html>
<head>
<title>eXist Database Administration</title>
<link type="text/css" href="admin.css" rel="stylesheet"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 20:10:47
|
Revision: 10303
http://exist.svn.sourceforge.net/exist/?rev=10303&view=rev
Author: wolfgang_m
Date: 2009-10-31 20:10:37 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] Fix for bug 2878447: Parse error on >= - ID: 2878447.
http://sourceforge.net/tracker/?func=detail&aid=2878447&group_id=17691&atid=117691
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java
trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java
trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt
trunk/eXist/src/org/exist/xquery/parser/XQuery.g
trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java
trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java
trunk/eXist/src/org/exist/xquery/parser/XQueryTokenTypes.java
trunk/eXist/src/org/exist/xquery/parser/XQueryTokenTypes.txt
trunk/eXist/src/org/exist/xquery/parser/XQueryTreeParser.java
trunk/eXist/src/org/exist/xquery/parser/XQueryTreeParserTokenTypes.java
trunk/eXist/src/org/exist/xquery/parser/XQueryTreeParserTokenTypes.txt
Modified: trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java 2009-10-31 19:55:19 UTC (rev 10302)
+++ trunk/eXist/src/org/exist/xquery/parser/DeclScanner.java 2009-10-31 20:10:37 UTC (rev 10303)
@@ -145,6 +145,7 @@
"COMP_NS_CONSTRUCTOR",
"COMP_DOC_CONSTRUCTOR",
"PRAGMA",
+ "GTEQ",
"\"xpointer\"",
"opening parenthesis '('",
"closing parenthesis ')'",
@@ -238,9 +239,8 @@
"\"le\"",
"\"gt\"",
"\"ge\"",
+ ">",
"!=",
- ">",
- ">=",
"<",
"<=",
"\"is\"",
Modified: trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java 2009-10-31 19:55:19 UTC (rev 10302)
+++ trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.java 2009-10-31 20:10:37 UTC (rev 10303)
@@ -52,102 +52,102 @@
int COMP_NS_CONSTRUCTOR = 46;
int COMP_DOC_CONSTRUCTOR = 47;
int PRAGMA = 48;
- int LITERAL_xpointer = 49;
- int LPAREN = 50;
- int RPAREN = 51;
- int NCNAME = 52;
- int LITERAL_xquery = 53;
- int LITERAL_version = 54;
- int SEMICOLON = 55;
- int LITERAL_module = 56;
- int LITERAL_namespace = 57;
- int EQ = 58;
- int STRING_LITERAL = 59;
- int LITERAL_declare = 60;
- int LITERAL_default = 61;
- // "boundary-space" = 62
- int LITERAL_ordering = 63;
- int LITERAL_construction = 64;
- // "base-uri" = 65
- // "copy-namespaces" = 66
- int LITERAL_option = 67;
- int LITERAL_function = 68;
- int LITERAL_variable = 69;
- int LITERAL_import = 70;
- int LITERAL_encoding = 71;
- int LITERAL_collation = 72;
- int LITERAL_element = 73;
- int LITERAL_order = 74;
- int LITERAL_empty = 75;
- int LITERAL_greatest = 76;
- int LITERAL_least = 77;
- int LITERAL_preserve = 78;
- int LITERAL_strip = 79;
- int LITERAL_ordered = 80;
- int LITERAL_unordered = 81;
- int COMMA = 82;
- // "no-preserve" = 83
- int LITERAL_inherit = 84;
- // "no-inherit" = 85
- int DOLLAR = 86;
- int LCURLY = 87;
- int RCURLY = 88;
- int COLON = 89;
- int LITERAL_external = 90;
- int LITERAL_schema = 91;
- int LITERAL_as = 92;
- int LITERAL_at = 93;
- // "empty-sequence" = 94
- int QUESTION = 95;
- int STAR = 96;
- int PLUS = 97;
- int LITERAL_item = 98;
- int LITERAL_for = 99;
- int LITERAL_let = 100;
- int LITERAL_some = 101;
- int LITERAL_every = 102;
- int LITERAL_if = 103;
- int LITERAL_typeswitch = 104;
- int LITERAL_update = 105;
- int LITERAL_replace = 106;
- int LITERAL_value = 107;
- int LITERAL_insert = 108;
- int LITERAL_delete = 109;
- int LITERAL_rename = 110;
- int LITERAL_with = 111;
- int LITERAL_into = 112;
- int LITERAL_preceding = 113;
- int LITERAL_following = 114;
- int LITERAL_where = 115;
- int LITERAL_return = 116;
- int LITERAL_in = 117;
- int LITERAL_by = 118;
- int LITERAL_stable = 119;
- int LITERAL_ascending = 120;
- int LITERAL_descending = 121;
- int LITERAL_group = 122;
- int LITERAL_satisfies = 123;
- int LITERAL_case = 124;
- int LITERAL_then = 125;
- int LITERAL_else = 126;
- int LITERAL_or = 127;
- int LITERAL_and = 128;
- int LITERAL_instance = 129;
- int LITERAL_of = 130;
- int LITERAL_treat = 131;
- int LITERAL_castable = 132;
- int LITERAL_cast = 133;
- int BEFORE = 134;
- int AFTER = 135;
- int LITERAL_eq = 136;
- int LITERAL_ne = 137;
- int LITERAL_lt = 138;
- int LITERAL_le = 139;
- int LITERAL_gt = 140;
- int LITERAL_ge = 141;
- int NEQ = 142;
+ int GTEQ = 49;
+ int LITERAL_xpointer = 50;
+ int LPAREN = 51;
+ int RPAREN = 52;
+ int NCNAME = 53;
+ int LITERAL_xquery = 54;
+ int LITERAL_version = 55;
+ int SEMICOLON = 56;
+ int LITERAL_module = 57;
+ int LITERAL_namespace = 58;
+ int EQ = 59;
+ int STRING_LITERAL = 60;
+ int LITERAL_declare = 61;
+ int LITERAL_default = 62;
+ // "boundary-space" = 63
+ int LITERAL_ordering = 64;
+ int LITERAL_construction = 65;
+ // "base-uri" = 66
+ // "copy-namespaces" = 67
+ int LITERAL_option = 68;
+ int LITERAL_function = 69;
+ int LITERAL_variable = 70;
+ int LITERAL_import = 71;
+ int LITERAL_encoding = 72;
+ int LITERAL_collation = 73;
+ int LITERAL_element = 74;
+ int LITERAL_order = 75;
+ int LITERAL_empty = 76;
+ int LITERAL_greatest = 77;
+ int LITERAL_least = 78;
+ int LITERAL_preserve = 79;
+ int LITERAL_strip = 80;
+ int LITERAL_ordered = 81;
+ int LITERAL_unordered = 82;
+ int COMMA = 83;
+ // "no-preserve" = 84
+ int LITERAL_inherit = 85;
+ // "no-inherit" = 86
+ int DOLLAR = 87;
+ int LCURLY = 88;
+ int RCURLY = 89;
+ int COLON = 90;
+ int LITERAL_external = 91;
+ int LITERAL_schema = 92;
+ int LITERAL_as = 93;
+ int LITERAL_at = 94;
+ // "empty-sequence" = 95
+ int QUESTION = 96;
+ int STAR = 97;
+ int PLUS = 98;
+ int LITERAL_item = 99;
+ int LITERAL_for = 100;
+ int LITERAL_let = 101;
+ int LITERAL_some = 102;
+ int LITERAL_every = 103;
+ int LITERAL_if = 104;
+ int LITERAL_typeswitch = 105;
+ int LITERAL_update = 106;
+ int LITERAL_replace = 107;
+ int LITERAL_value = 108;
+ int LITERAL_insert = 109;
+ int LITERAL_delete = 110;
+ int LITERAL_rename = 111;
+ int LITERAL_with = 112;
+ int LITERAL_into = 113;
+ int LITERAL_preceding = 114;
+ int LITERAL_following = 115;
+ int LITERAL_where = 116;
+ int LITERAL_return = 117;
+ int LITERAL_in = 118;
+ int LITERAL_by = 119;
+ int LITERAL_stable = 120;
+ int LITERAL_ascending = 121;
+ int LITERAL_descending = 122;
+ int LITERAL_group = 123;
+ int LITERAL_satisfies = 124;
+ int LITERAL_case = 125;
+ int LITERAL_then = 126;
+ int LITERAL_else = 127;
+ int LITERAL_or = 128;
+ int LITERAL_and = 129;
+ int LITERAL_instance = 130;
+ int LITERAL_of = 131;
+ int LITERAL_treat = 132;
+ int LITERAL_castable = 133;
+ int LITERAL_cast = 134;
+ int BEFORE = 135;
+ int AFTER = 136;
+ int LITERAL_eq = 137;
+ int LITERAL_ne = 138;
+ int LITERAL_lt = 139;
+ int LITERAL_le = 140;
+ int LITERAL_gt = 141;
+ int LITERAL_ge = 142;
int GT = 143;
- int GTEQ = 144;
+ int NEQ = 144;
int LT = 145;
int LTEQ = 146;
int LITERAL_is = 147;
Modified: trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt 2009-10-31 19:55:19 UTC (rev 10302)
+++ trunk/eXist/src/org/exist/xquery/parser/DeclScannerTokenTypes.txt 2009-10-31 20:10:37 UTC (rev 10303)
@@ -45,102 +45,102 @@
COMP_NS_CONSTRUCTOR=46
COMP_DOC_CONSTRUCTOR=47
PRAGMA=48
-LITERAL_xpointer="xpointer"=49
-LPAREN("opening parenthesis '('")=50
-RPAREN("closing parenthesis ')'")=51
-NCNAME("name")=52
-LITERAL_xquery="xquery"=53
-LITERAL_version="version"=54
-SEMICOLON("semicolon ';'")=55
-LITERAL_module="module"=56
-LITERAL_namespace="namespace"=57
-EQ("=")=58
-STRING_LITERAL("string literal")=59
-LITERAL_declare="declare"=60
-LITERAL_default="default"=61
-"boundary-space"=62
-LITERAL_ordering="ordering"=63
-LITERAL_construction="construction"=64
-"base-uri"=65
-"copy-namespaces"=66
-LITERAL_option="option"=67
-LITERAL_function="function"=68
-LITERAL_variable="variable"=69
-LITERAL_import="import"=70
-LITERAL_encoding="encoding"=71
-LITERAL_collation="collation"=72
-LITERAL_element="element"=73
-LITERAL_order="order"=74
-LITERAL_empty="empty"=75
-LITERAL_greatest="greatest"=76
-LITERAL_least="least"=77
-LITERAL_preserve="preserve"=78
-LITERAL_strip="strip"=79
-LITERAL_ordered="ordered"=80
-LITERAL_unordered="unordered"=81
-COMMA=82
-"no-preserve"=83
-LITERAL_inherit="inherit"=84
-"no-inherit"=85
-DOLLAR("dollar sign '$'")=86
-LCURLY("opening curly brace '{'")=87
-RCURLY("closing curly brace '}'")=88
-COLON=89
-LITERAL_external="external"=90
-LITERAL_schema="schema"=91
-LITERAL_as="as"=92
-LITERAL_at="at"=93
-"empty-sequence"=94
-QUESTION("question mark '?'")=95
-STAR("wildcard '*'")=96
-PLUS("+")=97
-LITERAL_item="item"=98
-LITERAL_for="for"=99
-LITERAL_let="let"=100
-LITERAL_some="some"=101
-LITERAL_every="every"=102
-LITERAL_if="if"=103
-LITERAL_typeswitch="typeswitch"=104
-LITERAL_update="update"=105
-LITERAL_replace="replace"=106
-LITERAL_value="value"=107
-LITERAL_insert="insert"=108
-LITERAL_delete="delete"=109
-LITERAL_rename="rename"=110
-LITERAL_with="with"=111
-LITERAL_into="into"=112
-LITERAL_preceding="preceding"=113
-LITERAL_following="following"=114
-LITERAL_where="where"=115
-LITERAL_return="return"=116
-LITERAL_in="in"=117
-LITERAL_by="by"=118
-LITERAL_stable="stable"=119
-LITERAL_ascending="ascending"=120
-LITERAL_descending="descending"=121
-LITERAL_group="group"=122
-LITERAL_satisfies="satisfies"=123
-LITERAL_case="case"=124
-LITERAL_then="then"=125
-LITERAL_else="else"=126
-LITERAL_or="or"=127
-LITERAL_and="and"=128
-LITERAL_instance="instance"=129
-LITERAL_of="of"=130
-LITERAL_treat="treat"=131
-LITERAL_castable="castable"=132
-LITERAL_cast="cast"=133
-BEFORE=134
-AFTER=135
-LITERAL_eq="eq"=136
-LITERAL_ne="ne"=137
-LITERAL_lt="lt"=138
-LITERAL_le="le"=139
-LITERAL_gt="gt"=140
-LITERAL_ge="ge"=141
-NEQ("!=")=142
+GTEQ=49
+LITERAL_xpointer="xpointer"=50
+LPAREN("opening parenthesis '('")=51
+RPAREN("closing parenthesis ')'")=52
+NCNAME("name")=53
+LITERAL_xquery="xquery"=54
+LITERAL_version="version"=55
+SEMICOLON("semicolon ';'")=56
+LITERAL_module="module"=57
+LITERAL_namespace="namespace"=58
+EQ("=")=59
+STRING_LITERAL("string literal")=60
+LITERAL_declare="declare"=61
+LITERAL_default="default"=62
+"boundary-space"=63
+LITERAL_ordering="ordering"=64
+LITERAL_construction="construction"=65
+"base-uri"=66
+"copy-namespaces"=67
+LITERAL_option="option"=68
+LITERAL_function="function"=69
+LITERAL_variable="variable"=70
+LITERAL_import="import"=71
+LITERAL_encoding="encoding"=72
+LITERAL_collation="collation"=73
+LITERAL_element="element"=74
+LITERAL_order="order"=75
+LITERAL_empty="empty"=76
+LITERAL_greatest="greatest"=77
+LITERAL_least="least"=78
+LITERAL_preserve="preserve"=79
+LITERAL_strip="strip"=80
+LITERAL_ordered="ordered"=81
+LITERAL_unordered="unordered"=82
+COMMA=83
+"no-preserve"=84
+LITERAL_inherit="inherit"=85
+"no-inherit"=86
+DOLLAR("dollar sign '$'")=87
+LCURLY("opening curly brace '{'")=88
+RCURLY("closing curly brace '}'")=89
+COLON=90
+LITERAL_external="external"=91
+LITERAL_schema="schema"=92
+LITERAL_as="as"=93
+LITERAL_at="at"=94
+"empty-sequence"=95
+QUESTION("question mark '?'")=96
+STAR("wildcard '*'")=97
+PLUS("+")=98
+LITERAL_item="item"=99
+LITERAL_for="for"=100
+LITERAL_let="let"=101
+LITERAL_some="some"=102
+LITERAL_every="every"=103
+LITERAL_if="if"=104
+LITERAL_typeswitch="typeswitch"=105
+LITERAL_update="update"=106
+LITERAL_replace="replace"=107
+LITERAL_value="value"=108
+LITERAL_insert="insert"=109
+LITERAL_delete="delete"=110
+LITERAL_rename="rename"=111
+LITERAL_with="with"=112
+LITERAL_into="into"=113
+LITERAL_preceding="preceding"=114
+LITERAL_following="following"=115
+LITERAL_where="where"=116
+LITERAL_return="return"=117
+LITERAL_in="in"=118
+LITERAL_by="by"=119
+LITERAL_stable="stable"=120
+LITERAL_ascending="ascending"=121
+LITERAL_descending="descending"=122
+LITERAL_group="group"=123
+LITERAL_satisfies="satisfies"=124
+LITERAL_case="case"=125
+LITERAL_then="then"=126
+LITERAL_else="else"=127
+LITERAL_or="or"=128
+LITERAL_and="and"=129
+LITERAL_instance="instance"=130
+LITERAL_of="of"=131
+LITERAL_treat="treat"=132
+LITERAL_castable="castable"=133
+LITERAL_cast="cast"=134
+BEFORE=135
+AFTER=136
+LITERAL_eq="eq"=137
+LITERAL_ne="ne"=138
+LITERAL_lt="lt"=139
+LITERAL_le="le"=140
+LITERAL_gt="gt"=141
+LITERAL_ge="ge"=142
GT(">")=143
-GTEQ(">=")=144
+NEQ("!=")=144
LT("<")=145
LTEQ("<=")=146
LITERAL_is="is"=147
Modified: trunk/eXist/src/org/exist/xquery/parser/XQuery.g
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/XQuery.g 2009-10-31 19:55:19 UTC (rev 10302)
+++ trunk/eXist/src/org/exist/xquery/parser/XQuery.g 2009-10-31 20:10:37 UTC (rev 10303)
@@ -160,6 +160,7 @@
COMP_NS_CONSTRUCTOR
COMP_DOC_CONSTRUCTOR
PRAGMA
+ GTEQ
;
// === XPointer ===
@@ -706,12 +707,14 @@
comparisonExpr throws XPathException
:
- rangeExpr (
+ r1:rangeExpr (
( BEFORE ) => BEFORE^ rangeExpr
|
( AFTER ) => AFTER^ rangeExpr
| ( ( "eq"^ | "ne"^ | "lt"^ | "le"^ | "gt"^ | "ge"^ ) rangeExpr )
- | ( ( EQ^ | NEQ^ | GT^ | GTEQ^ | LT^ | LTEQ^ ) rangeExpr )
+ | ( GT EQ ) => GT^ EQ^ r2:rangeExpr
+ { #comparisonExpr = #(#[GTEQ, ">="], #r1, #r2); }
+ | ( ( EQ^ | NEQ^ | GT^ | LT^ | LTEQ^ ) rangeExpr )
| ( ( "is"^ | "isnot"^ ) rangeExpr )
| ( ( ANDEQ^ | OREQ^ ) rangeExpr )
)?
@@ -1670,7 +1673,6 @@
protected EQ options { paraphrase="="; }: '=' ;
protected NEQ options { paraphrase="!="; }: "!=" ;
protected GT options { paraphrase=">"; }: '>' ;
-protected GTEQ options { paraphrase=">="; }: ">=" ;
protected QUOT options { paraphrase="double quote '\"'"; }: '"' ;
protected APOS options { paraphrase="single quote '"; }: "'";
protected LTEQ options { paraphrase="<="; }: "<=" ;
@@ -2047,9 +2049,6 @@
|
GT { $setType(GT); }
|
- { !(inAttributeContent || inElementContent) }?
- GTEQ { $setType(GTEQ); }
- |
XML_PI_END { $setType(XML_PI_END); }
|
XML_CDATA_END { $setType(XML_CDATA_END); }
Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java 2009-10-31 19:55:19 UTC (rev 10302)
+++ trunk/eXist/src/org/exist/xquery/parser/XQueryLexer.java 2009-10-31 20:10:37 UTC (rev 10303)
@@ -90,110 +90,110 @@
caseSensitiveLiterals = true;
setCaseSensitive(true);
literals = new Hashtable();
- literals.put(new ANTLRHashString("treat", this), new Integer(131));
- literals.put(new ANTLRHashString("typeswitch", this), new Integer(104));
- literals.put(new ANTLRHashString("copy-namespaces", this), new Integer(66));
- literals.put(new ANTLRHashString("xpointer", this), new Integer(49));
- literals.put(new ANTLRHashString("namespace", this), new Integer(57));
- literals.put(new ANTLRHashString("no-preserve", this), new Integer(83));
+ literals.put(new ANTLRHashString("treat", this), new Integer(132));
+ literals.put(new ANTLRHashString("typeswitch", this), new Integer(105));
+ literals.put(new ANTLRHashString("copy-namespaces", this), new Integer(67));
+ literals.put(new ANTLRHashString("xpointer", this), new Integer(50));
+ literals.put(new ANTLRHashString("namespace", this), new Integer(58));
+ literals.put(new ANTLRHashString("no-preserve", this), new Integer(84));
literals.put(new ANTLRHashString("comment", this), new Integer(167));
- literals.put(new ANTLRHashString("case", this), new Integer(124));
- literals.put(new ANTLRHashString("option", this), new Integer(67));
- literals.put(new ANTLRHashString("delete", this), new Integer(109));
- literals.put(new ANTLRHashString("ne", this), new Integer(137));
+ literals.put(new ANTLRHashString("case", this), new Integer(125));
+ literals.put(new ANTLRHashString("option", this), new Integer(68));
+ literals.put(new ANTLRHashString("delete", this), new Integer(110));
+ literals.put(new ANTLRHashString("ne", this), new Integer(138));
literals.put(new ANTLRHashString("validate", this), new Integer(203));
- literals.put(new ANTLRHashString("le", this), new Integer(139));
- literals.put(new ANTLRHashString("greatest", this), new Integer(76));
+ literals.put(new ANTLRHashString("le", this), new Integer(140));
+ literals.put(new ANTLRHashString("greatest", this), new Integer(77));
literals.put(new ANTLRHashString("ancestor-or-self", this), new Integer(185));
literals.put(new ANTLRHashString("descendant-or-self", this), new Integer(181));
- literals.put(new ANTLRHashString("insert", this), new Integer(108));
- literals.put(new ANTLRHashString("variable", this), new Integer(69));
- literals.put(new ANTLRHashString("where", this), new Integer(115));
- literals.put(new ANTLRHashString("stable", this), new Integer(119));
- literals.put(new ANTLRHashString("construction", this), new Integer(64));
- literals.put(new ANTLRHashString("then", this), new Integer(125));
- literals.put(new ANTLRHashString("preceding", this), new Integer(113));
+ literals.put(new ANTLRHashString("insert", this), new Integer(109));
+ literals.put(new ANTLRHashString("variable", this), new Integer(70));
+ literals.put(new ANTLRHashString("where", this), new Integer(116));
+ literals.put(new ANTLRHashString("stable", this), new Integer(120));
+ literals.put(new ANTLRHashString("construction", this), new Integer(65));
+ literals.put(new ANTLRHashString("then", this), new Integer(126));
+ literals.put(new ANTLRHashString("preceding", this), new Integer(114));
literals.put(new ANTLRHashString("document-node", this), new Integer(169));
- literals.put(new ANTLRHashString("collation", this), new Integer(72));
+ literals.put(new ANTLRHashString("collation", this), new Integer(73));
literals.put(new ANTLRHashString("to", this), new Integer(151));
- literals.put(new ANTLRHashString("and", this), new Integer(128));
- literals.put(new ANTLRHashString("module", this), new Integer(56));
- literals.put(new ANTLRHashString("strip", this), new Integer(79));
- literals.put(new ANTLRHashString("return", this), new Integer(116));
- literals.put(new ANTLRHashString("inherit", this), new Integer(84));
- literals.put(new ANTLRHashString("schema", this), new Integer(91));
- literals.put(new ANTLRHashString("external", this), new Integer(90));
- literals.put(new ANTLRHashString("unordered", this), new Integer(81));
- literals.put(new ANTLRHashString("ordered", this), new Integer(80));
+ literals.put(new ANTLRHashString("and", this), new Integer(129));
+ literals.put(new ANTLRHashString("module", this), new Integer(57));
+ literals.put(new ANTLRHashString("strip", this), new Integer(80));
+ literals.put(new ANTLRHashString("return", this), new Integer(117));
+ literals.put(new ANTLRHashString("inherit", this), new Integer(85));
+ literals.put(new ANTLRHashString("schema", this), new Integer(92));
+ literals.put(new ANTLRHashString("external", this), new Integer(91));
+ literals.put(new ANTLRHashString("unordered", this), new Integer(82));
+ literals.put(new ANTLRHashString("ordered", this), new Integer(81));
literals.put(new ANTLRHashString("mod", this), new Integer(155));
- literals.put(new ANTLRHashString("following", this), new Integer(114));
+ literals.put(new ANTLRHashString("following", this), new Integer(115));
literals.put(new ANTLRHashString("except", this), new Integer(161));
literals.put(new ANTLRHashString("text", this), new Integer(164));
- literals.put(new ANTLRHashString("preserve", this), new Integer(78));
- literals.put(new ANTLRHashString("function", this), new Integer(68));
- literals.put(new ANTLRHashString("with", this), new Integer(111));
- literals.put(new ANTLRHashString("gt", this), new Integer(140));
+ literals.put(new ANTLRHashString("preserve", this), new Integer(79));
+ literals.put(new ANTLRHashString("function", this), new Integer(69));
+ literals.put(new ANTLRHashString("with", this), new Integer(112));
+ literals.put(new ANTLRHashString("gt", this), new Integer(141));
literals.put(new ANTLRHashString("preceding-sibling", this), new Integer(186));
literals.put(new ANTLRHashString("intersect", this), new Integer(160));
- literals.put(new ANTLRHashString("version", this), new Integer(54));
- literals.put(new ANTLRHashString("at", this), new Integer(93));
- literals.put(new ANTLRHashString("of", this), new Integer(130));
+ literals.put(new ANTLRHashString("version", this), new Integer(55));
+ literals.put(new ANTLRHashString("at", this), new Integer(94));
+ literals.put(new ANTLRHashString("of", this), new Integer(131));
literals.put(new ANTLRHashString("is", this), new Integer(147));
- literals.put(new ANTLRHashString("empty-sequence", this), new Integer(94));
- literals.put(new ANTLRHashString("or", this), new Integer(127));
- literals.put(new ANTLRHashString("if", this), new Integer(103));
- literals.put(new ANTLRHashString("least", this), new Integer(77));
- literals.put(new ANTLRHashString("as", this), new Integer(92));
- literals.put(new ANTLRHashString("by", this), new Integer(118));
+ literals.put(new ANTLRHashString("empty-sequence", this), new Integer(95));
+ literals.put(new ANTLRHashString("or", this), new Integer(128));
+ literals.put(new ANTLRHashString("if", this), new Integer(104));
+ literals.put(new ANTLRHashString("least", this), new Integer(78));
+ literals.put(new ANTLRHashString("as", this), new Integer(93));
+ literals.put(new ANTLRHashString("by", this), new Integer(119));
literals.put(new ANTLRHashString("union", this), new Integer(158));
- literals.put(new ANTLRHashString("order", this), new Integer(74));
- literals.put(new ANTLRHashString("xquery", this), new Integer(53));
+ literals.put(new ANTLRHashString("order", this), new Integer(75));
+ literals.put(new ANTLRHashString("xquery", this), new Integer(54));
literals.put(new ANTLRHashString("following-sibling", this), new Integer(182));
literals.put(new ANTLRHashString("node", this), new Integer(165));
literals.put(new ANTLRHashString("collection", this), new Integer(202));
- literals.put(new ANTLRHashString("some", this), new Integer(101));
- literals.put(new ANTLRHashString("ge", this), new Integer(141));
- literals.put(new ANTLRHashString("declare", this), new Integer(60));
- literals.put(new ANTLRHashString("for", this), new Integer(99));
- literals.put(new ANTLRHashString("ascending", this), new Integer(120));
+ literals.put(new ANTLRHashString("some", this), new Integer(102));
+ literals.put(new ANTLRHashString("ge", this), new Integer(142));
+ literals.put(new ANTLRHashString("declare", this), new Integer(61));
+ literals.put(new ANTLRHashString("for", this), new Integer(100));
+ literals.put(new ANTLRHashString("ascending", this), new Integer(121));
literals.put(new ANTLRHashString("isnot", this), new Integer(148));
- literals.put(new ANTLRHashString("eq", this), new Integer(136));
- literals.put(new ANTLRHashString("element", this), new Integer(73));
- literals.put(new ANTLRHashString("default", this), new Integer(61));
- literals.put(new ANTLRHashString("descending", this), new Integer(121));
- literals.put(new ANTLRHashString("castable", this), new Integer(132));
+ literals.put(new ANTLRHashString("eq", this), new Integer(137));
+ literals.put(new ANTLRHashString("element", this), new Integer(74));
+ literals.put(new ANTLRHashString("default", this), new Integer(62));
+ literals.put(new ANTLRHashString("descending", this), new Integer(122));
+ literals.put(new ANTLRHashString("castable", this), new Integer(133));
literals.put(new ANTLRHashString("idiv", this), new Integer(154));
- literals.put(new ANTLRHashString("boundary-space", this), new Integer(62));
+ literals.put(new ANTLRHashString("boundary-space", this), new Integer(63));
literals.put(new ANTLRHashString("ancestor", this), new Integer(184));
- literals.put(new ANTLRHashString("ordering", this), new Integer(63));
- literals.put(new ANTLRHashString("instance", this), new Integer(129));
- literals.put(new ANTLRHashString("replace", this), new Integer(106));
- literals.put(new ANTLRHashString("no-inherit", this), new Integer(85));
+ literals.put(new ANTLRHashString("ordering", this), new Integer(64));
+ literals.put(new ANTLRHashString("instance", this), new Integer(130));
+ literals.put(new ANTLRHashString("replace", this), new Integer(107));
+ literals.put(new ANTLRHashString("no-inherit", this), new Integer(86));
literals.put(new ANTLRHashString("attribute", this), new Integer(166));
- literals.put(new ANTLRHashString("empty", this), new Integer(75));
- literals.put(new ANTLRHashString("cast", this), new Integer(133));
- literals.put(new ANTLRHashString("value", this), new Integer(107));
- literals.put(new ANTLRHashString("encoding", this), new Integer(71));
+ literals.put(new ANTLRHashString("empty", this), new Integer(76));
+ literals.put(new ANTLRHashString("cast", this), new Integer(134));
+ literals.put(new ANTLRHashString("value", this), new Integer(108));
+ literals.put(new ANTLRHashString("encoding", this), new Integer(72));
literals.put(new ANTLRHashString("schema-element", this), new Integer(190));
- literals.put(new ANTLRHashString("into", this), new Integer(112));
- literals.put(new ANTLRHashString("rename", this), new Integer(110));
- literals.put(new ANTLRHashString("else", this), new Integer(126));
- literals.put(new ANTLRHashString("import", this), new Integer(70));
- literals.put(new ANTLRHashString("lt", this), new Integer(138));
+ literals.put(new ANTLRHashString("into", this), new Integer(113));
+ literals.put(new ANTLRHashString("rename", this), new Integer(111));
+ literals.put(new ANTLRHashString("else", this), new Integer(127));
+ literals.put(new ANTLRHashString("import", this), new Integer(71));
+ literals.put(new ANTLRHashString("lt", this), new Integer(139));
literals.put(new ANTLRHashString("document", this), new Integer(170));
literals.put(new ANTLRHashString("self", this), new Integer(179));
- literals.put(new ANTLRHashString("in", this), new Integer(117));
- literals.put(new ANTLRHashString("let", this), new Integer(100));
- literals.put(new ANTLRHashString("base-uri", this), new Integer(65));
+ literals.put(new ANTLRHashString("in", this), new Integer(118));
+ literals.put(new ANTLRHashString("let", this), new Integer(101));
+ literals.put(new ANTLRHashString("base-uri", this), new Integer(66));
literals.put(new ANTLRHashString("processing-instruction", this), new Integer(168));
literals.put(new ANTLRHashString("parent", this), new Integer(183));
literals.put(new ANTLRHashString("descendant", this), new Integer(180));
- literals.put(new ANTLRHashString("update", this), new Integer(105));
- literals.put(new ANTLRHashString("every", this), new Integer(102));
- literals.put(new ANTLRHashString("group", this), new Integer(122));
- literals.put(new ANTLRHashString("satisfies", this), new Integer(123));
+ literals.put(new ANTLRHashString("update", this), new Integer(106));
+ literals.put(new ANTLRHashString("every", this), new Integer(103));
+ literals.put(new ANTLRHashString("group", this), new Integer(123));
+ literals.put(new ANTLRHashString("satisfies", this), new Integer(124));
literals.put(new ANTLRHashString("div", this), new Integer(153));
- literals.put(new ANTLRHashString("item", this), new Integer(98));
+ literals.put(new ANTLRHashString("item", this), new Integer(99));
literals.put(new ANTLRHashString("child", this), new Integer(178));
}
@@ -535,19 +535,6 @@
_returnToken = _token;
}
- protected final void mGTEQ(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
- int _ttype; Token _token=null; int _begin=text.length();
- _ttype = GTEQ;
- int _saveIndex;
-
- match(">=");
- if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
- _token = makeToken(_ttype);
- _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin));
- }
- _returnToken = _token;
- }
-
protected final void mQUOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException {
int _ttype; Token _token=null; int _begin=text.length();
_ttype = QUOT;
@@ -2281,17 +2268,17 @@
int _saveIndex;
{
- int _cnt443=0;
- _loop443:
+ int _cnt444=0;
+ _loop444:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- if ( _cnt443>=1 ) { break _loop443; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt444>=1 ) { break _loop444; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt443++;
+ _cnt444++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -2432,8 +2419,8 @@
int _saveIndex;
{
- int _cnt446=0;
- _loop446:
+ int _cnt447=0;
+ _loop447:
do {
switch ( LA(1)) {
case '0': case '1': case '2': case '3':
@@ -2457,10 +2444,10 @@
}
default:
{
- if ( _cnt446>=1 ) { break _loop446; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt447>=1 ) { break _loop447; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
}
- _cnt446++;
+ _cnt447++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3184,13 +3171,13 @@
mNMSTART(false);
{
- _loop453:
+ _loop454:
do {
if ((_tokenSet_5.member(LA(1)))) {
mNMCHAR(false);
}
else {
- break _loop453;
+ break _loop454;
}
} while (true);
@@ -3209,8 +3196,8 @@
int _saveIndex;
{
- int _cnt456=0;
- _loop456:
+ int _cnt457=0;
+ _loop457:
do {
if ((LA(1)==' ') && (true) && (true) && (true)) {
match(' ');
@@ -3228,10 +3215,10 @@
match('\r');
}
else {
- if ( _cnt456>=1 ) { break _loop456; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt457>=1 ) { break _loop457; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt456++;
+ _cnt457++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3248,10 +3235,10 @@
match("(:");
{
- _loop460:
+ _loop461:
do {
// nongreedy exit test
- if ((LA(1)==':') && (LA(2)==')') && (true) && (true)) break _loop460;
+ if ((LA(1)==':') && (LA(2)==')') && (true) && (true)) break _loop461;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && (true)) {
{
if ((LA(1)=='(') && (LA(2)==':') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe'))) {
@@ -3267,7 +3254,7 @@
}
}
else {
- break _loop460;
+ break _loop461;
}
} while (true);
@@ -3318,13 +3305,13 @@
{
match('.');
{
- _loop468:
+ _loop469:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- break _loop468;
+ break _loop469;
}
} while (true);
@@ -3412,13 +3399,13 @@
if ((LA(1)=='.')) {
match('.');
{
- _loop476:
+ _loop477:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- break _loop476;
+ break _loop477;
}
} while (true);
@@ -3526,7 +3513,7 @@
match('"');
text.setLength(_saveIndex);
{
- _loop486:
+ _loop487:
do {
if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) {
mPREDEFINED_ENTITY_REF(false);
@@ -3548,7 +3535,7 @@
}
}
else {
- break _loop486;
+ break _loop487;
}
} while (true);
@@ -3564,7 +3551,7 @@
match('\'');
text.setLength(_saveIndex);
{
- _loop490:
+ _loop491:
do {
if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) {
mPREDEFINED_ENTITY_REF(false);
@@ -3586,7 +3573,7 @@
}
}
else {
- break _loop490;
+ break _loop491;
}
} while (true);
@@ -3614,8 +3601,8 @@
int _saveIndex;
{
- int _cnt494=0;
- _loop494:
+ int _cnt495=0;
+ _loop495:
do {
if ((_tokenSet_8.member(LA(1)))) {
{
@@ -3623,10 +3610,10 @@
}
}
else {
- if ( _cnt494>=1 ) { break _loop494; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt495>=1 ) { break _loop495; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt494++;
+ _cnt495++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3648,8 +3635,8 @@
int _saveIndex;
{
- int _cnt498=0;
- _loop498:
+ int _cnt499=0;
+ _loop499:
do {
if ((_tokenSet_9.member(LA(1)))) {
{
@@ -3657,10 +3644,10 @@
}
}
else {
- if ( _cnt498>=1 ) { break _loop498; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt499>=1 ) { break _loop499; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt498++;
+ _cnt499++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3710,8 +3697,8 @@
int _saveIndex;
{
- int _cnt503=0;
- _loop503:
+ int _cnt504=0;
+ _loop504:
do {
switch ( LA(1)) {
case '\t':
@@ -3773,10 +3760,10 @@
matchRange('\u007e','\uFFFD');
}
else {
- if ( _cnt503>=1 ) { break _loop503; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt504>=1 ) { break _loop504; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
}
- _cnt503++;
+ _cnt504++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3795,7 +3782,7 @@
match("<!--");
text.setLength(_saveIndex);
{
- _loop510:
+ _loop511:
do {
if ((_tokenSet_10.member(LA(1)))) {
{
@@ -3803,10 +3790,10 @@
}
}
else {
- boolean synPredMatched509 = false;
+ boolean synPredMatched510 = false;
if (((LA(1)=='-'))) {
- int _m509 = mark();
- synPredMatched509 = true;
+ int _m510 = mark();
+ synPredMatched510 = true;
inputState.guessing++;
try {
{
@@ -3817,16 +3804,16 @@
}
}
catch (RecognitionException pe) {
- synPredMatched509 = false;
+ synPredMatched510 = false;
}
- rewind(_m509);
+ rewind(_m510);
inputState.guessing--;
}
- if ( synPredMatched509 ) {
+ if ( synPredMatched510 ) {
match('-');
}
else {
- break _loop510;
+ break _loop511;
}
}
} while (true);
@@ -3851,7 +3838,7 @@
if ((LA(1)==' ')) {
match(' ');
{
- _loop518:
+ _loop519:
do {
if ((_tokenSet_11.member(LA(1)))) {
{
@@ -3859,10 +3846,10 @@
}
}
else {
- boolean synPredMatched517 = false;
+ boolean synPredMatched518 = false;
if (((LA(1)=='?'))) {
- int _m517 = mark();
- synPredMatched517 = true;
+ int _m518 = mark();
+ synPredMatched518 = true;
inputState.guessing++;
try {
{
@@ -3873,16 +3860,16 @@
}
}
catch (RecognitionException pe) {
- synPredMatched517 = false;
+ synPredMatched518 = false;
}
- rewind(_m517);
+ rewind(_m518);
inputState.guessing--;
}
- if ( synPredMatched517 ) {
+ if ( synPredMatched518 ) {
match('?');
}
else {
- break _loop518;
+ break _loop519;
}
}
} while (true);
@@ -3908,12 +3895,12 @@
mXML_CDATA_START(false);
text.setLength(_saveIndex);
{
- _loop529:
+ _loop530:
do {
- boolean synPredMatched524 = false;
+ boolean synPredMatched525 = false;
if (((LA(1)==']') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m524 = mark();
- synPredMatched524 = true;
+ int _m525 = mark();
+ synPredMatched525 = true;
inputState.guessing++;
try {
{
@@ -3924,19 +3911,19 @@
}
}
catch (RecognitionException pe) {
- synPredMatched524 = false;
+ synPredMatched525 = false;
}
- rewind(_m524);
+ rewind(_m525);
inputState.guessing--;
}
- if ( synPredMatched524 ) {
+ if ( synPredMatched525 ) {
match(']');
}
else {
- boolean synPredMatched527 = false;
+ boolean synPredMatched528 = false;
if (((LA(1)==']') && (LA(2)==']') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m527 = mark();
- synPredMatched527 = true;
+ int _m528 = mark();
+ synPredMatched528 = true;
inputState.guessing++;
try {
{
@@ -3948,12 +3935,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched527 = false;
+ synPredMatched528 = false;
}
- rewind(_m527);
+ rewind(_m528);
inputState.guessing--;
}
- if ( synPredMatched527 ) {
+ if ( synPredMatched528 ) {
{
match(']');
match(']');
@@ -3965,7 +3952,7 @@
}
}
else {
- break _loop529;
+ break _loop530;
}
}
} while (true);
@@ -3986,8 +3973,8 @@
int _saveIndex;
{
- int _cnt533=0;
- _loop533:
+ int _cnt534=0;
+ _loop534:
do {
if ((LA(1)=='\t'||LA(1)=='\n'||LA(1)=='\r'||LA(1)==' ')) {
{
@@ -4020,10 +4007,10 @@
}
}
else {
- if ( _cnt533>=1 ) { break _loop533; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt534>=1 ) { break _loop534; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt533++;
+ _cnt534++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -4070,15 +4057,15 @@
mWS(false);
text.setLength(_saveIndex);
{
- _loop539:
+ _loop540:
do {
// nongreedy exit test
- if ((LA(1)=='#') && (LA(2)==')') && (true)) break _loop539;
+ if ((LA(1)=='#') && (LA(2)==')') && (true)) break _loop540;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe'))) {
matchNot(EOF_CHAR);
}
else {
- break _loop539;
+ break _loop540;
}
} while (true);
@@ -4168,10 +4155,10 @@
}
}
else {
- boolean synPredMatched547 = false;
+ boolean synPredMatched548 = false;
if (((_tokenSet_14.member(LA(1))) && (_tokenSet_15.member(LA(2))) && (_tokenSet_16.member(LA(3))) && (true))) {
- int _m547 = mark();
- synPredMatched547 = true;
+ int _m548 = mark();
+ synPredMatched548 = true;
inputState.guessing++;
try {
{
@@ -4198,22 +4185,22 @@
}
}
catch (RecognitionException pe) {
- synPredMatched547 = false;
+ synPredMatched548 = false;
}
- rewind(_m547);
+ rewind(_m548);
inputState.guessing--;
}
- if ( synPredMatched547 ) {
+ if ( synPredMatched548 ) {
mDOUBLE_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DOUBLE_LITERAL;
}
}
else {
- boolean synPredMatched556 = false;
+ boolean synPredMatched557 = false;
if (((_tokenSet_14.member(LA(1))) && (_tokenSet_15.member(LA(2))) && (_tokenSet_16.member(LA(3))) && (true))) {
- int _m556 = mark();
- synPredMatched556 = true;
+ int _m557 = mark();
+ synPredMatched557 = true;
inputState.guessing++;
try {
{
@@ -4267,12 +4254,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched556 = false;
+ synPredMatched557 = false;
}
- rewind(_m556);
+ rewind(_m557);
inputState.guessing--;
}
- if ( synPredMatched556 ) {
+ if ( synPredMatched557 ) {
mDOUBLE_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DOUBLE_LITERAL;
@@ -4291,10 +4278,10 @@
}
}
else {
- boolean synPredMatched542 = false;
+ boolean synPredMatched543 = false;
if (((LA(1)=='<') && (LA(2)=='?'))) {
- int _m542 = mark();
- synPredMatched542 = true;
+ int _m543 = mark();
+ synPredMatched543 = true;
inputState.guessing++;
try {
{
@@ -4302,12 +4289,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched542 = false;
+ synPredMatched543 = false;
}
- rewind(_m542);
+ rewind(_m543);
inputState.guessing--;
}
- if ( synPredMatched542 ) {
+ if ( synPredMatched543 ) {
mXML_PI(false);
if ( inputState.guessing==0 ) {
_ttype = XML_PI;
@@ -4354,10 +4341,10 @@
}
}
else {
- boolean synPredMatched544 = false;
+ boolean synPredMatched545 = false;
if ((((LA(1)=='.') && (LA(2)=='.') && (true) && (true))&&( !(inAttributeContent || inElementContent) ))) {
- int _m544 = mark();
- synPredMatched544 = true;
+ int _m545 = mark();
+ synPredMatched545 = true;
inputState.guessing++;
try {
{
@@ -4366,12 +4353,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched544 = false;
+ synPredMatched545 = false;
}
- rewind(_m544);
+ rewind(_m545);
inputState.guessing--;
}
- if ( synPredMatched544 ) {
+ if ( synPredMatched545 ) {
mPARENT(false);
if ( inputState.guessing==0 ) {
_ttype = PARENT;
@@ -4407,12 +4394,6 @@
_ttype = AFTER;
}
}
- else if (((LA(1)=='>') && (LA(2)=='=') && (true) && (true))&&( !(inAttributeContent || inElementContent) )) {
- mGTEQ(false);
- if ( inputState.guessing==0 ) {
- _ttype = GTEQ;
- }
- }
else if ((LA(1)=='?') && (LA(2)=='>') && (true) && (true)) {
mXML_PI_END(false);
if ( inputState.guessing==0 ) {
@@ -4496,10 +4477,10 @@
}
}
else {
- boolean synPredMatched549 = false;
+ boolean synPredMatched550 = false;
if (((_tokenSet_14.member(LA(1))) && (true) && (true) && (true))) {
- int _m549 = mark();
- synPredMatched549 = true;
+ int _m550 = mark();
+ synPredMatched550 = true;
inputState.guessing++;
try {
{
@@ -4508,22 +4489,22 @@
}
}
catch (RecognitionException pe) {
- synPredMatched549 = false;
+ synPredMatched550 = false;
}
- rewind(_m549);
+ rewind(_m550);
inputState.guessing--;
}
- if ( synPredMatched549 ) {
+ if ( synPredMatched550 ) {
mDECIMAL_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DECIMAL_LITERAL;
}
}
else {
- boolean synPredMatched551 = false;
+ boolean synPredMatched552 = false;
if (((LA(1)=='.') && (true) && (true) && (true))) {
- int _m551 = mark();
- synPredMatched551 = true;
+ int _m552 = mark();
+ synPredMatched552 = true;
inputState.guessing++;
try {
{
@@ -4531,22 +4512,22 @@
}
}
catch (RecognitionException pe) {
- synPredMatched551 = false;
+ synPredMatched552 = false;
}
- rewind(_m551);
+ rewind(_m552);
inputState.guessing--;
}
- if ( synPredMatched551 ) {
+ if ( synPredMatched552 ) {
mSELF(false);
if ( inputState.guessing==0 ) {
_ttype = SELF;
}
}
else {
- boolean synPredMatched558 = false;
+ boolean synPredMatched559 = false;
if (((_tokenSet_14.member(LA(1))) && (true) && (true) && (true))) {
- int _m558 = mark();
- synPredMatched558 = true;
+ int _m559 = mark();
+ synPredMatched559 = true;
inputState.guessing++;
try {
{
@@ -4555,12 +4536,12 @@
}
}
catch (RecognitionException pe) {
- synPredMatched558 = false;
+ synPredMatched559 = false;
}
- rewind(_m558);
+ rewind(_m559);
inputState.guessing--;
}
- if ( synPredMatched558 ) {
+ if ( synPredMatched559 ) {
mDECIMAL_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DECIMAL_LITERAL;
Modified: trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2009-10-31 19:55:19 UTC (rev 10302)
+++ trunk/eXist/src/org/exist/xquery/parser/XQueryParser.java 2009-10-31 20:10:37 UTC (rev 10303)
@@ -314,6 +314,10 @@
tmp45_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp45_AST);
match(PRAGMA);
+ org.exist.xquery.parser.XQueryAST tmp46_AST = null;
+ tmp46_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp46_AST);
+ match(GTEQ);
imaginaryTokenDefinitions_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
returnAST = imaginaryTokenDefinitions_AST;
}
@@ -330,9 +334,9 @@
switch ( LA(1)) {
case LITERAL_xpointer:
{
- org.exist.xquery.parser.XQueryAST tmp46_AST = null;
- tmp46_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp46_AST);
+ org.exist.xquery.parser.XQueryAST tmp47_AST = null;
+ tmp47_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp47_AST);
match(LITERAL_xpointer);
match(LPAREN);
expr();
@@ -387,9 +391,9 @@
_loop107:
do {
if ((LA(1)==COMMA)) {
- org.exist.xquery.parser.XQueryAST tmp49_AST = null;
- tmp49_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp49_AST);
+ org.exist.xquery.parser.XQueryAST tmp50_AST = null;
+ tmp50_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp50_AST);
match(COMMA);
exprSingle();
astFactory.addASTChild(currentAST, returnAST);
@@ -424,9 +428,9 @@
}
}
- org.exist.xquery.parser.XQueryAST tmp50_AST = null;
- tmp50_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp50_AST);
+ org.exist.xquery.parser.XQueryAST tmp51_AST = null;
+ tmp51_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp51_AST);
match(Token.EOF_TYPE);
xpath_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
@@ -530,13 +534,13 @@
Token enc = null;
org.exist.xquery.parser.XQueryAST enc_AST = null;
- org.exist.xquery.parser.XQueryAST tmp52_AST = null;
- tmp52_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp52_AST);
- match(LITERAL_xquery);
org.exist.xquery.parser.XQueryAST tmp53_AST = null;
tmp53_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
astFactory.addASTChild(currentAST, tmp53_AST);
+ match(LITERAL_xquery);
+ org.exist.xquery.parser.XQueryAST tmp54_AST = null;
+ tmp54_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp54_AST);
match(LITERAL_version);
v = LT(1);
v_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(v);
@@ -609,10 +613,10 @@
case STRING_LITERAL:
case LITERAL_declare:
case LITERAL_default:
- case 62:
+ case 63:
case LITERAL_ordering:
case LITERAL_construction:
- case 65:
+ case 66:
case LITERAL_option:
case LITERAL_function:
case LITERAL_variable:
@@ -626,9 +630,9 @@
case LITERAL_strip:
case LITERAL_ordered:
case LITERAL_unordered:
- case 83:
+ case 84:
case LITERAL_inherit:
- case 85:
+ case 86:
case DOLLAR:
case LITERAL_external:
case LITERAL_schema:
@@ -764,9 +768,9 @@
match(LITERAL_default);
break;
}
- case 62:
+ case 63:
{
- match(62);
+ match(63);
break;
}
case LITERAL_ordering:
@@ -779,14 +783,14 @@
match(LITERAL_construction);
break;
}
- case 65:
+ case 66:
{
- match(65);
+ match(66);
break;
}
- case 66:
+ case 67:
{
- match(66);
+ match(67);
break;
}
case LITERAL_namespace:
@@ -1089,26 +1093,26 @@
}
case LITERAL_order:
{
- org.exist.xquery.parser.XQueryAST tmp67_AST = null;
- tmp67_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp67_AST);
+ org.exist.xquery.parser.XQueryAST tmp68_AST = null;
+ tmp68_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp68_AST);
match(LITERAL_order);
match(LITERAL_empty);
{
switch ( LA(1)) {
case LITERAL_greatest:
{
- org.exist.xquery.parser.XQueryAST tmp69_AST = null;
- tmp69_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp69_AST);
+ org.exist.xquery.parser.XQueryAST tmp70_AST = null;
+ tmp70_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp70_AST);
match(LITERAL_greatest);
break;
}
case LITERAL_least:
{
- org.exist.xquery.parser.XQueryAST tmp70_AST = null;
- tmp70_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp70_AST);
+ org.exist.xquery.parser.XQueryAST tmp71_AST = null;
+ tmp71_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp71_AST);
match(LITERAL_least);
break;
}
@@ -1136,7 +1140,7 @@
try {
{
match(LITERAL_declare);
- match(62);
+ match(63);
}
}
catch (RecognitionException pe) {
@@ -1147,25 +1151,25 @@
}
if ( synPredMatched41 ) {
match(LITERAL_declare);
- org.exist.xquery.parser.XQueryAST tmp72_AST = null;
- tmp72_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp72_AST);
- match(62);
+ org.exist.xquery.parser.XQueryAST tmp73_AST = null;
+ tmp73_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp73_AST);
+ match(63);
{
switch ( LA(1)) {
case LITERAL_preserve:
{
- org.exist.xquery.parser.XQueryAST tmp73_AST = null;
- tmp73_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp73_AST);
+ org.exist.xquery.parser.XQueryAST tmp74_AST = null;
+ tmp74_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp74_AST);
match(LITERAL_preserve);
break;
}
case LITERAL_strip:
{
- org.exist.xquery.parser.XQueryAST tmp74_AST = null;
- tmp74_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp74_AST);
+ org.exist.xquery.parser.XQueryAST tmp75_AST = null;
+ tmp75_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp75_AST);
match(LITERAL_strip);
break;
}
@@ -1185,7 +1189,7 @@
try {
{
match(LITERAL_declare);
- match(65);
+ match(66);
}
}
catch (RecognitionException pe) {
@@ -1196,13 +1200,13 @@
}
if ( synPredMatched44 ) {
match(LITERAL_declare);
- org.exist.xquery.parser.XQueryAST tmp76_AST = null;
- tmp76_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp76_AST);
- match(65);
org.exist.xquery.parser.XQueryAST tmp77_AST = null;
tmp77_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp77_AST);
+ astFactory.makeASTRoot(currentAST, tmp77_AST);
+ match(66);
+ org.exist.xquery.parser.XQueryAST tmp78_AST = null;
+ tmp78_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp78_AST);
match(STRING_LITERAL);
}
else {
@@ -1225,25 +1229,25 @@
}
if ( synPredMatched46 ) {
match(LITERAL_declare);
- org.exist.xquery.parser.XQueryAST tmp79_AST = null;
- tmp79_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp79_AST);
+ org.exist.xquery.parser.XQueryAST tmp80_AST = null;
+ tmp80_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp80_AST);
match(LITERAL_ordering);
{
switch ( LA(1)) {
case LITERAL_ordered:
{
- org.exist.xquery.parser.XQueryAST tmp80_AST = null;
- tmp80_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp80_AST);
+ org.exist.xquery.parser.XQueryAST tmp81_AST = null;
+ tmp81_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp81_AST);
match(LITERAL_ordered);
break;
}
case LITERAL_unordered:
{
- org.exist.xquery.parser.XQueryAST tmp81_AST = null;
- tmp81_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp81_AST);
+ org.exist.xquery.parser.XQueryAST tmp82_AST = null;
+ tmp82_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp82_AST);
match(LITERAL_unordered);
break;
}
@@ -1274,25 +1278,25 @@
}
if ( synPredMatched49 ) {
match(LITERAL_declare);
- org.exist.xquery.parser.XQueryAST tmp83_AST = null;
- tmp83_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp83_AST);
+ org.exist.xquery.parser.XQueryAST tmp84_AST = null;
+ tmp84_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp84_AST);
match(LITERAL_construction);
{
switch ( LA(1)) {
case LITERAL_preserve:
{
- org.exist.xquery.parser.XQueryAST tmp84_AST = null;
- tmp84_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp84_AST);
+ org.exist.xquery.parser.XQueryAST tmp85_AST = null;
+ tmp85_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp85_AST);
match(LITERAL_preserve);
break;
}
case LITERAL_strip:
{
- org.exist.xquery.parser.XQueryAST tmp85_AST = null;
- tmp85_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp85_AST);
+ org.exist.xquery.parser.XQueryAST tmp86_AST = null;
+ tmp86_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp86_AST);
match(LITERAL_strip);
break;
}
@@ -1312,7 +1316,7 @@
try {
{
match(LITERAL_declare);
- match(66);
+ match(67);
}
}
catch (RecognitionException pe) {
@@ -1323,10 +1327,10 @@
}
if ( synPredMatched52 ) {
match(LITERAL_declare);
- org.exist.xquery.parser.XQueryAST tmp87_AST = null;
- tmp87_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.makeASTRoot(currentAST, tmp87_AST);
- match(66);
+ org.exist.xquery.parser.XQueryAST tmp88_AST = null;
+ tmp88_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.makeASTRoot(currentAST, tmp88_AST);
+ match(67);
preserveMode();
astFactory.addASTChild(currentAST, returnAST);
match(COMMA);
@@ -1382,9 +1386,9 @@
opt_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(opt);
match(LITERAL_option);
qn=qName();
- org.exist.xquery.parser.XQueryAST tmp89_AST = null;
- tmp89_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp89_AST);
+ org.exist.xquery.parser.XQueryAST tmp90_AST = null;
+ tmp90_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp90_AST);
match(STRING_LITERAL);
if ( inputState.guessing==0 ) {
optionDecl_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -1465,9 +1469,9 @@
}
case LITERAL_external:
{
- org.exist.xquery.parser.XQueryAST tmp93_AST = null;
- tmp93_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp93_AST);
+ org.exist.xquery.parser.XQueryAST tmp94_AST = null;
+ tmp94_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp94_AST);
match(LITERAL_external);
break;
}
@@ -1564,9 +1568,9 @@
}
case LITERAL_external:
{
- org.exist.xquery.parser.XQueryAST tmp100_AST = null;
- tmp100_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp100_AST);
+ org.exist.xquery.parser.XQueryAST tmp101_AST = null;
+ tmp101_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp101_AST);
match(LITERAL_external);
break;
}
@@ -1621,9 +1625,9 @@
}
}
}
- org.exist.xquery.parser.XQueryAST tmp102_AST = null;
- tmp102_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp102_AST);
+ org.exist.xquery.parser.XQueryAST tmp103_AST = null;
+ tmp103_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp103_AST);
match(STRING_LITERAL);
{
switch ( LA(1)) {
@@ -1690,9 +1694,9 @@
}
}
}
- org.exist.xquery.parser.XQueryAST tmp104_AST = null;
- tmp104_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp104_AST);
+ org.exist.xquery.parser.XQueryAST tmp105_AST = null;
+ tmp105_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp105_AST);
match(STRING_LITERAL);
{
switch ( LA(1)) {
@@ -1737,18 +1741,18 @@
switch ( LA(1)) {
case LITERAL_preserve:
{
- org.exist.xquery.parser.XQueryAST tmp105_AST = null;
- tmp105_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp105_AST);
+ org.exist.xquery.parser.XQueryAST tmp106_AST = null;
+ tmp106_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
+ astFactory.addASTChild(currentAST, tmp106_AST);
match(LITERAL_preserve);
break;
}
- case 83:
+ case 84:
{
- org.exist.xquery.parser.XQueryAST tmp106_AST = null;
- tmp106_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp106_AST);
- match(83);
+ org.exist.xquery.parser.XQueryAST tmp107_AST = null;
...
[truncated message content] |
|
From: <di...@us...> - 2009-10-31 19:55:27
|
Revision: 10302
http://exist.svn.sourceforge.net/exist/?rev=10302&view=rev
Author: dizzzz
Date: 2009-10-31 19:55:19 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[ignore] added pre-parse and clear grammar cache button
Modified Paths:
--------------
trunk/eXist/webapp/admin/grammar.xqm
Modified: trunk/eXist/webapp/admin/grammar.xqm
===================================================================
--- trunk/eXist/webapp/admin/grammar.xqm 2009-10-31 17:21:34 UTC (rev 10301)
+++ trunk/eXist/webapp/admin/grammar.xqm 2009-10-31 19:55:19 UTC (rev 10302)
@@ -37,9 +37,65 @@
declare function grammar:main() as element() {
let $action := lower-case(request:get-parameter("action", "refresh"))
+
+ (: clear grammar cache :)
+ let $removed := if($action eq "clear-cache")
+ then
+ validation:clear-grammar-cache()
+ else
+ ()
+
+ (: cache grammar doc :)
+ let $url := request:get-parameter("url", "http://....")
+ let $cached := if($action eq "pre-parse")
+ then
+ if($url eq "http://....") then
+ ()
+ else
+ validation:pre-parse-grammar(xs:anyURI($url))
+ else
+ ()
+
return
<div class="panel">
<h1>Grammar Cache</h1>
+
+ <table>
+ <tr><td>
+ <form method="POST" enctype="multipart/form-data">
+ <input type="submit" name="button" value="Clear grammar cache"/>
+ <input type="hidden" name="panel" value="grammar"/>
+ <input type="hidden" name="action" value="clear-cache"/>
+ </form>
+ </td><td> </td><td>
+ <form method="POST" enctype="multipart/form-data">
+ <input type="submit" name="button" value="Pre-parse grammar"/>
+ <input type="text" name="url" value="{$url}"/>
+ <input type="hidden" name="panel" value="grammar"/>
+ <input type="hidden" name="action" value="pre-parse"/>
+ </form>
+ </td></tr>
+ </table>
+
+
+ <!--
+ {
+ if(not(empty($removed)))
+ then
+ <div>Removed {$removed} grammars.<p/></div>
+ else
+ ()
+ }
+ -->
+
+ {
+ if(not(empty($cached)))
+ then
+ <div><br/>Cached {$cached} grammar.<p/></div>
+ else
+ ()
+ }
+ <p/>
<table id="grammar" cellpadding="7">
{
let $cache := validation:show-grammar-cache()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-10-31 17:21:47
|
Revision: 10301
http://exist.svn.sourceforge.net/exist/?rev=10301&view=rev
Author: shabanovd
Date: 2009-10-31 17:21:34 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[ignore] update class's paths for eclipse
Modified Paths:
--------------
branches/dizzzz/jetty-upgrade/.classpath
Modified: branches/dizzzz/jetty-upgrade/.classpath
===================================================================
--- branches/dizzzz/jetty-upgrade/.classpath 2009-10-31 17:18:32 UTC (rev 10300)
+++ branches/dizzzz/jetty-upgrade/.classpath 2009-10-31 17:21:34 UTC (rev 10301)
@@ -39,7 +39,6 @@
<classpathentry kind="lib" path="lib/core/xmlrpc-client-3.1.1.jar"/>
<classpathentry kind="lib" path="lib/core/xmlrpc-common-3.1.1.jar"/>
<classpathentry kind="lib" path="lib/core/xmlrpc-server-3.1.1.jar"/>
- <classpathentry kind="lib" path="extensions/indexes/lucene/lib/lucene-core-2.3.2.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/cocoon/avalon-framework-impl-4.1.5.jar"/>
<classpathentry kind="lib" path="lib/cocoon/cocoon-2.1.7-deprecated.jar"/>
@@ -70,7 +69,6 @@
<classpathentry kind="lib" path="lib/cocoon/util.concurrent-1.3.4.jar"/>
<classpathentry kind="lib" path="lib/core/antlr-2.7.7.jar"/>
<classpathentry kind="lib" path="lib/core/excalibur-cli-1.0.jar"/>
- <classpathentry kind="lib" path="lib/core/javax.servlet-1.4.jar"/>
<classpathentry kind="lib" path="lib/core/jgroups-all-2.2.6.jar"/>
<classpathentry kind="lib" path="lib/core/jline-0.9.5.jar"/>
<classpathentry kind="lib" path="lib/core/log4j-1.2.15.jar"/>
@@ -92,7 +90,6 @@
<classpathentry kind="lib" path="tools/ant/lib/junit-4.5.jar"/>
<classpathentry kind="lib" path="tools/ant/lib/xmlunit-1.2.jar"/>
<classpathentry kind="lib" path="tools/ircbot/lib/pircbot.jar"/>
- <classpathentry kind="lib" path="tools/jetty/lib/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="tools/wrapper/lib/wrapper.jar"/>
<classpathentry kind="lib" path="lib/cocoon/avalon-framework-api-4.1.5.jar"/>
<classpathentry kind="lib" path="lib/core/jta-1.1.jar"/>
@@ -110,5 +107,10 @@
<classpathentry kind="lib" path="lib/user/svnkit.jar"/>
<classpathentry kind="lib" path="lib/user/jfreechart-1.0.12.jar"/>
<classpathentry kind="lib" path="lib/user/jcommon-1.0.15.jar"/>
+ <classpathentry kind="lib" path="extensions/indexes/lucene/lib/lucene-core-2.4.1.jar"/>
+ <classpathentry kind="lib" path="extensions/indexes/lucene/lib/lucene-regex-2.4.1.jar"/>
+ <classpathentry kind="lib" path="tools/jetty/lib/servlet-api-2.5-20081211.jar"/>
+ <classpathentry kind="lib" path="tools/jetty/lib/jetty-6.1.21.jar" sourcepath="lib/source/jetty-6.1.21-src.zip"/>
+ <classpathentry kind="lib" path="tools/jetty/lib/jetty-util-6.1.21.jar"/>
<classpathentry kind="output" path="test/classes"/>
</classpath>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-10-31 17:18:41
|
Revision: 10300
http://exist.svn.sourceforge.net/exist/?rev=10300&view=rev
Author: shabanovd
Date: 2009-10-31 17:18:32 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[ignore] update to jetty 6.1.21 ( up & running )
Modified Paths:
--------------
branches/dizzzz/jetty-upgrade/src/org/exist/StandaloneServer.java
Added Paths:
-----------
branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-6.1.21.jar
branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-util-6.1.21.jar
Removed Paths:
-------------
branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-6.1.16.jar
branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-util-6.1.16.jar
Modified: branches/dizzzz/jetty-upgrade/src/org/exist/StandaloneServer.java
===================================================================
--- branches/dizzzz/jetty-upgrade/src/org/exist/StandaloneServer.java 2009-10-31 13:44:14 UTC (rev 10299)
+++ branches/dizzzz/jetty-upgrade/src/org/exist/StandaloneServer.java 2009-10-31 17:18:32 UTC (rev 10300)
@@ -282,24 +282,24 @@
// HttpContext context = new HttpContext();
// context.setContextPath("/");
- ContextHandler contextHandler = new ContextHandler();
- contextHandler.setContextPath("/");
+// ContextHandler contextHandler = new ContextHandler();
+// contextHandler.setContextPath("/");
+//
+// // Setting up resourceBase, if it is possible
+// // This one is needed by many Servlets which depend
+// // on a not null context.getResourceBase() value
+// File eXistHome = ConfigurationHelper.getExistHome();
+// if (eXistHome != null) {
+// contextHandler.setResourceBase(eXistHome.getAbsolutePath());
+// }
- // Setting up resourceBase, if it is possible
- // This one is needed by many Servlets which depend
- // on a not null context.getResourceBase() value
- File eXistHome = ConfigurationHelper.getExistHome();
- if (eXistHome != null) {
- contextHandler.setResourceBase(eXistHome.getAbsolutePath());
- }
+ Context context = new Context(server, "/", Context.SESSIONS);
- Context context = new Context(contextHandler, "/", Context.SESSIONS);
-
// WebApplicationHandler webappHandler = new WebApplicationHandler();
// TODO: this should be read from a configuration file
- Map bootstrappers = new HashMap();
+ Map<String, ServletBootstrap> bootstrappers = new HashMap<String, ServletBootstrap>();
// REST
@@ -307,7 +307,8 @@
public void bootstrap(Properties props, Context context) {
String path = props.getProperty("rest.context", "/*");
- ServletHolder restServlet = context.addServlet(path, "org.exist.http.servlets.EXistServlet");
+
+ ServletHolder restServlet = new ServletHolder(new org.exist.http.servlets.EXistServlet());
restServlet.setName("EXistServlet");
restServlet.setInitParameter("form-encoding", props.getProperty("rest.param.form-encoding"));
restServlet.setInitParameter("container-encoding", props.getProperty("rest.param.container-encoding"));
@@ -324,6 +325,7 @@
if (value != null) {
restServlet.setInitParameter("password", value);
}
+ context.addServlet(restServlet, path);
}
});
@@ -332,9 +334,10 @@
public void bootstrap(Properties props, Context context) {
String path = props.getProperty("webdav.context", "/webdav/*");
- ServletHolder davServlet = context.addServlet(path, "org.exist.http.servlets.WebDAVServlet");
+ ServletHolder davServlet = new ServletHolder(new org.exist.http.servlets.WebDAVServlet());;
davServlet.setName("WebDAV");
davServlet.setInitParameter("authentication", props.getProperty("webdav.param.authentication"));
+ context.addServlet(davServlet, path);
}
});
@@ -343,30 +346,31 @@
public void bootstrap(Properties props, Context context) {
String path = props.getProperty("xmlrpc.context", "/xmlrpc/*");
- ServletHolder rpcServlet = context.addServlet(path, "org.exist.xmlrpc.RpcServlet");
+ ServletHolder rpcServlet = new ServletHolder(new org.exist.xmlrpc.RpcServlet());
rpcServlet.setName("RpcServlet");
+ context.addServlet(rpcServlet, path);
}
});
-
for (int i = 0; i < servlets.size(); i++) {
String name = (String) servlets.get(i);
ServletBootstrap bootstrapper = (ServletBootstrap) bootstrappers.get(name);
if (bootstrapper != null) {
bootstrapper.bootstrap(props, context);
} else {
- String path = props.getProperty(name + ".context", "/" + name + "/*");
- String sname = props.getProperty(name + ".name", name);
- ServletHolder servlet = context.addServlet(path, props.getProperty(name + ".class"));
- servlet.setName(sname);
- String paramPrefix = name + ".param.";
- for (Enumeration pnames = props.propertyNames(); pnames.hasMoreElements();) {
- String pname = (String) pnames.nextElement();
- if (pname.startsWith(paramPrefix)) {
- String theName = pname.substring(paramPrefix.length());
- servlet.setInitParameter(theName, props.getProperty(pname));
- }
- }
+ //XXX: need refactoring -shabanovd
+// String path = props.getProperty(name + ".context", "/" + name + "/*");
+// String sname = props.getProperty(name + ".name", name);
+// ServletHolder servlet = context.addServlet(props.getProperty(name + ".class"), path);
+// servlet.setName(sname);
+// String paramPrefix = name + ".param.";
+// for (Enumeration pnames = props.propertyNames(); pnames.hasMoreElements();) {
+// String pname = (String) pnames.nextElement();
+// if (pname.startsWith(paramPrefix)) {
+// String theName = pname.substring(paramPrefix.length());
+// servlet.setInitParameter(theName, props.getProperty(pname));
+// }
+// }
}
}
@@ -406,13 +410,13 @@
// context.addHandler(forward);
// }
- contextHandler.addHandler(context);
+// contextHandler.setHandler(context);
// TODO has changed
// context.addHandler(new NotFoundHandler());
// TODO not sure
//httpServer.addContext(context);
- server.addHandler(contextHandler);
+ server.setHandler(context);
server.start();
}
Deleted: branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-6.1.16.jar
===================================================================
(Binary files differ)
Added: branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-6.1.21.jar
===================================================================
(Binary files differ)
Property changes on: branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-6.1.21.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-util-6.1.16.jar
===================================================================
(Binary files differ)
Added: branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-util-6.1.21.jar
===================================================================
(Binary files differ)
Property changes on: branches/dizzzz/jetty-upgrade/tools/jetty/lib/jetty-util-6.1.21.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 13:44:21
|
Revision: 10299
http://exist.svn.sourceforge.net/exist/?rev=10299&view=rev
Author: wolfgang_m
Date: 2009-10-31 13:44:14 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] Fix for bug 2889959: Positional predicates when multiple predicates are used
https://sourceforge.net/tracker/index.php?func=detail&aid=2889959&group_id=17691&atid=117691
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/FilteredExpression.java
Modified: trunk/eXist/src/org/exist/xquery/FilteredExpression.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/FilteredExpression.java 2009-10-31 12:32:41 UTC (rev 10298)
+++ trunk/eXist/src/org/exist/xquery/FilteredExpression.java 2009-10-31 13:44:14 UTC (rev 10299)
@@ -149,6 +149,8 @@
for (Iterator i = predicates.iterator(); i.hasNext();) {
Predicate pred = (Predicate) i.next();
seq = pred.evalPredicate(contextSequence, seq, Constants.DESCENDANT_SELF_AXIS);
+ //subsequent predicates operate on the result of the previous one
+ contextSequence = null;
}
return seq;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 12:32:53
|
Revision: 10298
http://exist.svn.sourceforge.net/exist/?rev=10298&view=rev
Author: wolfgang_m
Date: 2009-10-31 12:32:41 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] Fix for bug 2880394: global variable causes for-loop to return only one element
https://sourceforge.net/tracker/?func=detail&aid=2880394&group_id=17691&atid=117691
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/PathExpr.java
Modified: trunk/eXist/src/org/exist/xquery/PathExpr.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/PathExpr.java 2009-10-31 10:55:15 UTC (rev 10297)
+++ trunk/eXist/src/org/exist/xquery/PathExpr.java 2009-10-31 12:32:41 UTC (rev 10298)
@@ -248,7 +248,7 @@
Type.subTypeOf(result.getItemType(), Type.ATOMIC))
gotAtomicResult = true;
- if(steps.size() > 1)
+ if(steps.size() > 1 && getLastExpression() instanceof Step)
// remove duplicate nodes if this is a path
// expression with more than one step
result.removeDuplicates();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 10:55:23
|
Revision: 10297
http://exist.svn.sourceforge.net/exist/?rev=10297&view=rev
Author: wolfgang_m
Date: 2009-10-31 10:55:15 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[website]
* /exist/tools is now mapped to xmldb:exist:///db/www
* created new panel in admin webapp which allows users to install the admin and sandbox apps into /db/www
* use xforms within admin webapp
Modified Paths:
--------------
trunk/eXist/webapp/WEB-INF/controller-config.xml
trunk/eXist/webapp/admin/admin.xql
trunk/eXist/webapp/admin/controller.xql
trunk/eXist/webapp/admin/scripts/admin.js
Added Paths:
-----------
trunk/eXist/webapp/admin/install.xqm
Modified: trunk/eXist/webapp/WEB-INF/controller-config.xml
===================================================================
--- trunk/eXist/webapp/WEB-INF/controller-config.xml 2009-10-31 10:35:51 UTC (rev 10296)
+++ trunk/eXist/webapp/WEB-INF/controller-config.xml 2009-10-31 10:55:15 UTC (rev 10297)
@@ -24,7 +24,7 @@
++ Default configuration: main web application is served from the
++ webapp directory.
-->
- <root pattern="/db" path="xmldb:exist:///db"/>
+ <root pattern="/tools" path="xmldb:exist:///db/www"/>
<root pattern=".*" path="/"/>
<!--
Modified: trunk/eXist/webapp/admin/admin.xql
===================================================================
--- trunk/eXist/webapp/admin/admin.xql 2009-10-31 10:35:51 UTC (rev 10296)
+++ trunk/eXist/webapp/admin/admin.xql 2009-10-31 10:55:15 UTC (rev 10297)
@@ -21,6 +21,7 @@
import module namespace backup="http://exist-db.org/xquery/admin-interface/backup" at "backup.xqm";
import module namespace prof="http://exist-db.org/xquery/profiling" at "trace.xqm";
import module namespace grammar="http://exist-db.org/xquery/admin-interface/grammar" at "grammar.xqm";
+import module namespace install="http://exist-db.org/xquery/install-tools" at "install.xqm";
declare option exist:serialize "method=xhtml media-type=text/html";
@@ -81,12 +82,26 @@
(
grammar:main()
)
+ else if ($panel eq "install") then
+ (
+ install:main()
+ )
else
(
status:main()
)
};
+declare function admin:panel-header() {
+ let $panel := request:get-parameter("panel", "status")
+ return
+ if ($panel eq "install") then
+ install:header()
+ else
+ <xf:model xmlns:xf="http://www.w3.org/2002/xforms">
+ </xf:model>
+};
+
(:~
Display the login form.
:)
@@ -158,8 +173,9 @@
true()
)
)
-return
- <html>
+return (
+ <?css-conversion no?>,
+ <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>eXist Database Administration</title>
<link type="text/css" href="admin.css" rel="stylesheet"/>
@@ -169,7 +185,8 @@
<link rel="icon" href="../resources/exist_icon_16x16.png" type="image/png"/>
<script type="text/javascript" src="scripts/prettify.js"/>
<script type="text/javascript" src="../scripts/yui/yui-combined2.7.0.js"></script>
- <script type="text/javascript" src="scripts/admin.js"></script>
+ <script type="text/javascript" src="scripts/admin.js"></script>
+ { admin:panel-header() }
</head>
<body class="yui-skin-sam">
<div class="header">
@@ -190,6 +207,7 @@
<li><a href="{$link}?panel=users">User Management</a></li>
<li><a href="{$link}?panel=xqueries">View Running Jobs</a></li>
<li><a href="{$link}?panel=setup">Examples Setup</a></li>
+ <li><a href="{$link}?panel=install">Install Tools</a></li>
<li><a href="{$link}?panel=backup">Backups</a></li>
<li><a href="{$link}?panel=trace">Query Profiling</a></li>
<li><a href="{$link}?panel=grammar">Grammar cache</a></li>
@@ -214,3 +232,4 @@
</div>
</body>
</html>
+)
\ No newline at end of file
Modified: trunk/eXist/webapp/admin/controller.xql
===================================================================
--- trunk/eXist/webapp/admin/controller.xql 2009-10-31 10:35:51 UTC (rev 10296)
+++ trunk/eXist/webapp/admin/controller.xql 2009-10-31 10:55:15 UTC (rev 10297)
@@ -16,11 +16,26 @@
<add-parameter name="archive" value="{$exist:resource}"/>
</forward>
</dispatch>
- else if ($exist:path = "/") then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <redirect url="admin.xql"/>
- </dispatch>
- else
- <ignore xmlns="http://exist.sourceforge.net/NS/exist">
- <cache-control cache="yes"/>
- </ignore>
\ No newline at end of file
+else if ($exist:path eq "/") then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <redirect url="admin.xql"/>
+ </dispatch>
+else if ($exist:resource eq "admin.xql") then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <view>
+ <forward servlet="XSLTServlet">
+ (: Apply xsltforms.xsl stylesheet :)
+ <set-attribute name="xslt.stylesheet"
+ value="{$exist:root}/xforms/xsltforms/xsltforms.xsl"/>
+ <set-attribute name="xslt.output.omit-xml-declaration" value="yes"/>
+ <set-attribute name="xslt.output.indent" value="no"/>
+ <set-attribute name="xslt.output.media-type" value="text/html"/>
+ <set-attribute name="xslt.output.method" value="xhtml"/>
+ <set-attribute name="xslt.baseuri" value="../xforms/xsltforms/"/>
+ </forward>
+ </view>
+ </dispatch>
+else
+ <ignore xmlns="http://exist.sourceforge.net/NS/exist">
+ <cache-control cache="yes"/>
+ </ignore>
\ No newline at end of file
Added: trunk/eXist/webapp/admin/install.xqm
===================================================================
--- trunk/eXist/webapp/admin/install.xqm (rev 0)
+++ trunk/eXist/webapp/admin/install.xqm 2009-10-31 10:55:15 UTC (rev 10297)
@@ -0,0 +1,173 @@
+module namespace install="http://exist-db.org/xquery/install-tools";
+
+import module namespace xdb="http://exist-db.org/xquery/xmldb";
+
+declare function install:header() as element()+ {
+ <xf:model xmlns:xf="http://www.w3.org/2002/xforms">
+ <xf:instance>
+ <action>
+ <panel>install</panel>
+ <modules/>
+ </action>
+ </xf:instance>
+ <xf:instance id="modules">
+ <modules>
+ <module id="admin">DB Admin Web Application</module>
+ <module id="sandbox">XQuery Sandbox</module>
+ <!--module id="functions">Function Documentation</module-->
+ </modules>
+ </xf:instance>
+ <xf:submission id="exec" method="get" action="admin.xql" replace="all"/>
+ </xf:model>,
+ <style type="text/css">
+ .report {{ border-top: 1px solid #777777; }}
+ .actions {{ font-size: 77%; }}
+ .xforms-submit {{ display: block; margin-top: 1em; }}
+ </style>
+};
+
+declare function install:main() as element() {
+ <div xmlns:xf="http://www.w3.org/2002/xforms" class="panel">
+ <h1>Tool Installation</h1>
+
+ <p>Use this module to install selected XQuery tool apps into
+ the database. The tools will be stored into the db collection
+ <b>/db/www</b>.</p>
+ <p>Installing the sandbox or the admin tool into the database is
+ useful if you want to use eXist in a basic, "stand-alone" setup
+ without keeping web resources in the filesystem.</p>
+ {
+ let $modules := tokenize(request:get-parameter("modules", ()), ' ')
+ return
+ if (exists($modules)) then
+ let $null := install:create-collection("/db", "www")
+ let $dir := install:webapp-home()
+ return
+ <div class="report">
+ <p>Tools have been installed. You should be able to access
+ them using the following links:</p>
+ <ul>
+ <li><a href="http://localhost:8080/exist/tools/admin/">Admin</a></li>
+ <li><a href="http://localhost:8080/exist/tools/sandbox/">XQuery Sandbox</a></li>
+ </ul>
+ <p>Installation report:</p>
+ <ul class="actions">
+ { install:scripts($dir) }
+ {
+ for $module in $modules
+ return
+ install:module($module, $dir)
+ }
+ </ul>
+ </div>
+ else (
+ <xf:select ref="modules" appearance="full">
+ <xf:label><h2>Modules:</h2></xf:label>
+ <xf:itemset nodeset="instance('modules')//module">
+ <xf:label ref="."/>
+ <xf:value ref="@id"/>
+ </xf:itemset>
+ </xf:select>,
+ <xf:submit submission="exec">
+ <xf:label>Install</xf:label>
+ </xf:submit>
+ )
+ }
+ </div>
+};
+
+declare function install:webapp-home() {
+ let $home := system:get-exist-home()
+ let $pathSep := util:system-property("file.separator")
+ return
+ if (doc-available(concat("file:///", $home, "/webapp/index.xml"))) then
+ concat($home, $pathSep, "webapp")
+ else if(ends-with($home, "WEB-INF")) then
+ substring-before($home, "WEB-INF")
+ else
+ concat($home, $pathSep, "webapp")
+};
+
+declare function install:create-collection($parent as xs:string, $collection as xs:string) {
+ let $r := xdb:create-collection($parent, $collection)
+ return
+ <li>Created collection {$r}</li>
+};
+
+declare function install:store-files($collection as xs:string, $home as xs:string, $patterns as xs:string, $mimeType as xs:string?) as element()*
+{
+ let $stored :=
+ if ($mimeType) then
+ xdb:store-files-from-pattern($collection, $home, $patterns, $mimeType)
+ else
+ xdb:store-files-from-pattern($collection, $home, $patterns)
+ for $doc in $stored return
+ <li>Uploaded: {$doc}</li>
+};
+
+declare function install:scripts($dir as xs:string) {
+ install:create-collection("/db/www", "scripts"),
+ install:store-files("/db/www/scripts", $dir, "scripts/*.js", "application/x-javascript"),
+ install:create-collection("/db/www/scripts", "yui"),
+ install:store-files("/db/www/scripts/yui", $dir, "scripts/yui/*.js", "application/x-javascript"),
+ install:store-files("/db/www/scripts/yui", $dir, "scripts/yui/*.css", "text/css"),
+ install:create-collection("/db/www", "xforms"),
+ install:create-collection("/db/www/xforms", "xsltforms"),
+ install:store-files("/db/www/xforms/xsltforms", $dir, "xforms/xsltforms/*.js", "application/x-javascript"),
+ install:store-files("/db/www/xforms/xsltforms", $dir, "xforms/xsltforms/*.css", "text/css"),
+ install:store-files("/db/www/xforms/xsltforms", $dir, "xforms/xsltforms/*.xsl", "text/xml"),
+ install:store-files("/db/www/xforms/xsltforms", $dir, "xforms/xsltforms/*.gif", "image/gif"),
+ install:store-files("/db/www/xforms/xsltforms", $dir, "xforms/xsltforms/message*", "text/plain")
+};
+
+declare function install:admin($dir as xs:string) {
+ install:create-collection("/db/www", "admin"),
+ install:store-files("/db/www/admin", $dir, "admin/*.xql", "application/xquery"),
+ install:store-files("/db/www/admin", $dir, "admin/*.jpg", "image/jpeg"),
+ install:store-files("/db/www/admin", $dir, "admin/*.xqm", "application/xquery"),
+ install:store-files("/db/www/admin", $dir, "admin/*.css", "text/css"),
+ install:create-collection("/db/www/admin", "scripts"),
+ install:store-files("/db/www/admin/scripts", $dir, "admin/scripts/*.js", "application/x-javascript"),
+ install:create-collection("/db/www/admin", "styles"),
+ install:store-files("/db/www/admin/styles", $dir, "admin/styles/*.css", "text/css")
+};
+
+declare function install:sandbox($dir as xs:string) {
+ install:create-collection("/db/www", "sandbox"),
+ install:store-files("/db/www/sandbox", $dir, "sandbox/*.xql", "application/xquery"),
+ install:create-collection("/db/www/sandbox", "scripts"),
+ install:store-files("/db/www/sandbox/scripts", $dir, "sandbox/scripts/*.js", "application/x-javascript"),
+ install:create-collection("/db/www/sandbox", "styles"),
+ install:store-files("/db/www/sandbox/styles", $dir, "sandbox/styles/*.css", "text/css")
+};
+
+(:
+declare function install:functions($dir as xs:string) {
+ install:create-collection("/db/www", "functions"),
+ install:store-files("/db/www/functions", $dir, "xquery/functions.xql", "application/xquery"),
+ install:store-files("/db/www/functions", $dir, "xquery/docsetup.xql", "application/xquery"),
+ install:store-files("/db/www/functions", $dir, "xquery/sidebar.xml", "text/xml"),
+ install:store-files("/db/www/functions", $dir, "admin/install/functions-controller.xql", "application/xquery"),
+ xdb:rename("/db/www/functions", "functions-controller.xql", "controller.xql"),
+ install:create-collection("/db/www/functions", "styles"),
+ install:store-files("/db/www/functions/styles", $dir, "xquery/styles/functions.css", "text/css"),
+ install:store-files("/db/www/functions/styles", $dir, "stylesheets/db2xhtml.xsl", "text/xml"),
+ install:create-collection("/db/www/functions", "resources"),
+ install:store-files("/db/www/functions/resources", $dir, "resources/*.gif", "image/gif"),
+ install:store-files("/db/www/functions/resources", $dir, "resources/*.png", "image/png"),
+ install:store-files("/db/www/functions/resources", $dir, "resources/*.jpg", "image/jpeg")
+};
+:)
+
+declare function install:module($module as xs:string, $dir as xs:string) {
+ if ($module eq 'admin') then
+ install:admin($dir)
+ else if ($module eq 'sandbox') then
+ install:sandbox($dir)
+ (:
+ else if ($module eq 'functions') then
+ install:functions($dir)
+ :)
+ else
+ ()
+};
\ No newline at end of file
Modified: trunk/eXist/webapp/admin/scripts/admin.js
===================================================================
--- trunk/eXist/webapp/admin/scripts/admin.js 2009-10-31 10:35:51 UTC (rev 10296)
+++ trunk/eXist/webapp/admin/scripts/admin.js 2009-10-31 10:55:15 UTC (rev 10297)
@@ -1,7 +1,7 @@
-var Dom = YAHOO.util.Dom,
- Event = YAHOO.util.Event;
+var yDom = YAHOO.util.Dom,
+ yEvent = YAHOO.util.Event;
-Event.onDOMReady(function () {
+yEvent.onDOMReady(function () {
if (document.getElementById('xqueries-container')) {
setTimeout('reloadScheduledJobs()', 3000);
setTimeout('reloadJobs()', 3000);
@@ -55,10 +55,10 @@
function displayDiff(id, resource, revision) {
var div = document.getElementById(id);
- if (Dom.getStyle(div, 'display') == 'none')
- Dom.setStyle(div, 'display', '');
+ if (yDom.getStyle(div, 'display') == 'none')
+ yDom.setStyle(div, 'display', '');
else
- Dom.setStyle(div, 'display', 'none');
+ yDom.setStyle(div, 'display', 'none');
if (div.innerHTML == '') {
var callback = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 10:35:58
|
Revision: 10296
http://exist.svn.sourceforge.net/exist/?rev=10296&view=rev
Author: wolfgang_m
Date: 2009-10-31 10:35:51 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] XInclude: try to located xincluded resource in database even if main resource was generated dynamically by XQuery.
Modified Paths:
--------------
trunk/eXist/src/org/exist/storage/serializers/XIncludeFilter.java
Modified: trunk/eXist/src/org/exist/storage/serializers/XIncludeFilter.java
===================================================================
--- trunk/eXist/src/org/exist/storage/serializers/XIncludeFilter.java 2009-10-31 10:32:52 UTC (rev 10295)
+++ trunk/eXist/src/org/exist/storage/serializers/XIncludeFilter.java 2009-10-31 10:35:51 UTC (rev 10296)
@@ -344,11 +344,25 @@
String path = externalUri.getSchemeSpecificPart();
File f = new File(path);
if (!f.isAbsolute()) {
- f = new File(moduleLoadPath, path);
- externalUri = f.toURI();
+ if (moduleLoadPath.startsWith(XmldbURI.XMLDB_URI_PREFIX)) {
+ XmldbURI parentUri = XmldbURI.create(moduleLoadPath);
+ docUri = parentUri.append(path);
+ try {
+ doc = (DocumentImpl) serializer.broker.getXMLResource(docUri);
+ if(doc != null && !doc.getPermissions().validate(serializer.broker.getUser(), Permission.READ))
+ throw new ResourceError("Permission denied to read xincluded resource");
+ } catch (PermissionDeniedException e) {
+ LOG.warn("permission denied", e);
+ throw new ResourceError("Permission denied to read xincluded resource", e);
+ }
+ } else {
+ f = new File(moduleLoadPath, path);
+ externalUri = f.toURI();
+ }
}
}
- memtreeDoc = parseExternal(externalUri);
+ if (doc == null)
+ memtreeDoc = parseExternal(externalUri);
} catch (IOException e) {
throw new ResourceError("XInclude: failed to read document at URI: " + href +
": " + e.getMessage(), e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 10:33:00
|
Revision: 10295
http://exist.svn.sourceforge.net/exist/?rev=10295&view=rev
Author: wolfgang_m
Date: 2009-10-31 10:32:52 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] NPE in XSLTServlet
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java
Modified: trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java
===================================================================
--- trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java 2009-10-31 08:29:02 UTC (rev 10294)
+++ trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java 2009-10-31 10:32:52 UTC (rev 10295)
@@ -405,6 +405,7 @@
DBBroker broker;
public DatabaseResolver(DBBroker broker, DocumentImpl myDoc) {
+ this.broker = broker;
this.doc = myDoc;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-31 08:29:22
|
Revision: 10294
http://exist.svn.sourceforge.net/exist/?rev=10294&view=rev
Author: wolfgang_m
Date: 2009-10-31 08:29:02 +0000 (Sat, 31 Oct 2009)
Log Message:
-----------
[bugfix] XQueryURLRewrite: fixed client redirects. Added external variable $exist:root to point to the root of the current path mapping, which could either be an xmldb URI or a directory.
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java
trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
Modified: trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java
===================================================================
--- trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java 2009-10-30 17:20:00 UTC (rev 10293)
+++ trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java 2009-10-31 08:29:02 UTC (rev 10294)
@@ -242,6 +242,8 @@
base = stylesheet.substring(0, p);
else
base = stylesheet;
+ if (LOG.isDebugEnabled())
+ LOG.debug("Loading stylesheet from " + stylesheet);
CachedStylesheet cached = (CachedStylesheet)cache.get(stylesheet);
if(cached == null) {
cached = new CachedStylesheet(factory, user, stylesheet, base);
Modified: trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-30 17:20:00 UTC (rev 10293)
+++ trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-31 08:29:02 UTC (rev 10294)
@@ -426,7 +426,7 @@
*/
protected void doRewrite(URLRewrite action, RequestWrapper request, HttpServletResponse response,
FilterChain filterChain) throws IOException, ServletException {
- if (action.getTarget() != null) {
+ if (action.getTarget() != null && !(action instanceof Redirect)) {
String uri = action.resolve(request);
URLRewrite staticRewrite = rewriteConfig.lookup(uri, true);
if (staticRewrite != null) {
@@ -539,7 +539,7 @@
}
// Find correct module load path
queryContext.setModuleLoadPath(moduleLoadPath);
- declareVariables(queryContext, sourceInfo, request, response);
+ declareVariables(queryContext, sourceInfo, basePath, request, response);
if (compiled == null) {
try {
compiled = xquery.compile(queryContext, sourceInfo.source);
@@ -709,7 +709,7 @@
return sourceInfo;
}
- private void declareVariables(XQueryContext context, SourceInfo sourceInfo,
+ private void declareVariables(XQueryContext context, SourceInfo sourceInfo, String basePath,
RequestWrapper request, HttpServletResponse response)
throws XPathException {
HttpRequestWrapper reqw = new HttpRequestWrapper(request, "UTF-8", "UTF-8", false);
@@ -721,7 +721,8 @@
context.declareVariable(SessionModule.PREFIX + ":session", reqw.getSession( false ));
context.declareVariable("exist:controller", sourceInfo.controllerPath);
-
+ context.declareVariable("exist:root", basePath);
+
String path;
if (sourceInfo.controllerPath.length() > 0 && !sourceInfo.controllerPath.equals("/"))
path = request.getInContextPath().substring(sourceInfo.controllerPath.length());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-30 17:20:07
|
Revision: 10293
http://exist.svn.sourceforge.net/exist/?rev=10293&view=rev
Author: wolfgang_m
Date: 2009-10-30 17:20:00 +0000 (Fri, 30 Oct 2009)
Log Message:
-----------
[bugfix] Fixed another NPE in XQueryURLRewrite
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
Modified: trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-30 13:38:36 UTC (rev 10292)
+++ trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-30 17:20:00 UTC (rev 10293)
@@ -573,7 +573,6 @@
Collection collection = broker.openCollection(locationUri, Lock.READ_LOCK);
if (collection == null) {
LOG.warn("Controller base collection not found: " + basePath);
- collection.getLock().release(Lock.READ_LOCK);
return null;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-30 13:38:43
|
Revision: 10292
http://exist.svn.sourceforge.net/exist/?rev=10292&view=rev
Author: wolfgang_m
Date: 2009-10-30 13:38:36 +0000 (Fri, 30 Oct 2009)
Log Message:
-----------
[bugfix] Fixed NPE in XQueryURLRewrite
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
Modified: trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-30 08:31:33 UTC (rev 10291)
+++ trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-30 13:38:36 UTC (rev 10292)
@@ -471,7 +471,8 @@
while (node != null) {
if (node.getNodeType() == Node.ELEMENT_NODE && Namespaces.EXIST_NS.equals(node.getNamespaceURI())) {
URLRewrite urw = parseAction(request, (Element) node);
- modelView.addView(urw);
+ if (urw != null)
+ modelView.addView(urw);
}
node = node.getNextSibling();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-30 08:31:40
|
Revision: 10291
http://exist.svn.sourceforge.net/exist/?rev=10291&view=rev
Author: wolfgang_m
Date: 2009-10-30 08:31:33 +0000 (Fri, 30 Oct 2009)
Log Message:
-----------
[ignore] fixed fibo.xql example
Modified Paths:
--------------
trunk/eXist/descriptor.xml.tmpl
Modified: trunk/eXist/descriptor.xml.tmpl
===================================================================
--- trunk/eXist/descriptor.xml.tmpl 2009-10-29 21:49:01 UTC (rev 10290)
+++ trunk/eXist/descriptor.xml.tmpl 2009-10-30 08:31:33 UTC (rev 10291)
@@ -58,7 +58,7 @@
-->
<!-- Maps the virtual fibo.xql to fibo.xq. Here the XQueryServlet executes what would normally be executed by XQueryGenerator -->
- <map path="${WEBAPP_HOME}/xquery/fibo.xql" view="${WEBAPP_HOME}/xquery/fibo.xq"/>
+ <!--map path="${WEBAPP_HOME}/xquery/fibo.xql" view="${WEBAPP_HOME}/xquery/fibo.xq"/-->
<!-- Default Document like example for REST
<map path="/db/myCollection" view="/db/myCollection/index.xql"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-29 21:49:09
|
Revision: 10290
http://exist.svn.sourceforge.net/exist/?rev=10290&view=rev
Author: wolfgang_m
Date: 2009-10-29 21:49:01 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[bugfix] CDATA sections were correctly stored, but the character content was not passed into the indexing pipeline. Text within CDATA sections could thus not be searched with a Lucene or full text index.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndexWorker.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndexWorker.java
trunk/eXist/src/org/exist/Indexer.java
trunk/eXist/src/org/exist/fulltext/FTIndexWorker.java
trunk/eXist/src/org/exist/indexing/AbstractStreamListener.java
trunk/eXist/src/org/exist/indexing/StreamListener.java
trunk/eXist/src/org/exist/storage/NativeTextEngine.java
trunk/eXist/src/org/exist/storage/NativeValueIndex.java
trunk/eXist/src/org/exist/storage/TextSearchEngine.java
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -27,18 +27,7 @@
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.exist.collections.Collection;
-import org.exist.dom.AttrImpl;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.ElementImpl;
-import org.exist.dom.Match;
-import org.exist.dom.NewArrayNodeSet;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
-import org.exist.dom.StoredNode;
-import org.exist.dom.SymbolTable;
-import org.exist.dom.TextImpl;
+import org.exist.dom.*;
import org.exist.indexing.AbstractStreamListener;
import org.exist.indexing.IndexController;
import org.exist.indexing.IndexWorker;
@@ -732,7 +721,7 @@
super.attribute(transaction, attrib, path);
}
- public void characters(Txn transaction, TextImpl text, NodePath path) {
+ public void characters(Txn transaction, CharacterDataImpl text, NodePath path) {
if (contentStack != null && !contentStack.isEmpty()) {
for (int i = 0; i < contentStack.size(); i++) {
TextExtractor extractor = (TextExtractor) contentStack.get(i);
Modified: trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndexWorker.java
===================================================================
--- trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndexWorker.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/extensions/indexes/ngram/src/org/exist/indexing/ngram/NGramIndexWorker.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -23,18 +23,7 @@
import org.apache.log4j.Logger;
import org.exist.collections.Collection;
-import org.exist.dom.AttrImpl;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.ElementImpl;
-import org.exist.dom.ExtArrayNodeSet;
-import org.exist.dom.Match;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
-import org.exist.dom.StoredNode;
-import org.exist.dom.SymbolTable;
-import org.exist.dom.TextImpl;
+import org.exist.dom.*;
import org.exist.indexing.AbstractMatchListener;
import org.exist.indexing.AbstractStreamListener;
import org.exist.indexing.Index;
@@ -675,7 +664,7 @@
super.endElement(transaction, element, path);
}
- public void characters(Txn transaction, TextImpl text, NodePath path) {
+ public void characters(Txn transaction, CharacterDataImpl text, NodePath path) {
if (contentStack != null && !contentStack.isEmpty()) {
for (int i = 0; i < contentStack.size(); i++) {
XMLString next = (XMLString) contentStack.get(i);
Modified: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndexWorker.java
===================================================================
--- trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndexWorker.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndexWorker.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -30,14 +30,7 @@
import com.vividsolutions.jts.io.WKTWriter;
import org.apache.log4j.Logger;
import org.exist.collections.Collection;
-import org.exist.dom.AttrImpl;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.ElementImpl;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.StoredNode;
-import org.exist.dom.TextImpl;
+import org.exist.dom.*;
import org.exist.indexing.AbstractStreamListener;
import org.exist.indexing.Index;
import org.exist.indexing.IndexController;
@@ -673,7 +666,7 @@
super.attribute(transaction, attrib, path);
}
- public void characters(Txn transaction, TextImpl text, NodePath path) {
+ public void characters(Txn transaction, CharacterDataImpl text, NodePath path) {
if (isDocumentGMLAware) {
//Release the deferred element if any
if (deferredElement != null)
Modified: trunk/eXist/src/org/exist/Indexer.java
===================================================================
--- trunk/eXist/src/org/exist/Indexer.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/Indexer.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -281,8 +281,12 @@
CDATASectionImpl cdata = new CDATASectionImpl(charBuf);
cdata.setOwnerDocument(document);
last.appendChildInternal(prevNode, cdata);
- if (!validate)
+ if (!validate) {
broker.storeNode(transaction, cdata, currentPath, indexSpec);
+ if (indexListener != null) {
+ indexListener.characters(transaction, cdata, currentPath);
+ }
+ }
setPrevious(cdata);
if (!nodeContentStack.isEmpty()) {
Modified: trunk/eXist/src/org/exist/fulltext/FTIndexWorker.java
===================================================================
--- trunk/eXist/src/org/exist/fulltext/FTIndexWorker.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/fulltext/FTIndexWorker.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -22,16 +22,7 @@
package org.exist.fulltext;
import org.exist.collections.Collection;
-import org.exist.dom.AttrImpl;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.ElementImpl;
-import org.exist.dom.Match;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
-import org.exist.dom.StoredNode;
-import org.exist.dom.TextImpl;
+import org.exist.dom.*;
import org.exist.indexing.AbstractStreamListener;
import org.exist.indexing.IndexController;
import org.exist.indexing.IndexWorker;
@@ -250,7 +241,7 @@
* @param text
* @param path
*/
- public void characters(Txn transaction, TextImpl text, NodePath path) {
+ public void characters(Txn transaction, CharacterDataImpl text, NodePath path) {
if (config == null) {
engine.storeText(text, NativeTextEngine.TOKENIZE, config, mode == REMOVE_ALL_NODES);
} else if (config.match(path)) {
Modified: trunk/eXist/src/org/exist/indexing/AbstractStreamListener.java
===================================================================
--- trunk/eXist/src/org/exist/indexing/AbstractStreamListener.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/indexing/AbstractStreamListener.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -25,6 +25,7 @@
import org.exist.dom.AttrImpl;
import org.exist.dom.ElementImpl;
import org.exist.dom.TextImpl;
+import org.exist.dom.CharacterDataImpl;
import org.exist.storage.NodePath;
import org.exist.storage.txn.Txn;
@@ -65,7 +66,7 @@
}
}
- public void characters(Txn transaction, TextImpl text, NodePath path) {
+ public void characters(Txn transaction, CharacterDataImpl text, NodePath path) {
if (next != null) {
next.characters(transaction, text, path);
}
Modified: trunk/eXist/src/org/exist/indexing/StreamListener.java
===================================================================
--- trunk/eXist/src/org/exist/indexing/StreamListener.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/indexing/StreamListener.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -24,6 +24,7 @@
import org.exist.dom.AttrImpl;
import org.exist.dom.ElementImpl;
import org.exist.dom.TextImpl;
+import org.exist.dom.CharacterDataImpl;
import org.exist.storage.NodePath;
import org.exist.storage.txn.Txn;
@@ -100,7 +101,7 @@
* @param text the text node which has been stored to the db.
* @param path the current node path
*/
- void characters(Txn transaction, TextImpl text, NodePath path);
+ void characters(Txn transaction, CharacterDataImpl text, NodePath path);
/**
* Processed the closing tag of an element.
Modified: trunk/eXist/src/org/exist/storage/NativeTextEngine.java
===================================================================
--- trunk/eXist/src/org/exist/storage/NativeTextEngine.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/storage/NativeTextEngine.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -25,19 +25,7 @@
import org.exist.EXistException;
import org.exist.collections.Collection;
-import org.exist.dom.AttrImpl;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.ElementImpl;
-import org.exist.dom.Match;
-import org.exist.dom.NewArrayNodeSet;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
-import org.exist.dom.StoredNode;
-import org.exist.dom.SymbolTable;
-import org.exist.dom.TextImpl;
-import org.exist.dom.VirtualNodeSet;
+import org.exist.dom.*;
import org.exist.fulltext.ElementContent;
import org.exist.fulltext.FTMatch;
import org.exist.numbering.NodeId;
@@ -253,7 +241,7 @@
* if <code>false</code>, it is tokenized before being indexed
*/
//TODO : use an indexSpec member in order to get rid of <code>noTokenizing</code>
- public void storeText(TextImpl node, int indexingHint, FulltextIndexSpec indexSpec, boolean remove) {
+ public void storeText(CharacterDataImpl node, int indexingHint, FulltextIndexSpec indexSpec, boolean remove) {
if (indexingHint == TOKENIZE || indexingHint == DO_NOT_TOKENIZE) {
//final DocumentImpl doc = (DocumentImpl)node.getOwnerDocument();
//TODO : case conversion should be handled by the tokenizer -pb
Modified: trunk/eXist/src/org/exist/storage/NativeValueIndex.java
===================================================================
--- trunk/eXist/src/org/exist/storage/NativeValueIndex.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/storage/NativeValueIndex.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -26,17 +26,7 @@
import org.apache.log4j.Logger;
import org.exist.EXistException;
import org.exist.collections.Collection;
-import org.exist.dom.AttrImpl;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.ElementImpl;
-import org.exist.dom.NewArrayNodeSet;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
-import org.exist.dom.StoredNode;
-import org.exist.dom.SymbolTable;
-import org.exist.dom.TextImpl;
+import org.exist.dom.*;
import org.exist.indexing.AbstractStreamListener;
import org.exist.indexing.IndexUtils;
import org.exist.indexing.IndexWorker;
@@ -1390,7 +1380,7 @@
super.endElement(transaction, element, path);
}
- public void characters(Txn transaction, TextImpl text, NodePath path) {
+ public void characters(Txn transaction, CharacterDataImpl text, NodePath path) {
if (contentStack != null && !contentStack.isEmpty()) {
for (int i = 0; i < contentStack.size(); i++) {
XMLString next = (XMLString) contentStack.get(i);
Modified: trunk/eXist/src/org/exist/storage/TextSearchEngine.java
===================================================================
--- trunk/eXist/src/org/exist/storage/TextSearchEngine.java 2009-10-29 17:55:04 UTC (rev 10289)
+++ trunk/eXist/src/org/exist/storage/TextSearchEngine.java 2009-10-29 21:49:01 UTC (rev 10290)
@@ -29,12 +29,7 @@
import org.apache.log4j.Logger;
import org.exist.collections.Collection;
-import org.exist.dom.DocumentImpl;
-import org.exist.dom.DocumentSet;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
-import org.exist.dom.StoredNode;
-import org.exist.dom.TextImpl;
+import org.exist.dom.*;
import org.exist.fulltext.ElementContent;
import org.exist.security.PermissionDeniedException;
import org.exist.storage.analysis.SimpleTokenizer;
@@ -165,7 +160,7 @@
* @param indexSpec
* @param node
*/
- public abstract void storeText(TextImpl node, int indexingHint, FulltextIndexSpec indexSpec, boolean remove);
+ public abstract void storeText(CharacterDataImpl node, int indexingHint, FulltextIndexSpec indexSpec, boolean remove);
public abstract void storeText(StoredNode parent, ElementContent text, int indexingHint, FulltextIndexSpec indexSpec, boolean remove);
public abstract void flush();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-29 17:55:16
|
Revision: 10289
http://exist.svn.sourceforge.net/exist/?rev=10289&view=rev
Author: wolfgang_m
Date: 2009-10-29 17:55:04 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[feature] XQueryURLRewrite has been extended and may now serve as a single entry point into the web application. This makes it possible to have multiple root paths, which are either mapped to some path on the file system or a collection within the database. For example, the main web application could be served from a database collection, while URL paths starting with /fs point into the /webapp directory on the file system.
The controller.xql files, which define how a request to a certain path is handled, are now much more portable. With a properly written controller.xql, it should be possible to move an entire XQuery application from one directory to another or even from a directory into the database without changing any links or paths.
Modified Paths:
--------------
trunk/eXist/webapp/admin/admin.xql
trunk/eXist/webapp/admin/controller.xql
trunk/eXist/webapp/sandbox/controller.xql
trunk/eXist/webapp/sandbox/get-examples.xql
trunk/eXist/webapp/xforms/controller.xql
Modified: trunk/eXist/webapp/admin/admin.xql
===================================================================
--- trunk/eXist/webapp/admin/admin.xql 2009-10-29 17:50:35 UTC (rev 10288)
+++ trunk/eXist/webapp/admin/admin.xql 2009-10-29 17:55:04 UTC (rev 10289)
@@ -180,19 +180,23 @@
<div class="content">
<div class="guide">
<div class="guide-title">Select a Page</div>
- <ul>
- <li><a href="..">Home</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=status">System Status</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=browse">Browse Collections</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=users">User Management</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=xqueries">View Running Jobs</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=setup">Examples Setup</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=backup">Backups</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=trace">Query Profiling</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=grammar">Grammar cache</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?panel=shutdown">Shutdown</a></li>
- <li><a href="{session:encode-url(request:get-uri())}?logout=yes">Logout</a></li>
- </ul>
+ {
+ let $link := session:encode-url(request:get-uri())
+ return
+ <ul>
+ <li><a href="..">Home</a></li>
+ <li><a href="{$link}?panel=status">System Status</a></li>
+ <li><a href="{$link}?panel=browse">Browse Collections</a></li>
+ <li><a href="{$link}?panel=users">User Management</a></li>
+ <li><a href="{$link}?panel=xqueries">View Running Jobs</a></li>
+ <li><a href="{$link}?panel=setup">Examples Setup</a></li>
+ <li><a href="{$link}?panel=backup">Backups</a></li>
+ <li><a href="{$link}?panel=trace">Query Profiling</a></li>
+ <li><a href="{$link}?panel=grammar">Grammar cache</a></li>
+ <li><a href="{$link}?panel=shutdown">Shutdown</a></li>
+ <li><a href="{$link}?logout=yes">Logout</a></li>
+ </ul>
+ }
<div class="userinfo">
Logged in as: {xdb:get-current-user()}
</div>
Modified: trunk/eXist/webapp/admin/controller.xql
===================================================================
--- trunk/eXist/webapp/admin/controller.xql 2009-10-29 17:50:35 UTC (rev 10288)
+++ trunk/eXist/webapp/admin/controller.xql 2009-10-29 17:55:04 UTC (rev 10289)
@@ -3,33 +3,24 @@
import module namespace request="http://exist-db.org/xquery/request";
import module namespace xdb = "http://exist-db.org/xquery/xmldb";
-let $uri := request:get-uri()
-let $context := request:get-context-path()
-let $path := substring-after($uri, $context)
-let $name := replace($uri, '^.*/([^/]+)$', '$1')
-return
- if (starts-with($path, "/admin/backups")) then
- let $user := xdb:get-current-user()
- return
- if (not(xdb:is-admin-user($user))) then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <redirect url="../admin.xql"/>
- </dispatch>
- else
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="/admin/retrieve-backup.xql">
- <add-parameter name="archive" value="{$name}"/>
- </forward>
- </dispatch>
- else if (matches($path, "admin/?$")) then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <redirect url="admin.xql"/>
- </dispatch>
- else if ($name eq "admin.xql") then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="/admin/admin.xql"/>
- </dispatch>
- else
- <ignore xmlns="http://exist.sourceforge.net/NS/exist">
- <cache-control cache="yes"/>
- </ignore>
\ No newline at end of file
+if (starts-with($exist:path, "/backups")) then
+ let $user := xdb:get-current-user()
+ return
+ if (not(xdb:is-admin-user($user))) then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <redirect url="../admin.xql"/>
+ </dispatch>
+ else
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="/admin/retrieve-backup.xql">
+ <add-parameter name="archive" value="{$exist:resource}"/>
+ </forward>
+ </dispatch>
+ else if ($exist:path = "/") then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <redirect url="admin.xql"/>
+ </dispatch>
+ else
+ <ignore xmlns="http://exist.sourceforge.net/NS/exist">
+ <cache-control cache="yes"/>
+ </ignore>
\ No newline at end of file
Modified: trunk/eXist/webapp/sandbox/controller.xql
===================================================================
--- trunk/eXist/webapp/sandbox/controller.xql 2009-10-29 17:50:35 UTC (rev 10288)
+++ trunk/eXist/webapp/sandbox/controller.xql 2009-10-29 17:55:04 UTC (rev 10289)
@@ -7,11 +7,9 @@
be handled like any other query. The results are then passed to
a second XQuery, session.xql, for post-processing.
:)
-import module namespace xdb = "http://exist-db.org/xquery/xmldb";
-
(: Root path: redirect to sandbox.xql :)
-if ($exist:resource eq '/') then
+if ($exist:path eq '/') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="sandbox.xql"/>
</dispatch>
Modified: trunk/eXist/webapp/sandbox/get-examples.xql
===================================================================
--- trunk/eXist/webapp/sandbox/get-examples.xql 2009-10-29 17:50:35 UTC (rev 10288)
+++ trunk/eXist/webapp/sandbox/get-examples.xql 2009-10-29 17:55:04 UTC (rev 10289)
@@ -6,7 +6,7 @@
<select id="saved" name="saved">
<option value=""></option>
{
- for $entry in //example-queries/query
+ for $entry in collection("/db")//example-queries/query
return
<option value="{$entry/code}">{$entry/description}</option>
}
Modified: trunk/eXist/webapp/xforms/controller.xql
===================================================================
--- trunk/eXist/webapp/xforms/controller.xql 2009-10-29 17:50:35 UTC (rev 10288)
+++ trunk/eXist/webapp/xforms/controller.xql 2009-10-29 17:55:04 UTC (rev 10289)
@@ -33,17 +33,13 @@
};
let $dummy := local:setup()
-let $uri := request:get-uri()
-let $context := request:get-context-path()
-let $path := substring-after($uri, $context)
-let $name := replace($uri, '^.*/([^/]+)$', '$1')
return
- if (matches($path, '/xforms/?$')) then
+ if ($exist:path eq '/') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <redirect url="{$context}/xforms/examples.xml"/>
+ <redirect url="examples.xml"/>
</dispatch>
(: send docbook docs through the db2xhtml stylesheet :)
- else if (ends-with($uri, 'examples.xml') or ends-with($uri, 'xforms.xml')) then
+ else if ($exist:resource = ('examples.xml', 'xforms.xml')) then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward servlet="XSLTServlet">
@@ -61,8 +57,8 @@
</dispatch>
(: for the following examples, the xsltforms.xsl stylesheet is applied
on the *server*, not the client :)
- else if ($name = ('todo-list.xml', 'shakespeare.xml')) then
- let $relPath := if ($name eq 'todo-list.xml') then '../' else ''
+ else if ($exist:resource = ('todo-list.xml', 'shakespeare.xml')) then
+ let $relPath := if ($exist:resource eq 'todo-list.xml') then '../' else ''
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
@@ -85,7 +81,7 @@
</view>
<cache-control cache="yes"/>
</dispatch>
- else if ($name eq 'test.xql') then
+ else if ($exist:resource eq 'test.xql') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<view>
<forward servlet="XSLTServlet">
@@ -102,16 +98,16 @@
<cache-control cache="yes"/>
</dispatch>
(: make sure the global css and js files are resolved :)
- else if ($name = ('default-style.css', 'default-style2.css', 'curvycorners.js')
- or matches($path, 'resources/')) then
- let $newPath := replace($path, '^.*/([^/]+/[^/]+)$', '/$1')
+ else if ($exist:resource = ('default-style.css', 'default-style2.css', 'curvycorners.js')
+ or matches($exist:path, 'resources/')) then
+ let $newPath := replace($exist:path, '^.*/([^/]+/[^/]+)$', '/$1')
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$newPath}"/>
<cache-control cache="yes"/>
</dispatch>
- else if (matches($path, 'syntax/.*\.(css|js)')) then
- let $newPath := replace($path, '^.*/([^/]+/syntax/[^/]+)$', '/$1')
+ else if (matches($exist:path, 'syntax/.*\.(css|js)')) then
+ let $newPath := replace($exist:path, '^.*/([^/]+/syntax/[^/]+)$', '/$1')
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="{$newPath}"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-10-29 17:50:45
|
Revision: 10288
http://exist.svn.sourceforge.net/exist/?rev=10288&view=rev
Author: shabanovd
Date: 2009-10-29 17:50:35 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[ignore] adding XSLT's access context
Modified Paths:
--------------
trunk/eXist/src/org/exist/security/xacml/AccessContext.java
Modified: trunk/eXist/src/org/exist/security/xacml/AccessContext.java
===================================================================
--- trunk/eXist/src/org/exist/security/xacml/AccessContext.java 2009-10-29 17:44:59 UTC (rev 10287)
+++ trunk/eXist/src/org/exist/security/xacml/AccessContext.java 2009-10-29 17:50:35 UTC (rev 10288)
@@ -44,6 +44,10 @@
*/
public static final AccessContext XMLDB = new AccessContext("XML:DB");
/**
+ * This represents when access is made through XSLT
+ */
+ public static final AccessContext XSLT = new AccessContext("XSLT");
+ /**
* This represents when access is made through XQJ
*/
public static final AccessContext XQJ = new AccessContext("XQJ");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-10-29 17:45:07
|
Revision: 10287
http://exist.svn.sourceforge.net/exist/?rev=10287&view=rev
Author: shabanovd
Date: 2009-10-29 17:44:59 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[ignore] minor optimization
Modified Paths:
--------------
trunk/eXist/extensions/indexes/ngram/src/org/exist/xquery/modules/ngram/NGramSearch.java
trunk/eXist/src/org/exist/xupdate/Conditional.java
trunk/eXist/src/org/exist/xupdate/XUpdateProcessor.java
Modified: trunk/eXist/extensions/indexes/ngram/src/org/exist/xquery/modules/ngram/NGramSearch.java
===================================================================
--- trunk/eXist/extensions/indexes/ngram/src/org/exist/xquery/modules/ngram/NGramSearch.java 2009-10-29 17:43:00 UTC (rev 10286)
+++ trunk/eXist/extensions/indexes/ngram/src/org/exist/xquery/modules/ngram/NGramSearch.java 2009-10-29 17:44:59 UTC (rev 10287)
@@ -285,8 +285,11 @@
private NodeSet endsWith(NodeSet nodes) {
NodeSet temp = new ExtArrayNodeSet();
- LOG.debug("Filtering " + nodes.getLength());
- for (NodeSetIterator iterator = nodes.iterator(); iterator.hasNext();) {
+
+ if (LOG.isDebugEnabled())
+ LOG.debug("Filtering " + nodes.getLength());
+
+ for (NodeSetIterator iterator = nodes.iterator(); iterator.hasNext();) {
NodeProxy next = (NodeProxy) iterator.next();
String data = next.getNodeValue();
int len = data.length();
Modified: trunk/eXist/src/org/exist/xupdate/Conditional.java
===================================================================
--- trunk/eXist/src/org/exist/xupdate/Conditional.java 2009-10-29 17:43:00 UTC (rev 10286)
+++ trunk/eXist/src/org/exist/xupdate/Conditional.java 2009-10-29 17:44:59 UTC (rev 10287)
@@ -102,7 +102,10 @@
mods += ((Modification)modifications.get(i)).process(transaction);
broker.flush();
}
- LOG.debug(mods + " modifications processed.");
+
+ if (LOG.isDebugEnabled())
+ LOG.debug(mods + " modifications processed.");
+
return mods;
} else
return 0;
Modified: trunk/eXist/src/org/exist/xupdate/XUpdateProcessor.java
===================================================================
--- trunk/eXist/src/org/exist/xupdate/XUpdateProcessor.java 2009-10-29 17:43:00 UTC (rev 10286)
+++ trunk/eXist/src/org/exist/xupdate/XUpdateProcessor.java 2009-10-29 17:44:59 UTC (rev 10287)
@@ -690,7 +690,10 @@
if (normalized.length() > 0) {
Text text = doc.createTextNode(normalized);
if (stack.isEmpty()) {
- LOG.debug("appending text to fragment: " + text.getData());
+
+ if (LOG.isDebugEnabled())
+ LOG.debug("appending text to fragment: " + text.getData());
+
contents.add(text);
} else {
Element last = (Element) stack.peek();
@@ -719,10 +722,14 @@
private void createVariable(String name, String select)
throws SAXException {
- LOG.debug("creating variable " + name + " as " + select);
+ if (LOG.isDebugEnabled())
+ LOG.debug("creating variable " + name + " as " + select);
+
Sequence result = processQuery(select);
+
if (LOG.isDebugEnabled())
LOG.debug("found " + result.getItemCount() + " for variable " + name);
+
variables.put(name, result);
}
@@ -752,7 +759,9 @@
}
AST ast = parser.getAST();
- LOG.debug("generated AST: " + ast.toStringTree());
+
+ if (LOG.isDebugEnabled())
+ LOG.debug("generated AST: " + ast.toStringTree());
PathExpr expr = new PathExpr(context);
treeParser.xpath(ast, expr);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-29 17:43:21
|
Revision: 10286
http://exist.svn.sourceforge.net/exist/?rev=10286&view=rev
Author: wolfgang_m
Date: 2009-10-29 17:43:00 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[feature] XQueryURLRewrite has been extended and may now serve as a single entry point into the web application. This makes it possible to have multiple root paths, which are either mapped to some path on the file system or a collection within the database. For example, the main web application could be served from a database collection, while URL paths starting with /fs point into the /webapp directory on the file system.
The controller.xql files, which define how a request to a certain path is handled, are now much more portable. With a properly written controller.xql, it should be possible to move an entire XQuery application from one directory to another or even from a directory into the database without changing any links or paths.
Modified Paths:
--------------
trunk/eXist/webapp/WEB-INF/web.xml
trunk/eXist/webapp/controller.xql
trunk/eXist/webapp/sandbox/controller.xql
trunk/eXist/webapp/sandbox/sandbox.xql
trunk/eXist/webapp/xquery/controller.xql
trunk/eXist/webapp/xquery/dump.xql
Added Paths:
-----------
trunk/eXist/webapp/WEB-INF/controller-config.xml
Added: trunk/eXist/webapp/WEB-INF/controller-config.xml
===================================================================
--- trunk/eXist/webapp/WEB-INF/controller-config.xml (rev 0)
+++ trunk/eXist/webapp/WEB-INF/controller-config.xml 2009-10-29 17:43:00 UTC (rev 10286)
@@ -0,0 +1,45 @@
+<!--
+ ++ Base configuration for eXist's URL rewriting. This file defines
+ ++ all basic path mappings. A path can be mapped to a servlet or
+ ++ the root of a directory or collection hierarchy.
+-->
+<configuration xmlns="http://exist.sourceforge.net/NS/exist">
+ <!-- Webstart servlet -->
+ <forward pattern="/webstart" servlet="jnlp"/>
+ <!-- XMLRPC servlet -->
+ <forward pattern="/xmlrpc" servlet="org.exist.xmlrpc.RpcServlet"/>
+ <!-- REST interface -->
+ <forward pattern="/(rest|servlet)" servlet="EXistServlet"/>
+ <!-- WebDAV interface -->
+ <forward pattern="/webdav" servlet="WebDAVServlet"/>
+ <!-- Atom Publishing Protocol -->
+ <forward pattern="/atom" servlet="AtomServlet"/>
+ <!-- Apache SOAP interface -->
+ <forward pattern="/axis-servlet/AxisServlet" servlet="AxisServlet"/>
+ <forward pattern=".*\.jws" servlet="AxisServlet"/>
+ <forward pattern="/services" servlet="AxisServlet"/>
+ <forward pattern="/axis-servlet/AdminServlet" servlet="AdminServlet"/>
+
+ <!--
+ ++ Default configuration: main web application is served from the
+ ++ webapp directory.
+ -->
+ <root pattern="/db" path="xmldb:exist:///db"/>
+ <root pattern=".*" path="/"/>
+
+ <!--
+ ++ The following configuration assumes that the main webapp
+ ++ is stored in the database. However, the contents of the /webapp directory
+ ++ should still be accessible with a /fs prefix in the path.
+ -->
+ <!--root pattern="/fs" path="/"/>
+ <root pattern=".*" path="xmldb:exist:///db/www"/-->
+
+ <!--
+ ++ Order is important here: the forward rule for XQuery resources has
+ ++ to be last in this document, otherwise all XQuery files would be immediately
+ ++ forwarded to the XQueryServlet without ever going through any of the
+ ++ controllers.
+ -->
+ <forward pattern=".*\.(xql|xqy|xquery)$" servlet="XQueryServlet"/>
+</configuration>
\ No newline at end of file
Modified: trunk/eXist/webapp/WEB-INF/web.xml
===================================================================
--- trunk/eXist/webapp/WEB-INF/web.xml 2009-10-29 17:38:49 UTC (rev 10285)
+++ trunk/eXist/webapp/WEB-INF/web.xml 2009-10-29 17:43:00 UTC (rev 10286)
@@ -129,13 +129,6 @@
<filter>
<filter-name>XQueryURLRewrite</filter-name>
<filter-class>org.exist.http.urlrewrite.XQueryURLRewrite</filter-class>
-
- <!-- Uncomment the following if you want to keep your controller XQueries stored
- in the db. -->
- <!--init-param>
- <param-name>base</param-name>
- <param-value>xmldb:exist:///db</param-value>
- </init-param-->
</filter>
<servlet>
@@ -488,66 +481,10 @@
<!-- ====================== URL space mappings ======================= -->
- <!-- XMLRPC -->
- <servlet-mapping>
- <servlet-name>org.exist.xmlrpc.RpcServlet</servlet-name>
- <url-pattern>/xmlrpc</url-pattern>
- </servlet-mapping>
-
- <!-- REST new mapping-->
- <servlet-mapping>
- <servlet-name>EXistServlet</servlet-name>
- <url-pattern>/rest/*</url-pattern>
- </servlet-mapping>
-
- <!-- REST original mapping-->
- <servlet-mapping>
- <servlet-name>EXistServlet</servlet-name>
- <url-pattern>/servlet/*</url-pattern>
- </servlet-mapping>
-
- <!-- webDAV -->
- <servlet-mapping>
- <servlet-name>WebDAVServlet</servlet-name>
- <url-pattern>/webdav/*</url-pattern>
- </servlet-mapping>
-
- <!-- XQuery (not for database stored queries) -->
- <servlet-mapping>
- <servlet-name>XQueryServlet</servlet-name>
- <url-pattern>*.xql</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>XQueryServlet</servlet-name>
- <url-pattern>*.xqy</url-pattern>
- </servlet-mapping>
-
<filter-mapping>
<filter-name>XQueryURLRewrite</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-
- <!-- SOAP (Apache Axis) -->
- <servlet-mapping>
- <servlet-name>AxisServlet</servlet-name>
- <url-pattern>/axis-servlet/AxisServlet</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>AxisServlet</servlet-name>
- <url-pattern>*.jws</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>AxisServlet</servlet-name>
- <url-pattern>/services/*</url-pattern>
- </servlet-mapping>
-
- <servlet-mapping>
- <servlet-name>AdminServlet</servlet-name>
- <url-pattern>/axis-servlet/AdminServlet</url-pattern>
- </servlet-mapping>
<!--
Finally, we establish the main mapping for Cocoon
@@ -577,20 +514,7 @@
<servlet-name>Cocoon</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping-->
-
- <!-- Java Webstart -->
- <servlet-mapping>
- <servlet-name>jnlp</servlet-name>
- <url-pattern>/webstart/*</url-pattern>
- </servlet-mapping>
-
- <!-- Atom Publishing Protocol -->
- <servlet-mapping>
- <servlet-name>AtomServlet</servlet-name>
- <url-pattern>/atom/*</url-pattern>
- </servlet-mapping>
-
<!-- ==================== various MIME type mappings ================== -->
<mime-mapping>
Modified: trunk/eXist/webapp/controller.xql
===================================================================
--- trunk/eXist/webapp/controller.xql 2009-10-29 17:38:49 UTC (rev 10285)
+++ trunk/eXist/webapp/controller.xql 2009-10-29 17:43:00 UTC (rev 10286)
@@ -12,23 +12,19 @@
import module namespace request="http://exist-db.org/xquery/request";
import module namespace xdb = "http://exist-db.org/xquery/xmldb";
-let $uri := request:get-uri()
-let $context := request:get-context-path()
-let $path := substring-after($uri, $context)
-let $name := replace($uri, '^.*/([^/]+)$', '$1')
let $query := request:get-parameter("q", ())
return
(: redirect webapp root to index.xml :)
- if ($path eq '/') then
+ if ($exist:path eq '/') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<redirect url="index.xml"/>
</dispatch>
(: /rest and /webdav will be ignored :)
- else if (matches($path, "/(xmlrpc|rest|servlet|webdav/|cocoon|test.xml)")) then
+ else if (matches($exist:path, "/(xmlrpc|rest|servlet|webdav/|cocoon|test.xml)")) then
<ignore xmlns="http://exist.sourceforge.net/NS/exist">
<cache-control cache="yes"/>
</ignore>
- else if ($name eq 'applications.xml') then
+ else if ($exist:resource eq 'applications.xml') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<!-- query results are passed to XSLT servlet via request attribute -->
<set-attribute name="xquery.attribute"
@@ -48,7 +44,7 @@
</forward>
</view>
</dispatch>
- else if ($name eq 'articles') then
+ else if ($exist:resource eq 'articles') then
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="/xquery/exist-articles.xql">
<!-- query results are passed to XSLT servlet via request attribute -->
@@ -65,7 +61,7 @@
</view>
</dispatch>
- else if ($path = "/xforms/idxconf.xml") then
+ else if ($exist:path = "/xforms/idxconf.xml") then
let $log := util:log("DEBUG", "in xforms rule") return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="idxconf.xql"/>
@@ -79,12 +75,12 @@
</dispatch>
(: the following xml files use different stylesheets :)
- else if ($name = ('index.xml', 'roadmap.xml', 'facts.xml')
- or $path = '/examples.xml') then
+ else if ($exist:resource = ('index.xml', 'roadmap.xml', 'facts.xml')
+ or $exist:path = '/examples.xml') then
let $stylesheet :=
- if ($name eq 'roadmap.xml') then
+ if ($exist:resource eq 'roadmap.xml') then
"stylesheets/roadmap.xsl"
- else if ($name eq "facts.xml") then
+ else if ($exist:resource eq "facts.xml") then
"stylesheets/facts.xsl"
else
"stylesheets/doc2html-2.xsl"
@@ -100,15 +96,13 @@
</view>
<cache-control cache="no"/>
</dispatch>
- else if (ends-with($uri, '.xml')) then
+ else if (ends-with($exist:resource, '.xml')) then
(: check if the requested document was selected from a query result.
if yes, pass it to docs.xql to get the match highlighting. :)
if ($query) then
- let $docName := replace($uri, '^.*/([^/]+)$', '$1')
- return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
<forward url="/xquery/docs.xql">
- <add-parameter name="path" value="/db/xqdocs/{$docName}"/>
+ <add-parameter name="path" value="/db/xqdocs/{$exist:resource}"/>
</forward>
<view>
<forward servlet="XSLTServlet">
@@ -141,7 +135,7 @@
<set-attribute name="xslt.output.doctype-system"
value="resources/xhtml1-transitional.dtd"/>
{
- if ($name eq 'download.xml') then
+ if ($exist:resource eq 'download.xml') then
<set-attribute name="xslt.table-of-contents"
value="'no'"/>
else
@@ -151,14 +145,17 @@
</view>
<cache-control cache="no"/>
</dispatch>
- else if (ends-with($path, '/dump')) then
- let $newPath := substring-before($path, '/dump')
- let $log := util:log("DEBUG", ("LOG: ", $newPath))
+ else if (ends-with($exist:path, '/dump')) then
+ let $newPath := substring-before($exist:path, '/dump')
return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="{$newPath}"/>
+ <forward url="{$exist:controller}{$newPath}"/>
<view>
- <forward url="/xquery/dump.xql"/>
+ <forward url="xquery/dump.xql">
+ <set-attribute name="controller" value="{$exist:controller}"/>
+ <set-attribute name="path" value="{$exist:path}"/>
+ <set-attribute name="resource" value="{$exist:resource}"/>
+ </forward>
</view>
</dispatch>
else
Modified: trunk/eXist/webapp/sandbox/controller.xql
===================================================================
--- trunk/eXist/webapp/sandbox/controller.xql 2009-10-29 17:38:49 UTC (rev 10285)
+++ trunk/eXist/webapp/sandbox/controller.xql 2009-10-29 17:43:00 UTC (rev 10286)
@@ -7,57 +7,58 @@
be handled like any other query. The results are then passed to
a second XQuery, session.xql, for post-processing.
:)
-import module namespace request="http://exist-db.org/xquery/request";
import module namespace xdb = "http://exist-db.org/xquery/xmldb";
-let $uri := request:get-uri()
-let $context := request:get-context-path()
-let $path := substring-after($uri, $context)
-let $name := replace($uri, '^.*/([^/]+)$', '$1')
-return
- (: Root path: redirect to sandbox.xql :)
- if ($path eq '/sandbox/') then
+
+(: Root path: redirect to sandbox.xql :)
+if ($exist:resource eq '/') then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <redirect url="sandbox.xql"/>
+ </dispatch>
+(: Execute a query :)
+else if ($exist:resource eq 'execute') then
+ let $query := request:get-parameter("qu", ())
+ let $startTime := util:system-time()
+ return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <redirect url="sandbox.xql"/>
- </dispatch>
- (: Execute a query :)
- else if ($name eq 'execute') then
- let $query := request:get-parameter("qu", ())
- let $startTime := util:system-time()
- return
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <!-- Query is executed by XQueryServlet -->
- <forward servlet="XQueryServlet">
- <!-- Query is passed via the attribute 'xquery.source' -->
- <set-attribute name="xquery.source" value="{$query}"/>
- <!-- Results should be written into attribute 'results' -->
- <set-attribute name="xquery.attribute" value="results"/>
- <clear-attribute name="results"/>
- <!-- Errors should be passed through instead of terminating the request -->
- <set-attribute name="xquery.report-errors" value="yes"/>
- </forward>
- <view>
- <!-- Post process the result: store it into the HTTP session
- and return the number of hits only. -->
- <forward url="session.xql">
- <clear-attribute name="xquery.source"/>
- <clear-attribute name="xquery.attribute"/>
- <set-attribute name="elapsed"
- value="{string(seconds-from-duration(util:system-time() - $startTime))}"/>
- </forward>
- </view>
- </dispatch>
- (: Retrieve an item from the query results stored in the HTTP session. The
- format of the URL will be /sandbox/results/X, where X is the number of the
- item in the result set :)
- else if (starts-with($path, '/sandbox/results/')) then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="../session.xql">
- <add-parameter name="num" value="{$name}"/>
- </forward>
- </dispatch>
- else
- (: everything else is passed through :)
- <ignore xmlns="http://exist.sourceforge.net/NS/exist">
- <cache-control cache="yes"/>
- </ignore>
+ <!-- Query is executed by XQueryServlet -->
+ <forward servlet="XQueryServlet">
+ <!-- Query is passed via the attribute 'xquery.source' -->
+ <set-attribute name="xquery.source" value="{$query}"/>
+ <!-- Results should be written into attribute 'results' -->
+ <set-attribute name="xquery.attribute" value="results"/>
+ <clear-attribute name="results"/>
+ <!-- Errors should be passed through instead of terminating the request -->
+ <set-attribute name="xquery.report-errors" value="yes"/>
+ </forward>
+ <view>
+ <!-- Post process the result: store it into the HTTP session
+ and return the number of hits only. -->
+ <forward url="session.xql">
+ <clear-attribute name="xquery.source"/>
+ <clear-attribute name="xquery.attribute"/>
+ <set-attribute name="elapsed"
+ value="{string(seconds-from-duration(util:system-time() - $startTime))}"/>
+ </forward>
+ </view>
+ </dispatch>
+(: Retrieve an item from the query results stored in the HTTP session. The
+ format of the URL will be /sandbox/results/X, where X is the number of the
+ item in the result set :)
+else if (starts-with($exist:path, '/results/')) then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="../session.xql">
+ <add-parameter name="num" value="{$exist:resource}"/>
+ </forward>
+ </dispatch>
+else if (starts-with($exist:path, '/scripts/yui')) then
+ let $log := util:log("DEBUG", ("UI: ", replace($exist:path, '(/scripts/yui/.*)$', '$1')))
+ return
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="/{replace($exist:path, '(/scripts/yui/.*)$', '$1')}"/>
+ </dispatch>
+else
+ (: everything else is passed through :)
+ <ignore xmlns="http://exist.sourceforge.net/NS/exist">
+ <cache-control cache="yes"/>
+ </ignore>
Modified: trunk/eXist/webapp/sandbox/sandbox.xql
===================================================================
--- trunk/eXist/webapp/sandbox/sandbox.xql 2009-10-29 17:38:49 UTC (rev 10285)
+++ trunk/eXist/webapp/sandbox/sandbox.xql 2009-10-29 17:43:00 UTC (rev 10286)
@@ -81,12 +81,12 @@
<head>
<title>XQuery Sandbox</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <link rel="stylesheet" type="text/css" href="../scripts/yui/yui-skin.css"/>
+ <link rel="stylesheet" type="text/css" href="scripts/yui/yui-skin.css"/>
<link type="text/css" href="styles/sandbox.css" rel="stylesheet"/>
<link rel="shortcut icon" href="../resources/exist_icon_16x16.ico"/>
<link rel="icon" href="../resources/exist_icon_16x16.png" type="image/png"/>
- <script src="../scripts/yui/yui-combined2.7.0.js"/>
+ <script src="scripts/yui/yui-combined2.7.0.js"/>
<script language="Javascript" type="text/javascript" src="scripts/sandbox.js"/>
</head>
<body class=" yui-skin-sam">
Modified: trunk/eXist/webapp/xquery/controller.xql
===================================================================
--- trunk/eXist/webapp/xquery/controller.xql 2009-10-29 17:38:49 UTC (rev 10285)
+++ trunk/eXist/webapp/xquery/controller.xql 2009-10-29 17:43:00 UTC (rev 10286)
@@ -3,115 +3,125 @@
import module namespace request="http://exist-db.org/xquery/request";
import module namespace xdb = "http://exist-db.org/xquery/xmldb";
-let $uri := request:get-uri()
-let $context := request:get-context-path()
-let $path := substring-after($uri, $context)
-let $name := replace($uri, '^.*/([^/]+)$', '$1')
-return
- if ($name = ('search.xql', 'functions.xql', 'svnlog.xql')) then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="{$path}">
- <!-- query results are passed to XSLT servlet via request attribute -->
- <set-attribute name="xquery.attribute"
+if ($exist:path = "/") then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <redirect url="../examples.xml"/>
+ </dispatch>
+else if ($exist:resource = ('search.xql', 'functions.xql', 'svnlog.xql')) then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <!-- query results are passed to XSLT servlet via request attribute -->
+ <set-attribute name="xquery.attribute"
+ value="model"/>
+ <view>
+ <forward servlet="XSLTServlet">
+ <set-attribute name="xslt.input"
value="model"/>
+ <set-attribute name="xslt.stylesheet"
+ value="/stylesheets/db2xhtml.xsl"/>
+ <set-attribute name="xslt.output.media-type"
+ value="text/html"/>
+ <set-attribute name="xslt.output.doctype-public"
+ value="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
+ <set-attribute name="xslt.output.doctype-system"
+ value="resources/xhtml1-transitional.dtd"/>
</forward>
- <view>
- <forward servlet="XSLTServlet">
- <set-attribute name="xslt.input"
- value="model"/>
- <set-attribute name="xslt.stylesheet"
- value="/stylesheets/db2xhtml.xsl"/>
- <set-attribute name="xslt.output.media-type"
- value="text/html"/>
- <set-attribute name="xslt.output.doctype-public"
- value="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
- <set-attribute name="xslt.output.doctype-system"
- value="resources/xhtml1-transitional.dtd"/>
- </forward>
- </view>
- <cache-control cache="no"/>
- </dispatch>
- else if ($name eq 'acronyms.xql') then
+ </view>
+ <cache-control cache="no"/>
+ </dispatch>
+else if ($exist:resource eq 'acronyms.xql') then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <!-- query results are passed to XSLT servlet via request attribute -->
+ <set-attribute name="xquery.attribute"
+ value="model"/>
+ <view>
+ <forward servlet="XSLTServlet">
+ <set-attribute name="xslt.input"
+ value="model"/>
+ <set-attribute name="xslt.stylesheet"
+ value="stylesheets/acronyms.xsl"/>
+ </forward>
+ <forward servlet="XSLTServlet">
+ <set-attribute name="xslt.input"
+ value=""/>
+ <set-attribute name="xslt.stylesheet"
+ value="/stylesheets/db2xhtml.xsl"/>
+ <set-attribute name="xslt.output.media-type"
+ value="text/html"/>
+ <set-attribute name="xslt.output.doctype-public"
+ value="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
+ <set-attribute name="xslt.output.doctype-system"
+ value="resources/xhtml1-transitional.dtd"/>
+ </forward>
+ </view>
+ </dispatch>
+else if ($exist:resource = 'biblio.xml') then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <view>
+ <forward servlet="XSLTServlet">
+ <set-attribute name="xslt.stylesheet"
+ value="stylesheets/doc2html-2.xsl"/>
+ </forward>
+ </view>
+ <cache-control cache="yes"/>
+ </dispatch>
+else if ($exist:resource eq 'biblio.xql') then
+ let $display := request:get-parameter("display", "overview")
+ let $xsl :=
+ if ($display eq "details") then "detailed.xsl" else "overview.xsl"
+ return
<dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <!-- query results are passed to XSLT servlet via request attribute -->
- <set-attribute name="xquery.attribute"
- value="model"/>
+ <set-attribute name="xquery.attribute" value="model"/>
<view>
- <forward servlet="XSLTServlet">
- <set-attribute name="xslt.input"
- value="model"/>
- <set-attribute name="xslt.stylesheet"
- value="stylesheets/acronyms.xsl"/>
- </forward>
- <forward servlet="XSLTServlet">
- <set-attribute name="xslt.input"
- value=""/>
- <set-attribute name="xslt.stylesheet"
- value="/stylesheets/db2xhtml.xsl"/>
- <set-attribute name="xslt.output.media-type"
- value="text/html"/>
- <set-attribute name="xslt.output.doctype-public"
- value="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
- <set-attribute name="xslt.output.doctype-system"
- value="resources/xhtml1-transitional.dtd"/>
- </forward>
+ <forward servlet="XSLTServlet">
+ <set-attribute name="xslt.input"
+ value="model"/>
+ <set-attribute name="xslt.stylesheet"
+ value="xquery/stylesheets/{$xsl}"/>
+ </forward>
+ <forward servlet="XSLTServlet">
+ <set-attribute name="xslt.input"
+ value=""/>
+ <set-attribute name="xslt.stylesheet"
+ value="stylesheets/doc2html-2.xsl"/>
+ </forward>
+
</view>
</dispatch>
- else if ($name = 'biblio.xml') then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+else if ($exist:resource eq 'twitter.xql') then
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="twitter.xql"/>
+ <view>
+ <forward url="twitter-view.xql"/>
+ </view>
+ </dispatch>
+else if ($exist:resource = ('default-style.css', 'default-style2.css', 'curvycorners.js')) then
+ let $newPath := replace($exist:path, '^.*/([^/]+/[^/]+)$', '/$1')
+ return
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="{$newPath}"/>
+ <cache-control cache="yes"/>
+ </dispatch>
+else if (matches($exist:path, 'syntax/.*\.(css|js)')) then
+ let $newPath := replace($exist:path, '^.*/([^/]+/syntax/[^/]+)$', '/$1')
+ return
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="{$newPath}"/>
+ <cache-control cache="yes"/>
+ </dispatch>
+else if (ends-with($exist:path, '/dump')) then
+ let $newPath := substring-before($exist:path, '/dump')
+ return
+ <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
+ <forward url="{$exist:controller}{$newPath}"/>
<view>
- <forward servlet="XSLTServlet">
- <set-attribute name="xslt.stylesheet"
- value="stylesheets/doc2html-2.xsl"/>
- </forward>
+ <forward url="/xquery/dump.xql">
+ <set-attribute name="controller" value="{$exist:controller}"/>
+ <set-attribute name="path" value="{$exist:path}"/>
+ <set-attribute name="resource" value="{$exist:resource}"/>
+ </forward>
</view>
- <cache-control cache="yes"/>
</dispatch>
- else if ($name eq 'biblio.xql') then
- let $display := request:get-parameter("display", "overview")
- let $xsl :=
- if ($display eq "details") then "detailed.xsl" else "overview.xsl"
- return
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <set-attribute name="xquery.attribute" value="model"/>
- <view>
- <forward servlet="XSLTServlet">
- <set-attribute name="xslt.input"
- value="model"/>
- <set-attribute name="xslt.stylesheet"
- value="xquery/stylesheets/{$xsl}"/>
- </forward>
- <forward servlet="XSLTServlet">
- <set-attribute name="xslt.input"
- value=""/>
- <set-attribute name="xslt.stylesheet"
- value="stylesheets/doc2html-2.xsl"/>
- </forward>
-
- </view>
- </dispatch>
- else if ($name eq 'twitter.xql') then
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="twitter.xql"/>
- <view>
- <forward url="twitter-view.xql"/>
- </view>
- </dispatch>
- else if ($name = ('default-style.css', 'default-style2.css', 'curvycorners.js')) then
- let $newPath := replace($path, '^.*/([^/]+/[^/]+)$', '/$1')
- return
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="{$newPath}"/>
- <cache-control cache="yes"/>
- </dispatch>
- else if (matches($path, 'syntax/.*\.(css|js)')) then
- let $newPath := replace($path, '^.*/([^/]+/syntax/[^/]+)$', '/$1')
- return
- <dispatch xmlns="http://exist.sourceforge.net/NS/exist">
- <forward url="{$newPath}"/>
- <cache-control cache="yes"/>
- </dispatch>
- else
- <ignore xmlns="http://exist.sourceforge.net/NS/exist">
- <cache-control cache="yes"/>
- </ignore>
\ No newline at end of file
+else
+ <ignore xmlns="http://exist.sourceforge.net/NS/exist">
+ <cache-control cache="yes"/>
+ </ignore>
\ No newline at end of file
Modified: trunk/eXist/webapp/xquery/dump.xql
===================================================================
--- trunk/eXist/webapp/xquery/dump.xql 2009-10-29 17:38:49 UTC (rev 10285)
+++ trunk/eXist/webapp/xquery/dump.xql 2009-10-29 17:43:00 UTC (rev 10286)
@@ -4,6 +4,12 @@
declare option exist:serialize "media-type=text/xml omit-xml-declaration=no";
+declare function dump:attributes() {
+ for $attr in request:attribute-names()
+ return
+ <attribute name="{$attr}">{request:get-attribute($attr)}</attribute>
+};
+
declare function dump:headers() {
for $header in request:get-header-names()
return
@@ -15,6 +21,7 @@
<headers>
{ dump:headers() }
</headers>
+ { dump:attributes() }
<data>{$data}</data>
</request>
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-10-29 17:39:00
|
Revision: 10285
http://exist.svn.sourceforge.net/exist/?rev=10285&view=rev
Author: wolfgang_m
Date: 2009-10-29 17:38:49 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[feature] XQueryURLRewrite has been extended and may now serve as a single entry point into the web application. This makes it possible to have multiple root paths, which are either mapped to some path on the file system or a collection within the database. For example, the main web application could be served from a database collection, while URL paths starting with /fs point into the /webapp directory on the file system.
The controller.xql files, which define how a request to a certain path is handled, are now much more portable. With a properly written controller.xql, it should be possible to move an entire XQuery application from one directory to another or even from a directory into the database without changing any links or paths.
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/urlrewrite/PassThrough.java
trunk/eXist/src/org/exist/http/urlrewrite/PathForward.java
trunk/eXist/src/org/exist/http/urlrewrite/URLRewrite.java
trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
Added Paths:
-----------
trunk/eXist/src/org/exist/http/urlrewrite/ControllerForward.java
trunk/eXist/src/org/exist/http/urlrewrite/RewriteConfig.java
Added: trunk/eXist/src/org/exist/http/urlrewrite/ControllerForward.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/ControllerForward.java (rev 0)
+++ trunk/eXist/src/org/exist/http/urlrewrite/ControllerForward.java 2009-10-29 17:38:49 UTC (rev 10285)
@@ -0,0 +1,65 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-07 The eXist Project
+ * http://exist-db.org
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * $Id$
+ */
+
+package org.exist.http.urlrewrite;
+
+import org.w3c.dom.Element;
+import org.exist.xmldb.XmldbURI;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+public class ControllerForward extends URLRewrite {
+
+ public ControllerForward(Element config, String uri) {
+ super(config, uri);
+ this.target = config.getAttribute("path");
+ }
+
+ public void doRewrite(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
+ }
+
+ public boolean isControllerForward() {
+ return true;
+ }
+
+ protected void updateRequest(XQueryURLRewrite.RequestWrapper request) {
+ super.updateRequest(request);
+ if (!(target.length() == 0 || target.equals("/") ||target.startsWith(XmldbURI.XMLDB_URI_PREFIX))) {
+ String oldURI = request.getInContextPath();
+ String uri = target + oldURI;
+ request.setInContextPath(uri);
+ }
+ }
+
+ protected void rewriteRequest(XQueryURLRewrite.RequestWrapper request) {
+ if (target != null && target.startsWith(XmldbURI.XMLDB_URI_PREFIX)) {
+ XmldbURI dbURI = XmldbURI.create(target);
+ this.uri = "/rest";
+ request.setPaths("/rest" + dbURI.getCollectionPath() + request.getInContextPath(), "/rest");
+ request.setBasePath("/rest" + dbURI.getCollectionPath());
+ }
+ }
+}
Modified: trunk/eXist/src/org/exist/http/urlrewrite/PassThrough.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/PassThrough.java 2009-10-29 16:34:53 UTC (rev 10284)
+++ trunk/eXist/src/org/exist/http/urlrewrite/PassThrough.java 2009-10-29 17:38:49 UTC (rev 10285)
@@ -31,12 +31,14 @@
public class PassThrough extends URLRewrite {
- public PassThrough(String uri) {
- super(null, uri);
+ public PassThrough(HttpServletRequest request) {
+ super(null, request.getRequestURI());
+ this.target = request.getRequestURI().substring(request.getContextPath().length());
}
- public PassThrough(Element config, String uri) {
- super(config, uri);
+ public PassThrough(Element config, HttpServletRequest request) {
+ super(config, request.getRequestURI());
+ this.target = request.getRequestURI().substring(request.getContextPath().length());
}
public void doRewrite(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
Modified: trunk/eXist/src/org/exist/http/urlrewrite/PathForward.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/PathForward.java 2009-10-29 16:34:53 UTC (rev 10284)
+++ trunk/eXist/src/org/exist/http/urlrewrite/PathForward.java 2009-10-29 17:38:49 UTC (rev 10285)
@@ -22,6 +22,7 @@
package org.exist.http.urlrewrite;
import org.w3c.dom.Element;
+import org.exist.xmldb.XmldbURI;
import javax.servlet.RequestDispatcher;
import javax.servlet.FilterConfig;
@@ -50,7 +51,9 @@
protected RequestDispatcher getRequestDispatcher(HttpServletRequest request) {
if (servletName != null)
return filterConfig.getServletContext().getNamedDispatcher(servletName);
+ else if (request != null)
+ return request.getRequestDispatcher(target);
else
- return request.getRequestDispatcher(target);
+ return filterConfig.getServletContext().getRequestDispatcher(target);
}
}
Added: trunk/eXist/src/org/exist/http/urlrewrite/RewriteConfig.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/RewriteConfig.java (rev 0)
+++ trunk/eXist/src/org/exist/http/urlrewrite/RewriteConfig.java 2009-10-29 17:38:49 UTC (rev 10285)
@@ -0,0 +1,192 @@
+package org.exist.http.urlrewrite;
+
+import org.apache.log4j.Logger;
+import org.exist.Namespaces;
+import org.exist.memtree.SAXAdapter;
+import org.exist.xquery.util.RegexTranslator;
+import org.exist.xquery.Constants;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Handles static mapping configuration for the @link XQueryURLRewrite filter,
+ * defined in controller-config.xml. The static mapping is used to map
+ * base paths to base controllers or servlets.
+ */
+public class RewriteConfig {
+
+ public final static String CONFIG_FILE = "controller-config.xml";
+
+ public final static String MAP_ELEMENT = "map";
+ public final static String PATTERN_ATTRIBUTE = "pattern";
+
+ /**
+ * Maps a regular expression to an URLRewrite instance
+ */
+ private final static class Mapping {
+
+ Pattern pattern;
+ Matcher matcher = null;
+ URLRewrite action;
+
+ private Mapping(String regex, URLRewrite action) throws ServletException {
+ try {
+ regex = RegexTranslator.translate(regex, true);
+ this.pattern = Pattern.compile(regex, 0);
+ this.action = action;
+ } catch (RegexTranslator.RegexSyntaxException e) {
+ throw new ServletException("Syntax error in regular expression specified for path. " +
+ e.getMessage(), e);
+ }
+ }
+
+ public String match(String path) {
+ if (matcher == null)
+ matcher = pattern.matcher(path);
+ else
+ matcher.reset(path);
+ if (matcher.lookingAt()) {
+ return path.substring(matcher.start(), matcher.end());
+ }
+ return null;
+ }
+ }
+
+ private final static Logger LOG = Logger.getLogger(RewriteConfig.class);
+
+ // the list of established mappings
+ private List<Mapping> mappings = new ArrayList<Mapping>();
+ // source file for controller-config.xml
+ private File configFile;
+ private long lastModified;
+ // parent XQueryURLRewrite
+ private XQueryURLRewrite urlRewrite;
+
+ public RewriteConfig(XQueryURLRewrite urlRewrite) throws ServletException {
+ this.urlRewrite = urlRewrite;
+ File d = new File(urlRewrite.getConfig().getServletContext().getRealPath("."), "WEB-INF");
+ configFile = new File(d, CONFIG_FILE);
+ if (configFile.canRead()) {
+ configure();
+ }
+ }
+
+ /**
+ * Lookup the given path in the static mappings table.
+ *
+ * @param request use the path from this request
+ * @return the URLRewrite instance for the mapping or null if none was found
+ * @throws ServletException
+ */
+ public synchronized URLRewrite lookup(HttpServletRequest request) throws ServletException {
+ String path = request.getRequestURI().substring(request.getContextPath().length());
+ return lookup(path, false);
+ }
+
+ /**
+ * Lookup the given path in the static mappings table.
+ *
+ * @param path path to look up
+ * @param staticMapping don't return redirects to other controllers, just static mappings
+ * to servlets.
+ * @return the URLRewrite instance for the mapping or null if none was found
+ * @throws ServletException
+ */
+ public synchronized URLRewrite lookup(String path, boolean staticMapping) throws ServletException {
+ if (configFile.lastModified() > lastModified)
+ configure();
+ int p = path.lastIndexOf(';');
+ if(p != Constants.STRING_NOT_FOUND)
+ path = path.substring(0, p);
+ for (int i = 0; i < mappings.size(); i++) {
+ Mapping m = mappings.get(i);
+ String matchedString = m.match(path);
+ if (matchedString != null) {
+ URLRewrite action = m.action;
+ // if the mapping matches a part of the URI only, set the prefix to the
+ // matched string. This will later be stripped from the URI.
+ if (matchedString.length() != path.length() && !matchedString.equals("/"))
+ action.setPrefix(matchedString);
+ action.setURI(path);
+ if (!staticMapping || !(action instanceof ControllerForward))
+ return action;
+ }
+ }
+ return null;
+ }
+
+ private void configure() throws ServletException {
+ LOG.debug("Loading XQueryURLRewrite configuration from " + configFile.getAbsolutePath());
+ try {
+ Document doc = parseConfig(configFile);
+ Element root = doc.getDocumentElement();
+ Node child = root.getFirstChild();
+ while (child != null) {
+ if (child.getNodeType() == Node.ELEMENT_NODE &&
+ child.getNamespaceURI().equals(Namespaces.EXIST_NS)) {
+ Element elem = (Element) child;
+ String pattern = elem.getAttribute(PATTERN_ATTRIBUTE);
+ if (pattern == null)
+ throw new ServletException("Action in controller-config.xml has no pattern: " + elem.toString());
+ URLRewrite urw = parseAction(urlRewrite.getConfig(), pattern, elem);
+ if (urw == null)
+ throw new ServletException("Unknown action in controller-config.xml: " + elem.getNodeName());
+ mappings.add(new Mapping(pattern, urw));
+ }
+ child = child.getNextSibling();
+ }
+ lastModified = configFile.lastModified();
+ urlRewrite.clearCaches();
+ } catch (ParserConfigurationException e) {
+ throw new ServletException("Failed to parse controller.xml: " + e.getMessage(), e);
+ } catch (SAXException e) {
+ throw new ServletException("Failed to parse controller.xml: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new ServletException("Failed to parse controller.xml: " + e.getMessage(), e);
+ }
+ }
+
+ private URLRewrite parseAction(FilterConfig config, String pattern, Element action) throws ServletException {
+ URLRewrite rewrite = null;
+ if ("forward".equals(action.getLocalName())) {
+ rewrite = new PathForward(config, action, pattern);
+ } else if ("redirect".equals(action.getLocalName())) {
+ rewrite = new Redirect(action, pattern);
+ } else if ("root".equals(action.getLocalName())) {
+ rewrite = new ControllerForward(action, pattern);
+ }
+ return rewrite;
+ }
+
+ private Document parseConfig(File cf) throws ParserConfigurationException, SAXException, IOException {
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ InputSource src = new InputSource(new FileInputStream(cf));
+ SAXParser parser = factory.newSAXParser();
+ XMLReader xr = parser.getXMLReader();
+ SAXAdapter adapter = new SAXAdapter();
+ xr.setContentHandler(adapter);
+ xr.setProperty(Namespaces.SAX_LEXICAL_HANDLER, adapter);
+ xr.parse(src);
+
+ return adapter.getDocument();
+ }
+}
\ No newline at end of file
Modified: trunk/eXist/src/org/exist/http/urlrewrite/URLRewrite.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/URLRewrite.java 2009-10-29 16:34:53 UTC (rev 10284)
+++ trunk/eXist/src/org/exist/http/urlrewrite/URLRewrite.java 2009-10-29 17:38:49 UTC (rev 10285)
@@ -33,6 +33,8 @@
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
+import java.net.URI;
+import java.net.URISyntaxException;
/**
* Base class for all rewritten URLs.
@@ -43,6 +45,7 @@
protected String uri;
protected String target;
+ protected String prefix = null;
protected Map attributes = null;
protected Map parameters = null;
protected Map headers = null;
@@ -70,6 +73,43 @@
}
}
+ protected void updateRequest(XQueryURLRewrite.RequestWrapper request) {
+ if (prefix != null)
+ request.removePathPrefix(prefix);
+ }
+
+ protected void rewriteRequest(XQueryURLRewrite.RequestWrapper request) {
+ // do nothing by default
+ }
+
+ /**
+ * Resolve the target of this rewrite rule against the current request context.
+ *
+ * @return the new target path excluding context path
+ */
+ protected String resolve(XQueryURLRewrite.RequestWrapper request) throws ServletException {
+ String path = request.getInContextPath();
+ if (target == null)
+ return path;
+ String fixedTarget;
+ if (request.getBasePath() != null && target.startsWith("/")) {
+ fixedTarget = request.getBasePath() + target;
+ } else
+ fixedTarget = target;
+ try {
+ URI reqURI = new URI(path);
+ return reqURI.resolve(fixedTarget).toASCIIString();
+ } catch (URISyntaxException e) {
+ throw new ServletException(e.getMessage(), e);
+ }
+ }
+
+ protected void copyFrom(URLRewrite other) {
+ this.headers = other.headers;
+ this.parameters = other.parameters;
+ this.attributes = other.attributes;
+ }
+
private void setHeader(String key, String value) {
if (headers == null)
headers = new HashMap();
@@ -98,6 +138,26 @@
this.target = target;
}
+ public String getTarget() {
+ return target;
+ }
+
+ public void setURI(String uri) {
+ this.uri = uri;
+ }
+
+ public String getURI() {
+ return uri;
+ }
+
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
public abstract void doRewrite(HttpServletRequest request, HttpServletResponse response,
FilterChain chain) throws ServletException, IOException;
@@ -129,6 +189,10 @@
}
}
+ public boolean isControllerForward() {
+ return false;
+ }
+
protected static String normalizePath(String path) {
StringBuilder sb = new StringBuilder(path.length());
for (int i = 0; i < path.length(); i++) {
Modified: trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-29 16:34:53 UTC (rev 10284)
+++ trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-10-29 17:38:49 UTC (rev 10285)
@@ -41,10 +41,7 @@
import org.exist.xquery.functions.request.RequestModule;
import org.exist.xquery.functions.response.ResponseModule;
import org.exist.xquery.functions.session.SessionModule;
-import org.exist.xquery.XQuery;
-import org.exist.xquery.XQueryContext;
-import org.exist.xquery.CompiledXQuery;
-import org.exist.xquery.XPathException;
+import org.exist.xquery.*;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Type;
@@ -99,6 +96,8 @@
import java.util.Map;
import java.util.Properties;
import java.util.Vector;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
/**
* A filter to redirect HTTP requests. Similar to the popular UrlRewriteFilter, but
@@ -156,9 +155,11 @@
public final static String DRIVER = "org.exist.xmldb.DatabaseImpl";
+ private final static Pattern NAME_REGEX = Pattern.compile("^.*/([^/]+)$", 0);
+
private FilterConfig config;
- private Map<String, ModelAndView> urlCache = new HashMap<String, ModelAndView>();
+ private final Map<String, ModelAndView> urlCache = new HashMap<String, ModelAndView>();
private User user;
private BrokerPool pool;
@@ -166,19 +167,18 @@
// path to the query
private String query = null;
- private List<Source> sources = new ArrayList<Source>();
+ private final Map<Object, Source> sources = new HashMap<Object, Source>();
- private String basePath = null;
private boolean checkModified = true;
+ private RewriteConfig rewriteConfig;
+
public void init(FilterConfig filterConfig) throws ServletException {
// save FilterConfig for later use
this.config = filterConfig;
+ this.rewriteConfig = new RewriteConfig(this);
query = filterConfig.getInitParameter("xquery");
- basePath = filterConfig.getInitParameter("base");
- if (query == null && basePath == null)
- basePath = ".";
String opt = filterConfig.getInitParameter("check-modified");
if (opt != null)
@@ -214,151 +214,155 @@
try {
configure();
+ checkCache();
- DBBroker broker = null;
- if (checkModified) {
- // check if any of the currently used sources has been updated
- // if yes, clear the cache
- for (int i = 0; i < sources.size(); i++) {
- Source source = sources.get(i);
- if (source instanceof DBSource) {
- // Check if the XQuery source changed. If yes, clear all caches.
- try {
- broker = pool.get(user);
- if (source.isValid(broker) != Source.VALID)
- urlCache.clear();
- } finally {
- pool.release(broker);
- }
- } else {
- if (source.isValid((DBBroker)null) != Source.VALID)
- urlCache.clear();
- }
- }
- }
-
- if (LOG.isTraceEnabled())
- LOG.trace("Processing request URI: " + request.getRequestURI());
RequestWrapper modifiedRequest = new RequestWrapper(request);
- // check if the request URI is already in the url cache
- ModelAndView modelView = urlCache.get(request.getRequestURI());
- // no: create a new model and view configuration
- if (modelView == null) {
- modelView = new ModelAndView();
- // Execute the query
- Sequence result = Sequence.EMPTY_SEQUENCE;
- try {
- broker = pool.get(user);
- result = runQuery(broker, request, response);
- } finally {
- pool.release(broker);
+ URLRewrite staticRewrite = rewriteConfig.lookup(modifiedRequest);
+ if (staticRewrite != null && !staticRewrite.isControllerForward()) {
+ modifiedRequest.setPaths(staticRewrite.resolve(modifiedRequest), staticRewrite.getPrefix());
+ if (LOG.isTraceEnabled())
+ LOG.trace("Forwarding to target: " + staticRewrite.getTarget());
+ staticRewrite.doRewrite(modifiedRequest, response, filterChain);
+ } else {
+ if (LOG.isTraceEnabled())
+ LOG.trace("Processing request URI: " + request.getRequestURI());
+
+ if (staticRewrite != null) {
+ // fix the request URI
+ staticRewrite.updateRequest(modifiedRequest);
}
- // process the query result
- if (result.getItemCount() == 1) {
- Item resource = result.itemAt(0);
- if (!Type.subTypeOf(resource.getType(), Type.NODE))
- throw new ServletException("XQueryURLRewrite: urlrewrite query should return an element!");
- Node node = ((NodeValue) resource).getNode();
- if (node.getNodeType() == Node.DOCUMENT_NODE)
- node = ((Document) node).getDocumentElement();
- if (node.getNodeType() != Node.ELEMENT_NODE) {
- throw new ServletException("Redirect XQuery should return an XML element!");
+ // check if the request URI is already in the url cache
+ ModelAndView modelView = null;
+ synchronized (urlCache) {
+ urlCache.get(modifiedRequest.getRequestURI());
+ }
+ // no: create a new model and view configuration
+ if (modelView == null) {
+ modelView = new ModelAndView();
+ // Execute the query
+ Sequence result = Sequence.EMPTY_SEQUENCE;
+ DBBroker broker = null;
+ try {
+ broker = pool.get(user);
+ result = runQuery(broker, modifiedRequest, response,
+ staticRewrite == null ? "." : staticRewrite.getTarget());
+
+ logResult(broker, result);
+ } finally {
+ pool.release(broker);
}
- Element elem = (Element) node;
- if (!(Namespaces.EXIST_NS.equals(elem.getNamespaceURI()))) {
- throw new ServletException("Redirect XQuery should return an element in namespace " + Namespaces.EXIST_NS);
- }
- if ("dispatch".equals(elem.getLocalName())) {
- node = elem.getFirstChild();
- while (node != null) {
- if (node.getNodeType() == Node.ELEMENT_NODE && Namespaces.EXIST_NS.equals(node.getNamespaceURI())) {
- Element action = (Element) node;
- if ("view".equals(action.getLocalName())) {
- parseViews(request, action, modelView);
- } else if ("cache-control".equals(action.getLocalName())) {
- String option = action.getAttribute("cache");
- modelView.setUseCache("yes".equals(option));
- } else {
- URLRewrite urw = parseAction(request, action);
- if (urw != null)
- modelView.setModel(urw);
+ // process the query result
+ if (result.getItemCount() == 1) {
+ Item resource = result.itemAt(0);
+ if (!Type.subTypeOf(resource.getType(), Type.NODE))
+ throw new ServletException("XQueryURLRewrite: urlrewrite query should return an element!");
+ Node node = ((NodeValue) resource).getNode();
+ if (node.getNodeType() == Node.DOCUMENT_NODE)
+ node = ((Document) node).getDocumentElement();
+ if (node.getNodeType() != Node.ELEMENT_NODE) {
+ throw new ServletException("Redirect XQuery should return an XML element!");
+ }
+ Element elem = (Element) node;
+ if (!(Namespaces.EXIST_NS.equals(elem.getNamespaceURI()))) {
+ throw new ServletException("Redirect XQuery should return an element in namespace " + Namespaces.EXIST_NS);
+ }
+
+ if ("dispatch".equals(elem.getLocalName())) {
+ node = elem.getFirstChild();
+ while (node != null) {
+ if (node.getNodeType() == Node.ELEMENT_NODE && Namespaces.EXIST_NS.equals(node.getNamespaceURI())) {
+ Element action = (Element) node;
+ if ("view".equals(action.getLocalName())) {
+ parseViews(modifiedRequest, action, modelView);
+ } else if ("cache-control".equals(action.getLocalName())) {
+ String option = action.getAttribute("cache");
+ modelView.setUseCache("yes".equals(option));
+ } else {
+ URLRewrite urw = parseAction(modifiedRequest, action);
+ if (urw != null)
+ modelView.setModel(urw);
+ }
}
+ node = node.getNextSibling();
}
- node = node.getNextSibling();
+ if (modelView.getModel() == null)
+ modelView.setModel(new PassThrough(elem, modifiedRequest));
+ } else if ("ignore".equals(elem.getLocalName())) {
+ modelView.setModel(new PassThrough(elem, modifiedRequest));
+ NodeList nl = elem.getElementsByTagNameNS(Namespaces.EXIST_NS, "cache-control");
+ if (nl.getLength() > 0) {
+ elem = (Element) nl.item(0);
+ String option = elem.getAttribute("cache");
+ modelView.setUseCache("yes".equals(option));
+ }
}
- if (modelView.getModel() == null)
- modelView.setModel(new PassThrough(elem, request.getRequestURI()));
- } else if ("ignore".equals(elem.getLocalName())) {
- modelView.setModel(new PassThrough(elem, request.getRequestURI()));
- NodeList nl = elem.getElementsByTagNameNS(Namespaces.EXIST_NS, "cache-control");
- if (nl.getLength() > 0) {
- elem = (Element) nl.item(0);
- String option = elem.getAttribute("cache");
- modelView.setUseCache("yes".equals(option));
+ }
+
+ // store the original request URI to org.exist.forward.request-uri
+ modifiedRequest.setAttribute(RQ_ATTR_REQUEST_URI, request.getRequestURI());
+ modifiedRequest.setAttribute(RQ_ATTR_SERVLET_PATH, request.getServletPath());
+
+ if (modelView.useCache()) {
+ synchronized (urlCache) {
+ urlCache.put(request.getRequestURI(), modelView);
}
}
}
+ if (LOG.isTraceEnabled())
+ LOG.trace("URLRewrite took " + (System.currentTimeMillis() - start) + "ms.");
- // store the original request URI to org.exist.forward.request-uri
- modifiedRequest.setAttribute(RQ_ATTR_REQUEST_URI, request.getRequestURI());
- modifiedRequest.setAttribute(RQ_ATTR_SERVLET_PATH, request.getServletPath());
+ HttpServletResponse wrappedResponse = response;
+ if (modelView.hasViews())
+ wrappedResponse = new CachingResponseWrapper(response);
+ if (modelView.getModel() == null)
+ modelView.setModel(new PassThrough(modifiedRequest));
- if (modelView.useCache()) {
- urlCache.put(request.getRequestURI(), modelView);
+ if (staticRewrite != null) {
+ staticRewrite.rewriteRequest(modifiedRequest);
}
- }
- if (LOG.isTraceEnabled())
- LOG.trace("URLRewrite took " + (System.currentTimeMillis() - start) + "ms.");
+ doRewrite(modelView.getModel(), modifiedRequest, wrappedResponse, filterChain);
- HttpServletResponse wrappedResponse = response;
- if (modelView.hasViews())
- wrappedResponse = new CachingResponseWrapper(response);
- if (modelView.getModel() == null)
- modelView.setModel(new PassThrough(request.getRequestURI()));
- modelView.getModel().prepareRequest(modifiedRequest);
- modelView.getModel().doRewrite(modifiedRequest, wrappedResponse, filterChain);
+ if (modelView.hasViews()) {
+ int status = ((CachingResponseWrapper) wrappedResponse).getStatus();
+ if (status == HttpServletResponse.SC_NOT_MODIFIED) {
+ response.flushBuffer();
+ } else if (status < 400) {
+ List views = modelView.views;
+ for (int i = 0; i < views.size(); i++) {
+ URLRewrite view = (URLRewrite) views.get(i);
+ RequestWrapper wrappedReq = new RequestWrapper(modifiedRequest);
+ wrappedReq.setMethod("POST");
+ wrappedReq.setCharacterEncoding(wrappedResponse.getCharacterEncoding());
+ wrappedReq.setContentType(wrappedResponse.getContentType());
+ byte[] data = ((CachingResponseWrapper) wrappedResponse).getData();
+ if (data != null)
+ wrappedReq.setData(data);
- if (modelView.hasViews()) {
- int status = ((CachingResponseWrapper) wrappedResponse).getStatus();
- if (status == HttpServletResponse.SC_NOT_MODIFIED) {
- response.flushBuffer();
- } else if (status < 400) {
- List views = modelView.views;
- for (int i = 0; i < views.size(); i++) {
- URLRewrite view = (URLRewrite) views.get(i);
- RequestWrapper wrappedReq = new RequestWrapper(request);
- wrappedReq.setMethod("POST");
- wrappedReq.setCharacterEncoding(wrappedResponse.getCharacterEncoding());
- wrappedReq.setContentType(wrappedResponse.getContentType());
+ if (i < views.size() - 1)
+ wrappedResponse = new CachingResponseWrapper(response);
+ else
+ wrappedResponse = response;
+ doRewrite(view, wrappedReq, wrappedResponse, null);
+ wrappedResponse.flushBuffer();
+ }
+ } else {
+ // HTTP response code indicates an error
byte[] data = ((CachingResponseWrapper) wrappedResponse).getData();
- if (data != null)
- wrappedReq.setData(data);
-
- if (i < views.size() - 1)
- wrappedResponse = new CachingResponseWrapper(response);
- else
- wrappedResponse = response;
- view.prepareRequest(wrappedReq);
- view.doRewrite(wrappedReq, wrappedResponse, null);
- wrappedResponse.flushBuffer();
+ if (data != null) {
+ response.setContentType(wrappedResponse.getContentType());
+ response.setCharacterEncoding(wrappedResponse.getCharacterEncoding());
+ response.getOutputStream().write(data);
+ response.flushBuffer();
+ }
}
- } else {
- // HTTP response code indicates an error
- byte[] data = ((CachingResponseWrapper) wrappedResponse).getData();
- if (data != null) {
- response.setContentType(wrappedResponse.getContentType());
- response.setCharacterEncoding(wrappedResponse.getCharacterEncoding());
- response.getOutputStream().write(data);
- response.flushBuffer();
- }
}
- }
// Sequence result;
// if ((result = (Sequence) request.getAttribute(RQ_ATTR_RESULT)) != null) {
// writeResults(response, broker, result);
// }
+ }
} catch (EXistException e) {
LOG.error(e.getMessage(), e);
throw new ServletException("An error occurred while retrieving query results: "
@@ -379,6 +383,77 @@
}
}
+ private void checkCache() throws EXistException {
+ if (checkModified) {
+ // check if any of the currently used sources has been updated
+ // if yes, clear the cache
+ synchronized (urlCache) {
+ for (Source source : sources.values()) {
+ if (source instanceof DBSource) {
+ // Check if the XQuery source changed. If yes, clear all caches.
+ DBBroker broker = null;
+ try {
+ broker = pool.get(user);
+ if (source.isValid(broker) != Source.VALID) {
+ clearCaches();
+ break;
+ }
+ } finally {
+ pool.release(broker);
+ }
+ } else {
+ if (source.isValid((DBBroker)null) != Source.VALID) {
+ clearCaches();
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Process a rewrite action. Method checks if the target path is mapped
+ * to another action in controller-config.xml. If yes, replaces the current action
+ * with the new action.
+ *
+ * @param action
+ * @param request
+ * @param response
+ * @param filterChain
+ * @throws IOException
+ * @throws ServletException
+ */
+ protected void doRewrite(URLRewrite action, RequestWrapper request, HttpServletResponse response,
+ FilterChain filterChain) throws IOException, ServletException {
+ if (action.getTarget() != null) {
+ String uri = action.resolve(request);
+ URLRewrite staticRewrite = rewriteConfig.lookup(uri, true);
+ if (staticRewrite != null) {
+ staticRewrite.copyFrom(action);
+ action = staticRewrite;
+ RequestWrapper modifiedRequest = new RequestWrapper(request);
+ modifiedRequest.setPaths(uri, action.getPrefix());
+ if (LOG.isTraceEnabled())
+ LOG.trace("Forwarding to target: " + action.getTarget() + " url: " + action.getURI());
+ request = modifiedRequest;
+ }
+ }
+ action.prepareRequest(request);
+ action.doRewrite(request, response, filterChain);
+ }
+
+ protected FilterConfig getConfig() {
+ return config;
+ }
+
+ protected void clearCaches() {
+ synchronized (urlCache) {
+ urlCache.clear();
+ sources.clear();
+ }
+ }
+
private URLRewrite parseAction(HttpServletRequest request, Element action) throws ServletException {
URLRewrite rewrite = null;
if ("forward".equals(action.getLocalName())) {
@@ -419,19 +494,15 @@
}
}
- private void writeResults(HttpServletResponse response, DBBroker broker, Sequence result) throws IOException, SAXException {
- if (result.getItemCount() > 0) {
- ServletOutputStream os = response.getOutputStream();
- Writer writer = new OutputStreamWriter(os, "UTF-8");
+ private void logResult(DBBroker broker, Sequence result) throws IOException, SAXException {
+ if (LOG.isTraceEnabled() && result.getItemCount() > 0) {
Serializer serializer = broker.getSerializer();
serializer.reset();
- SAXSerializer sax = (SAXSerializer) SerializerPool.getInstance().borrowObject(SAXSerializer.class);
- sax.setOutput(writer, new Properties());
- serializer.setSAXHandlers(sax, sax);
- serializer.toSAX(result, 1, result.getItemCount(), false);
-
- writer.close();
+ Item item = result.itemAt(0);
+ if (Type.subTypeOf(item.getType(), Type.NODE)) {
+ LOG.trace(serializer.serialize((NodeValue) item));
+ }
}
}
@@ -439,18 +510,26 @@
config = null;
}
- private Sequence runQuery(DBBroker broker, HttpServletRequest request, HttpServletResponse response) throws ServletException, XPathException {
+ private Sequence runQuery(DBBroker broker, RequestWrapper request, HttpServletResponse response, String basePath)
+ throws ServletException, XPathException {
// Try to find the XQuery
- Source source;
+ SourceInfo sourceInfo;
String moduleLoadPath = config.getServletContext().getRealPath(".");
if (basePath == null)
- source = getSource(broker, moduleLoadPath);
+ sourceInfo = getSource(broker, moduleLoadPath);
else
- source = findSource(request, broker, moduleLoadPath);
- sources.add(source);
+ sourceInfo = findSource(request, broker, basePath);
+
+ if (sourceInfo == null)
+ return Sequence.EMPTY_SEQUENCE; // no controller found
+
+ synchronized (urlCache) {
+ sources.put(sourceInfo.source.getKey(), sourceInfo.source);
+ }
+
XQuery xquery = broker.getXQueryService();
XQueryPool pool = xquery.getXQueryPool();
- CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
+ CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, sourceInfo.source);
XQueryContext queryContext;
if (compiled == null) {
queryContext = xquery.newContext(AccessContext.REST);
@@ -459,10 +538,10 @@
}
// Find correct module load path
queryContext.setModuleLoadPath(moduleLoadPath);
- declareVariables(queryContext, request, response);
+ declareVariables(queryContext, sourceInfo, request, response);
if (compiled == null) {
try {
- compiled = xquery.compile(queryContext, source);
+ compiled = xquery.compile(queryContext, sourceInfo.source);
} catch (IOException e) {
throw new ServletException("Failed to read query from " + query, e);
}
@@ -476,23 +555,26 @@
try {
return xquery.execute(compiled, null);
} finally {
- pool.returnCompiledXQuery(source, compiled);
+ pool.returnCompiledXQuery(sourceInfo.source, compiled);
}
}
- private Source findSource(HttpServletRequest request, DBBroker broker, String moduleLoadPath) throws ServletException {
+ private SourceInfo findSource(HttpServletRequest request, DBBroker broker, String basePath) throws ServletException {
String requestURI = request.getRequestURI();
String path = requestURI.substring(request.getContextPath().length());
if (path.startsWith("/"))
path = path.substring(1);
String[] components = path.split("/");
-
+ SourceInfo sourceInfo = null;
if (basePath.startsWith(XmldbURI.XMLDB_URI_PREFIX)) {
try {
XmldbURI locationUri = XmldbURI.xmldbUriFor(basePath);
Collection collection = broker.openCollection(locationUri, Lock.READ_LOCK);
- if (collection == null)
- throw new ServletException("Base collection not found: " + basePath);
+ if (collection == null) {
+ LOG.warn("Controller base collection not found: " + basePath);
+ collection.getLock().release(Lock.READ_LOCK);
+ return null;
+ }
Collection subColl = collection;
DocumentImpl controllerDoc = null;
@@ -518,11 +600,10 @@
subColl.getLock().release(Lock.READ_LOCK);
}
} else {
- if (subColl != null)
- subColl.getLock().release(Lock.READ_LOCK);
break;
}
}
+ collection.getLock().release(Lock.READ_LOCK);
if (controllerDoc == null) {
try {
XmldbURI docUri = collection.getURI().append("controller.xql");
@@ -532,21 +613,32 @@
e.getMessage(), e);
}
}
- if (controllerDoc == null)
- throw new ServletException("XQueryURLRewrite controller could not be found");
+ if (controllerDoc == null) {
+ LOG.warn("XQueryURLRewrite controller could not be found");
+ return null;
+ }
if (controllerDoc.getResourceType() != DocumentImpl.BINARY_FILE ||
- !controllerDoc.getMetadata().getMimeType().equals("application/xquery"))
- throw new ServletException("XQuery resource: " + query + " is not an XQuery or " +
- "declares a wrong mime-type");
- return new DBSource(broker, (BinaryDocument) controllerDoc, true);
+ !controllerDoc.getMetadata().getMimeType().equals("application/xquery")) {
+ LOG.warn("XQuery resource: " + query + " is not an XQuery or " +
+ "declares a wrong mime-type");
+ return null;
+ }
+ sourceInfo = new SourceInfo(new DBSource(broker, (BinaryDocument) controllerDoc, true));
+ String controllerPath = controllerDoc.getCollection().getURI().getRawCollectionPath();
+ sourceInfo.controllerPath =
+ controllerPath.substring(locationUri.getCollectionPath().length());
+ return sourceInfo;
} catch (URISyntaxException e) {
- throw new ServletException("Bad URI for base path: " + e.getMessage(), e);
+ LOG.warn("Bad URI for base path: " + e.getMessage(), e);
+ return null;
}
} else {
String realPath = config.getServletContext().getRealPath(basePath);
File baseDir = new File(realPath);
- if (!baseDir.isDirectory())
- throw new ServletException("Base path for XQueryURLRewrite does not point to a directory");
+ if (!baseDir.isDirectory()) {
+ LOG.warn("Base path for XQueryURLRewrite does not point to a directory");
+ return null;
+ }
File controllerFile = null;
File subDir = baseDir;
@@ -566,16 +658,22 @@
if (cf.canRead())
controllerFile = cf;
}
- if (controllerFile == null)
- throw new ServletException("XQueryURLRewrite controller could not be found");
+ if (controllerFile == null) {
+ LOG.warn("XQueryURLRewrite controller could not be found");
+ return null;
+ }
if (LOG.isTraceEnabled())
LOG.trace("Found controller file: " + controllerFile.getAbsolutePath());
- return new FileSource(controllerFile, "UTF-8", true);
+ sourceInfo = new SourceInfo(new FileSource(controllerFile, "UTF-8", true));
+ String parentPath = controllerFile.getParentFile().getAbsolutePath();
+ sourceInfo.controllerPath =
+ parentPath.substring(baseDir.getAbsolutePath().length());
+ return sourceInfo;
}
}
- private Source getSource(DBBroker broker, String moduleLoadPath) throws ServletException {
- Source source;
+ private SourceInfo getSource(DBBroker broker, String moduleLoadPath) throws ServletException {
+ SourceInfo sourceInfo;
if (query.startsWith(XmldbURI.XMLDB_URI_PREFIX)) {
// Is the module source stored in the database?
try {
@@ -589,7 +687,7 @@
!sourceDoc.getMetadata().getMimeType().equals("application/xquery"))
throw new ServletException("XQuery resource: " + query + " is not an XQuery or " +
"declares a wrong mime-type");
- source = new DBSource(broker, (BinaryDocument) sourceDoc, true);
+ sourceInfo = new SourceInfo(new DBSource(broker, (BinaryDocument) sourceDoc, true));
} catch (PermissionDeniedException e) {
throw new ServletException("permission denied to read module source from " + query);
} finally {
@@ -601,18 +699,18 @@
}
} else {
try {
- source = SourceFactory.getSource(broker, moduleLoadPath, query, true);
+ sourceInfo = new SourceInfo(SourceFactory.getSource(broker, moduleLoadPath, query, true));
} catch (IOException e) {
throw new ServletException("IO error while reading XQuery source: " + query);
} catch (PermissionDeniedException e) {
throw new ServletException("Permission denied while reading XQuery source: " + query);
}
}
- return source;
+ return sourceInfo;
}
- private void declareVariables(XQueryContext context,
- HttpServletRequest request, HttpServletResponse response)
+ private void declareVariables(XQueryContext context, SourceInfo sourceInfo,
+ RequestWrapper request, HttpServletResponse response)
throws XPathException {
HttpRequestWrapper reqw = new HttpRequestWrapper(request, "UTF-8", "UTF-8", false);
HttpResponseWrapper respw = new HttpResponseWrapper(response);
@@ -621,6 +719,28 @@
context.declareVariable(RequestModule.PREFIX + ":request", reqw);
context.declareVariable(ResponseModule.PREFIX + ":response", respw);
context.declareVariable(SessionModule.PREFIX + ":session", reqw.getSession( false ));
+
+ context.declareVariable("exist:controller", sourceInfo.controllerPath);
+
+ String path;
+ if (sourceInfo.controllerPath.length() > 0 && !sourceInfo.controllerPath.equals("/"))
+ path = request.getInContextPath().substring(sourceInfo.controllerPath.length());
+ else
+ path = request.getInContextPath();
+ int p = path.lastIndexOf(';');
+ if(p != Constants.STRING_NOT_FOUND)
+ path = path.substring(0, p);
+ context.declareVariable("exist:path", path);
+
+ String resource = "";
+ Matcher nameMatcher = NAME_REGEX.matcher(path);
+ if (nameMatcher.matches()) {
+ resource = nameMatcher.group(1);
+ }
+ context.declareVariable("exist:resource", resource);
+
+ if (LOG.isTraceEnabled())
+ LOG.debug("\nexist:path = " + path + "\nexist:resource = " + resource);
}
private class ModelAndView {
@@ -657,6 +777,16 @@
}
}
+ private static class SourceInfo {
+
+ Source source;
+ String controllerPath = "";
+
+ private SourceInfo(Source source) {
+ this.source = source;
+ }
+ }
+
public static class RequestWrapper extends javax.servlet.http.HttpServletRequestWrapper {
Map<String, String[]> addedParams = new HashMap<String, String[]>();
@@ -670,6 +800,9 @@
int contentLength = 0;
String characterEncoding = null;
String method = null;
+ String inContextPath = null;
+ String servletPath;
+ String basePath = null;
private RequestWrapper(HttpServletRequest request) {
super(request);
@@ -681,8 +814,23 @@
}
contentType = request.getContentType();
+ servletPath = request.getServletPath();
}
+ public String getRequestURI() {
+ return inContextPath == null ? super.getRequestURI() : getContextPath() + inContextPath;
+ }
+
+ public String getInContextPath() {
+ if (inContextPath == null)
+ return getRequestURI().substring(getContextPath().length());
+ return inContextPath;
+ }
+
+ public void setInContextPath(String path) {
+ inContextPath = path;
+ }
+
public String getMethod() {
if (method == null)
return super.getMethod();
@@ -692,7 +840,48 @@
public void setMethod(String method) {
this.method = method;
}
-
+
+ /**
+ * Change the requestURI and the servletPath
+ *
+ * @param requestURI the URI of the request without the context path
+ * @param servletPath the servlet path
+ */
+ public void setPaths(String requestURI, String servletPath) {
+ this.inContextPath = requestURI;
+ if (servletPath == null)
+ this.servletPath = requestURI;
+ else
+ this.servletPath = servletPath;
+ }
+
+ public void setBasePath(String base) {
+ this.basePath = base;
+ }
+
+ public String getBasePath() {
+ return basePath;
+ }
+
+ /**
+ * Change the base path of the request, e.g. if the original request pointed
+ * to /fs/foo/baz, but the request should be forwarded to /foo/baz.
+ *
+ * @param base the base path to remove
+ */
+ public void removePathPrefix(String base) {
+ setPaths(getInContextPath().substring(base.length()), servletPath.substring(base.length()));
+ }
+
+ public String getServletPath() {
+ return servletPath;
+ }
+
+ public String getPathInfo() {
+ String path = getInContextPath();
+ return path.length() == servletPath.length() ? null : path.substring(servletPath.length());
+ }
+
protected void setData(byte[] data) {
if (data == null)
data = new byte[0];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-10-29 16:35:04
|
Revision: 10284
http://exist.svn.sourceforge.net/exist/?rev=10284&view=rev
Author: shabanovd
Date: 2009-10-29 16:34:53 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[ignore] updating eclipse class's paths
Modified Paths:
--------------
trunk/eXist/.classpath
Modified: trunk/eXist/.classpath
===================================================================
--- trunk/eXist/.classpath 2009-10-29 14:17:21 UTC (rev 10283)
+++ trunk/eXist/.classpath 2009-10-29 16:34:53 UTC (rev 10284)
@@ -13,6 +13,10 @@
<classpathentry kind="src" path="extensions/modules/src"/>
<classpathentry kind="src" path="tools/ircbot/src"/>
<classpathentry kind="src" path="tools/requestlog/src"/>
+ <classpathentry kind="src" path="extensions/debuggee/src"/>
+ <classpathentry kind="src" path="extensions/debuggee/test"/>
+ <classpathentry kind="src" path="extensions/xslt/src"/>
+ <classpathentry kind="src" path="extensions/xslt/test"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test/src"/>
<classpathentry kind="src" path="tools/wrapper/src"/>
@@ -103,7 +107,6 @@
<classpathentry kind="lib" path="lib/endorsed/resolver-1.2.jar"/>
<classpathentry kind="lib" path="lib/optional/commons-discovery-0.4.jar"/>
<classpathentry kind="lib" path="lib/core/stax-api-1.0.1.jar"/>
- <classpathentry kind="lib" path="lib/optional/onvdl-20070517.jar"/>
<classpathentry kind="lib" path="lib/endorsed/xalan-2.7.1.jar"/>
<classpathentry kind="lib" path="lib/user/fop.jar"/>
<classpathentry kind="lib" path="lib/user/mail-1.4.2.jar"/>
@@ -114,5 +117,8 @@
<classpathentry kind="lib" path="extensions/indexes/lucene/lib/lucene-core-2.4.1.jar"/>
<classpathentry kind="lib" path="extensions/indexes/lucene/lib/lucene-regex-2.4.1.jar"/>
<classpathentry kind="lib" path="tools/ant/lib/ant-launcher.jar"/>
+ <classpathentry kind="lib" path="lib/optional/jing-20090920.jar"/>
+ <classpathentry kind="lib" path="extensions/debuggee/lib/mina-core-2.0.0-M6.jar"/>
+ <classpathentry kind="lib" path="extensions/debuggee/lib/slf4j-api-1.5.2.jar"/>
<classpathentry kind="output" path="test/classes"/>
</classpath>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-10-29 14:17:29
|
Revision: 10283
http://exist.svn.sourceforge.net/exist/?rev=10283&view=rev
Author: shabanovd
Date: 2009-10-29 14:17:21 +0000 (Thu, 29 Oct 2009)
Log Message:
-----------
[ignore] NPE bug at namespaces handling
Modified Paths:
--------------
trunk/eXist/src/org/exist/memtree/SAXAdapter.java
Modified: trunk/eXist/src/org/exist/memtree/SAXAdapter.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/SAXAdapter.java 2009-10-29 13:58:05 UTC (rev 10282)
+++ trunk/eXist/src/org/exist/memtree/SAXAdapter.java 2009-10-29 14:17:21 UTC (rev 10283)
@@ -141,7 +141,7 @@
if(atts.getQName(i).startsWith("xmlns")) {
String prefix = atts.getLocalName(i);
String uri = atts.getValue(i);
- if(!namespaces.containsKey(prefix))
+ if(namespaces == null || !namespaces.containsKey(prefix))
builder.namespaceNode(prefix, uri);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|