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
(4) |
2
|
3
|
4
(2) |
|
5
|
6
(12) |
7
(6) |
8
(7) |
9
(7) |
10
(13) |
11
(9) |
|
12
(18) |
13
(13) |
14
(22) |
15
(14) |
16
(12) |
17
(5) |
18
(16) |
|
19
(4) |
20
(15) |
21
(13) |
22
(20) |
23
(15) |
24
(16) |
25
(20) |
|
26
(18) |
27
(24) |
28
(18) |
29
(17) |
30
(13) |
31
(21) |
|
|
From: <el...@us...> - 2009-07-31 23:50:27
|
Revision: 9612
http://exist.svn.sourceforge.net/exist/?rev=9612&view=rev
Author: ellefj
Date: 2009-07-31 23:50:14 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] propset svn:keywords only
Property Changed:
----------------
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndex.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndexWorker.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/GMLHSQLIndex.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/GMLHSQLIndexWorker.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/GMLIndexConfig.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/SpatialIndexException.java
Property changes on: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndex.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Property changes on: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/AbstractGMLJDBCIndexWorker.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Property changes on: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/GMLHSQLIndex.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Property changes on: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/GMLHSQLIndexWorker.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Property changes on: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/GMLIndexConfig.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Property changes on: trunk/eXist/extensions/indexes/spatial/src/org/exist/indexing/spatial/SpatialIndexException.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2009-07-31 23:43:16
|
Revision: 9611
http://exist.svn.sourceforge.net/exist/?rev=9611&view=rev
Author: ellefj
Date: 2009-07-31 23:43:05 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function documentation
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunDocumentURI.java
trunk/eXist/src/org/exist/xquery/functions/FunEmpty.java
trunk/eXist/src/org/exist/xquery/functions/FunEncodeForURI.java
trunk/eXist/src/org/exist/xquery/functions/FunEndsWith.java
trunk/eXist/src/org/exist/xquery/functions/FunError.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunDocumentURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunDocumentURI.java 2009-07-31 22:34:52 UTC (rev 9610)
+++ trunk/eXist/src/org/exist/xquery/functions/FunDocumentURI.java 2009-07-31 23:43:05 UTC (rev 9611)
@@ -1,23 +1,24 @@
-/* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 The eXist team
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
-
package org.exist.xquery.functions;
import org.exist.dom.NodeProxy;
@@ -32,6 +33,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AnyURIValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
@@ -46,13 +49,13 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("document-uri", Function.BUILTIN_FUNCTION_NS),
- "Returns the absolute URI of the resource from which the document node $a " +
+ "Returns the absolute URI of the resource from which the document node $document-node " +
"was constructed, if none such URI exists returns the empty sequence. " +
- "If $a is the empty sequence, returns the empty sequence.",
+ "If $document-node is the empty sequence, returns the empty sequence.",
new SequenceType[] {
- new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE)
+ new FunctionParameterSequenceType("document-node", Type.NODE, Cardinality.ZERO_OR_ONE, "the document-node")
},
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE));
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE, "document-uri of $document-node"));
/**
*
Modified: trunk/eXist/src/org/exist/xquery/functions/FunEmpty.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunEmpty.java 2009-07-31 22:34:52 UTC (rev 9610)
+++ trunk/eXist/src/org/exist/xquery/functions/FunEmpty.java 2009-07-31 23:43:05 UTC (rev 9611)
@@ -1,23 +1,22 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
@@ -31,6 +30,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -44,11 +45,11 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("empty", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the value of the argument is the empty sequence, false otherwise.",
+ "Returns true() if the value of the argument, $item-sequence, is the empty sequence, false() otherwise.",
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)
+ new FunctionParameterSequenceType("item-sequence", Type.ITEM, Cardinality.ZERO_OR_MORE, "the item-sequence")
},
- new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE, "true() if empty sequence, false() otherwise"));
public FunEmpty(XQueryContext context) {
super(context, signature);
@@ -64,9 +65,10 @@
/* (non-Javadoc)
* @see org.exist.xquery.Expression#eval(org.exist.dom.DocumentSet, org.exist.xquery.value.Sequence, org.exist.xquery.value.Item)
*/
- public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
+ public Sequence eval(Sequence contextSequence, Item contextItem)
+ throws XPathException {
if (context.getProfiler().isEnabled()) {
- context.getProfiler().start(this);
+ context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
if (contextSequence != null)
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunEncodeForURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunEncodeForURI.java 2009-07-31 22:34:52 UTC (rev 9610)
+++ trunk/eXist/src/org/exist/xquery/functions/FunEncodeForURI.java 2009-07-31 23:43:05 UTC (rev 9611)
@@ -1,22 +1,22 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-05 The eXist Project
- * http://exist-db.org
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2005-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
@@ -30,19 +30,29 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.util.URIUtils;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.StringValue;
import org.exist.xquery.value.Type;
+/**
+ *
+ * @author perig
+ *
+ */
public class FunEncodeForURI extends Function {
public final static FunctionSignature signature =
new FunctionSignature(
new QName("encode-for-uri", Function.BUILTIN_FUNCTION_NS),
- new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE));
+ "Escapes reserved characters in $uri-part by replacing it with its percent-encoded form as described in [RFC 3986]. If $uri-part is the empty sequence, returns the zero-length string.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("uri-part", Type.STRING, Cardinality.ZERO_OR_ONE, "the uri-part to encode")
+ },
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "uri-part with reserved characters precent-encoded"));
public FunEncodeForURI(XQueryContext context, FunctionSignature signature) {
super(context, signature);
@@ -50,7 +60,7 @@
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
if (context.getProfiler().isEnabled()) {
- context.getProfiler().start(this);
+ context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
if (contextSequence != null)
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunEndsWith.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunEndsWith.java 2009-07-31 22:34:52 UTC (rev 9610)
+++ trunk/eXist/src/org/exist/xquery/functions/FunEndsWith.java 2009-07-31 23:43:05 UTC (rev 9611)
@@ -1,23 +1,24 @@
-/* eXist Native XML Database
- * Copyright (C) 2000-2006, The eXist team
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 The eXist Project
+ * http://exist-db.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
+ *
+ * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $Id$
+ *
+ * $Id$
*/
-
package org.exist.xquery.functions;
import java.text.Collator;
@@ -32,6 +33,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -43,24 +46,26 @@
new FunctionSignature(
new QName("ends-with", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the string value of $b is a suffix of the " +
- "string value of $a, false otherwise. If either $a or $b is the empty " +
- "sequence, the empty sequence is returned.", new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)),
+ "Returns true if the string value of $suffix is a suffix of the " +
+ "string value of $source-string, false otherwise. If either $source-string or $suffix is the empty " +
+ "sequence, the empty sequence is returned.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("source-string", Type.STRING, Cardinality.ZERO_OR_ONE, "the source-string"),
+ new FunctionParameterSequenceType("suffix", Type.STRING, Cardinality.ZERO_OR_ONE, "the suffix")
+ },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true() if $suffix is suffix of $source-string, false() otherwise")),
new FunctionSignature (
new QName("ends-with", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the string value of $b is a suffix of the " +
- "string value of $a using collation $c, " + " false otherwise. If " +
- "either $a or $b is the empty sequence, the empty sequence" +
- " is returned.",
+ "Returns true if the string value of $suffix is a suffix of the " +
+ "string value of $source-string using collation $collation-uri, " + " false otherwise. If " +
+ "either $source-string or $suffix is the empty sequence, the empty sequence" +
+ " is returned." + THIRD_REL_COLLATION_ARG_EXAMPLE,
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("source-string", Type.STRING, Cardinality.ZERO_OR_ONE, "the source-string"),
+ new FunctionParameterSequenceType("suffix", Type.STRING, Cardinality.ZERO_OR_ONE, "the suffix"),
+ new FunctionParameterSequenceType("collation-uri", Type.STRING, Cardinality.EXACTLY_ONE, "the collation-uri")
},
- new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE))
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE, "true() if $suffix is suffix of $source-string, false() otherwise"))
};
public FunEndsWith(XQueryContext context, FunctionSignature signature) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunError.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunError.java 2009-07-31 22:34:52 UTC (rev 9610)
+++ trunk/eXist/src/org/exist/xquery/functions/FunError.java 2009-07-31 23:43:05 UTC (rev 9611)
@@ -1,25 +1,28 @@
-/* eXist Open Source Native XML Database
- * Copyright (C) 2000-03, Wolfgang M. Meier (me...@if...)
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 The eXist Project
+ * http://exist-db.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
+ *
+ * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * GNU Lesser General Public License for more details.
*
- * $Id$
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
*/
-
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import org.exist.dom.QName;
import org.exist.storage.serializers.Serializer;
import org.exist.xquery.BasicFunction;
@@ -28,6 +31,8 @@
import org.exist.xquery.FunctionSignature;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.QNameValue;
@@ -38,41 +43,41 @@
import org.xml.sax.SAXException;
public class FunError extends BasicFunction {
-
+ protected static final Logger logger = Logger.getLogger(FunError.class);
public final static FunctionSignature signature[] = {
new FunctionSignature(
new QName("error", Function.BUILTIN_FUNCTION_NS),
"Indicates that an irrecoverable error has occurred. The "
- + "script will terminate immediately with an exception.",
+ + "script will terminate immediately with an exception using the default qname, 'http://www.w3.org/2004/07/xqt-errors#err:FOER0000', and the default error message, 'An error has been raised by the query'.",
null,
- new SequenceType(Type.EMPTY, Cardinality.ZERO)),
+ new FunctionReturnSequenceType(Type.EMPTY, Cardinality.ZERO, "empty-sequence")),
new FunctionSignature(
new QName("error", Function.BUILTIN_FUNCTION_NS),
"Indicates that an irrecoverable error has occurred. The "
- + "script will terminate immediately with an exception.",
+ + "script will terminate immediately with an exception using $qname and the default message,'An error has been raised by the query'.",
new SequenceType[] {
- new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("qname", Type.QNAME, Cardinality.EXACTLY_ONE, "the qname")
},
- new SequenceType(Type.EMPTY, Cardinality.ZERO)),
+ new FunctionReturnSequenceType(Type.EMPTY, Cardinality.ZERO, "empty-sequence")),
new FunctionSignature(
new QName("error", Function.BUILTIN_FUNCTION_NS),
"Indicates that an irrecoverable error has occurred. The "
- + "script will terminate immediately with an exception.",
+ + "script will terminate immediately with an exception using $qname and $message.",
new SequenceType[] {
- new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("qname", Type.QNAME, Cardinality.ZERO_OR_ONE, "the qname"),
+ new FunctionParameterSequenceType("message", Type.STRING, Cardinality.EXACTLY_ONE, "the message")
},
- new SequenceType(Type.EMPTY, Cardinality.ZERO)),
+ new FunctionReturnSequenceType(Type.EMPTY, Cardinality.ZERO, "empty-sequence")),
new FunctionSignature(
new QName("error", Function.BUILTIN_FUNCTION_NS),
"Indicates that an irrecoverable error has occurred. The "
- + "script will terminate immediately with an exception.",
+ + "script will terminate immediately with an exception using $qname and $message with $error-object appended.",
new SequenceType[] {
- new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE),
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)
+ new FunctionParameterSequenceType("qname", Type.QNAME, Cardinality.ZERO_OR_ONE, "the qname"),
+ new FunctionParameterSequenceType("message", Type.STRING, Cardinality.EXACTLY_ONE, "the message"),
+ new FunctionParameterSequenceType("error-object", Type.ITEM, Cardinality.ZERO_OR_MORE, "the error-object")
},
- new SequenceType(Type.EMPTY, Cardinality.ZERO)),
+ new FunctionReturnSequenceType(Type.EMPTY, Cardinality.ZERO, "empty-sequence")),
};
public final static QName DEFAULT_ERR =
@@ -86,7 +91,8 @@
return Type.EMPTY;
}
- public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
+ public Sequence eval(Sequence[] args, Sequence contextSequence)
+ throws XPathException {
QName errQName = DEFAULT_ERR;
String message = "An error has been raised by the query";
if (args.length > 0) {
@@ -97,11 +103,14 @@
if (args.length == 3)
message += ": " + serializeErrorObject(args[2]);
}
+ logger.error(message + " (" +
+ errQName.getNamespaceURI() + '#' + errQName.getLocalName() + ')');
throw new XPathException(this, message + " (" +
errQName.getNamespaceURI() + '#' + errQName.getLocalName() + ')');
}
- private String serializeErrorObject(Sequence seq) throws XPathException {
+ private String serializeErrorObject(Sequence seq)
+ throws XPathException {
StringBuilder buf = new StringBuilder();
for(SequenceIterator i = seq.unorderedIterator(); i.hasNext(); ) {
Item next = i.nextItem();
@@ -111,6 +120,7 @@
try {
buf.append(serializer.serialize((NodeValue) next));
} catch (SAXException e) {
+ logger.error("An exception occurred while serializing node to log: " + e.getMessage());
throw new XPathException(this, "An exception occurred while serializing node to log: " +
"e.getMessage()", e);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2009-07-31 22:35:04
|
Revision: 9610
http://exist.svn.sourceforge.net/exist/?rev=9610&view=rev
Author: dizzzz
Date: 2009-07-31 22:34:52 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] removed warnings during startup, added information and ports, and some textual cleanup
Modified Paths:
--------------
trunk/eXist/src/org/exist/JettyStart.java
trunk/eXist/src/org/exist/start/start.config
Modified: trunk/eXist/src/org/exist/JettyStart.java
===================================================================
--- trunk/eXist/src/org/exist/JettyStart.java 2009-07-31 21:42:23 UTC (rev 9609)
+++ trunk/eXist/src/org/exist/JettyStart.java 2009-07-31 22:34:52 UTC (rev 9610)
@@ -70,6 +70,14 @@
// configure database
System.out.println("Configuring eXist from " + SingleInstanceConfiguration.getPath());
+ System.out.println();
+ System.out.println("Running with Java "+
+ System.getProperty("java.version", "(unknown java.version)") + " [" +
+ System.getProperty("java.vendor", "(unknown java.vendor)") + " (" +
+ System.getProperty("java.vm.name", "(unknown java.vm.name)") + ") in " +
+ System.getProperty("java.home", "(unknown java.home)") +"]");
+ System.out.println();
+
try {
// we register our own shutdown hook
BrokerPool.setRegisterShutdownHook(false);
@@ -108,15 +116,26 @@
server.start();
HttpListener[] listeners = server.getListeners();
- if (listeners.length > 0)
- port = listeners[0].getPort();
+
+ StringBuilder ports = new StringBuilder();
+
+ if (listeners.length > 0) {
+ for (HttpListener listener : listeners) {
+ port = listener.getPort();
+ ports.append(" "+port);
+ }
+
+ } else {
+ ports.append(" "+port);
+ }
+
HttpContext[] contexts = server.getContexts();
- System.out.println("-----------------------------------------------------");
- System.out.println("Server has started on port " + port + ". Configured contexts:");
+ System.out.println("----------------------------------------------------------------");
+ System.out.println("eXist-db has started on port" + ports + ". Configured contexts:");
for (int i = 0; i < contexts.length; i++) {
System.out.println("http://localhost:" + port + contexts[i].getContextPath());
}
- System.out.println("-----------------------------------------------------");
+ System.out.println("----------------------------------------------------------------");
if (registerShutdownHook) {
// register a shutdown hook for the server
Modified: trunk/eXist/src/org/exist/start/start.config
===================================================================
--- trunk/eXist/src/org/exist/start/start.config 2009-07-31 21:42:23 UTC (rev 9609)
+++ trunk/eXist/src/org/exist/start/start.config 2009-07-31 22:34:52 UTC (rev 9610)
@@ -33,7 +33,6 @@
exist.jar always
exist-optional.jar always
test/classes mode == other
-examples.jar always
lib/endorsed/* always
lib/core/antlr-%latest%.jar always
lib/core/commons-pool-%latest%.jar always
@@ -78,4 +77,3 @@
tools/jetty/lib/* mode == other
lib/user/* always
tools/ircbot/lib/* mode == jetty
-tools/ircbot/dist/ircbot.jar mode == jetty
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2009-07-31 21:42:39
|
Revision: 9609
http://exist.svn.sourceforge.net/exist/?rev=9609&view=rev
Author: dizzzz
Date: 2009-07-31 21:42:23 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[bugfix] escape xml/html chars in REST API exception - ID: 2830333 ; patch by mike sokolov ; test: http://localhost:8080/exist/rest/db/_query=<
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/RESTServer.java
Modified: trunk/eXist/src/org/exist/http/RESTServer.java
===================================================================
--- trunk/eXist/src/org/exist/http/RESTServer.java 2009-07-31 21:28:12 UTC (rev 9608)
+++ trunk/eXist/src/org/exist/http/RESTServer.java 2009-07-31 21:42:23 UTC (rev 9609)
@@ -49,6 +49,7 @@
import javax.xml.transform.TransformerConfigurationException;
import org.apache.log4j.Logger;
+
import org.exist.EXistException;
import org.exist.Namespaces;
import org.exist.collections.Collection;
@@ -59,6 +60,7 @@
import org.exist.dom.DocumentImpl;
import org.exist.dom.DocumentMetadata;
import org.exist.dom.MutableDocumentSet;
+import org.exist.dom.XMLUtil;
import org.exist.http.servlets.HttpRequestWrapper;
import org.exist.http.servlets.HttpResponseWrapper;
import org.exist.http.servlets.ResponseWrapper;
@@ -1397,11 +1399,12 @@
writer.write("</a></p>");
writer.write("<p class=\"errmsg\">");
- writer.write( ( e.getMessage() == null ? e.toString() : e.getMessage() ) );
+ String message = e.getMessage() == null ? e.toString() : e.getMessage();
+ writer.write(XMLUtil.encodeAttrMarkup(message));
writer.write("</p>");
if (query != null) {
writer.write("<p><span class=\"high\">Query</span>:</p><pre>");
- writer.write(query);
+ writer.write(XMLUtil.encodeAttrMarkup(query));
writer.write("</pre>");
}
writer.write("</body></html>");
@@ -1437,11 +1440,12 @@
writer.write(path);
writer.write("</path>");
writer.write("<message>");
- writer.write( ( e.getMessage() == null ? e.toString() : e.getMessage() ) );
+ String message = e.getMessage() == null ? e.toString() : e.getMessage();
+ writer.write(XMLUtil.encodeAttrMarkup(message));
writer.write("</message>");
if (query != null) {
writer.write("<query>");
- writer.write(query);
+ writer.write(XMLUtil.encodeAttrMarkup(query));
writer.write("</query>");
}
writer.write("</exception>");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2009-07-31 21:28:26
|
Revision: 9608
http://exist.svn.sourceforge.net/exist/?rev=9608&view=rev
Author: ellefj
Date: 2009-07-31 21:28:12 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function documentation
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunDefaultCollation.java
trunk/eXist/src/org/exist/xquery/functions/FunDistinctValues.java
trunk/eXist/src/org/exist/xquery/functions/FunDoc.java
trunk/eXist/src/org/exist/xquery/functions/FunDocAvailable.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunDefaultCollation.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunDefaultCollation.java 2009-07-31 17:14:50 UTC (rev 9607)
+++ trunk/eXist/src/org/exist/xquery/functions/FunDefaultCollation.java 2009-07-31 21:28:12 UTC (rev 9608)
@@ -1,7 +1,8 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2000-2007 The eXist team
- *
+ * Copyright (C) 2007-2009 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
@@ -16,9 +17,8 @@
* along with this program; if not, write to the Free Software Foundation
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * $Id$
+ * $Id$
*/
-
package org.exist.xquery.functions;
import org.exist.dom.QName;
@@ -30,24 +30,25 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.StringValue;
import org.exist.xquery.value.Type;
/**
- * Built-in function fn:last().
+ * Built-in function fn:default-collation().
*
- * @author wolf
+ * @author perig
*/
public class FunDefaultCollation extends BasicFunction {
public final static FunctionSignature signature =
new FunctionSignature(
new QName("default-collation", Function.BUILTIN_FUNCTION_NS),
- "Returns the context's default collation.",
+ "Returns the context's default collation. E.g. http://www.w3.org/2005/xpath-functions/collation/codepoint",
null,
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "default collation from context"));
public FunDefaultCollation(XQueryContext context) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunDistinctValues.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunDistinctValues.java 2009-07-31 17:14:50 UTC (rev 9607)
+++ trunk/eXist/src/org/exist/xquery/functions/FunDistinctValues.java 2009-07-31 21:28:12 UTC (rev 9608)
@@ -1,7 +1,8 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 The eXist team
- *
+ * Copyright (C) 2001-2009 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
@@ -20,6 +21,8 @@
*/
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import java.text.Collator;
import java.util.Comparator;
import java.util.TreeSet;
@@ -35,6 +38,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AtomicValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NumericValue;
import org.exist.xquery.value.Sequence;
@@ -47,26 +52,29 @@
* Implements the fn:distinct-values standard library function.
*
* @author wolf
+ * @author perig
*/
public class FunDistinctValues extends CollatingFunction {
-
+ protected static final Logger logger = Logger.getLogger(FunDistinctValues.class);
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("distinct-values", Function.BUILTIN_FUNCTION_NS, ModuleImpl.PREFIX),
- "Returns a sequence where duplicate values of $a, based on value equality, " +
+ "Returns a sequence where duplicate values of $atomic-values, based on value equality, " +
"have been deleted.",
- new SequenceType[] { new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)
+ new SequenceType[] {
+ new FunctionParameterSequenceType("atomic-values", Type.ATOMIC, Cardinality.ZERO_OR_MORE, "the atomic-values")
+ },
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE, "distinct-values sequence")
),
new FunctionSignature(
new QName("distinct-values", Function.BUILTIN_FUNCTION_NS, ModuleImpl.PREFIX),
- "Returns a sequence where duplicate values of $a, based on value equality specified by collation $b, " +
+ "Returns a sequence where duplicate values of $atomic-values, based on value equality specified by collation $collation-uri, " +
"have been deleted.",
new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("atomic-values", Type.ATOMIC, Cardinality.ZERO_OR_MORE, "the atomic values"),
+ new FunctionParameterSequenceType("collation-uri", Type.STRING, Cardinality.EXACTLY_ONE, "the collation-uri")
},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE, "distinct-values sequence")
)
};
@@ -165,6 +173,7 @@
else
return ((AtomicValue) o1).compareTo(collator, (AtomicValue) o2);
} catch (XPathException e) {
+ logger.error("cannot compare values" + e.getMessage());
//throw new IllegalArgumentException("cannot compare values");
//Values that cannot be compared, i.e. the eq operator is not defined for their types, are considered to be distinct
return Constants.INFERIOR;
Modified: trunk/eXist/src/org/exist/xquery/functions/FunDoc.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunDoc.java 2009-07-31 17:14:50 UTC (rev 9607)
+++ trunk/eXist/src/org/exist/xquery/functions/FunDoc.java 2009-07-31 21:28:12 UTC (rev 9608)
@@ -1,27 +1,28 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import org.exist.dom.DocumentImpl;
import org.exist.dom.DocumentSet;
import org.exist.dom.QName;
@@ -31,6 +32,8 @@
import org.exist.storage.UpdateListener;
import org.exist.xquery.*;
import org.exist.xquery.util.DocUtils;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -44,18 +47,20 @@
* @author wolf
*/
public class FunDoc extends Function {
-
+ protected static final Logger logger = Logger.getLogger(FunDoc.class);
public final static FunctionSignature signature =
new FunctionSignature(
new QName("doc", Function.BUILTIN_FUNCTION_NS),
- "Returns the documents specified in the input sequence. " +
- "The arguments are either document paths like '" +
+ "Returns the document node of $document-uri specified. " +
+ "The argument is either a document path like '" +
DBBroker.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml' or " +
- "XMLDB URIs like 'xmldb:exist://localhost:8081/" +
+ "XMLDB URI like 'xmldb:exist://localhost:8081/" +
DBBroker.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml' or " +
- "standard URLs starting with http://, file://, etc.",
- new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)},
- new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE));
+ "standard URL starting with http://, file://, etc.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("document-uri", Type.STRING, Cardinality.ZERO_OR_ONE, "the document-uri")
+ },
+ new FunctionReturnSequenceType(Type.NODE, Cardinality.ZERO_OR_ONE, "the document node of $document-uri"));
private UpdateListener listener = null;
@@ -76,9 +81,10 @@
/**
* @see org.exist.xquery.Expression#eval(Sequence, Item)
*/
- public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
+ public Sequence eval(Sequence contextSequence, Item contextItem)
+ throws XPathException {
if (context.getProfiler().isEnabled()) {
- context.getProfiler().start(this);
+ context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
if (contextSequence != null)
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);
@@ -103,6 +109,7 @@
try {
result = DocUtils.getDocument(this.context, path);
if (result.isEmpty() && context.isRaiseErrorOnFailedRetrieval()) {
+ logger.error("FODC0002: can not access '" + path + "'");
throw new XPathException(this, "FODC0002: can not access '" + path + "'");
}
// TODO: we still need a final decision about this. Also check base-uri.
@@ -115,6 +122,7 @@
}
}
catch (Exception e) {
+ logger.error(e.getMessage());
throw new XPathException(this, e.getMessage(), e);
}
}
@@ -142,7 +150,7 @@
}
public void debug() {
- LOG.debug("UpdateListener: Line: " + getLine() + ": " + FunDoc.this.toString());
+ logger.debug("UpdateListener: Line: " + getLine() + ": " + FunDoc.this.toString());
}
};
context.registerUpdateListener(listener);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunDocAvailable.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunDocAvailable.java 2009-07-31 17:14:50 UTC (rev 9607)
+++ trunk/eXist/src/org/exist/xquery/functions/FunDocAvailable.java 2009-07-31 21:28:12 UTC (rev 9608)
@@ -1,52 +1,61 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2005-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import org.exist.dom.QName;
import org.exist.storage.DBBroker;
import org.exist.xquery.*;
import org.exist.xquery.util.DocUtils;
-import org.exist.xquery.value.*;
+import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.Item;
+import org.exist.xquery.value.Sequence;
+import org.exist.xquery.value.SequenceType;
+import org.exist.xquery.value.Type;
/**
* Implements the XQuery's fn:doc-available() function.
*
+ * @author Pierrick Brihaye <pie...@fr...>
* @author wolf
- * @author Pierrick Brihaye <pie...@fr...>
*/
public class FunDocAvailable extends Function {
-
+ protected static final Logger logger = Logger.getLogger(FunDocAvailable.class);
public final static FunctionSignature signature =
new FunctionSignature(
new QName("doc-available", Function.BUILTIN_FUNCTION_NS),
- "Returns whether or not the document specified in the input sequence is available. " +
+ "Returns whether or not the document, $document-uri, specified in the input sequence is available. " +
"The arguments are either document pathes like '" +
DBBroker.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml' or " +
"XMLDB URIs like 'xmldb:exist://localhost:8081/" +
DBBroker.ROOT_COLLECTION + "/shakespeare/plays/hamlet.xml' or " +
"standard URLs, starting with http://, file://, etc.",
- new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)},
- new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE));
+ new SequenceType[] {
+ new FunctionParameterSequenceType("document-uri", Type.STRING, Cardinality.ZERO_OR_ONE, "the document-uri")
+ },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE, "true() if the document is available, false() otherwise"));
public FunDocAvailable(XQueryContext context) {
super(context, signature);
@@ -64,7 +73,7 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
if (context.getProfiler().isEnabled()) {
- context.getProfiler().start(this);
+ context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
if (contextSequence != null)
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);
@@ -82,6 +91,7 @@
result = BooleanValue.valueOf(DocUtils.isDocumentAvailable(this.context, path));
}
catch (Exception e) {
+ logger.error(e.getMessage());
throw new XPathException(this, 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-07-31 17:15:02
|
Revision: 9607
http://exist.svn.sourceforge.net/exist/?rev=9607&view=rev
Author: wolfgang_m
Date: 2009-07-31 17:14:50 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[website] sandbox example queries should use Lucene-based index instead of old full text index. yui js library was missing some required classes needed by sandbox.
Modified Paths:
--------------
trunk/eXist/samples/examples.xml
trunk/eXist/webapp/scripts/yui/yui-combined2.7.0.js
Added Paths:
-----------
trunk/eXist/samples/shakespeare/collection.xconf
Modified: trunk/eXist/samples/examples.xml
===================================================================
--- trunk/eXist/samples/examples.xml 2009-07-31 16:54:29 UTC (rev 9606)
+++ trunk/eXist/samples/examples.xml 2009-07-31 17:14:50 UTC (rev 9607)
@@ -1,7 +1,8 @@
<?xml version="1.0"?>
-<!-- This file contains example queries for the web interface
- (see webapp/xquery/xquery.xq
+<!--
+ This file contains example queries for the web interface
+ (see webapp/sandbox/)
-->
<example-queries>
<query>
Added: trunk/eXist/samples/shakespeare/collection.xconf
===================================================================
--- trunk/eXist/samples/shakespeare/collection.xconf (rev 0)
+++ trunk/eXist/samples/shakespeare/collection.xconf 2009-07-31 17:14:50 UTC (rev 9607)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<collection xmlns="" rel="nofollow">http://exist-db.org/collection-config/1.0">
+ <!-- Defines a bunch of numeric indexes on the mondial collection.
+ This file should be stored into /db/system/config/db/mondial.
+ -->
+ <index>
+ <fulltext default="none" attributes="no">
+ </fulltext>
+
+ <lucene>
+ <text match="//SCENE/*"/>
+ <text qname="TITLE"/>
+ </lucene>
+ <ngram qname="SPEAKER"/>
+ </index>
+</collection>
\ No newline at end of file
Modified: trunk/eXist/webapp/scripts/yui/yui-combined2.7.0.js
===================================================================
--- trunk/eXist/webapp/scripts/yui/yui-combined2.7.0.js 2009-07-31 16:54:29 UTC (rev 9606)
+++ trunk/eXist/webapp/scripts/yui/yui-combined2.7.0.js 2009-07-31 17:14:50 UTC (rev 9607)
@@ -48,7 +48,13 @@
O.addProperty(L.IFRAME.key,{handler:this.configIframe,value:L.IFRAME.value,validator:L.IFRAME.validator,supercedes:L.IFRAME.supercedes});O.addProperty(L.PREVENT_CONTEXT_OVERLAP.key,{value:L.PREVENT_CONTEXT_OVERLAP.value,validator:L.PREVENT_CONTEXT_OVERLAP.validator,supercedes:L.PREVENT_CONTEXT_OVERLAP.supercedes});},moveTo:function(O,P){this.cfg.setProperty("xy",[O,P]);},hideMacGeckoScrollbars:function(){F.replaceClass(this.element,"show-scrollbars","hide-scrollbars");},showMacGeckoScrollbars:function(){F.replaceClass(this.element,"hide-scrollbars","show-scrollbars");},_setDomVisibility:function(O){F.setStyle(this.element,"visibility",(O)?"visible":"hidden");if(O){F.removeClass(this.element,"yui-overlay-hidden");}else{F.addClass(this.element,"yui-overlay-hidden");}},configVisible:function(R,O,X){var Q=O[0],S=F.getStyle(this.element,"visibility"),Y=this.cfg.getProperty("effect"),V=[],U=(this.platform=="mac"&&K.gecko),g=D.alreadySubscribed,W,P,f,c,b,a,d,Z,T;if(S=="inherit"){f=this.element.parentNode;while(f.nodeType!=9&&f.nodeType!=11){S=F.getStyle(f,"visibility");if(S!="inherit"){break;}f=f.parentNode;}if(S=="inherit"){S="visible";}}if(Y){if(Y instanceof Array){Z=Y.length;for(c=0;c<Z;c++){W=Y[c];V[V.length]=W.effect(this,W.duration);}}else{V[V.length]=Y.effect(this,Y.duration);}}if(Q){if(U){this.showMacGeckoScrollbars();}if(Y){if(Q){if(S!="visible"||S===""){this.beforeShowEvent.fire();T=V.length;for(b=0;b<T;b++){P=V[b];if(b===0&&!g(P.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){P.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}P.animateIn();}}}}else{if(S!="visible"||S===""){this.beforeShowEvent.fire();this._setDomVisibility(true);this.cfg.refireEvent("iframe");this.showEvent.fire();}else{this._setDomVisibility(true);}}}else{if(U){this.hideMacGeckoScrollbars();}if(Y){if(S=="visible"){this.beforeHideEvent.fire();T=V.length;for(a=0;a<T;a++){d=V[a];if(a===0&&!g(d.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){d.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}d.animateOut();}}else{if(S===""){this._setDomVisibility(false);}}}else{if(S=="visible"||S===""){this.beforeHideEvent.fire();this._setDomVisibility(false);this.hideEvent.fire();}else{this._setDomVisibility(false);}}}},doCenterOnDOMEvent:function(){var O=this.cfg,P=O.getProperty("fixedcenter");if(O.getProperty("visible")){if(P&&(P!==C||this.fitsInViewport())){this.center();}}},fitsInViewport:function(){var S=B.VIEWPORT_OFFSET,Q=this.element,T=Q.offsetWidth,R=Q.offsetHeight,O=F.getViewportWidth(),P=F.getViewportHeight();return((T+S<O)&&(R+S<P));},configFixedCenter:function(S,Q,T){var U=Q[0],P=D.alreadySubscribed,R=B.windowResizeEvent,O=B.windowScrollEvent;if(U){this.center();if(!P(this.beforeShowEvent,this.center)){this.beforeShowEvent.subscribe(this.center);}if(!P(R,this.doCenterOnDOMEvent,this)){R.subscribe(this.doCenterOnDOMEvent,this,true);}if(!P(O,this.doCenterOnDOMEvent,this)){O.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);R.unsubscribe(this.doCenterOnDOMEvent,this);O.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(R,P,S){var O=P[0],Q=this.element;F.setStyle(Q,"height",O);this.cfg.refireEvent("iframe");},configAutoFillHeight:function(T,S,P){var V=S[0],Q=this.cfg,U="autofillheight",W="height",R=Q.getProperty(U),O=this._autoFillOnHeightChange;Q.unsubscribeFromConfigEvent(W,O);G.textResizeEvent.unsubscribe(O);this.changeContentEvent.unsubscribe(O);if(R&&V!==R&&this[R]){F.setStyle(this[R],W,"");}if(V){V=I.trim(V.toLowerCase());Q.subscribeToConfigEvent(W,O,this[V],this);G.textResizeEvent.subscribe(O,this[V],this);this.changeContentEvent.subscribe(O,this[V],this);Q.setProperty(U,V,true);}},configWidth:function(R,O,S){var Q=O[0],P=this.element;F.setStyle(P,"width",Q);this.cfg.refireEvent("iframe");},configzIndex:function(Q,O,R){var S=O[0],P=this.element;if(!S){S=F.getStyle(P,"zIndex");if(!S||isNaN(S)){S=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(S<=0){S=1;}}F.setStyle(P,"zIndex",S);this.cfg.setProperty("zIndex",S,true);if(this.iframe){this.stackIframe();}},configXY:function(Q,P,R){var T=P[0],O=T[0],S=T[1];this.cfg.setProperty("x",O);this.cfg.setProperty("y",S);this.beforeMoveEvent.fire([O,S]);O=this.cfg.getProperty("x");S=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([O,S]);},configX:function(Q,P,R){var O=P[0],S=this.cfg.getProperty("y");this.cfg.setProperty("x",O,true);this.cfg.setProperty("y",S,true);this.beforeMoveEvent.fire([O,S]);O=this.cfg.getProperty("x");S=this.cfg.getProperty("y");F.setX(this.element,O,true);this.cfg.setProperty("xy",[O,S],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([O,S]);},configY:function(Q,P,R){var O=this.cfg.getProperty("x"),S=P[0];this.cfg.setProperty("x",O,true);this.cfg.setProperty("y",S,true);this.beforeMoveEvent.fire([O,S]);O=this.cfg.getProperty("x");S=this.cfg.getProperty("y");F.setY(this.element,S,true);this.cfg.setProperty("xy",[O,S],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([O,S]);},showIframe:function(){var P=this.iframe,O;if(P){O=this.element.parentNode;if(O!=P.parentNode){this._addToParent(O,P);}P.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var O=this.iframe,Q=this.element,S=B.IFRAME_OFFSET,P=(S*2),R;if(O){O.style.width=(Q.offsetWidth+P+"px");O.style.height=(Q.offsetHeight+P+"px");R=this.cfg.getProperty("xy");if(!I.isArray(R)||(isNaN(R[0])||isNaN(R[1]))){this.syncPosition();R=this.cfg.getProperty("xy");}F.setXY(O,[(R[0]-S),(R[1]-S)]);}},stackIframe:function(){if(this.iframe){var O=F.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(O)&&!isNaN(O)){F.setStyle(this.iframe,"zIndex",(O-1));}}},configIframe:function(R,Q,S){var O=Q[0];function T(){var V=this.iframe,W=this.element,X;if(!V){if(!J){J=document.createElement("iframe");if(this.isSecure){J.src=B.IFRAME_SRC;}if(K.ie){J.style.filter="alpha(opacity=0)";
J.frameBorder=0;}else{J.style.opacity="0";}J.style.position="absolute";J.style.border="none";J.style.margin="0";J.style.padding="0";J.style.display="none";J.tabIndex=-1;}V=J.cloneNode(false);X=W.parentNode;var U=X||document.body;this._addToParent(U,V);this.iframe=V;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function P(){T.call(this);this.beforeShowEvent.unsubscribe(P);this._iframeDeferred=false;}if(O){if(this.cfg.getProperty("visible")){T.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(P);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(P,O,Q){var R=O[0];if(R){if(!D.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!D.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(T,S,P){var W=S[0],Q,O,U,R,V=this.CONTEXT_TRIGGERS;if(W){Q=W[0];O=W[1];U=W[2];R=W[3];if(V&&V.length>0){R=(R||[]).concat(V);}if(Q){if(typeof Q=="string"){this.cfg.setProperty("context",[document.getElementById(Q),O,U,R],true);}if(O&&U){this.align(O,U);}if(this._contextTriggers){this._processTriggers(this._contextTriggers,E,this._alignOnTrigger);}if(R){this._processTriggers(R,H,this._alignOnTrigger);this._contextTriggers=R;}}}},_alignOnTrigger:function(P,O){this.align();},_findTriggerCE:function(O){var P=null;if(O instanceof M){P=O;}else{if(B._TRIGGER_MAP[O]){P=B._TRIGGER_MAP[O];}}return P;},_processTriggers:function(S,U,R){var Q,T;for(var P=0,O=S.length;P<O;++P){Q=S[P];T=this._findTriggerCE(Q);if(T){T[U](R,this,true);}else{this[U](Q,R);}}},align:function(P,O){var U=this.cfg.getProperty("context"),T=this,S,R,V;function Q(W,X){switch(P){case B.TOP_LEFT:T.moveTo(X,W);break;case B.TOP_RIGHT:T.moveTo((X-R.offsetWidth),W);break;case B.BOTTOM_LEFT:T.moveTo(X,(W-R.offsetHeight));break;case B.BOTTOM_RIGHT:T.moveTo((X-R.offsetWidth),(W-R.offsetHeight));break;}}if(U){S=U[0];R=this.element;T=this;if(!P){P=U[1];}if(!O){O=U[2];}if(R&&S){V=F.getRegion(S);switch(O){case B.TOP_LEFT:Q(V.top,V.left);break;case B.TOP_RIGHT:Q(V.top,V.right);break;case B.BOTTOM_LEFT:Q(V.bottom,V.left);break;case B.BOTTOM_RIGHT:Q(V.bottom,V.right);break;}}}},enforceConstraints:function(P,O,Q){var S=O[0];var R=this.getConstrainedXY(S[0],S[1]);this.cfg.setProperty("x",R[0],true);this.cfg.setProperty("y",R[1],true);this.cfg.setProperty("xy",R,true);},getConstrainedX:function(V){var S=this,O=S.element,e=O.offsetWidth,c=B.VIEWPORT_OFFSET,h=F.getViewportWidth(),d=F.getDocumentScrollLeft(),Y=(e+c<h),b=this.cfg.getProperty("context"),Q,X,j,T=false,f,W,g=d+c,P=d+h-e-c,i=V,U={"tltr":true,"blbr":true,"brbl":true,"trtl":true};var Z=function(){var k;if((S.cfg.getProperty("x")-d)>X){k=(X-e);}else{k=(X+j);}S.cfg.setProperty("x",(k+d),true);return k;};var R=function(){if((S.cfg.getProperty("x")-d)>X){return(W-c);}else{return(f-c);}};var a=function(){var k=R(),l;if(e>k){if(T){Z();}else{Z();T=true;l=a();}}return l;};if(V<g||V>P){if(Y){if(this.cfg.getProperty("preventcontextoverlap")&&b&&U[(b[1]+b[2])]){Q=b[0];X=F.getX(Q)-d;j=Q.offsetWidth;f=X;W=(h-(X+j));a();i=this.cfg.getProperty("x");}else{if(V<g){i=g;}else{if(V>P){i=P;}}}}else{i=c+d;}}return i;},getConstrainedY:function(Z){var W=this,P=W.element,i=P.offsetHeight,h=B.VIEWPORT_OFFSET,d=F.getViewportHeight(),g=F.getDocumentScrollTop(),e=(i+h<d),f=this.cfg.getProperty("context"),U,a,b,X=false,V,Q,c=g+h,S=g+d-i-h,O=Z,Y={"trbr":true,"tlbl":true,"bltl":true,"brtr":true};var T=function(){var k;if((W.cfg.getProperty("y")-g)>a){k=(a-i);}else{k=(a+b);}W.cfg.setProperty("y",(k+g),true);return k;};var R=function(){if((W.cfg.getProperty("y")-g)>a){return(Q-h);}else{return(V-h);}};var j=function(){var l=R(),k;if(i>l){if(X){T();}else{T();X=true;k=j();}}return k;};if(Z<c||Z>S){if(e){if(this.cfg.getProperty("preventcontextoverlap")&&f&&Y[(f[1]+f[2])]){U=f[0];b=U.offsetHeight;a=(F.getY(U)-g);V=a;Q=(d-(a+b));j();O=W.cfg.getProperty("y");}else{if(Z<c){O=c;}else{if(Z>S){O=S;}}}}else{O=h+g;}}return O;},getConstrainedXY:function(O,P){return[this.getConstrainedX(O),this.getConstrainedY(P)];},center:function(){var R=B.VIEWPORT_OFFSET,S=this.element.offsetWidth,Q=this.element.offsetHeight,P=F.getViewportWidth(),T=F.getViewportHeight(),O,U;if(S<P){O=(P/2)-(S/2)+F.getDocumentScrollLeft();}else{O=R+F.getDocumentScrollLeft();}if(Q<T){U=(T/2)-(Q/2)+F.getDocumentScrollTop();}else{U=R+F.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(O,10),parseInt(U,10)]);this.cfg.refireEvent("iframe");if(K.webkit){this.forceContainerRedraw();}},syncPosition:function(){var O=F.getXY(this.element);this.cfg.setProperty("x",O[0],true);this.cfg.setProperty("y",O[1],true);this.cfg.setProperty("xy",O,true);},onDomResize:function(Q,P){var O=this;B.superclass.onDomResize.call(this,Q,P);setTimeout(function(){O.syncPosition();O.cfg.refireEvent("iframe");O.cfg.refireEvent("context");},0);},_getComputedHeight:(function(){if(document.defaultView&&document.defaultView.getComputedStyle){return function(P){var O=null;if(P.ownerDocument&&P.ownerDocument.defaultView){var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){O=parseInt(Q.height,10);}}return(I.isNumber(O))?O:null;};}else{return function(P){var O=null;
if(P.style.pixelHeight){O=P.style.pixelHeight;}return(I.isNumber(O))?O:null;};}})(),_validateAutoFillHeight:function(O){return(!O)||(I.isString(O)&&B.STD_MOD_RE.test(O));},_autoFillOnHeightChange:function(R,P,Q){var O=this.cfg.getProperty("height");if((O&&O!=="auto")||(O===0)){this.fillHeight(Q);}},_getPreciseHeight:function(P){var O=P.offsetHeight;if(P.getBoundingClientRect){var Q=P.getBoundingClientRect();O=Q.bottom-Q.top;}return O;},fillHeight:function(R){if(R){var P=this.innerElement||this.element,O=[this.header,this.body,this.footer],V,W=0,X=0,T=0,Q=false;for(var U=0,S=O.length;U<S;U++){V=O[U];if(V){if(R!==V){X+=this._getPreciseHeight(V);}else{Q=true;}}}if(Q){if(K.ie||K.opera){F.setStyle(R,"height",0+"px");}W=this._getComputedHeight(P);if(W===null){F.addClass(P,"yui-override-padding");W=P.clientHeight;F.removeClass(P,"yui-override-padding");}T=Math.max(W-X,0);F.setStyle(R,"height",T+"px");if(R.offsetHeight!=T){T=Math.max(T-(R.offsetHeight-T),0);}F.setStyle(R,"height",T+"px");}}},bringToTop:function(){var S=[],R=this.element;function V(Z,Y){var b=F.getStyle(Z,"zIndex"),a=F.getStyle(Y,"zIndex"),X=(!b||isNaN(b))?0:parseInt(b,10),W=(!a||isNaN(a))?0:parseInt(a,10);if(X>W){return -1;}else{if(X<W){return 1;}else{return 0;}}}function Q(Y){var X=F.hasClass(Y,B.CSS_OVERLAY),W=YAHOO.widget.Panel;if(X&&!F.isAncestor(R,Y)){if(W&&F.hasClass(Y,W.CSS_PANEL)){S[S.length]=Y.parentNode;}else{S[S.length]=Y;}}}F.getElementsBy(Q,"DIV",document.body);S.sort(V);var O=S[0],U;if(O){U=F.getStyle(O,"zIndex");if(!isNaN(U)){var T=false;if(O!=R){T=true;}else{if(S.length>1){var P=F.getStyle(S[1],"zIndex");if(!isNaN(P)&&(U==P)){T=true;}}}if(T){this.cfg.setProperty("zindex",(parseInt(U,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);G.textResizeEvent.unsubscribe(this._autoFillOnHeightChange);B.superclass.destroy.call(this);},forceContainerRedraw:function(){var O=this;F.addClass(O.element,"yui-force-redraw");setTimeout(function(){F.removeClass(O.element,"yui-force-redraw");},0);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){K.focus();}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);M.focusEvent.unsubscribe(this._onOverlayFocusHandler,M);M.blurEvent.unsubscribe(this._onOverlayBlurHandler,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}if(M.focusEvent._managed){M.focusEvent=null;}if(M.blurEvent._managed){M.blurEvent=null;}if(M.focus._managed){M.focus=null;}if(M.blur._managed){M.blur=null;}}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._manageBlur=function(J){var K=false;if(H==J){E.removeClass(H.element,A.CSS_FOCUSED);H=null;K=true;}return K;};this._manageFocus=function(J){var K=false;if(H!=J){if(H){H.blur();}H=J;this.bringToTop(H);E.addClass(H.element,A.CSS_FOCUSED);K=true;}return K;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},_onOverlayFocusHandler:function(H,G,I){this._manageFocus(I);},_onOverlayBlurHandler:function(H,G,I){this._manageBlur(I);},_bindFocus:function(G){var H=this;if(!G.focusEvent){G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.focusEvent.subscribe(H._onOverlayFocusHandler,G,H);}if(!G.focus){C.on(G.element,H.cfg.getProperty("focusevent"),H._onOverlayElementFocus,null,G);G.focus=function(){if(H._manageFocus(this)){if(this.cfg.getProperty("visible")&&this.focusFirst){this.focusFirst();}this.focusEvent.fire();}};G.focus._managed=true;}},_bindBlur:function(G){var H=this;if(!G.blurEvent){G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focusEvent._managed=true;}else{G.blurEvent.subscribe(H._onOverlayBlurHandler,G,H);}if(!G.blur){G.blur=function(){if(H._manageBlur(this)){this.blurEvent.fire();}};G.blur._managed=true;}G.hideEvent.subscribe(G.blur);},_bindDestroy:function(G){var H=this;G.destroyEvent.subscribe(H._onOverlayDestroy,G,H);},_syncZIndex:function(G){var H=E.getStyle(G.element,"zIndex");if(!isNaN(H)){G.cfg.setProperty("zIndex",parseInt(H,10));}else{G.cfg.setProperty("zIndex",0);}},register:function(G){var J=false,H,I;if(G instanceof D){G.cfg.addProperty("manager",{value:this});this._bindFocus(G);this._bindBlur(G);this._bindDestroy(G);this._syncZIndex(G);this.overlays.push(G);this.bringToTop(G);J=true;}else{if(G instanceof Array){for(H=0,I=G.length;H<I;H++){J=this.register(G[H])||J;}}}return J;},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");
-if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.ContainerEffect=function(E,H,G,D,F){if(!F){F=YAHOO.util.Anim;}this.overlay=E;this.attrIn=H;this.attrOut=G;this.targetElement=D||E.element;this.animClass=F;};var B=YAHOO.util.Dom,C=YAHOO.util.CustomEvent,A=YAHOO.widget.ContainerEffect;A.FADE=function(D,F){var G=YAHOO.util.Easing,I={attributes:{opacity:{from:0,to:1}},duration:F,method:G.easeIn},E={attributes:{opacity:{to:0}},duration:F,method:G.easeOut},H=new A(D,I,E,D.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(D.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(D.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();L.overlay._setDomVisibility(true);B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.overlay._setDomVisibility(false);B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(F,D){var I=YAHOO.util.Easing,L=F.cfg.getProperty("x")||B.getX(F.element),K=F.cfg.getProperty("y")||B.getY(F.element),M=B.getClientWidth(),H=F.element.offsetWidth,J={attributes:{points:{to:[L,K]}},duration:D,method:I.easeIn},E={attributes:{points:{to:[(M+25),K]}},duration:D,method:I.easeOut},G=new A(F,J,E,F.element,YAHOO.util.Motion);G.handleStartAnimateIn=function(O,N,P){P.overlay.element.style.left=((-25)-H)+"px";P.overlay.element.style.top=K+"px";};G.handleTweenAnimateIn=function(Q,P,R){var S=B.getXY(R.overlay.element),O=S[0],N=S[1];if(B.getStyle(R.overlay.element,"visibility")=="hidden"&&O<L){R.overlay._setDomVisibility(true);}R.overlay.cfg.setProperty("xy",[O,N],true);R.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateIn=function(O,N,P){P.overlay.cfg.setProperty("xy",[L,K],true);P.startX=L;P.startY=K;P.overlay.cfg.refireEvent("iframe");P.animateInCompleteEvent.fire();};G.handleStartAnimateOut=function(O,N,R){var P=B.getViewportWidth(),S=B.getXY(R.overlay.element),Q=S[1];R.animOut.attributes.points.to=[(P+25),Q];};G.handleTweenAnimateOut=function(P,O,Q){var S=B.getXY(Q.overlay.element),N=S[0],R=S[1];Q.overlay.cfg.setProperty("xy",[N,R],true);Q.overlay.cfg.refireEvent("iframe");};G.handleCompleteAnimateOut=function(O,N,P){P.overlay._setDomVisibility(false);P.overlay.cfg.setProperty("xy",[L,K]);P.animateOutCompleteEvent.fire();};G.init();return G;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=C.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=C.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=C.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=C.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(E,D,F){},handleTweenAnimateIn:function(E,D,F){},handleCompleteAnimateIn:function(E,D,F){},handleStartAnimateOut:function(E,D,F){},handleTweenAnimateOut:function(E,D,F){},handleCompleteAnimateOut:function(E,D,F){},toString:function(){var D="ContainerEffect";if(this.overlay){D+=" ["+this.overlay.toString()+"]";}return D;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("containercore",YAHOO.widget.Module,{version:"2.7.0",build:"1796"});/*
+if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var K=G instanceof D,I=this.overlays,M=I.length,J=null,L,H;if(K||typeof G=="string"){for(H=M-1;H>=0;H--){L=I[H];if((K&&(L===G))||(L.id==G)){J=L;break;}}}return J;},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return -1;}else{if(H>G){return -1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].show();}},hideAll:function(){var H=this.overlays,I=H.length,G;for(G=I-1;G>=0;G--){H[G].hide();}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(P,O){YAHOO.widget.Tooltip.superclass.constructor.call(this,P,O);};var E=YAHOO.lang,N=YAHOO.util.Event,M=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,J=YAHOO.widget.Tooltip,H=YAHOO.env.ua,G=(H.ie&&(H.ie<=6||document.compatMode=="BackCompat")),F,I={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};J.CSS_TOOLTIP="yui-tt";function K(Q,O){var P=this.cfg,R=P.getProperty("width");if(R==O){P.setProperty("width",Q);}}function D(P,O){if("_originalWidth" in this){K.call(this,this._originalWidth,this._forcedWidth);}var Q=document.body,U=this.cfg,T=U.getProperty("width"),R,S;if((!T||T=="auto")&&(U.getProperty("container")!=Q||U.getProperty("x")>=C.getViewportWidth()||U.getProperty("y")>=C.getViewportHeight())){S=this.element.cloneNode(true);S.style.visibility="hidden";S.style.top="0px";S.style.left="0px";Q.appendChild(S);R=(S.offsetWidth+"px");Q.removeChild(S);S=null;U.setProperty("width",R);U.refireEvent("xy");this._originalWidth=T||"";this._forcedWidth=R;}}function B(P,O,Q){this.render(Q);}function L(){N.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(J,YAHOO.widget.Overlay,{init:function(P,O){J.superclass.init.call(this,P);this.beforeInitEvent.fire(J);C.addClass(this.element,J.CSS_TOOLTIP);if(O){this.cfg.applyConfig(O,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("changeContent",D);this.subscribe("init",L);this.subscribe("render",this.onRender);this.initEvent.fire(J);},initEvents:function(){J.superclass.initEvents.call(this);var O=M.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=O;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=O;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=O;},initDefaultConfig:function(){J.superclass.initDefaultConfig.call(this);this.cfg.addProperty(I.PREVENT_OVERLAP.key,{value:I.PREVENT_OVERLAP.value,validator:I.PREVENT_OVERLAP.validator,supercedes:I.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(I.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:I.SHOW_DELAY.validator});this.cfg.addProperty(I.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:I.AUTO_DISMISS_DELAY.value,validator:I.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(I.HIDE_DELAY.key,{handler:this.configHideDelay,value:I.HIDE_DELAY.value,validator:I.HIDE_DELAY.validator});this.cfg.addProperty(I.TEXT.key,{handler:this.configText,suppressEvent:I.TEXT.suppressEvent});this.cfg.addProperty(I.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(I.DISABLED.key,{handler:this.configContainer,value:I.DISABLED.value,supressEvent:I.DISABLED.suppressEvent});},configText:function(P,O,Q){var R=O[0];if(R){this.setBody(R);}},configContainer:function(Q,P,R){var O=P[0];if(typeof O=="string"){this.cfg.setProperty("container",document.getElementById(O),true);}},_removeEventListeners:function(){var R=this._context,O,Q,P;if(R){O=R.length;if(O>0){P=O-1;do{Q=R[P];N.removeListener(Q,"mouseover",this.onContextMouseOver);N.removeListener(Q,"mousemove",this.onContextMouseMove);N.removeListener(Q,"mouseout",this.onContextMouseOut);}while(P--);}}},configContext:function(T,P,U){var S=P[0],V,O,R,Q;if(S){if(!(S instanceof Array)){if(typeof S=="string"){this.cfg.setProperty("context",[document.getElementById(S)],true);}else{this.cfg.setProperty("context",[S],true);}S=this.cfg.getProperty("context");}this._removeEventListeners();this._context=S;V=this._context;if(V){O=V.length;if(O>0){Q=O-1;do{R=V[Q];N.on(R,"mouseover",this.onContextMouseOver,this);N.on(R,"mousemove",this.onContextMouseMove,this);N.on(R,"mouseout",this.onContextMouseOut,this);}while(Q--);}}}},onContextMouseMove:function(P,O){O.pageX=N.getPageX(P);O.pageY=N.getPageY(P);},onContextMouseOver:function(Q,P){var O=this;if(O.title){P._tempTitle=O.title;O.title="";}if(P.fireEvent("contextMouseOver",O,Q)!==false&&!P.cfg.getProperty("disabled")){if(P.hideProcId){clearTimeout(P.hideProcId);P.hideProcId=null;}N.on(O,"mousemove",P.onContextMouseMove,P);P.showProcId=P.doShow(Q,O);}},onContextMouseOut:function(Q,P){var O=this;if(P._tempTitle){O.title=P._tempTitle;P._tempTitle=null;}if(P.showProcId){clearTimeout(P.showProcId);P.showProcId=null;}if(P.hideProcId){clearTimeout(P.hideProcId);P.hideProcId=null;}P.fireEvent("contextMouseOut",O,Q);P.hideProcId=setTimeout(function(){P.hide();},P.cfg.getProperty("hidedelay"));},doShow:function(Q,O){var R=25,P=this;
+if(H.opera&&O.tagName&&O.tagName.toUpperCase()=="A"){R+=12;}return setTimeout(function(){var S=P.cfg.getProperty("text");if(P._tempTitle&&(S===""||YAHOO.lang.isUndefined(S)||YAHOO.lang.isNull(S))){P.setBody(P._tempTitle);}else{P.cfg.refireEvent("text");}P.moveTo(P.pageX,P.pageY+R);if(P.cfg.getProperty("preventoverlap")){P.preventOverlap(P.pageX,P.pageY);}N.removeListener(O,"mousemove",P.onContextMouseMove);P.contextTriggerEvent.fire(O);P.show();P.hideProcId=P.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var O=this;return setTimeout(function(){O.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(S,R){var O=this.element.offsetHeight,Q=new YAHOO.util.Point(S,R),P=C.getRegion(this.element);P.top-=5;P.left-=5;P.right+=5;P.bottom+=5;if(P.contains(Q)){this.cfg.setProperty("y",(R-O-5));}},onRender:function(S,R){function T(){var W=this.element,V=this.underlay;if(V){V.style.width=(W.offsetWidth+6)+"px";V.style.height=(W.offsetHeight+1)+"px";}}function P(){C.addClass(this.underlay,"yui-tt-shadow-visible");if(H.ie){this.forceUnderlayRedraw();}}function O(){C.removeClass(this.underlay,"yui-tt-shadow-visible");}function U(){var X=this.underlay,W,V,Z,Y;if(!X){W=this.element;V=YAHOO.widget.Module;Z=H.ie;Y=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}X=F.cloneNode(false);W.appendChild(X);this.underlay=X;this._shadow=this.underlay;P.call(this);this.subscribe("beforeShow",P);this.subscribe("hide",O);if(G){window.setTimeout(function(){T.call(Y);},0);this.cfg.subscribeToConfigEvent("width",T);this.cfg.subscribeToConfigEvent("height",T);this.subscribe("changeContent",T);V.textResizeEvent.subscribe(T,this,true);this.subscribe("destroy",function(){V.textResizeEvent.unsubscribe(T,this);});}}}function Q(){U.call(this);this.unsubscribe("beforeShow",Q);}if(this.cfg.getProperty("visible")){U.call(this);}else{this.subscribe("beforeShow",Q);}},forceUnderlayRedraw:function(){var O=this;C.addClass(O.underlay,"yui-force-redraw");setTimeout(function(){C.removeClass(O.underlay,"yui-force-redraw");},0);},destroy:function(){this._removeEventListeners();J.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(V,U){YAHOO.widget.Panel.superclass.constructor.call(this,V,U);};var S=null;var E=YAHOO.lang,F=YAHOO.util,A=F.Dom,T=F.Event,M=F.CustomEvent,K=YAHOO.util.KeyListener,I=F.Config,H=YAHOO.widget.Overlay,O=YAHOO.widget.Panel,L=YAHOO.env.ua,P=(L.ie&&(L.ie<=6||document.compatMode=="BackCompat")),G,Q,C,D={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},N={"CLOSE":{key:"close",value:true,validator:E.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(F.DD?true:false),validator:E.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:E.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:E.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]},"STRINGS":{key:"strings",supercedes:["close"],validator:E.isObject,value:{close:"Close"}}};O.CSS_PANEL="yui-panel";O.CSS_PANEL_CONTAINER="yui-panel-container";O.FOCUSABLE=["a","button","select","textarea","input","iframe"];function J(V,U){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader(" ");}}function R(V,U,W){var Z=W[0],X=W[1],Y=this.cfg,a=Y.getProperty("width");if(a==X){Y.setProperty("width",Z);}this.unsubscribe("hide",R,W);}function B(V,U){var Y,X,W;if(P){Y=this.cfg;X=Y.getProperty("width");if(!X||X=="auto"){W=(this.element.offsetWidth+"px");Y.setProperty("width",W);this.subscribe("hide",R,[(X||""),W]);}}}YAHOO.extend(O,H,{init:function(V,U){O.superclass.init.call(this,V);this.beforeInitEvent.fire(O);A.addClass(this.element,O.CSS_PANEL);this.buildWrapper();if(U){this.cfg.applyConfig(U,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",J);this.subscribe("render",function(){this.setFirstLastFocusable();this.subscribe("changeContent",this.setFirstLastFocusable);});this.subscribe("show",this.focusFirst);this.initEvent.fire(O);},_onElementFocus:function(Z){if(S===this){var Y=T.getTarget(Z),X=document.documentElement,V=(Y!==X&&Y!==window);if(V&&Y!==this.element&&Y!==this.mask&&!A.isAncestor(this.element,Y)){try{if(this.firstElement){this.firstElement.focus();}else{if(this._modalFocus){this._modalFocus.focus();}else{this.innerElement.focus();}}}catch(W){try{if(V&&Y!==document.body){Y.blur();}}catch(U){}}}}},_addFocusHandlers:function(V,U){if(!this.firstElement){if(L.webkit||L.opera){if(!this._modalFocus){this._createHiddenFocusElement();}}else{this.innerElement.tabIndex=0;}}this.setTabLoop(this.firstElement,this.lastElement);T.onFocus(document.documentElement,this._onElementFocus,this,true);S=this;},_createHiddenFocusElement:function(){var U=document.createElement("button");U.style.height="1px";U.style.width="1px";U.style.position="absolute";U.style.left="-10000em";U.style.opacity=0;U.tabIndex=-1;this.innerElement.appendChild(U);this._modalFocus=U;},_removeFocusHandlers:function(V,U){T.removeFocusListener(document.documentElement,this._onElementFocus,this);if(S==this){S=null;}},focusFirst:function(W,U,Y){var V=this.firstElement;if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},focusLast:function(W,U,Y){var V=this.lastElement;if(U&&U[1]){T.stopEvent(U[1]);}if(V){try{V.focus();}catch(X){}}},setTabLoop:function(X,Z){var V=this.preventBackTab,W=this.preventTabOut,U=this.showEvent,Y=this.hideEvent;if(V){V.disable();U.unsubscribe(V.enable,V);Y.unsubscribe(V.disable,V);V=this.preventBackTab=null;}if(W){W.disable();U.unsubscribe(W.enable,W);Y.unsubscribe(W.disable,W);W=this.preventTabOut=null;}if(X){this.preventBackTab=new K(X,{shift:true,keys:9},{fn:this.focusLast,scope:this,correctScope:true});V=this.preventBackTab;U.subscribe(V.enable,V,true);
+Y.subscribe(V.disable,V,true);}if(Z){this.preventTabOut=new K(Z,{shift:false,keys:9},{fn:this.focusFirst,scope:this,correctScope:true});W=this.preventTabOut;U.subscribe(W.enable,W,true);Y.subscribe(W.disable,W,true);}},getFocusableElements:function(U){U=U||this.innerElement;var X={};for(var W=0;W<O.FOCUSABLE.length;W++){X[O.FOCUSABLE[W]]=true;}function V(Y){if(Y.focus&&Y.type!=="hidden"&&!Y.disabled&&X[Y.tagName.toLowerCase()]){return true;}return false;}return A.getElementsBy(V,null,U);},setFirstLastFocusable:function(){this.firstElement=null;this.lastElement=null;var U=this.getFocusableElements();this.focusableElements=U;if(U.length>0){this.firstElement=U[0];this.lastElement=U[U.length-1];}if(this.cfg.getProperty("modal")){this.setTabLoop(this.firstElement,this.lastElement);}},initEvents:function(){O.superclass.initEvents.call(this);var U=M.LIST;this.showMaskEvent=this.createEvent(D.SHOW_MASK);this.showMaskEvent.signature=U;this.hideMaskEvent=this.createEvent(D.HIDE_MASK);this.hideMaskEvent.signature=U;this.dragEvent=this.createEvent(D.DRAG);this.dragEvent.signature=U;},initDefaultConfig:function(){O.superclass.initDefaultConfig.call(this);this.cfg.addProperty(N.CLOSE.key,{handler:this.configClose,value:N.CLOSE.value,validator:N.CLOSE.validator,supercedes:N.CLOSE.supercedes});this.cfg.addProperty(N.DRAGGABLE.key,{handler:this.configDraggable,value:(F.DD)?true:false,validator:N.DRAGGABLE.validator,supercedes:N.DRAGGABLE.supercedes});this.cfg.addProperty(N.DRAG_ONLY.key,{value:N.DRAG_ONLY.value,validator:N.DRAG_ONLY.validator,supercedes:N.DRAG_ONLY.supercedes});this.cfg.addProperty(N.UNDERLAY.key,{handler:this.configUnderlay,value:N.UNDERLAY.value,supercedes:N.UNDERLAY.supercedes});this.cfg.addProperty(N.MODAL.key,{handler:this.configModal,value:N.MODAL.value,validator:N.MODAL.validator,supercedes:N.MODAL.supercedes});this.cfg.addProperty(N.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:N.KEY_LISTENERS.suppressEvent,supercedes:N.KEY_LISTENERS.supercedes});this.cfg.addProperty(N.STRINGS.key,{value:N.STRINGS.value,handler:this.configStrings,validator:N.STRINGS.validator,supercedes:N.STRINGS.supercedes});},configClose:function(X,V,Y){var Z=V[0],W=this.close,U=this.cfg.getProperty("strings");if(Z){if(!W){if(!C){C=document.createElement("a");C.className="container-close";C.href="#";}W=C.cloneNode(true);this.innerElement.appendChild(W);W.innerHTML=(U&&U.close)?U.close:" ";T.on(W,"click",this._doClose,this,true);this.close=W;}else{W.style.display="block";}}else{if(W){W.style.display="none";}}},_doClose:function(U){T.preventDefault(U);this.hide();},configDraggable:function(V,U,W){var X=U[0];if(X){if(!F.DD){this.cfg.setProperty("draggable",false);return;}if(this.header){A.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",B);}else{if(this.dd){this.dd.unreg();}if(this.header){A.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",B);}},configUnderlay:function(d,c,Z){var b=(this.platform=="mac"&&L.gecko),e=c[0].toLowerCase(),V=this.underlay,W=this.element;function X(){var f=false;if(!V){if(!Q){Q=document.createElement("div");Q.className="underlay";}V=Q.cloneNode(false);this.element.appendChild(V);this.underlay=V;if(P){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}if(L.webkit&&L.webkit<420){this.changeContentEvent.subscribe(this.forceUnderlayRedraw);}f=true;}}function a(){var f=X.call(this);if(!f&&P){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(a);}function Y(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(a);this._underlayDeferred=false;}if(V){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.forceUnderlayRedraw);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(V);this.underlay=null;}}switch(e){case"shadow":A.removeClass(W,"matte");A.addClass(W,"shadow");break;case"matte":if(!b){Y.call(this);}A.removeClass(W,"shadow");A.addClass(W,"matte");break;default:if(!b){Y.call(this);}A.removeClass(W,"shadow");A.removeClass(W,"matte");break;}if((e=="shadow")||(b&&!V)){if(this.cfg.getProperty("visible")){var U=X.call(this);if(!U&&P){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(a);this._underlayDeferred=true;}}}},configModal:function(V,U,X){var W=U[0];if(W){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);H.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);H.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var V=this.mask,U;if(V){this.hideMask();U=V.parentNode;if(U){U.removeChild(V);}this.mask=null;}},configKeyListeners:function(X,U,a){var W=U[0],Z,Y,V;if(W){if(W instanceof Array){Y=W.length;for(V=0;V<Y;V++){Z=W[V];if(!I.alreadySubscribed(this.showEvent,Z.enable,Z)){this.showEvent.subscribe(Z.enable,Z,true);}if(!I.alreadySubscribed(this.hideEvent,Z.disable,Z)){this.hideEvent.subscribe(Z.disable,Z,true);this.destroyEvent.subscribe(Z.disable,Z,true);}}}else{if(!I.alreadySubscribed(this.showEvent,W.enable,W)){this.showEvent.subscribe(W.enable,W,true);}if(!I.alreadySubscribed(this.hideEvent,W.disable,W)){this.hideEvent.subscribe(W.disable,W,true);
+this.destroyEvent.subscribe(W.disable,W,true);}}}},configStrings:function(V,U,W){var X=E.merge(N.STRINGS.value,U[0]);this.cfg.setProperty(N.STRINGS.key,X,true);},configHeight:function(X,V,Y){var U=V[0],W=this.innerElement;A.setStyle(W,"height",U);this.cfg.refireEvent("iframe");},_autoFillOnHeightChange:function(X,V,W){O.superclass._autoFillOnHeightChange.apply(this,arguments);if(P){var U=this;setTimeout(function(){U.sizeUnderlay();},0);}},configWidth:function(X,U,Y){var W=U[0],V=this.innerElement;A.setStyle(V,"width",W);this.cfg.refireEvent("iframe");},configzIndex:function(V,U,X){O.superclass.configzIndex.call(this,V,U,X);if(this.mask||this.cfg.getProperty("modal")===true){var W=A.getStyle(this.element,"zIndex");if(!W||isNaN(W)){W=0;}if(W===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var W=this.element.parentNode,U=this.element,V=document.createElement("div");V.className=O.CSS_PANEL_CONTAINER;V.id=U.id+"_c";if(W){W.insertBefore(V,U);}V.appendChild(U);this.element=V;this.innerElement=U;A.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var V=this.underlay,U;if(V){U=this.element;V.style.width=U.offsetWidth+"px";V.style.height=U.offsetHeight+"px";}},registerDragDrop:function(){var V=this;if(this.header){if(!F.DD){return;}var U=(this.cfg.getProperty("dragonly")===true);this.dd=new F.DD(this.element.id,this.id,{dragOnly:U});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var X,Z,W,c,b,a;if(YAHOO.env.ua.ie==6){A.addClass(V.element,"drag");}if(V.cfg.getProperty("constraintoviewport")){var Y=H.VIEWPORT_OFFSET;X=V.element.offsetHeight;Z=V.element.offsetWidth;W=A.getViewportWidth();c=A.getViewportHeight();b=A.getDocumentScrollLeft();a=A.getDocumentScrollTop();if(X+Y<c){this.minY=a+Y;this.maxY=a+c-X-Y;}else{this.minY=a+Y;this.maxY=a+Y;}if(Z+Y<W){this.minX=b+Y;this.maxX=b+W-Z-Y;}else{this.minX=b+Y;this.maxX=b+Y;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}V.dragEvent.fire("startDrag",arguments);};this.dd."iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}V.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){A.removeClass(V.element,"drag");}V.dragEvent.fire("endDrag",arguments);V.moveEvent.fire(V.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var U=this.mask;if(!U){if(!G){G=document.createElement("div");G.className="mask";G.innerHTML=" ";}U=G.cloneNode(true);U.id=this.id+"_mask";document.body.insertBefore(U,document.body.firstChild);this.mask=U;if(YAHOO.env.ua.gecko&&this.platform=="mac"){A.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";A.removeClass(document.body,"masked");this.hideMaskEvent.fire();}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){A.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){var V=this.mask,W=A.getViewportWidth(),U=A.getViewportHeight();if(V.offsetHeight>U){V.style.height=U+"px";}if(V.offsetWidth>W){V.style.width=W+"px";}V.style.height=A.getDocumentHeight()+"px";V.style.width=A.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var U=A.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(U)&&!isNaN(U)){A.setStyle(this.mask,"zIndex",U-1);}}},render:function(U){return O.superclass.render.call(this,U,this.innerElement);},destroy:function(){H.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){T.purgeElement(this.close);}O.superclass.destroy.call(this);},forceUnderlayRedraw:function(){var U=this.underlay;A.addClass(U,"yui-force-redraw");setTimeout(function(){A.removeClass(U,"yui-force-redraw");},0);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(J,I){YAHOO.widget.Dialog.superclass.constructor.call(this,J,I);};var B=YAHOO.util.Event,G=YAHOO.util.CustomEvent,E=YAHOO.util.Dom,A=YAHOO.widget.Dialog,F=YAHOO.lang,H={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},C={"POST_METHOD":{key:"postmethod",value:"async"},"POST_DATA":{key:"postdata",value:null},"BUTTONS":{key:"buttons",value:"none",supercedes:["visible"]},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};A.CSS_DIALOG="yui-dialog";function D(){var L=this._aButtons,J,K,I;if(F.isArray(L)){J=L.length;if(J>0){I=J-1;do{K=L[I];if(YAHOO.widget.Button&&K instanceof YAHOO.widget.Button){K.destroy();}else{if(K.tagName.toUpperCase()=="BUTTON"){B.purgeElement(K);B.purgeElement(K,false);}}}while(I--);}}}YAHOO.extend(A,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){A.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(C.POST_METHOD.key,{handler:this.configPostMethod,value:C.POST_METHOD.value,validator:function(I){if(I!="form"&&I!="async"&&I!="none"&&I!="manual"){return false;}else{return true;}}});this.cfg.addProperty(C.POST_DATA.key,{value:C.POST_DATA.value});this.cfg.addProperty(C.HIDEAFTERSUBMIT.key,{value:C.HIDEAFTERSUBMIT.value});this.cfg.addProperty(C.BUTTONS.key,{handler:this.configButtons,value:C.BUTTONS.value,supercedes:C.BUTTONS.supercedes});},initEvents:function(){A.superclass.initEvents.call(this);var I=G.LIST;this.beforeSubmitEvent=this.createEvent(H.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=I;this.submitEvent=this.createEvent(H.SUBMIT);this.submitEvent.signature=I;this.manualSubmitEvent=this.createEvent(H.MANUAL_SUBMIT);this.manualSubmitEvent.signature=I;this.asyncSubmitEvent=this.createEvent(H.ASYNC_SUBMIT);
+this.asyncSubmitEvent.signature=I;this.formSubmitEvent=this.createEvent(H.FORM_SUBMIT);this.formSubmitEvent.signature=I;this.cancelEvent=this.createEvent(H.CANCEL);this.cancelEvent.signature=I;},init:function(J,I){A.superclass.init.call(this,J);this.beforeInitEvent.fire(A);E.addClass(this.element,A.CSS_DIALOG);this.cfg.setProperty("visible",false);if(I){this.cfg.applyConfig(I,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(A);},doSubmit:function(){var P=YAHOO.util.Connect,Q=this.form,K=false,N=false,R,M,L,I;switch(this.cfg.getProperty("postmethod")){case"async":R=Q.elements;M=R.length;if(M>0){L=M-1;do{if(R[L].type=="file"){K=true;break;}}while(L--);}if(K&&YAHOO.env.ua.ie&&this.isSecure){N=true;}I=this._getFormAttributes(Q);P.setForm(Q,K,N);var J=this.cfg.getProperty("postdata");var O=P.asyncRequest(I.method,I.action,this.callback,J);this.asyncSubmitEvent.fire(O);break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},_getFormAttributes:function(K){var I={method:null,action:null};if(K){if(K.getAttributeNode){var J=K.getAttributeNode("action");var L=K.getAttributeNode("method");if(J){I.action=J.value;}if(L){I.method=L.value;}}else{I.action=K.getAttribute("action");I.method=K.getAttribute("method");}}I.method=(F.isString(I.method)?I.method:"POST").toUpperCase();I.action=F.isString(I.action)?I.action:"";return I;},registerForm:function(){var I=this.element.getElementsByTagName("form")[0];if(this.form){if(this.form==I&&E.isAncestor(this.element,this.form)){return;}else{B.purgeElement(this.form);this.form=null;}}if(!I){I=document.createElement("form");I.name="frm_"+this.id;this.body.appendChild(I);}if(I){this.form=I;B.on(I,"submit",this._submitHandler,this,true);}},_submitHandler:function(I){B.stopEvent(I);this.submit();this.form.blur();},setTabLoop:function(I,J){I=I||this.firstButton;J=this.lastButton||J;A.superclass.setTabLoop.call(this,I,J);},setFirstLastFocusable:function(){A.superclass.setFirstLastFocusable.call(this);var J,I,K,L=this.focusableElements;this.firstFormElement=null;this.lastFormElement=null;if(this.form&&L&&L.length>0){I=L.length;for(J=0;J<I;++J){K=L[J];if(this.form===K.form){this.firstFormElement=K;break;}}for(J=I-1;J>=0;--J){K=L[J];if(this.form===K.form){this.lastFormElement=K;break;}}}},configClose:function(J,I,K){A.superclass.configClose.apply(this,arguments);},_doClose:function(I){B.preventDefault(I);this.cancel();},configButtons:function(S,R,M){var N=YAHOO.widget.Button,U=R[0],K=this.innerElement,T,P,J,Q,O,I,L;D.call(this);this._aButtons=null;if(F.isArray(U)){O=document.createElement("span");O.className="button-group";Q=U.length;this._aButtons=[];this.defaultHtmlButton=null;for(L=0;L<Q;L++){T=U[L];if(N){J=new N({label:T.text});J.appendTo(O);P=J.get("element");if(T.isDefault){J.addClass("default");this.defaultHtmlButton=P;}if(F.isFunction(T.handler)){J.set("onclick",{fn:T.handler,obj:this,scope:this});}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){J.set("onclick",{fn:T.handler.fn,obj:((!F.isUndefined(T.handler.obj))?T.handler.obj:this),scope:(T.handler.scope||this)});}}this._aButtons[this._aButtons.length]=J;}else{P=document.createElement("button");P.setAttribute("type","button");if(T.isDefault){P.className="default";this.defaultHtmlButton=P;}P.innerHTML=T.text;if(F.isFunction(T.handler)){B.on(P,"click",T.handler,this,true);}else{if(F.isObject(T.handler)&&F.isFunction(T.handler.fn)){B.on(P,"click",T.handler.fn,((!F.isUndefined(T.handler.obj))?T.handler.obj:this),(T.handler.scope||this));}}O.appendChild(P);this._aButtons[this._aButtons.length]=P;}T.htmlButton=P;if(L===0){this.firstButton=P;}if(L==(Q-1)){this.lastButton=P;}}this.setFooter(O);I=this.footer;if(E.inDocument(this.element)&&!E.isAncestor(K,I)){K.appendChild(I);}this.buttonSpan=O;}else{O=this.buttonSpan;I=this.footer;if(O&&I){I.removeChild(O);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.changeContentEvent.fire();},getButtons:function(){return this._aButtons||null;},focusFirst:function(K,I,M){var J=this.firstFormElement;if(I&&I[1]){B.stopEvent(I[1]);}if(J){try{J.focus();}catch(L){}}else{if(this.defaultHtmlButton){this.focusDefaultButton();}else{this.focusFirstButton();}}},focusLast:function(K,I,M){var N=this.cfg.getProperty("buttons"),J=this.lastFormElement;if(I&&I[1]){B.stopEvent(I[1]);}if(N&&F.isArray(N)){this.focusLastButton();}else{if(J){try{J.focus();}catch(L){}}}},_getButton:function(J){var I=YAHOO.widget.Button;if(I&&J&&J.nodeName&&J.id){J=I.getButton(J.id)||J;}return J;},focusDefaultButton:function(){var I=this._getButton(this.defaultHtmlButton);if(I){try{I.focus();}catch(J){}}},blurButtons:function(){var N=this.cfg.getProperty("buttons"),K,M,J,I;if(N&&F.isArray(N)){K=N.length;if(K>0){I=(K-1);do{M=N[I];if(M){J=this._getButton(M.htmlButton);if(J){try{J.blur();}catch(L){}}}}while(I--);}}},focusFirstButton:function(){var L=this.cfg.getProperty("buttons"),K,I;if(L&&F.isArray(L)){K=L[0];if(K){I=this._getButton(K.htmlButton);if(I){try{I.focus();}catch(J){}}}}},focusLastButton:function(){var M=this.cfg.getProperty("buttons"),J,L,I;if(M&&F.isArray(M)){J=M.length;if(J>0){L=M[(J-1)];if(L){I=this._getButton(L.htmlButton);if(I){try{I.focus();}catch(K){}}}}}},configPostMethod:function(J,I,K){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var Y=this.form,K,R,U,M,S,P,O,J,V,L,W,Z,I,N,a,X,T;function Q(c){var b=c.tagName.toUpperCase();return((b=="INPUT"||b=="TEXTAREA"||b=="SELECT")&&c.name==M);}if(Y){K=Y.elements;R=K.length;U={};for(X=0;X<R;X++){M=K[X].name;S=E.getElementsBy(Q,"*",Y);
+P=S.length;if(P>0){if(P==1){S=S[0];O=S.type;J=S.tagName.toUpperCase();switch(J){case"INPUT":if(O=="checkbox"){U[M]=S.checked;}else{if(O!="radio"){U[M]=S.value;}}break;case"TEXTAREA":U[M]=S.value;break;case"SELECT":V=S.options;L=V.length;W=[];for(T=0;T<L;T++){Z=V[T];if(Z.selected){I=Z.value;if(!I||I===""){I=Z.text;}W[W.length]=I;}}U[M]=W;break;}}else{O=S[0].type;switch(O){case"radio":for(T=0;T<P;T++){N=S[T];if(N.checked){U[M]=N.value;break;}}break;case"checkbox":W=[];for(T=0;T<P;T++){a=S[T];if(a.checked){W[W.length]=a.value;}}U[M]=W;break;}}}}}return U;},destroy:function(){D.call(this);this._aButtons=null;var I=this.element.getElementsByTagName("form"),J;if(I.length>0){J=I[0];if(J){B.purgeElement(J);if(J.parentNode){J.parentNode.removeChild(J);}this.form=null;}}A.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML=" ";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(E,H,G,D,F){if(!F){F=YAHOO.util.Anim;}this.overlay=E;this.attrIn=H;this.attrOut=G;this.targetElement=D||E.element;this.animClass=F;};var B=YAHOO.util.Dom,C=YAHOO.util.CustomEvent,A=YAHOO.widget.ContainerEffect;A.FADE=function(D,F){var G=YAHOO.util.Easing,I={attributes:{opacity:{from:0,to:1}},duration:F,method:G.easeIn},E={attributes:{opacity:{to:0}},duration:F,method:G.easeOut},H=new A(D,I,E,D.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(D.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(D.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();L.overlay._setDomVisibility(true);B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.overlay._setDomVisibility(false);B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire(...
[truncated message content] |
|
From: <el...@us...> - 2009-07-31 16:54:38
|
Revision: 9606
http://exist.svn.sourceforge.net/exist/?rev=9606&view=rev
Author: ellefj
Date: 2009-07-31 16:54:29 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] need for yjp-8 notice in bin/run.sh
Modified Paths:
--------------
trunk/eXist/bin/run.sh
Modified: trunk/eXist/bin/run.sh
===================================================================
--- trunk/eXist/bin/run.sh 2009-07-31 15:48:52 UTC (rev 9605)
+++ trunk/eXist/bin/run.sh 2009-07-31 16:54:29 UTC (rev 9606)
@@ -4,7 +4,7 @@
# $Id$
# Usage with profiler:
-usage="run.sh [-a architecture-and-cpu] [-y yjp-home-path] class-to-run\n run.sh -a linux-x86-32 -y /home/ljo/bin/yjp-5.0.9 org.exist.xquery.XPathQueryTest\n"
+usage="run.sh [-a architecture-and-cpu] [-y yjp-home-path] class-to-run\n run.sh -a linux-x86-32 -y /home/ljo/bin/yjp-8.0.13 org.exist.xquery.XPathQueryTest\n\nYou need yjp-8 now to profile since we are using java5+"
index=0
while getopts "a:y:" option
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2009-07-31 15:49:05
|
Revision: 9605
http://exist.svn.sourceforge.net/exist/?rev=9605&view=rev
Author: ellefj
Date: 2009-07-31 15:48:52 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function documentation
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunCount.java
trunk/eXist/src/org/exist/xquery/functions/FunCurrentDateTime.java
trunk/eXist/src/org/exist/xquery/functions/FunData.java
trunk/eXist/src/org/exist/xquery/functions/FunDeepEqual.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCount.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCount.java 2009-07-31 15:05:18 UTC (rev 9604)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCount.java 2009-07-31 15:48:52 UTC (rev 9605)
@@ -1,22 +1,23 @@
-
-/* eXist Native XML Database
- * Copyright (C) 2001-06, Wolfgang M. Meier (wol...@ex...)
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 The eXist Project
+ * http://exist-db.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
+ *
+ * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Id$
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
*/
package org.exist.xquery.functions;
@@ -28,6 +29,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
@@ -39,9 +42,11 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("count", Function.BUILTIN_FUNCTION_NS),
- "Returns the number of items in the argument sequence.",
- new SequenceType[] { new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE) },
- new SequenceType(Type.INTEGER, Cardinality.ONE)
+ "Returns the number of items in the argument sequence, $items.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("items", Type.ITEM, Cardinality.ZERO_OR_MORE, "the items")
+ },
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ONE, "the number of items in the argument sequence")
);
public FunCount(XQueryContext context) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCurrentDateTime.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCurrentDateTime.java 2009-07-31 15:05:18 UTC (rev 9604)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCurrentDateTime.java 2009-07-31 15:48:52 UTC (rev 9605)
@@ -1,27 +1,28 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import org.exist.dom.QName;
import org.exist.xquery.Cardinality;
import org.exist.xquery.Dependency;
@@ -31,6 +32,7 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.DateTimeValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -40,7 +42,7 @@
* @author Wolfgang Meier (wol...@ex...)
*/
public class FunCurrentDateTime extends Function {
-
+ protected static final Logger logger = Logger.getLogger(FunCurrentDateTime.class);
public final static FunctionSignature fnCurrentDateTime =
new FunctionSignature(
new QName("current-dateTime", Function.BUILTIN_FUNCTION_NS),
@@ -48,7 +50,7 @@
"during the evaluation of a query or transformation in which fn:current-dateTime() " +
"is executed.",
null,
- new SequenceType(Type.DATE_TIME, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.DATE_TIME, Cardinality.EXACTLY_ONE, "the date-time current within query execution time span"));
public final static FunctionSignature fnCurrentTime =
new FunctionSignature(
@@ -57,7 +59,7 @@
"some time during the evaluation of a query or transformation " +
"in which fn:current-time() is executed.",
null,
- new SequenceType(Type.TIME, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.TIME, Cardinality.EXACTLY_ONE, "the time current within query execution time span"));
public final static FunctionSignature fnCurrentDate =
new FunctionSignature(
@@ -66,13 +68,17 @@
"time during the evaluation of a query or transformation in which " +
"fn:current-date() is executed.",
null,
- new SequenceType(Type.DATE, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.DATE, Cardinality.EXACTLY_ONE, "the date current within the query execution time span"));
public FunCurrentDateTime(XQueryContext context, FunctionSignature signature) {
super(context, signature);
}
+ public int getDependencies() {
+ return Dependency.CONTEXT_SET;
+ }
+
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
@@ -91,6 +97,7 @@
} else if (isCalledAs("current-time")) {
result = result.convertTo(Type.TIME);
} else {
+ logger.error("can't handle function " + mySignature.getName().getLocalName());
throw new Error("can't handle function " + mySignature.getName().getLocalName());
}
@@ -99,8 +106,4 @@
return result;
}
- public int getDependencies() {
- return Dependency.CONTEXT_SET;
- }
-
}
Modified: trunk/eXist/src/org/exist/xquery/functions/FunData.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunData.java 2009-07-31 15:05:18 UTC (rev 9604)
+++ trunk/eXist/src/org/exist/xquery/functions/FunData.java 2009-07-31 15:48:52 UTC (rev 9605)
@@ -1,23 +1,22 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
@@ -30,6 +29,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceIterator;
@@ -45,10 +46,11 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("data", Function.BUILTIN_FUNCTION_NS),
- "fn:data takes a sequence of items and returns a sequence of atomic values.",
+ "fn:data takes a sequence of items, $items, and returns a sequence of atomic values.",
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE));
+ new FunctionParameterSequenceType("items", Type.ITEM, Cardinality.ZERO_OR_MORE, "the items")
+ },
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE, "atomic values of the items in $items"));
/**
* @param context
@@ -68,7 +70,7 @@
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT SEQUENCE", contextSequence);
if (contextItem != null)
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT ITEM", contextItem.toSequence());
- }
+ }
Sequence arg = getArgument(0).eval(contextSequence, contextItem);
Sequence result;
Modified: trunk/eXist/src/org/exist/xquery/functions/FunDeepEqual.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunDeepEqual.java 2009-07-31 15:05:18 UTC (rev 9604)
+++ trunk/eXist/src/org/exist/xquery/functions/FunDeepEqual.java 2009-07-31 15:48:52 UTC (rev 9605)
@@ -1,25 +1,28 @@
-/* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 The eXist team
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2004-2009 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 program; if not, write to the Free Software Foundation
+ * along with this program; if not, write to the Free Software Foundation
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
+ *
* $Id$
*/
-
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import java.text.Collator;
import org.exist.Namespaces;
@@ -38,6 +41,8 @@
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AtomicValue;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.NumericValue;
@@ -53,29 +58,30 @@
* @author <a href="mailto:pi...@id...">Piotr Kaminski</a>
*/
public class FunDeepEqual extends CollatingFunction {
-
+ protected static final Logger logger = Logger.getLogger(FunDeepEqual.class);
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("deep-equal", Function.BUILTIN_FUNCTION_NS),
- "Returns true iff every item in $a is deep-equal to the item at the same position in $b, " +
- "false otherwise. If both $a and $b are the empty sequence, returns true. ",
+ "Returns true iff every item in $items-1 is deep-equal to the item at the same position in $items-2, " +
+ "false otherwise. If both $items-1 and $items-2 are the empty sequence, returns true(). ",
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)
+ new FunctionParameterSequenceType("items-1", Type.ITEM, Cardinality.ZERO_OR_MORE, "the first item sequence"),
+ new FunctionParameterSequenceType("items-2", Type.ITEM, Cardinality.ZERO_OR_MORE, "the second item sequence")
},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true() if the sequences are deep-equal, false() otherwise")
),
new FunctionSignature(
new QName("deep-equal", Function.BUILTIN_FUNCTION_NS),
- "Returns true iff every item in $a is deep-equal to the item at the same position in $b, " +
- "false otherwise. If both $a and $b are the empty sequence, returns true. " +
- "Comparison collation is specified by $c",
+ "Returns true iff every item in $items-1 is deep-equal to the item at the same position in $items-2, " +
+ "false otherwise. If both $items-1 and $items-2 are the empty sequence, returns true(). " +
+ "Comparison collation is specified by $collation-uri. " +
+ THIRD_REL_COLLATION_ARG_EXAMPLE,
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("items-1", Type.ITEM, Cardinality.ZERO_OR_MORE, "the first item sequence"),
+ new FunctionParameterSequenceType("items-2", Type.ITEM, Cardinality.ZERO_OR_MORE, "the second item sequence"),
+ new FunctionParameterSequenceType("collation-uri", Type.STRING, Cardinality.EXACTLY_ONE, "the collation-uri")
},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true() if the sequences are deep-equal, false() otherwise")
)
};
@@ -87,7 +93,8 @@
return Dependency.CONTEXT_SET | Dependency.CONTEXT_ITEM;
}
- public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
+ public Sequence eval(Sequence contextSequence, Item contextItem)
+ throws XPathException {
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -109,8 +116,8 @@
if (!deepEquals(args[0].itemAt(i), args[1].itemAt(i), collator)) {
result = BooleanValue.FALSE;
break;
- }
- }
+ }
+ }
}
if (context.getProfiler().isEnabled())
@@ -130,7 +137,7 @@
AtomicValue bv = (AtomicValue) b;
if (Type.subTypeOf(av.getType(), Type.NUMBER) && Type.subTypeOf(bv.getType(), Type.NUMBER)) {
//or if both values are NaN
- if (((NumericValue)a).isNaN() && ((NumericValue)b).isNaN())
+ if (((NumericValue) a).isNaN() && ((NumericValue) b).isNaN())
return true;
}
return ValueComparison.compareAtomic(
@@ -175,9 +182,13 @@
case Type.COMMENT:
return safeEquals(nva.getStringValue(), nvb.getStringValue());
- default: throw new RuntimeException("unexpected item type " + Type.getTypeName(a.getType()));
+ default: {
+ logger.error("unexpected item type " + Type.getTypeName(a.getType()));
+ throw new RuntimeException("unexpected item type " + Type.getTypeName(a.getType()));
+ }
}
} catch (XPathException e) {
+ logger.error(e.getMessage());
e.printStackTrace();
return false;
}
@@ -211,8 +222,10 @@
case Node.ELEMENT_NODE:
if (!compareElements(a, b)) return false;
break;
- default:
- throw new RuntimeException("unexpected node type " + nodeTypeA);
+ default: {
+ logger.error("unexpected node type " + nodeTypeA);
+ throw new RuntimeException("unexpected node type " + nodeTypeA);
+ }
}
a = findNextTextOrElementNode(a.getNextSibling());
b = findNextTextOrElementNode(b.getNextSibling());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-07-31 15:05:28
|
Revision: 9604
http://exist.svn.sourceforge.net/exist/?rev=9604&view=rev
Author: wolfgang_m
Date: 2009-07-31 15:05:18 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] Lucene index: documented regex query.
Modified Paths:
--------------
trunk/eXist/webapp/lucene.xml
Modified: trunk/eXist/webapp/lucene.xml
===================================================================
--- trunk/eXist/webapp/lucene.xml 2009-07-31 13:00:42 UTC (rev 9603)
+++ trunk/eXist/webapp/lucene.xml 2009-07-31 15:05:18 UTC (rev 9604)
@@ -414,6 +414,37 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><sgmltag>wildcard</sgmltag></term>
+ <listitem>
+ <para>A string with a '*' wildcard in it, which will be matched
+ against the terms of a document. Can be used instead of a <sgmltag>term</sgmltag>
+ element. For example:</para>
+ <synopsis language="xquery"><![CDATA[let $query :=
+ <query>
+ <term>nation</term><wildcard>miser*</wildcard>
+ </query>
+return
+//SPEECH[ft:query(., $query)]]]></synopsis>
+
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><sgmltag>regex</sgmltag></term>
+ <listitem>
+ <para>A regular expression which will be matched against the terms
+ of a document. Can be used instead of a <sgmltag>term</sgmltag>
+ element. For example:</para>
+ <synopsis language="xquery"><![CDATA[let $query :=
+ <query>
+ <term>nation</term><regex>miser.*</regex>
+ </query>
+return
+//SPEECH[ft:query(., $query)]]]></synopsis>
+
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>
<sgmltag>bool</sgmltag>
</term>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2009-07-31 13:11:47
|
Revision: 9603
http://exist.svn.sourceforge.net/exist/?rev=9603&view=rev
Author: ellefj
Date: 2009-07-31 13:00:42 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function documentation for xpath-functions
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/CollatingFunction.java
trunk/eXist/src/org/exist/xquery/functions/FunCompare.java
trunk/eXist/src/org/exist/xquery/functions/FunConcat.java
trunk/eXist/src/org/exist/xquery/functions/FunContains.java
Modified: trunk/eXist/src/org/exist/xquery/functions/CollatingFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/CollatingFunction.java 2009-07-31 11:10:49 UTC (rev 9602)
+++ trunk/eXist/src/org/exist/xquery/functions/CollatingFunction.java 2009-07-31 13:00:42 UTC (rev 9603)
@@ -35,7 +35,11 @@
* @author wolf
*/
public abstract class CollatingFunction extends Function {
-
+ public final static String THIRD_REL_COLLATION_ARG_EXAMPLE = "The third argument $collation-uri is relative so you only need to " +
+ "specify the last part of a valid full collation-uri, e.g. " +
+ "'?lang=sv-SE', " +
+ "'lang=sv-SE;strength=primary;decomposition=standard' "+
+ "or 'swedish'.";
/**
* @param context
* @param signature
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCompare.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCompare.java 2009-07-31 11:10:49 UTC (rev 9602)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCompare.java 2009-07-31 13:00:42 UTC (rev 9603)
@@ -70,11 +70,7 @@
"-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal " +
"to $string-2, 1 if $string-1 is superior to $string-2. " +
"If either comparand is the empty sequence, the empty sequence is returned. " +
- "The third argument $collation-uri is relative so you only need to " +
- "specify the last part of a valid full collation-uri, e.g. " +
- "'?lang=sv-SE', " +
- "'lang=sv-SE;strength=primary;decomposition=standard' "+
- "or 'swedish'.",
+ THIRD_REL_COLLATION_ARG_EXAMPLE,
new SequenceType[] {
new FunctionParameterSequenceType("string-1", Type.STRING, Cardinality.ZERO_OR_ONE, "the first string"),
new FunctionParameterSequenceType("string-2", Type.STRING, Cardinality.ZERO_OR_ONE, "the second string"),
Modified: trunk/eXist/src/org/exist/xquery/functions/FunConcat.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunConcat.java 2009-07-31 11:10:49 UTC (rev 9602)
+++ trunk/eXist/src/org/exist/xquery/functions/FunConcat.java 2009-07-31 13:00:42 UTC (rev 9603)
@@ -1,28 +1,28 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * Copyright (C) 2001-2009 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 program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id$
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
*/
-
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import java.util.Iterator;
import java.util.List;
@@ -39,6 +39,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.util.Error;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -50,19 +52,19 @@
*
*/
public class FunConcat extends Function {
-
+ protected static final Logger logger = Logger.getLogger(FunConcat.class);
public final static FunctionSignature signature =
new FunctionSignature(
new QName("concat", Function.BUILTIN_FUNCTION_NS),
- "Accepts two or more xdt:anyAtomicType arguments and converts them " +
+ "Accepts two or more xdt:anyAtomicType arguments, $atomizable-values, and converts them " +
"to xs:string. Returns the xs:string that is the concatenation of the values " +
"of its arguments after conversion. If any of the arguments is the empty sequence, " +
"the argument is treated as the zero-length string.",
new SequenceType[] {
//More complicated : see below
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE)
+ new FunctionParameterSequenceType("atomizable-values", Type.ATOMIC, Cardinality.ZERO_OR_ONE, "the atomizable values")
},
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.ZERO_OR_ONE, "the concatenated values"),
true
);
@@ -111,18 +113,20 @@
context.getProfiler().message(this, Profiler.START_SEQUENCES, "CONTEXT ITEM", contextItem.toSequence());
}
- if(getArgumentCount() < 2)
+ if(getArgumentCount() < 2) {
+ logger.error("fn:concat() requires at least two arguments");
throw new XPathException (this, "concat requires at least two arguments");
+ }
- StringBuilder concat = new StringBuilder();
- for (int i = 0; i < getArgumentCount(); i++) {
+ StringBuilder concat = new StringBuilder();
+ for (int i = 0; i < getArgumentCount(); i++) {
concat.append(getArgument(i).eval(contextSequence, contextItem).getStringValue());
}
Sequence result = new StringValue(concat.toString());
- if (context.getProfiler().isEnabled())
- context.getProfiler().end(this, "", result);
+ if (context.getProfiler().isEnabled())
+ context.getProfiler().end(this, "", result);
- return result;
+ return result;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/FunContains.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunContains.java 2009-07-31 11:10:49 UTC (rev 9602)
+++ trunk/eXist/src/org/exist/xquery/functions/FunContains.java 2009-07-31 13:00:42 UTC (rev 9603)
@@ -1,23 +1,22 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-04 Wolfgang M. Meier
- * wol...@ex...
- * http://exist.sourceforge.net
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
@@ -35,6 +34,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -45,29 +46,29 @@
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("contains", Function.BUILTIN_FUNCTION_NS),
- "Returns an xs:boolean indicating whether or not the value of $arg1 " +
+ "Returns an xs:boolean indicating whether or not the value of $source-string " +
"contains (at the beginning, at the end, or anywhere within) at least " +
"one sequence of collation units that provides a minimal match to the " +
- "collation units in the value of $arg2, according to the default collation.",
+ "collation units in the value of $substring, according to the default collation.",
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
+ new FunctionParameterSequenceType("source-string", Type.STRING, Cardinality.ZERO_OR_ONE, "the source-string"),
+ new FunctionParameterSequenceType("substring", Type.STRING, Cardinality.ZERO_OR_ONE, "the substring")
},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)),
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true() if $source-string contains $substring, false() otherwise")),
new FunctionSignature(
new QName("contains", Function.BUILTIN_FUNCTION_NS),
- "Returns an xs:boolean indicating whether or not the value of $arg1 " +
+ "Returns an xs:boolean indicating whether or not the value of $source-string " +
"contains (at the beginning, at the end, or anywhere within) at least " +
"one sequence of collation units that provides a minimal match to the " +
- "collation units in the value of $arg2, according to the collation that is " +
- "specified in $arg3.",
+ "collation units in the value of $substring, according to the collation that is " +
+ "specified in $collation-uri." + THIRD_REL_COLLATION_ARG_EXAMPLE,
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("source-string", Type.STRING, Cardinality.ZERO_OR_ONE, "the source-string"),
+ new FunctionParameterSequenceType("substring", Type.STRING, Cardinality.ZERO_OR_ONE, "the substring"),
+ new FunctionParameterSequenceType("collation-uri", Type.STRING, Cardinality.EXACTLY_ONE, "the collation-uri")
},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE))
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true() if $source-string contains $substring, false() otherwise"))
};
public FunContains(XQueryContext context, FunctionSignature signature) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2009-07-31 11:11:13
|
Revision: 9602
http://exist.svn.sourceforge.net/exist/?rev=9602&view=rev
Author: ellefj
Date: 2009-07-31 11:10:49 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function documentation for xpath-functions
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunCodepointsToString.java
trunk/eXist/src/org/exist/xquery/functions/FunCompare.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCodepointsToString.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCodepointsToString.java 2009-07-31 08:59:42 UTC (rev 9601)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCodepointsToString.java 2009-07-31 11:10:49 UTC (rev 9602)
@@ -1,27 +1,28 @@
/*
- * eXist Open Source Native XML Database
- * Copyright (C) 2001-04 The eXist Team
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2005-2009 The eXist Project
+ * http://exist-db.org
*
- * 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 free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
* $Id$
*/
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import org.exist.dom.QName;
import org.exist.util.XMLChar;
import org.exist.xquery.BasicFunction;
@@ -32,6 +33,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.NumericValue;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceIterator;
@@ -39,18 +42,23 @@
import org.exist.xquery.value.StringValue;
import org.exist.xquery.value.Type;
+/**
+ *
+ * @author wolf
+ *
+ */
public class FunCodepointsToString extends BasicFunction {
-
+ protected static final Logger logger = Logger.getLogger(FunCodepointsToString.class);
public final static FunctionSignature signature =
new FunctionSignature(
new QName("codepoints-to-string", Function.BUILTIN_FUNCTION_NS, ModuleImpl.PREFIX),
"Creates an xs:string from a sequence of code points. Returns the zero-length string if " +
- "$a is the empty sequence. If any of the code points in $a is not a legal XML character, " +
+ "$codepoints is the empty sequence. If any of the code points in $codepoints is not a legal XML character, " +
"an error is raised",
new SequenceType[] {
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_MORE),
+ new FunctionParameterSequenceType("codepoints", Type.INTEGER, Cardinality.ZERO_OR_MORE, "the codepoints as a sequence of xs:integer values"),
},
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "the string constructed from the codepoints if valid"));
public FunCodepointsToString(XQueryContext context) {
super(context, signature);
@@ -72,6 +80,9 @@
for (SequenceIterator i = args[0].iterate(); i.hasNext(); ) {
long next = ((NumericValue)i.nextItem()).getLong();
if (next < 0 || next > Integer.MAX_VALUE || !XMLChar.isValid((int)next)) {
+ logger.error("err:FOCH0001: Codepoint " +
+ next +
+ " is not a valid character.");
throw new XPathException(this, "err:FOCH0001: Codepoint " + next +
" is not a valid character.");
}
@@ -79,8 +90,8 @@
buf.append((char)next);
}
else { // output a surrogate pair
- buf.append(XMLChar.highSurrogate((int)next));
- buf.append(XMLChar.lowSurrogate((int)next));
+ buf.append(XMLChar.highSurrogate((int) next));
+ buf.append(XMLChar.lowSurrogate((int) next));
}
}
result = new StringValue(buf.toString());
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCompare.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCompare.java 2009-07-31 08:59:42 UTC (rev 9601)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCompare.java 2009-07-31 11:10:49 UTC (rev 9602)
@@ -1,23 +1,24 @@
-/* eXist Open Source Native XML Database
- * Copyright (C) 2000-03, Wolfgang M. Meier (me...@if...)
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2005-2009 The eXist Project
+ * http://exist-db.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
+ *
+ * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * GNU Lesser General Public License for more details.
*
- * $Id$
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
*/
-
package org.exist.xquery.functions;
import java.text.Collator;
@@ -32,30 +33,54 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.Type;
+/**
+ *
+ * @author perig
+ * @author ljo
+ *
+ */
public class FunCompare extends CollatingFunction {
public final static FunctionSignature signatures[] = {
new FunctionSignature (
new QName("compare", Function.BUILTIN_FUNCTION_NS),
+ "Returns the collatable comparison between $string-1 and $string-2, " +
+ "-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal " +
+ "to $string-2, 1 if $string-1 is superior to $string-2. " +
+ "If either comparand is the empty sequence, the empty sequence is " +
+ "returned. " +
+ "Remember to specify the collation in the context or as third " +
+ "argument if you dont want the system default.",
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
+ new FunctionParameterSequenceType("string-1", Type.STRING, Cardinality.ZERO_OR_ONE, "the first string"),
+ new FunctionParameterSequenceType("string-2", Type.STRING, Cardinality.ZERO_OR_ONE, "the second string")
},
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE)),
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE, "-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned.")),
new FunctionSignature (
new QName("compare", Function.BUILTIN_FUNCTION_NS),
+ "Returns the collatable comparison between $string-1 and $string-2, " +
+ "-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal " +
+ "to $string-2, 1 if $string-1 is superior to $string-2. " +
+ "If either comparand is the empty sequence, the empty sequence is returned. " +
+ "The third argument $collation-uri is relative so you only need to " +
+ "specify the last part of a valid full collation-uri, e.g. " +
+ "'?lang=sv-SE', " +
+ "'lang=sv-SE;strength=primary;decomposition=standard' "+
+ "or 'swedish'.",
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("string-1", Type.STRING, Cardinality.ZERO_OR_ONE, "the first string"),
+ new FunctionParameterSequenceType("string-2", Type.STRING, Cardinality.ZERO_OR_ONE, "the second string"),
+ new FunctionParameterSequenceType("collation-uri", Type.STRING, Cardinality.EXACTLY_ONE, "a relative collation-uri")
},
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE))
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE, "-1 if $string-1 is inferior to $string-2, 0 if $string-1 is equal to $string-2, 1 if $string-1 is superior to $string-2. If either comparand is the empty sequence, the empty sequence is returned."))
};
public FunCompare(XQueryContext context, FunctionSignature signature) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-07-31 08:59:48
|
Revision: 9601
http://exist.svn.sourceforge.net/exist/?rev=9601&view=rev
Author: wolfgang_m
Date: 2009-07-31 08:59:42 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] XSLTServlet again passes request attributes to stylesheet, but only those with a name starting with "xslt.". This fixes the problems introduced with rev 9580.
Revision Links:
--------------
http://exist.svn.sourceforge.net/exist/?rev=9580&view=rev
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java
trunk/eXist/src/org/exist/memtree/TextImpl.java
trunk/eXist/webapp/controller.xql
trunk/eXist/webapp/stylesheets/doc2html-2.xsl
trunk/eXist/webapp/xquery/controller.xql
Modified: trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java
===================================================================
--- trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java 2009-07-31 08:41:05 UTC (rev 9600)
+++ trunk/eXist/src/org/exist/http/servlets/XSLTServlet.java 2009-07-31 08:59:42 UTC (rev 9601)
@@ -42,6 +42,7 @@
import org.exist.dom.DocumentImpl;
import org.exist.collections.Collection;
import org.exist.EXistException;
+import org.exist.memtree.NodeImpl;
import org.exist.util.serializer.Receiver;
import org.exist.util.serializer.ReceiverToSAX;
import org.exist.util.serializer.SAXToReceiver;
@@ -81,6 +82,11 @@
public class XSLTServlet extends HttpServlet {
+ private final static String REQ_ATTRIBUTE_PREFIX = "xslt.";
+
+ private final static String REQ_ATTRIBUTE_STYLESHEET = "xslt.stylesheet";
+ private final static String REQ_ATTRIBUTE_INPUT = "xslt.input";
+
private final static Logger LOG = Logger.getLogger(XSLTServlet.class);
private BrokerPool pool;
@@ -88,12 +94,12 @@
private final Map cache = new HashMap();
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- String stylesheet = (String) request.getAttribute("xslt.stylesheet");
+ String stylesheet = (String) request.getAttribute(REQ_ATTRIBUTE_STYLESHEET);
if (stylesheet == null)
throw new ServletException("No stylesheet source specified!");
Item inputNode = null;
- String sourceAttrib = (String) request.getAttribute("xslt.input");
+ String sourceAttrib = (String) request.getAttribute(REQ_ATTRIBUTE_INPUT);
if (sourceAttrib != null) {
Object sourceObj = request.getAttribute(sourceAttrib);
if (sourceObj != null) {
@@ -135,7 +141,7 @@
OutputStream bufferedOutputStream = new BufferedOutputStream(os);
StreamResult result = new StreamResult(bufferedOutputStream);
TransformerHandler handler = factory.newTransformerHandler(templates);
-// setParameters(request, handler.getTransformer());
+ setParameters(request, handler.getTransformer());
handler.setResult(result);
String mediaType = handler.getTransformer().getOutputProperty("media-type");
String encoding = handler.getTransformer().getOutputProperty("encoding");
@@ -216,11 +222,20 @@
return cached.getTemplates(user);
}
- private void setParameters(HttpServletRequest request, Transformer transformer) {
+ private void setParameters(HttpServletRequest request, Transformer transformer) throws XPathException {
for (Enumeration e = request.getAttributeNames(); e.hasMoreElements(); ) {
String name = (String) e.nextElement();
- Object value = request.getAttribute(name);
- transformer.setParameter(name, value);
+ if (name.startsWith(REQ_ATTRIBUTE_PREFIX) &&
+ !(REQ_ATTRIBUTE_INPUT.equals(name) || REQ_ATTRIBUTE_STYLESHEET.equals(name))) {
+ Object value = request.getAttribute(name);
+ if (value instanceof NodeValue) {
+ NodeValue nv = (NodeValue) value;
+ if (nv.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
+ value = nv.toMemNodeSet();
+ }
+ }
+ transformer.setParameter(name, value);
+ }
}
}
Modified: trunk/eXist/src/org/exist/memtree/TextImpl.java
===================================================================
--- trunk/eXist/src/org/exist/memtree/TextImpl.java 2009-07-31 08:41:05 UTC (rev 9600)
+++ trunk/eXist/src/org/exist/memtree/TextImpl.java 2009-07-31 08:59:42 UTC (rev 9601)
@@ -32,8 +32,12 @@
public TextImpl(DocumentImpl doc, int nodeNumber) {
super(doc, nodeNumber);
}
-
- public String getStringValue() {
+
+ public boolean hasChildNodes() {
+ return false;
+ }
+
+ public String getStringValue() {
//Quick and (not so ?) dirty...
return getData();
}
Modified: trunk/eXist/webapp/controller.xql
===================================================================
--- trunk/eXist/webapp/controller.xql 2009-07-31 08:41:05 UTC (rev 9600)
+++ trunk/eXist/webapp/controller.xql 2009-07-31 08:59:42 UTC (rev 9601)
@@ -37,11 +37,11 @@
<dispatch xmlns="" rel="nofollow">http://exist.sourceforge.net/NS/exist">
<!-- query results are passed to XSLT servlet via request attribute -->
<set-attribute name="xquery.attribute"
- value="xslt.model"/>
+ value="model"/>
<view>
<forward servlet="XSLTServlet">
<set-attribute name="xslt.input"
- value="xslt.model"/>
+ value="model"/>
<set-attribute name="xslt.stylesheet"
value="apps/applications.xsl"/>
</forward>
@@ -58,12 +58,12 @@
<forward url="/xquery/exist-articles.xql">
<!-- query results are passed to XSLT servlet via request attribute -->
<set-attribute name="xquery.attribute"
- value="xslt.model"/>
+ value="model"/>
</forward>
<view>
<forward servlet="XSLTServlet">
<set-attribute name="xslt.input"
- value="xslt.model"/>
+ value="model"/>
<set-attribute name="xslt.stylesheet"
value="stylesheets/db2html.xsl"/>
</forward>
@@ -99,7 +99,7 @@
<forward servlet="XSLTServlet">
<set-attribute name="xslt.stylesheet"
value="{$stylesheet}"/>
- <set-attribute name="exist.version"
+ <set-attribute name="xslt.exist.version"
value="{system:get-version()}-rev{system:get-revision()}-{system:get-build()}"/>
</forward>
</view>
Modified: trunk/eXist/webapp/stylesheets/doc2html-2.xsl
===================================================================
--- trunk/eXist/webapp/stylesheets/doc2html-2.xsl 2009-07-31 08:41:05 UTC (rev 9600)
+++ trunk/eXist/webapp/stylesheets/doc2html-2.xsl 2009-07-31 08:59:42 UTC (rev 9601)
@@ -7,7 +7,7 @@
xmlns:dc="http://purl.org/dc/elements/1.1/"
version="1.0">
- <xsl:param name="exist.version"/>
+ <xsl:param name="xslt.exist.version"/>
<!-- used by multi-form pages -->
<xsl:param name="page"/>
@@ -67,7 +67,7 @@
<input type="submit" value="Search"/>
</form>
</div>
- <div id="version-info">Site based on: <xsl:value-of select="$exist.version"/></div>
+ <div id="version-info">Site based on: <xsl:value-of select="$xslt.exist.version"/></div>
<div id="navbar">
<xsl:apply-templates select="sidebar:sidebar/sidebar:toolbar"/>
<h1><xsl:value-of select="header/title"/></h1>
Modified: trunk/eXist/webapp/xquery/controller.xql
===================================================================
--- trunk/eXist/webapp/xquery/controller.xql 2009-07-31 08:41:05 UTC (rev 9600)
+++ trunk/eXist/webapp/xquery/controller.xql 2009-07-31 08:59:42 UTC (rev 9601)
@@ -13,12 +13,12 @@
<forward url="{$path}">
<!-- query results are passed to XSLT servlet via request attribute -->
<set-attribute name="xquery.attribute"
- value="xslt.model"/>
+ value="model"/>
</forward>
<view>
<forward servlet="XSLTServlet">
<set-attribute name="xslt.input"
- value="xslt.model"/>
+ value="model"/>
<set-attribute name="xslt.stylesheet"
value="stylesheets/db2html.xsl"/>
</forward>
@@ -28,11 +28,11 @@
<dispatch xmlns="" rel="nofollow">http://exist.sourceforge.net/NS/exist">
<!-- query results are passed to XSLT servlet via request attribute -->
<set-attribute name="xquery.attribute"
- value="xslt.model"/>
+ value="model"/>
<view>
<forward servlet="XSLTServlet">
<set-attribute name="xslt.input"
- value="xslt.model"/>
+ value="model"/>
<set-attribute name="xslt.stylesheet"
value="xquery/stylesheets/acronyms.xsl"/>
</forward>
@@ -60,11 +60,11 @@
if ($display eq "details") then "detailed.xsl" else "overview.xsl"
return
<dispatch xmlns="" rel="nofollow">http://exist.sourceforge.net/NS/exist">
- <set-attribute name="xquery.attribute" value="xslt.model"/>
+ <set-attribute name="xquery.attribute" value="model"/>
<view>
<forward servlet="XSLTServlet">
<set-attribute name="xslt.input"
- value="xslt.model"/>
+ value="model"/>
<set-attribute name="xslt.stylesheet"
value="xquery/stylesheets/{$xsl}"/>
</forward>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2009-07-31 08:41:13
|
Revision: 9600
http://exist.svn.sourceforge.net/exist/?rev=9600&view=rev
Author: ellefj
Date: 2009-07-31 08:41:05 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function documentation for xpath-functions
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunBaseURI.java
trunk/eXist/src/org/exist/xquery/functions/FunBoolean.java
trunk/eXist/src/org/exist/xquery/functions/FunCeiling.java
trunk/eXist/src/org/exist/xquery/functions/FunCodepointEqual.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunBaseURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunBaseURI.java 2009-07-31 05:46:38 UTC (rev 9599)
+++ trunk/eXist/src/org/exist/xquery/functions/FunBaseURI.java 2009-07-31 08:41:05 UTC (rev 9600)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2007 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -21,6 +21,8 @@
*/
package org.exist.xquery.functions;
+import org.apache.log4j.Logger;
+
import java.net.URI;
import java.net.URISyntaxException;
@@ -36,6 +38,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AnyURIValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
@@ -47,28 +51,28 @@
* @author wolf
*/
public class FunBaseURI extends BasicFunction {
-
+ protected static final Logger logger = Logger.getLogger(FunBaseURI.class);
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("base-uri", Function.BUILTIN_FUNCTION_NS),
"Returns the value of the base-uri property for the context item.",
null,
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE, "the base-uri from the context item")
),
new FunctionSignature(
new QName("base-uri", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of the base-uri property for $a. If $a is the empty " +
+ "Returns the value of the base-uri property for $uri. If $uri is the empty " +
"sequence, the empty sequence is returned.",
new SequenceType[] {
- new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE)
+ new FunctionParameterSequenceType("uri", Type.NODE, Cardinality.ZERO_OR_ONE, "the uri") },
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE, "the base-uri from $uri")
),
new FunctionSignature(
new QName("static-base-uri", Function.BUILTIN_FUNCTION_NS),
"Returns the value of the base-uri property from the static context. " +
"If the base-uri property is undefined, the empty sequence is returned.",
null,
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE, "the base-uri from the static context")
)
};
@@ -103,11 +107,15 @@
}
} else {
if (args.length == 0) {
- if (contextSequence == null || contextSequence.isEmpty())
+ if (contextSequence == null || contextSequence.isEmpty()) {
+ logger.error("err:XPDY0002: context sequence is empty and no argument specified");
throw new XPathException(this, "err:XPDY0002: context sequence is empty and no argument specified");
+ }
Item item = contextSequence.itemAt(0);
- if (!Type.subTypeOf(item.getType(), Type.NODE))
+ if (!Type.subTypeOf(item.getType(), Type.NODE)) {
+ logger.error("err:XPTY0004: context item is not a node");
throw new XPathException(this, "err:XPTY0004: context item is not a node");
+ }
node = (NodeValue) item;
} else {
if (args[0].isEmpty()) {
@@ -129,15 +137,16 @@
//The base-uri property of the node is empty.
//The parent property of the node is empty.
if (type == Node.PROCESSING_INSTRUCTION_NODE) {
- result = Sequence.EMPTY_SEQUENCE;
+ result = Sequence.EMPTY_SEQUENCE;
} else if (type == Node.ELEMENT_NODE || type == Node.DOCUMENT_NODE) {
- //Only elements, document nodes have a base-uri
+ //Only elements, document nodes have a base-uri
URI relativeURI;
URI baseURI;
try {
relativeURI = new URI(domNode.getBaseURI());
baseURI = new URI(context.getBaseURI() + "/");
} catch (URISyntaxException e) {
+ logger.error(e.getMessage());
throw new XPathException(this, e.getMessage(), e);
}
if (!"".equals(relativeURI.toString())) {
@@ -161,10 +170,11 @@
URI relativeURI;
URI baseURI;
try {
- org.exist.dom.NodeImpl baseNode = (org.exist.dom.NodeImpl)proxy.getNode();
+ org.exist.dom.NodeImpl baseNode = (org.exist.dom.NodeImpl) proxy.getNode();
relativeURI = new URI(baseNode.getBaseURI());
baseURI = new URI(context.getBaseURI() + "/");
} catch (URISyntaxException e) {
+ logger.error(e.getMessage());
throw new XPathException(this, e.getMessage(), e);
}
if (relativeURI.isAbsolute()) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunBoolean.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunBoolean.java 2009-07-31 05:46:38 UTC (rev 9599)
+++ trunk/eXist/src/org/exist/xquery/functions/FunBoolean.java 2009-07-31 08:41:05 UTC (rev 9600)
@@ -1,23 +1,24 @@
-/* eXist Native XML Database
- * Copyright (C) 2000-03, Wolfgang M. Meier (wol...@ex...)
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 The eXist Project
+ * http://exist-db.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
+ *
+ * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * GNU Lesser General Public License for more details.
*
- * $Id$
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
*/
-
package org.exist.xquery.functions;
import org.exist.dom.QName;
@@ -29,6 +30,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -44,8 +47,10 @@
new FunctionSignature(
new QName("boolean", Function.BUILTIN_FUNCTION_NS),
"Computes the xs:boolean value of the sequence argument.",
- new SequenceType[] { new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE) },
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)
+ new SequenceType[] {
+ new FunctionParameterSequenceType("items", Type.ITEM, Cardinality.ZERO_OR_MORE, "the items")
+ },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "the boolean value, ebv, of the items")
);
public FunBoolean(XQueryContext context) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCeiling.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCeiling.java 2009-07-31 05:46:38 UTC (rev 9599)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCeiling.java 2009-07-31 08:41:05 UTC (rev 9600)
@@ -1,21 +1,23 @@
-/* eXist Open Source Native XML Database
- * Copyright (C) 2001-06, Wolfgang M. Meier (wol...@ex...)
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 The eXist Project
+ * http://exist-db.org
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
+ *
+ * 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 Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * GNU Lesser General Public License for more details.
*
- * $Id$
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
*/
package org.exist.xquery.functions;
@@ -27,6 +29,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NumericValue;
import org.exist.xquery.value.Sequence;
@@ -40,9 +44,11 @@
new QName("ceiling", Function.BUILTIN_FUNCTION_NS),
"Returns a value of the same type as the argument. Specifically, " +
"returns the smallest (closest to negative infinity) number " +
- "with no fractional part that is not less than the value of the argument.",
- new SequenceType[] { new SequenceType(Type.NUMBER, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.NUMBER, Cardinality.ONE)
+ "with no fractional part that is not less than the value of the argument, $number.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("number", Type.NUMBER, Cardinality.ZERO_OR_ONE, "the number")
+ },
+ new FunctionReturnSequenceType(Type.NUMBER, Cardinality.ONE, "the non-fractional number not less than $number")
);
public FunCeiling(XQueryContext context) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunCodepointEqual.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunCodepointEqual.java 2009-07-31 05:46:38 UTC (rev 9599)
+++ trunk/eXist/src/org/exist/xquery/functions/FunCodepointEqual.java 2009-07-31 08:41:05 UTC (rev 9600)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-06 The eXist Project
+ * Copyright (C) 2006-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -32,22 +32,29 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionReturnSequenceType;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.Type;
+/**
+ *
+ * @author perig
+ *
+ */
public class FunCodepointEqual extends BasicFunction {
public final static FunctionSignature signature =
new FunctionSignature(
new QName("codepoint-equal", Function.BUILTIN_FUNCTION_NS, ModuleImpl.PREFIX),
- "Returns true or false depending on whether the value of $a is equal to the value of $b, " +
+ "Returns true or false depending on whether the value of $string-1 is equal to the value of $string-2, " +
"according to the Unicode code point collation",
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
+ new FunctionParameterSequenceType("string-1", Type.STRING, Cardinality.ZERO_OR_ONE, "the first string"),
+ new FunctionParameterSequenceType("string-2", Type.STRING, Cardinality.ZERO_OR_ONE, "the second string"),
},
- new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE));
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE, "true() if the codepoints are equal, false() otherwise"));
public FunCodepointEqual(XQueryContext context) {
super(context, signature);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-31 05:46:46
|
Revision: 9599
http://exist.svn.sourceforge.net/exist/?rev=9599&view=rev
Author: ixitar
Date: 2009-07-31 05:46:38 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] removing all of the logger calls for entering and exiting from the function modules.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/request/GetContextPath.java
trunk/eXist/src/org/exist/xquery/functions/request/GetCookieNames.java
trunk/eXist/src/org/exist/xquery/functions/request/GetCookieValue.java
trunk/eXist/src/org/exist/xquery/functions/request/GetData.java
trunk/eXist/src/org/exist/xquery/functions/request/GetExists.java
trunk/eXist/src/org/exist/xquery/functions/request/GetHeader.java
trunk/eXist/src/org/exist/xquery/functions/request/GetHeaderNames.java
trunk/eXist/src/org/exist/xquery/functions/request/GetHostname.java
trunk/eXist/src/org/exist/xquery/functions/request/GetMethod.java
trunk/eXist/src/org/exist/xquery/functions/request/GetParameter.java
trunk/eXist/src/org/exist/xquery/functions/request/GetParameterNames.java
trunk/eXist/src/org/exist/xquery/functions/request/GetPathInfo.java
trunk/eXist/src/org/exist/xquery/functions/request/GetQueryString.java
trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteAddr.java
trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteHost.java
trunk/eXist/src/org/exist/xquery/functions/request/GetRemotePort.java
trunk/eXist/src/org/exist/xquery/functions/request/GetRequestAttribute.java
trunk/eXist/src/org/exist/xquery/functions/request/GetServerName.java
trunk/eXist/src/org/exist/xquery/functions/request/GetServerPort.java
trunk/eXist/src/org/exist/xquery/functions/request/GetURI.java
trunk/eXist/src/org/exist/xquery/functions/request/GetURL.java
trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFile.java
trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileName.java
trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileSize.java
trunk/eXist/src/org/exist/xquery/functions/request/SetAttribute.java
trunk/eXist/src/org/exist/xquery/functions/session/Clear.java
trunk/eXist/src/org/exist/xquery/functions/session/Create.java
trunk/eXist/src/org/exist/xquery/functions/session/EncodeURL.java
trunk/eXist/src/org/exist/xquery/functions/session/GetAttribute.java
trunk/eXist/src/org/exist/xquery/functions/session/GetAttributeNames.java
trunk/eXist/src/org/exist/xquery/functions/session/GetExists.java
trunk/eXist/src/org/exist/xquery/functions/session/GetID.java
trunk/eXist/src/org/exist/xquery/functions/session/Invalidate.java
trunk/eXist/src/org/exist/xquery/functions/session/RemoveAttribute.java
trunk/eXist/src/org/exist/xquery/functions/session/SetAttribute.java
trunk/eXist/src/org/exist/xquery/functions/session/SetCurrentUser.java
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetContextPath.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetContextPath.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetContextPath.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -63,8 +63,7 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
-
+
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
// request object is read from global variable $request
@@ -76,7 +75,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
if (isCalledAs("get-context-path"))
return new StringValue(((RequestWrapper) value.getObject()).getContextPath());
else
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetCookieNames.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetCookieNames.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetCookieNames.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -67,14 +67,11 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
-
RequestModule myModule = (RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
// request object is read from global variable $request
Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR);
if (var == null || var.getValue() == null || var.getValue().getItemType() != Type.JAVA_OBJECT) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -93,11 +90,9 @@
names.add(new StringValue(cookies[c].getName()));
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return names;
}
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
else
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetCookieValue.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetCookieValue.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetCookieValue.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -70,14 +70,11 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
-
RequestModule myModule = (RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
// request object is read from global variable $request
Variable var = myModule.resolveVariable(RequestModule.REQUEST_VAR);
if (var == null || var.getValue() == null || var.getValue().getItemType() != Type.JAVA_OBJECT) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -94,13 +91,11 @@
{
if(cookies[c].getName().equals(cookieName))
{
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(cookies[c].getValue());
}
}
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
else
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetData.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetData.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetData.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -94,7 +94,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)throws XPathException
{
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -156,7 +155,6 @@
if(!mimeType.isXMLType())
{
//binary data
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new Base64Binary(bufRequestData);
}
}
@@ -178,7 +176,6 @@
reader.setContentHandler(receiver);
reader.parse(src);
Document doc = receiver.getDocument();
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return (NodeValue)doc.getDocumentElement();
}
catch(ParserConfigurationException e)
@@ -207,7 +204,6 @@
try
{
String s = new String(bufRequestData, encoding);
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(s);
}
catch (IOException e)
@@ -218,7 +214,6 @@
else
{
//no post data
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetExists.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetExists.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetExists.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -65,7 +65,6 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
BooleanValue exists = BooleanValue.TRUE;
@@ -78,7 +77,6 @@
exists = BooleanValue.FALSE;
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return( exists );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetHeader.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetHeader.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetHeader.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule) context
.getModule(RequestModule.NAMESPACE_URI);
@@ -91,7 +90,6 @@
if (value.getObject() instanceof RequestWrapper) {
String headerValue = ((RequestWrapper) value.getObject())
.getHeader(param);
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
if (headerValue == null) {
return Sequence.EMPTY_SEQUENCE;
} else {
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetHeaderNames.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetHeaderNames.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetHeaderNames.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -92,7 +91,6 @@
String param = (String) e.nextElement();
result.add(new StringValue(param));
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return result;
}
else
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetHostname.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetHostname.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetHostname.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -86,7 +85,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((RequestWrapper) value.getObject()).getRemoteHost());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetMethod.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetMethod.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetMethod.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -63,7 +63,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -76,7 +75,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((RequestWrapper) value.getObject()).getMethod());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetParameter.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetParameter.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetParameter.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -105,7 +105,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -122,7 +121,6 @@
if( failOnError ) {
throw new XPathException(this, "Variable $request is not bound to an Java object.");
} else {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return args[1];
}
}
@@ -133,7 +131,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
String[] values = ((RequestWrapper)value.getObject()).getParameterValues(param);
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
if (values == null || values.length == 0) {
return args[1];
}
@@ -146,7 +143,6 @@
if( failOnError ) {
throw new XPathException(this, "Variable $request is not bound to a Request object.");
} else {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return args[1];
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetParameterNames.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetParameterNames.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetParameterNames.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -79,7 +79,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -100,7 +99,6 @@
String param = (String) e.nextElement();
result.add(new StringValue(param));
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return result;
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetPathInfo.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetPathInfo.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetPathInfo.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -64,7 +64,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -78,7 +77,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
String path = ((RequestWrapper) value.getObject()).getPathInfo();
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(path == null ? "" : path);
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetQueryString.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetQueryString.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetQueryString.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -64,7 +64,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -79,7 +78,6 @@
if (value.getObject() instanceof RequestWrapper)
{
String queryString = ((RequestWrapper) value.getObject()).getQueryString();
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
if(queryString != null)
{
return new StringValue(queryString);
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteAddr.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteAddr.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteAddr.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -63,7 +63,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -77,7 +76,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((RequestWrapper) value.getObject()).getRemoteAddr());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteHost.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteHost.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetRemoteHost.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -63,7 +63,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -76,7 +75,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((RequestWrapper) value.getObject()).getRemoteHost());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetRemotePort.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetRemotePort.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetRemotePort.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -63,7 +63,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -76,7 +75,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(((RequestWrapper) value.getObject()).getRemotePort());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetRequestAttribute.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetRequestAttribute.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetRequestAttribute.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -68,7 +68,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
String name = args[0].getStringValue();
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -83,7 +82,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
Object attrib = ((RequestWrapper) value.getObject()).getAttribute(name);
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return attrib == null ? Sequence.EMPTY_SEQUENCE : XPathUtil.javaObjectToXPath(attrib, context);
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetServerName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetServerName.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetServerName.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -85,7 +84,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((RequestWrapper) value.getObject()).getServerName());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetServerPort.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetServerPort.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetServerPort.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -85,7 +84,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(((RequestWrapper) value.getObject()).getServerPort());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetURI.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetURI.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -71,7 +71,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -85,7 +84,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new AnyURIValue(((RequestWrapper) value.getObject()).getRequestURI());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetURL.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetURL.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetURL.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -63,7 +63,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -77,7 +76,6 @@
JavaObjectValue value = (JavaObjectValue) var.getValue().itemAt(0);
if (value.getObject() instanceof RequestWrapper) {
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((RequestWrapper) value.getObject()).getRequestURL().toString());
} else
throw new XPathException(this, "Variable $request is not bound to a Request object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFile.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFile.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFile.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -90,7 +90,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -110,10 +109,10 @@
RequestWrapper request = (RequestWrapper)value.getObject();
File file = request.getFileUploadParam(uploadParamName);
if(file == null) {
- LOG.debug("File param not found: " + uploadParamName);
+ logger.debug("File param not found: " + uploadParamName);
return Sequence.EMPTY_SEQUENCE;
} else
- LOG.debug("Uploaded file: " + file.getAbsolutePath());
+ logger.debug("Uploaded file: " + file.getAbsolutePath());
if(isCalledAs("get-uploaded-file-data"))
@@ -130,7 +129,6 @@
baos.write(buf, 0, read);
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new Base64Binary(baos.toByteArray());
}
@@ -152,14 +150,13 @@
}
catch (IOException ioe)
{
- LOG.warn(ioe.getMessage(), ioe);
+ logger.warn(ioe.getMessage(), ioe);
}
}
}
}
else
{
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
return new JavaObjectValue(file);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileName.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileName.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -67,7 +67,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -86,7 +85,6 @@
if (value.getObject() instanceof RequestWrapper) {
RequestWrapper request = (RequestWrapper)value.getObject();
String fname = request.getUploadedFileName(uploadParamName);
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
if(fname == null) {
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileSize.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileSize.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/GetUploadedFileSize.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -69,7 +69,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule =
(RequestModule) context.getModule(RequestModule.NAMESPACE_URI);
@@ -88,7 +87,6 @@
if (value.getObject() instanceof RequestWrapper) {
RequestWrapper request = (RequestWrapper)value.getObject();
File file = request.getFileUploadParam(uploadParamName);
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
if(file == null) {
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/request/SetAttribute.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/request/SetAttribute.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/request/SetAttribute.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -69,8 +69,6 @@
*/
public Sequence eval (Sequence contextSequence, Item contextItem ) throws XPathException
{
- logger.info("Entering " + RequestModule.PREFIX + ":" + getName().getLocalName());
-
if( context.getProfiler().isEnabled() ) {
context.getProfiler().start( this );
context.getProfiler().message( this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName( this.getDependencies() ) );
@@ -109,8 +107,6 @@
throw( new XPathException( this, "Type error: variable $request is not bound to a request object" ) );
}
- logger.info("Exiting " + RequestModule.PREFIX + ":" + getName().getLocalName());
-
return( Sequence.EMPTY_SEQUENCE );
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/session/Clear.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/Clear.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/Clear.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -65,7 +65,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
SessionModule myModule = (SessionModule) context.getModule(SessionModule.NAMESPACE_URI);
@@ -85,7 +84,6 @@
String attribName = (String) e.nextElement();
sessionWrapper.removeAttribute(attribName);
}
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
else
Modified: trunk/eXist/src/org/exist/xquery/functions/session/Create.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/Create.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/Create.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -71,10 +71,8 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
SessionModule.createSession( context, this );
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/session/EncodeURL.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/EncodeURL.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/EncodeURL.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -80,8 +80,6 @@
Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
-
ResponseModule myModule = (ResponseModule)context.getModule(ResponseModule.NAMESPACE_URI);
// request object is read from global variable $response
@@ -99,7 +97,6 @@
JavaObjectValue value = (JavaObjectValue)
var.getValue().itemAt(0);
if(value.getObject() instanceof ResponseWrapper) {
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return new AnyURIValue(((ResponseWrapper)value.getObject()).encodeURL(url));
} else {
throw new XPathException(this, "Variable $response is not bound to a Response object.");
Modified: trunk/eXist/src/org/exist/xquery/functions/session/GetAttribute.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/GetAttribute.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/GetAttribute.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -83,7 +83,6 @@
*/
public Sequence eval( Sequence contextSequence, Item contextItem ) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
SessionModule myModule = (SessionModule)context.getModule(SessionModule.NAMESPACE_URI);
@@ -92,7 +91,6 @@
if( var == null || var.getValue() == null ) {
// throw( new XPathException( this, "Session not set" ) );
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -108,7 +106,6 @@
if( session.getObject() instanceof SessionWrapper ) {
try {
Object o = ( (SessionWrapper)session.getObject() ).getAttribute( attribName );
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
if( o == null ) {
return( Sequence.EMPTY_SEQUENCE );
}
@@ -125,7 +122,6 @@
//log.error(ise.getStackTrace());
//throw new XPathException(this, "Session has an IllegalStateException for getAttribute() - " + ise.getStackTrace() + System.getProperty("line.separator") + System.getProperty("line.separator") + "Did you perhaps call session:invalidate() previously?");
- logger.error("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName(), ise);
return( Sequence.EMPTY_SEQUENCE );
}
} else {
Modified: trunk/eXist/src/org/exist/xquery/functions/session/GetAttributeNames.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/GetAttributeNames.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/GetAttributeNames.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -78,7 +78,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
SessionModule myModule = (SessionModule) context.getModule(SessionModule.NAMESPACE_URI);
@@ -99,7 +98,6 @@
String attribName = (String) e.nextElement();
result.add(new StringValue(attribName));
}
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return result;
}
else
Modified: trunk/eXist/src/org/exist/xquery/functions/session/GetExists.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/GetExists.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/GetExists.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -66,7 +66,6 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
BooleanValue exists = BooleanValue.TRUE;
SessionModule myModule = (SessionModule)context.getModule( SessionModule.NAMESPACE_URI );
@@ -78,7 +77,6 @@
exists = BooleanValue.FALSE;
}
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return( exists );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/session/GetID.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/GetID.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/GetID.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -75,7 +75,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
SessionModule myModule = (SessionModule)context.getModule(SessionModule.NAMESPACE_URI);
/* session object is read from global variable $session */
@@ -89,7 +88,6 @@
if(session.getObject() instanceof SessionWrapper)
{
String id = ((SessionWrapper)session.getObject()).getId();
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
if (id == null)
return Sequence.EMPTY_SEQUENCE;
return(new StringValue(id));
Modified: trunk/eXist/src/org/exist/xquery/functions/session/Invalidate.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/Invalidate.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/Invalidate.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
SessionModule myModule = (SessionModule)context.getModule(SessionModule.NAMESPACE_URI);
// session object is read from global variable $session
@@ -81,7 +80,6 @@
//Always called as "invalidate") because the translation is made at compile time
if (!isCalledAs("invalidate"))
throw new XPathException(this, SessionModule.SESSION_VAR + " not set");
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
if(var.getValue().getItemType() != Type.JAVA_OBJECT)
@@ -90,7 +88,6 @@
if(value.getObject() instanceof SessionWrapper) {
SessionWrapper session = (SessionWrapper)value.getObject();
session.invalidate();
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
} else
throw new XPathException(this, SessionModule.SESSION_VAR + " is not bound to a session object");
Modified: trunk/eXist/src/org/exist/xquery/functions/session/RemoveAttribute.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/RemoveAttribute.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/RemoveAttribute.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -66,8 +66,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
-
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -93,7 +91,7 @@
((SessionWrapper)session.getObject()).removeAttribute(attrib);
else
throw new XPathException(this, "Type error: variable $session is not bound to a session object");
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
+
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/session/SetAttribute.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/SetAttribute.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/SetAttribute.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -69,8 +69,7 @@
*/
public Sequence eval( Sequence contextSequence, Item contextItem ) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
-
+
JavaObjectValue session;
if( context.getProfiler().isEnabled() ) {
@@ -110,7 +109,6 @@
throw( new XPathException( this, "Type error: variable $session is not bound to a session object" ) );
}
- logger.info("Exiting " + SessionModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/session/SetCurrentUser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/session/SetCurrentUser.java 2009-07-31 05:45:57 UTC (rev 9598)
+++ trunk/eXist/src/org/exist/xquery/functions/session/SetCurrentUser.java 2009-07-31 05:46:38 UTC (rev 9599)
@@ -84,7 +84,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + SessionModule.PREFIX + ":" + getName().getLocalName());
RequestModule myModule = (RequestModule)context.getModule(RequestModule.NAMESPACE_URI);
@@ -120,7 +119,7 @@
}
else
{
- LOG.warn("Could not validate user " + userName);
+ logger.warn("Could not validate user " + userName);
return BooleanValue.FALSE;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-31 05:46:07
|
Revision: 9598
http://exist.svn.sourceforge.net/exist/?rev=9598&view=rev
Author: ixitar
Date: 2009-07-31 05:45:57 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] removing all of the logger calls for entering and exiting from the function modules.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/system/CountInstances.java
trunk/eXist/src/org/exist/xquery/functions/system/FtIndexLookup.java
trunk/eXist/src/org/exist/xquery/functions/system/GetBuild.java
trunk/eXist/src/org/exist/xquery/functions/system/GetExistHome.java
trunk/eXist/src/org/exist/xquery/functions/system/GetIndexStatistics.java
trunk/eXist/src/org/exist/xquery/functions/system/GetRunningXQueries.java
trunk/eXist/src/org/exist/xquery/functions/system/GetScheduledJobs.java
trunk/eXist/src/org/exist/xquery/functions/system/Restore.java
trunk/eXist/src/org/exist/xquery/functions/system/Shutdown.java
trunk/eXist/src/org/exist/xquery/functions/system/TriggerSystemTask.java
trunk/eXist/src/org/exist/xquery/functions/system/UpdateStatistics.java
trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java
trunk/eXist/src/org/exist/xquery/functions/util/BinaryToString.java
trunk/eXist/src/org/exist/xquery/functions/util/BuiltinFunctions.java
trunk/eXist/src/org/exist/xquery/functions/util/CallFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/CatchFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/Collations.java
trunk/eXist/src/org/exist/xquery/functions/util/CollectionName.java
trunk/eXist/src/org/exist/xquery/functions/util/Compile.java
trunk/eXist/src/org/exist/xquery/functions/util/DeepCopyFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/DescribeFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/DirectoryListFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/DocumentNameOrId.java
trunk/eXist/src/org/exist/xquery/functions/util/Expand.java
trunk/eXist/src/org/exist/xquery/functions/util/ExtractDocs.java
trunk/eXist/src/org/exist/xquery/functions/util/FunDoctype.java
trunk/eXist/src/org/exist/xquery/functions/util/FunUnEscapeURI.java
trunk/eXist/src/org/exist/xquery/functions/util/FunctionFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/GetFragmentBetween.java
trunk/eXist/src/org/exist/xquery/functions/util/GetNodeById.java
trunk/eXist/src/org/exist/xquery/functions/util/GetSequenceType.java
trunk/eXist/src/org/exist/xquery/functions/util/Hash.java
trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyDocuments.java
trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyOccurrences.java
trunk/eXist/src/org/exist/xquery/functions/util/IndexType.java
trunk/eXist/src/org/exist/xquery/functions/util/LockFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/LogFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/MD5.java
trunk/eXist/src/org/exist/xquery/functions/util/ModuleInfo.java
trunk/eXist/src/org/exist/xquery/functions/util/NodeId.java
trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java
trunk/eXist/src/org/exist/xquery/functions/util/Parse.java
trunk/eXist/src/org/exist/xquery/functions/util/Profile.java
trunk/eXist/src/org/exist/xquery/functions/util/PrologFunctions.java
trunk/eXist/src/org/exist/xquery/functions/util/QNameIndexLookup.java
trunk/eXist/src/org/exist/xquery/functions/util/RandomFunction.java
trunk/eXist/src/org/exist/xquery/functions/util/Serialize.java
trunk/eXist/src/org/exist/xquery/functions/util/SystemProperty.java
trunk/eXist/src/org/exist/xquery/functions/util/SystemTime.java
Modified: trunk/eXist/src/org/exist/xquery/functions/system/CountInstances.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/CountInstances.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/CountInstances.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -84,7 +84,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + SystemModule.PREFIX + ":" + getName().getLocalName());
int count = 0;
if(isCalledAs("count-instances-max"))
@@ -100,7 +99,6 @@
count = bp.available();
}
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(count, Type.INTEGER);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/FtIndexLookup.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/FtIndexLookup.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/FtIndexLookup.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -102,10 +102,9 @@
public Sequence eval(Sequence contextSequence, Item contextItem)
throws XPathException {
- logger.info("Entering " + SystemModule.PREFIX + ":" + getName().getLocalName());
+
Sequence querySeq = getArgument(1).eval(contextSequence);
if (querySeq.isEmpty()) {
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
String query = querySeq.itemAt(0).getStringValue();
@@ -130,7 +129,6 @@
result = result.deepIntersection(hits[k]);
}
logger.debug("FOUND: " + result.getLength());
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/GetBuild.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/GetBuild.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/GetBuild.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -64,7 +64,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + SystemModule.PREFIX + ":" + getName().getLocalName());
Properties sysProperties = new Properties();
try
{
@@ -75,7 +74,6 @@
logger.debug("Unable to load system.properties from class loader");
}
StringValue stringValue = new StringValue(sysProperties.getProperty("product-build", "unknown build"));
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
return stringValue;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/GetExistHome.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/GetExistHome.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/GetExistHome.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -59,9 +59,7 @@
* @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[], org.exist.xquery.value.Sequence)
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + SystemModule.PREFIX + ":" + getName().getLocalName());
StringValue stringValue = new StringValue( context.getBroker().getConfiguration().getExistHome().getAbsolutePath() );
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
return stringValue;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/GetIndexStatistics.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/GetIndexStatistics.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/GetIndexStatistics.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -27,11 +27,9 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + SystemModule.PREFIX + ":" + getName().getLocalName());
IndexStatistics index = (IndexStatistics) context.getBroker().getBrokerPool().
getIndexManager().getIndexById(IndexStatistics.ID);
if (index == null) {
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
// module may not be enabled
return Sequence.EMPTY_SEQUENCE;
}
@@ -45,7 +43,6 @@
throw new XPathException(this, "Error caught while retrieving statistics: " + e.getMessage(), e);
}
DocumentImpl doc = (DocumentImpl) adapter.getDocument();
- logger.info("Exiting " + SystemModule.PREFIX + ":" + getName().getLocalName());
return (NodeImpl) doc.getFirstChild();
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/GetRunningXQueries.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/GetRunningXQueries.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/GetRunningXQueries.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -69,7 +69,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + SystemModule.PREFIX + ":get-scheduled-jobs");
if( !context.getUser().hasDbaRole() ) {
XPathException xPathException = new XPathException( this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of running xqueries" );
logger.error("Invalid user " + SystemModule.PREFIX + ":get-scheduled-xqueries", xPathException);
@@ -82,7 +81,6 @@
private Sequence getRunningXQueries()
{
- logger.trace("Entering getRunningXQueries");
Sequence xmlResponse = null;
MemTreeBuilder builder = context.getDocumentBuilder();
@@ -102,13 +100,11 @@
xmlResponse = (NodeValue)builder.getDocument().getDocumentElement();
- logger.trace("Exiting getRunningXQueries");
return( xmlResponse );
}
private void getRunningXQuery( MemTreeBuilder builder, XQueryContext context, XQueryWatchDog watchdog )
{
- logger.trace("Entering getRunningXQuery");
builder.startElement( new QName( "xquery", NAMESPACE_URI, PREFIX ), null );
builder.addAttribute( new QName( "id", null, null ), "" + context.hashCode() );
@@ -124,7 +120,6 @@
builder.endElement();
builder.endElement();
- logger.trace("Exiting getRunningXQuery");
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/GetScheduledJobs.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/GetScheduledJobs.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/GetScheduledJobs.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -44,7 +44,6 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + SystemModule.PREFIX + ":get-scheduled-jobs");
if( !context.getUser().hasDbaRole() ) {
XPathException xPathException = new XPathException( this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of scheduled jobs" );
logger.error("Invalid user " + SystemModule.PREFIX + ":get-scheduled-jobs", xPathException);
@@ -82,7 +81,6 @@
builder.endElement();
builder.endDocument();
- logger.info("Exiting " + SystemModule.PREFIX + ":get-scheduled-jobs");
return( (NodeValue)builder.getDocument().getDocumentElement() );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/Restore.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/Restore.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/Restore.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -65,7 +65,6 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + SystemModule.PREFIX + ":restore");
String dirOrFile = args[0].getStringValue();
String adminPass = null;
if (args[1].hasOne())
@@ -87,7 +86,6 @@
}
builder.endElement();
builder.endDocument();
- logger.info("Exiting " + SystemModule.PREFIX + ":restore");
return (NodeValue) builder.getDocument().getDocumentElement();
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/Shutdown.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/Shutdown.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/Shutdown.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -78,7 +78,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + SystemModule.PREFIX + ":shutdown");
if(context.getUser().hasDbaRole())
{
//determine the shutdown delay
@@ -114,7 +113,6 @@
throw xPathException;
}
- logger.info("Exiting " + SystemModule.PREFIX + ":shutdown");
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/TriggerSystemTask.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/TriggerSystemTask.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/TriggerSystemTask.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -45,7 +45,6 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + SystemModule.PREFIX + ":trigger-system-task");
String className = args[0].getStringValue();
Properties properties = new Properties();
if (args[1].hasOne()) {
@@ -83,7 +82,6 @@
logger.error(message, e);
throw new XPathException(this, message + e.getMessage(), e);
}
- logger.info("Exiting " + SystemModule.PREFIX + ":trigger-system-task");
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/system/UpdateStatistics.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/system/UpdateStatistics.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/system/UpdateStatistics.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -51,7 +51,6 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + SystemModule.PREFIX + ":update-statistics");
IndexStatisticsWorker index = (IndexStatisticsWorker)
context.getBroker().getIndexController().getWorkerByIndexId(IndexStatistics.ID);
if (index != null) {
@@ -59,7 +58,6 @@
} else {
logger.error("The module may not be enabled!");
}
- logger.info("Exiting " + SystemModule.PREFIX + ":update-statistics");
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/BinaryDoc.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -84,12 +84,10 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Sequence defaultReturn = (isCalledAs("binary-doc") ? Sequence.EMPTY_SEQUENCE : BooleanValue.FALSE);
if (args[0].isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return defaultReturn;
}
@@ -99,12 +97,10 @@
doc = context.getBroker().getXMLResource(XmldbURI.xmldbUriFor(path), Lock.READ_LOCK);
if(doc == null)
{
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return defaultReturn;
}
else if(doc.getResourceType() != DocumentImpl.BINARY_FILE)
{
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return defaultReturn;
}
else if(isCalledAs("binary-doc"))
@@ -114,12 +110,10 @@
byte[] data = new byte[(int)context.getBroker().getBinaryResourceSize(bin)];
is.read(data);
is.close();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new Base64Binary(data);
}
else
{
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.TRUE;
}
} catch (URISyntaxException e) {
Modified: trunk/eXist/src/org/exist/xquery/functions/util/BinaryToString.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/BinaryToString.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/BinaryToString.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -72,10 +72,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
if (args[0].isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
String encoding = "UTF-8";
@@ -85,7 +82,6 @@
Base64Binary binary = (Base64Binary) args[0].itemAt(0);
byte[] data = binary.getBinaryData();
try {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(new String(data, encoding));
} catch (UnsupportedEncodingException e) {
throw new XPathException(this, "Unsupported encoding: " + encoding);
@@ -94,7 +90,6 @@
String str = args[0].getStringValue();
try {
byte[] data = str.getBytes(encoding);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new Base64Binary(data);
} catch (UnsupportedEncodingException e) {
throw new XPathException(this, "Unsupported encoding: " + encoding);
Modified: trunk/eXist/src/org/exist/xquery/functions/util/BuiltinFunctions.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/BuiltinFunctions.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/BuiltinFunctions.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -78,8 +78,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
ValueSequence resultSeq = new ValueSequence();
if(getSignature().getArgumentCount() == 1) {
String uri = args[0].getStringValue();
@@ -99,7 +97,6 @@
resultSeq.add(new QNameValue(context, sig.getName()));
}
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return resultSeq;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/CallFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/CallFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/CallFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -74,8 +74,6 @@
public Sequence eval(Sequence contextSequence, Item contextItem)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
Sequence arg0 = getArgument(0).eval(contextSequence, contextItem);
if(arg0.getCardinality() != Cardinality.EXACTLY_ONE)
throw new XPathException(this, "Expected exactly one item for first argument");
@@ -93,7 +91,6 @@
call.setArguments(params);
call.analyze(new AnalyzeContextInfo(this, 0));
// Evaluate the function
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return call.eval(contextSequence);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/CatchFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/CatchFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/CatchFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -71,14 +71,12 @@
* @see org.exist.xquery.Function#eval(org.exist.xquery.value.Sequence, org.exist.xquery.value.Item)
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Sequence exceptionClasses = getArgument(0).eval(contextSequence, contextItem);
try {
context.pushDocumentContext();
LocalVariable mark = context.markLocalVariables(false);
try {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return getArgument(1).eval(contextSequence, contextItem);
} finally {
context.popDocumentContext();
@@ -107,7 +105,6 @@
(UtilModule) context.getModule(UtilModule.NAMESPACE_URI);
myModule.declareVariable(UtilModule.EXCEPTION_QNAME, new StringValue(e.getClass().getName()));
myModule.declareVariable(UtilModule.EXCEPTION_MESSAGE_QNAME, new StringValue(e.getMessage()));
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return getArgument(2).eval(contextSequence, contextItem);
}
} catch (Exception e2) {
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Collations.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Collations.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Collations.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -53,7 +53,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
ValueSequence result = new ValueSequence();
Locale[] locales = Collator.getAvailableLocales();
String locale;
@@ -63,7 +62,6 @@
locale += '-' + locales[i].getCountry();
result.add(new StringValue(locale));
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/CollectionName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/CollectionName.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/CollectionName.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -74,10 +74,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
if(args[0].isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Item item = args[0].itemAt(0);
@@ -87,7 +84,6 @@
throw new XPathException(this, "Passed Java object should be of type org.xmldb.api.base.Collection");
Collection collection = (Collection)o;
try {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(collection.getName());
} catch (XMLDBException e) {
throw new XPathException(this, "Failed to retrieve collection name", e);
@@ -96,7 +92,6 @@
String path = item.getStringValue();
try {
XmldbURI uri = XmldbURI.xmldbUriFor(path).removeLastSegment();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(uri.toString());
} catch (URISyntaxException e) {
throw new XPathException(this, "Illegal URI for resource path: " + path);
@@ -106,14 +101,12 @@
if(node.getImplementationType() == NodeValue.PERSISTENT_NODE) {
NodeProxy p = (NodeProxy) node;
//TODO: use xmldbUri
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(p.getDocument().getCollection().getURI().toString());
}
} else
throw new XPathException(this, "First argument to util:collection-name should be either " +
"a Java object of type org.xmldb.api.base.Collection or a node; got: " +
Type.getTypeName(item.getType()));
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Compile.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Compile.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Compile.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -66,12 +66,10 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
// get the query expression
String expr = args[0].getStringValue();
if ("".equals(expr.trim())) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new EmptySequence();
}
context.pushNamespaceContext();
@@ -98,21 +96,16 @@
}
path.analyze(new AnalyzeContextInfo());
} catch (RecognitionException e) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName(), e);
return new StringValue(e.toString());
} catch (TokenStreamException e) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName(), e);
return new StringValue(e.toString());
} catch (XPathException e) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName(), e);
return new StringValue(e.toString());
} catch (Exception e) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName(), e);
return new StringValue(e.getMessage());
} finally {
context.popNamespaceContext();
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/DeepCopyFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/DeepCopyFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/DeepCopyFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -63,9 +63,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if (args[0].isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -85,7 +83,6 @@
builder.endDocument();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return (NodeValue)receiver.getDocument().getDocumentElement();
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/DescribeFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/DescribeFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/DescribeFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -72,7 +72,6 @@
Sequence contextSequence,
Item contextItem)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
String fname = getArgument(0).eval(contextSequence, contextItem).getStringValue();
QName qname = QName.parse(context, fname, context.getDefaultFunctionNamespace());
@@ -100,7 +99,6 @@
}
}
builder.endElement();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return ((DocumentImpl)builder.getDocument()).getNode(nodeNr);
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/DirectoryListFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/DirectoryListFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/DirectoryListFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -109,7 +109,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
File baseDir = new File( args[0].getStringValue() );
Sequence patterns = args[1];
@@ -162,8 +161,6 @@
xmlResponse = (NodeValue) builder.getDocument().getDocumentElement();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
return(xmlResponse);
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/DocumentNameOrId.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/DocumentNameOrId.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/DocumentNameOrId.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -84,7 +84,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
DocumentImpl doc = null;
if (Type.subTypeOf(args[0].getItemType(), Type.NODE)) {
@@ -107,14 +106,11 @@
}
if (doc != null) {
if ("document-name".equals(getSignature().getName().getLocalName())) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(doc.getFileURI().toString());
} else {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(doc.getDocId(), Type.INT);
}
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Expand.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Expand.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Expand.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -78,10 +78,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
if (args[0].isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -113,7 +110,6 @@
next.toSAX(context.getBroker(), receiver, serializeOptions);
result.add(builder.getDocument().getNode(nodeNr + 1));
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
} catch (SAXException e) {
throw new XPathException(this, e.getMessage());
Modified: trunk/eXist/src/org/exist/xquery/functions/util/ExtractDocs.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/ExtractDocs.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/ExtractDocs.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -52,12 +52,9 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
String moduleURI = args[0].getStringValue();
Module module = context.getModule(moduleURI);
if (module == null) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
MemTreeBuilder builder = context.getDocumentBuilder();
@@ -65,7 +62,6 @@
module(module, builder);
functions(module, builder);
builder.endElement();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return ((DocumentImpl)builder.getDocument()).getNode(nodeNr);
}
@@ -80,28 +76,6 @@
simpleElement(builder, "signature", function.toString());
builder.startElement(XQDOC_NS, "comment", "comment", null);
String functionDescription = function.getDescription();
- if (false) {
- if (functionDescription.startsWith("<?xml")) {
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = factory.newDocumentBuilder();
- InputSource inStream = new InputSource();
- inStream.setCharacterStream(new StringReader(functionDescription));
- Document doc = db.parse(inStream);
- } catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (SAXException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } else {
- simpleElement(builder, "description", functionDescription);
- }
- }
simpleElement(builder, "description", functionDescription);
int index = -1;
if (function.getArgumentTypes() != null) {
Modified: trunk/eXist/src/org/exist/xquery/functions/util/FunDoctype.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/FunDoctype.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/FunDoctype.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -58,8 +58,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -86,7 +84,6 @@
if (context.getProfiler().isEnabled())
context.getProfiler().end(this, "", result);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/FunUnEscapeURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/FunUnEscapeURI.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/FunUnEscapeURI.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -81,7 +81,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
try
{
return new StringValue(URLDecoder.decode(args[0].getStringValue(), args[1].getStringValue()));
@@ -90,9 +89,6 @@
{
throw new XPathException(this, "Unsupported Encoding Scheme: " + e.getMessage(), e);
}
- finally {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
- }
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/FunctionFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/FunctionFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/FunctionFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -76,12 +76,10 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
String funcName = args[0].getStringValue();
int arity = ((NumericValue) args[1].itemAt(0)).getInt();
this.resolvedFunction = lookupFunction(funcName, arity);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new FunctionReference(resolvedFunction);
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/GetFragmentBetween.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/GetFragmentBetween.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/GetFragmentBetween.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -92,7 +92,7 @@
* @throws XPathException
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
+
Sequence ms1 = args[0];
Sequence ms2 = args[1];
if (ms1.isEmpty()) {
@@ -125,7 +125,6 @@
StringValue strValFragment = new StringValue(fragment.toString());
ValueSequence resultFragment = new ValueSequence();
resultFragment.add(strValFragment);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return resultFragment;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/GetNodeById.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/GetNodeById.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/GetNodeById.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -74,17 +74,14 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
String id = args[1].itemAt(0).getStringValue();
NodeId nodeId = context.getBroker().getBrokerPool().getNodeFactory().createFromString(id);
NodeValue docNode = (NodeValue) args[0].itemAt(0);
if (docNode.getImplementationType() == NodeValue.IN_MEMORY_NODE) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return ((NodeImpl) docNode).getDocument().getNodeById(nodeId);
} else {
DocumentImpl doc = ((NodeProxy)docNode).getDocument();
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new NodeProxy(doc, nodeId);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/GetSequenceType.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/GetSequenceType.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/GetSequenceType.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -53,11 +53,9 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Sequence seq = args[0];
StringValue stringValue = new StringValue(Type.getTypeName(seq.getItemType()));
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return stringValue;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Hash.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Hash.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Hash.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -73,8 +73,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
boolean base64 = false;
String message = args[0].itemAt(0).getStringValue();
@@ -92,7 +90,6 @@
throw new XPathException(ex.getMessage());
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return (new StringValue(md));
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyDocuments.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyDocuments.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyDocuments.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -76,7 +76,6 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
@@ -120,7 +119,6 @@
if (context.getProfiler().isEnabled())
context.getProfiler().end(this, "", result);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyOccurrences.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyOccurrences.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/IndexKeyOccurrences.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -77,8 +77,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -103,7 +101,7 @@
if (indexWorker instanceof OrderedValuesIndex)
hints.put(OrderedValuesIndex.START_VALUE, args[1]);
else
- LOG.warn(indexWorker.getClass().getName() + " isn't an instance of org.exist.indexing.OrderedIndexWorker. Start value '" + args[1] + "' ignored." );
+ logger.warn(indexWorker.getClass().getName() + " isn't an instance of org.exist.indexing.OrderedIndexWorker. Start value '" + args[1] + "' ignored." );
Occurrences[] occur = indexWorker.scanIndex(context, docs, nodes, hints);
if (occur.length == 0)
result= Sequence.EMPTY_SEQUENCE;
@@ -123,7 +121,6 @@
if (context.getProfiler().isEnabled())
context.getProfiler().end(this, "", result);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/IndexType.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/IndexType.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/IndexType.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -74,7 +74,6 @@
* org.exist.xquery.value.Sequence)
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
@@ -100,7 +99,6 @@
if (context.getProfiler().isEnabled())
context.getProfiler().end(this, "", result);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/LockFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/LockFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/LockFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -49,7 +49,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Sequence docsArg = getArgument(0).eval(contextSequence, contextItem);
DocumentSet docs = docsArg.getDocumentSet();
@@ -60,7 +59,6 @@
throw new XPathException(this, "Could not lock document set", e);
} finally {
docs.unlock(exclusive);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/LogFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/LogFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/LogFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -90,26 +90,21 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
SequenceIterator i;
if( isCalledAs( "log" ) ) {
i = args[1].unorderedIterator();
if( args[1].isEmpty() ) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
} else if( isCalledAs( "log-app" ) ) {
i = args[2].unorderedIterator();
if( args[2].isEmpty() ) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
} else {
i = args[0].unorderedIterator();
if( args[0].isEmpty() ) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
}
@@ -176,7 +171,6 @@
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/MD5.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/MD5.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/MD5.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -77,8 +77,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
boolean base64 = false;
String arg = args[0].itemAt( 0 ).getStringValue();
@@ -89,7 +87,6 @@
String md = MessageDigester.md5( arg, base64 );
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return( new StringValue( md ) );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/ModuleInfo.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/ModuleInfo.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/ModuleInfo.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -85,19 +85,16 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if("get-module-description".equals(getSignature().getName().getLocalName())) {
String uri = args[0].getStringValue();
Module module = context.getModule(uri);
if(module == null)
throw new XPathException(this, "No module found matching namespace URI: " + uri);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(module.getDescription());
} else if ("is-module-registered".equals(getSignature().getName().getLocalName())) {
String uri = args[0].getStringValue();
Module module = context.getModule(uri);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new BooleanValue(module != null);
} else {
ValueSequence resultSeq = new ValueSequence();
@@ -105,7 +102,6 @@
Module module = (Module)i.next();
resultSeq.add(new StringValue(module.getNamespaceURI()));
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return resultSeq;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/NodeId.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/NodeId.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/NodeId.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -68,7 +68,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
NodeValue docNode =(NodeValue) args[0].itemAt(0);
org.exist.numbering.NodeId nodeId;
@@ -77,7 +76,6 @@
} else {
nodeId = ((NodeProxy)docNode).getNodeId();
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(nodeId.toString());
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/NodeXPath.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -28,11 +28,9 @@
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Sequence seq = getArgument(0).eval(contextSequence, contextItem);
if(seq.isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -41,7 +39,6 @@
//if at the document level just return /
if(n.getNodeType() == Node.DOCUMENT_NODE) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue("/");
}
@@ -58,7 +55,6 @@
}
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(buf.toString());
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Parse.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Parse.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Parse.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -53,15 +53,12 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if (args[0].getItemCount() == 0) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
String xmlContent = args[0].itemAt(0).getStringValue();
if (xmlContent.length() == 0) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
StringReader reader = new StringReader(xmlContent);
@@ -79,7 +76,7 @@
xr.setProperty("http://cyberneko.org/html/properties/names/elems", "match");
xr.setProperty("http://cyberneko.org/html/properties/names/attrs", "no-change");
} catch (Exception e) {
- LOG.warn("Could not instantiate neko HTML parser for function util:parse-html, falling back to " +
+ logger.warn("Could not instantiate neko HTML parser for function util:parse-html, falling back to " +
"default XML parser.", e);
}
}
@@ -93,7 +90,6 @@
xr.setProperty(Namespaces.SAX_LEXICAL_HANDLER, adapter);
xr.parse(src);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return (DocumentImpl) adapter.getDocument();
} catch (ParserConfigurationException e) {
throw new XPathException(this, "Error while constructing XML parser: " + e.getMessage(), e);
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Profile.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Profile.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Profile.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -63,7 +63,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Profiler profiler = context.getProfiler();
if (isCalledAs("enable-profiling")) {
@@ -73,7 +72,6 @@
} else {
profiler.setEnabled(false);
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/PrologFunctions.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/PrologFunctions.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/PrologFunctions.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -51,7 +51,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if (isCalledAs("declare-namespace"))
declareNamespace(args);
@@ -59,7 +58,6 @@
declareOption(args);
else
importModule(args);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/QNameIndexLookup.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/QNameIndexLookup.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/QNameIndexLookup.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -110,8 +110,6 @@
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
if (contextSequence == null || contextSequence.isEmpty()) {
// if the context sequence is empty, we create a default context
RootNode rootNode = new RootNode(context);
@@ -149,7 +147,7 @@
Type.getTypeName(comparisonCriterium.getType());
throw new XPathException(this, message);
}
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
+
return result;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/RandomFunction.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/RandomFunction.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/RandomFunction.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -64,20 +64,17 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
Random rndGen = new Random();
if(getArgumentCount() == 0)
{
DoubleValue result = new DoubleValue(rndGen.nextDouble());
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
else
{
IntegerValue upper = (IntegerValue)args[0].convertTo(Type.INTEGER);
IntegerValue result = new IntegerValue(rndGen.nextInt(upper.getInt()));
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/Serialize.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/Serialize.java 2009-07-31 05:45:04 UTC (rev 9597)
+++ trunk/eXist/src/org/exist/xquery/functions/util/Serialize.java 2009-07-31 05:45:57 UTC (rev 9598)
@@ -101,9 +101,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
if(args[0].isEmpty()) {
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -121,12 +119,10 @@
File file = new File(path);
if (file.isDirectory()) {
logger.debug("Output file is a directory: " + file.getAbsolutePath());
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
if (file.exists() && !file.canWrite()) {
logger.debug("Cannot write to file " + file.getAbsolutePath());
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
@@ -146,7 +142,6 @@
//do the serialization
serialize(args[0].iterate(), outputProperties, os);
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.TRUE;
}
else
@@ -165,7 +160,6 @@
try
{
String encoding = outputProperties.getProperty(OutputKeys.ENCODING, "UTF-8");
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(new String(((ByteArrayOutputStream)os).toByteArray(), encoding));
}
catch(UnsupportedEncodingException e)
Modified: trunk/eXist/src/org/exist/xquery/functions/util/SystemProperty.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/SystemProperty.java...
[truncated message content] |
|
From: <ix...@us...> - 2009-07-31 05:45:14
|
Revision: 9597
http://exist.svn.sourceforge.net/exist/?rev=9597&view=rev
Author: ixitar
Date: 2009-07-31 05:45:04 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] removing all of the logger calls for entering and exiting from the function modules.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/response/GetExists.java
trunk/eXist/src/org/exist/xquery/functions/response/RedirectTo.java
trunk/eXist/src/org/exist/xquery/functions/response/SetCookie.java
trunk/eXist/src/org/exist/xquery/functions/response/SetHeader.java
trunk/eXist/src/org/exist/xquery/functions/response/SetStatusCode.java
trunk/eXist/src/org/exist/xquery/functions/response/StreamBinary.java
trunk/eXist/src/org/exist/xquery/functions/transform/Transform.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAbstractCollectionManipulator.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAuthenticate.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChangeUser.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodCollection.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodResource.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCollectionAvailable.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCopy.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateCollection.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateUser.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreated.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDefragment.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDeleteUser.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDocument.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildCollections.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildResources.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetCurrentUser.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetMimeType.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetUserOrGroup.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBHasLock.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBIsAdmin.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBLoadFromPattern.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBMove.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBPermissions.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRegisterDatabase.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBReindex.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRemove.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRename.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetCollectionPermissions.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetResourcePermissions.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSize.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBStore.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBURIFunctions.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBUserAccess.java
trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBXUpdate.java
Modified: trunk/eXist/src/org/exist/xquery/functions/response/GetExists.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/response/GetExists.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/response/GetExists.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -66,7 +66,6 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + ResponseModule.PREFIX + ":" + getName().getLocalName());
BooleanValue exists = BooleanValue.TRUE;
ResponseModule myModule = (ResponseModule)context.getModule( ResponseModule.NAMESPACE_URI );
@@ -78,7 +77,6 @@
exists = BooleanValue.FALSE;
}
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return( exists );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/response/RedirectTo.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/response/RedirectTo.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/response/RedirectTo.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -76,7 +76,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + ResponseModule.PREFIX + ":" + getName().getLocalName());
ResponseModule myModule = (ResponseModule)context.getModule(ResponseModule.NAMESPACE_URI);
@@ -97,7 +96,6 @@
}
else
throw new XPathException(this, "Variable response is not bound to a response object.");
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/response/SetCookie.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/response/SetCookie.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/response/SetCookie.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -83,8 +83,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + ResponseModule.PREFIX + ":" + getName().getLocalName());
-
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -136,7 +134,6 @@
} else {
throw new XPathException(this, "Type error: variable $response is not bound to a response object");
}
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/response/SetHeader.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/response/SetHeader.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/response/SetHeader.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -78,8 +78,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + ResponseModule.PREFIX + ":" + getName().getLocalName());
-
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -109,7 +107,6 @@
else
throw new XPathException(this, "Type error: variable $response is not bound to a response object");
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/response/SetStatusCode.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/response/SetStatusCode.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/response/SetStatusCode.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -70,8 +70,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + ResponseModule.PREFIX + ":" + getName().getLocalName());
-
if (context.getProfiler().isEnabled()) {
context.getProfiler().start(this);
context.getProfiler().message(this, Profiler.DEPENDENCIES, "DEPENDENCIES", Dependency.getDependenciesName(this.getDependencies()));
@@ -100,7 +98,6 @@
else
throw new XPathException(this, "Type error: variable $response is not bound to a response object");
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/response/StreamBinary.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/response/StreamBinary.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/response/StreamBinary.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -82,9 +82,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + ResponseModule.PREFIX + ":" + getName().getLocalName());
if(args[0].isEmpty() || args[1].isEmpty()) {
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Base64Binary binary = (Base64Binary) args[0].itemAt(0);
@@ -122,7 +120,6 @@
} catch (IOException e) {
throw new XPathException(this, "IO exception while streaming data: " + e.getMessage(), e);
}
- logger.info("Exiting " + ResponseModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/transform/Transform.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/transform/Transform.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/transform/Transform.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -184,10 +184,7 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + TransformModule.PREFIX + ":" + getName().getLocalName());
-
if(args[0].isEmpty()) {
- logger.info("Exiting " + TransformModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Item inputNode = args[0].itemAt(0);
@@ -253,7 +250,6 @@
next = next.getNextSibling();
}
context.popDocumentContext();
- logger.info("Exiting " + TransformModule.PREFIX + ":" + getName().getLocalName());
return seq;
}
else
@@ -317,7 +313,6 @@
} catch (IOException e) {
throw new XPathException(this, "IO exception while transforming node: " + e.getMessage(), e);
}
- logger.info("Exiting " + TransformModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAbstractCollectionManipulator.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAbstractCollectionManipulator.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAbstractCollectionManipulator.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -79,8 +79,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
-
if (0 == args.length)
throw new XPathException(this, "Expected a collection as the argument " + (paramNumber + 1) + ".");
@@ -109,7 +107,6 @@
}
}
else {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
@@ -181,7 +178,6 @@
}
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return s;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAuthenticate.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAuthenticate.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBAuthenticate.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -128,9 +128,7 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if( args[1].isEmpty() ) {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
@@ -169,10 +167,8 @@
cacheUserInHttpSession( user, createSession );
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.TRUE;
} catch (XMLDBException e) {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
}
@@ -219,13 +215,11 @@
if( reqVar == null || reqVar.getValue() == null ) {
logger.error("No request object found in the current XQuery context.");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw( new XPathException( this, "No request object found in the current XQuery context." ) );
}
if( reqVar.getValue().getItemType() != Type.JAVA_OBJECT ) {
logger.error( "Variable $request is not bound to an Java object.");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw( new XPathException( this, "Variable $request is not bound to an Java object." ) );
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChangeUser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChangeUser.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChangeUser.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -72,7 +72,7 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
String userName = args[0].getStringValue();
Collection collection = null;
@@ -83,7 +83,6 @@
User user = new User(oldUser.getName());
if (user == null) {
logger.error("User " + userName + " not found");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "User " + userName + " not found");
}
@@ -108,7 +107,6 @@
user.setHome(XmldbURI.xmldbUriFor(args[3].getStringValue()));
} catch (URISyntaxException e) {
logger.error("Invalid home collection URI " + args[3].getStringValue(), e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this,"Invalid home collection URI",e);
}
@@ -117,15 +115,12 @@
ums.updateUser(user);
} catch (XMLDBException xe) {
logger.error("Failed to update user " + userName, xe);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Failed to update user " + userName, xe);
} finally {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if (null != collection)
try { collection.close(); } catch (XMLDBException e) { /* ignore */ }
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodCollection.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodCollection.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodCollection.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -71,16 +71,13 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
try {
UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
ums.chmod(((IntegerValue) args[1].convertTo(Type.INTEGER)).getInt());
} catch (XMLDBException xe) {
logger.error("Unable to change collection mode", xe);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to change collection mode", xe);
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodResource.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodResource.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBChmodResource.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -74,7 +74,6 @@
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
try {
Resource res = collection.getResource(args[1].getStringValue());
if (res != null) {
@@ -82,15 +81,12 @@
ums.chmod(res, ((IntegerValue) args[2].convertTo(Type.INTEGER)).getInt());
} else {
logger.error("Unable to locate resource "+args[1].getStringValue());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to locate resource "+args[1].getStringValue());
}
} catch (XMLDBException xe) {
logger.error("Unable to change resource permissions", xe);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to change resource permissions", xe);
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCollectionAvailable.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCollectionAvailable.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCollectionAvailable.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -73,8 +73,6 @@
public Sequence evalWithCollection(Collection collection, Sequence[] args,
Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return (collection == null) ? BooleanValue.FALSE : BooleanValue.TRUE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCopy.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCopy.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCopy.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -77,7 +77,6 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
XmldbURI destination = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI();
if (getSignature().getArgumentCount() == 3) {
@@ -86,14 +85,12 @@
Resource resource = collection.getResource(doc.toString());
if (resource == null) {
logger.error("Resource " + doc + " not found");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Resource " + doc + " not found");
}
CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) collection.getService("CollectionManagementService", "1.0");
service.copyResource(doc, destination, null);
} catch (XMLDBException e) {
logger.error("XMLDB exception caught: ", e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "XMLDB exception caught: " + e.getMessage(), e);
}
@@ -105,17 +102,14 @@
} catch (XMLDBException e) {
logger.error("Cannot copy collection: ", e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Cannot copy collection: " + e.getMessage(), e);
} catch (URISyntaxException e) {
logger.error("URI exception: ", e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "URI exception: " + e.getMessage(), e);
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateCollection.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateCollection.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateCollection.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -73,14 +73,12 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence args[], Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
String collectionName = args[1].getStringValue();
try {
Collection newCollection = createCollectionPath(collection, collectionName);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if (newCollection == null)
return Sequence.EMPTY_SEQUENCE;
else
@@ -88,7 +86,6 @@
} catch (XMLDBException e) {
logger.error("Unable to create new collection " + collectionName, e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "failed to create new collection " + collectionName + ": " + e.getMessage(), e);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateUser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateUser.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreateUser.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -82,8 +82,6 @@
public Sequence eval(Sequence args[], Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
-
String user = args[0].getStringValue();
String pass = args[1].getStringValue();
User userObj = new User(user, pass);
@@ -102,7 +100,6 @@
userObj.setHome(new AnyURIValue(args[3].getStringValue()).toXmldbURI());
} catch(XPathException e) {
logger.error("Invalid home collection-uri for user " + user);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this,"Invalid home collection URI", e);
}
@@ -115,15 +112,12 @@
} catch (XMLDBException xe) {
logger.error("Failed to create user: " + user);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Failed to create new user " + user, xe);
} finally {
if (null != collection)
try { collection.close(); } catch (XMLDBException e) { /* ignore */ }
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreated.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreated.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBCreated.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -95,7 +95,6 @@
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
try {
Date date;
if(getSignature().getArgumentCount() == 1) {
@@ -104,7 +103,6 @@
Resource resource = collection.getResource(args[1].getStringValue());
if(resource == null) {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -114,12 +112,10 @@
date = ((EXistResource)resource).getCreationTime();
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return new DateTimeValue(date);
} catch(XMLDBException e) {
logger.error("Failed to retrieve creation date or modification time of specified resource or creation date of collection");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Failed to retrieve creation date: " + e.getMessage(), e);
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDefragment.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDefragment.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDefragment.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -77,7 +77,6 @@
* @see org.exist.xquery.Expression#eval(org.exist.dom.DocumentSet, org.exist.xquery.value.Sequence, org.exist.xquery.value.Item)
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
int splitCount = ((IntegerValue)args[1].itemAt(0)).getInt();
NodeSet nodes = args[0].toNodeSet();
@@ -87,7 +86,6 @@
} catch (EXistException e) {
throw new XPathException("An error occurred while defragmenting documents: " + e.getMessage(), e);
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDeleteUser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDeleteUser.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDeleteUser.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -75,8 +75,6 @@
public Sequence eval(Sequence args[], Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
-
String user = args[0].getStringValue();
Collection collection = null;
@@ -92,7 +90,6 @@
if (null != collection)
try { collection.close(); } catch (XMLDBException e) { /* ignore */ }
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDocument.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDocument.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBDocument.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -106,7 +106,6 @@
*/
public Sequence eval(Sequence contextSequence, Item contextItem)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
DocumentSet docs = null;
Sequence result = null;
@@ -157,12 +156,10 @@
} catch (XPathException e) { //From AnyURIValue constructor
e.setLocation(line, column);
logger.error("From AnyURIValue constructor:", e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw e;
} catch (PermissionDeniedException e) {
logger.error("Permission denied", e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Permission denied: unable to load document " + (String) args.get(i));
}
@@ -189,20 +186,17 @@
}
} catch (LockException e) {
logger.error("Could not acquire lock on document set", e);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Could not acquire lock on document set.");
} finally {
if(!(cacheIsValid || lockOnLoad))
// release all locks
docs.unlock(lockOnLoad);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
}
cached = result;
cachedDocs = docs;
registerUpdateListener();
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildCollections.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildCollections.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildCollections.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -60,7 +60,6 @@
//TODO: decode names?
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
ValueSequence result = new ValueSequence();
try {
@@ -68,7 +67,6 @@
for(int i = 0; i < collections.length; i++) {
result.add(new StringValue(collections[i]));
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return result;
} catch (XMLDBException e) {
throw new XPathException(this, "Failed to retrieve child collections", e);
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildResources.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildResources.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetChildResources.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -60,14 +60,12 @@
//TODO decode names?
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
ValueSequence result = new ValueSequence();
try {
String[] collections = collection.listResources();
for(int i = 0; i < collections.length; i++) {
result.add(new StringValue(collections[i]));
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return result;
} catch (XMLDBException e) {
throw new XPathException(this, "Failed to retrieve child resources", e);
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetCurrentUser.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetCurrentUser.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetCurrentUser.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -60,9 +60,7 @@
public Sequence eval(Sequence args[], Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
StringValue stringValue = new StringValue(context.getUser().getName());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return stringValue;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetMimeType.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetMimeType.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetMimeType.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -64,7 +64,7 @@
public Sequence eval(Sequence args[], Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
String path = new AnyURIValue(args[0].itemAt(0).getStringValue()).toString();
if(path.matches("^[a-z]+://.*")) {
@@ -72,7 +72,6 @@
MimeTable mimeTable = MimeTable.getInstance();
MimeType mimeType = mimeTable.getContentTypeFor(path);
if(mimeType != null) {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(mimeType.getName());
}
} else {
@@ -86,21 +85,17 @@
// try to open the document and acquire a lock
doc = (DocumentImpl)context.getBroker().getXMLResource(pathUri, Lock.READ_LOCK);
if(doc != null) {
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return new StringValue(((DocumentImpl)doc).getMetadata().getMimeType());
}
} catch(Exception e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, e.getMessage(), e);
} finally {
//release all locks
if(doc != null)
doc.getUpdateLock().release(Lock.READ_LOCK);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetUserOrGroup.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetUserOrGroup.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBGetUserOrGroup.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -100,10 +100,9 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
try {
Permission perm = getPermissions(collection, args);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if("get-owner".equals(getSignature().getName().getLocalName())) {
return new StringValue(perm.getOwner());
} else {
@@ -113,7 +112,6 @@
} catch (XMLDBException xe) {
logger.error("Unable to retrieve resource permissions");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to retrieve resource permissions", xe);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBHasLock.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBHasLock.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBHasLock.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -73,22 +73,19 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
try {
UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
Resource res = collection.getResource(new AnyURIValue(args[1].getStringValue()).toXmldbURI().toString());
if (res != null) {
String lockUser = ums.hasUserLock(res);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return lockUser == null ? Sequence.EMPTY_SEQUENCE : new StringValue(lockUser);
} else {
logger.error("Unable to locate resource " + args[1].getStringValue());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to locate resource " + args[1].getStringValue());
}
} catch (XMLDBException e) {
logger.error("Failed to retrieve user lock");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Failed to retrieve user lock", e);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBIsAdmin.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBIsAdmin.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBIsAdmin.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -65,7 +65,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
String userName = args[0].getStringValue();
Collection collection = null;
@@ -74,18 +73,15 @@
UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
User user = ums.getUser(userName);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if(user == null)
return Sequence.EMPTY_SEQUENCE;
return user.hasDbaRole() ? BooleanValue.TRUE : BooleanValue.FALSE;
} catch (XMLDBException xe) {
logger.error("Failed to access user " + userName);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Failed to access user " + userName, xe);
} finally {
if (null != collection)
try { collection.close(); } catch (XMLDBException e) { /* ignore */ }
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBLoadFromPattern.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBLoadFromPattern.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBLoadFromPattern.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -110,7 +110,6 @@
*/
protected Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
File baseDir = new File(args[1].getStringValue());
logger.debug("Loading files from directory: " + baseDir);
@@ -174,11 +173,9 @@
stored.add(new StringValue(col.getName() + "/" + resource.getId()));
} catch(XMLDBException e) {
logger.error("Could not store file " + files[j].getAbsolutePath() + ": " + e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
}
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return stored;
}
}
\ No newline at end of file
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBMove.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBMove.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBMove.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -78,7 +78,6 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
XmldbURI destination = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI();
if (getSignature().getArgumentCount() == 3) {
@@ -87,14 +86,12 @@
Resource resource = collection.getResource(doc.toString());
if (resource == null) {
logger.error( "Resource " + doc + " not found");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Resource " + doc + " not found");
}
CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) collection.getService("CollectionManagementService", "1.0");
service.moveResource(doc, destination, null);
} catch (XMLDBException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "XMLDB exception caught: " + e.getMessage(), e);
}
} else {
@@ -105,16 +102,13 @@
} catch (XMLDBException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Cannot move collection: " + e.getMessage(), e);
} catch (URISyntaxException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "URI exception: " + e.getMessage(), e);
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBPermissions.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBPermissions.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBPermissions.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -79,14 +79,11 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
try {
Permission perm = getPermissions(collection, args);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(perm.getPermissions(), Type.INT);
} catch (XMLDBException xe) {
logger.error("Unable to retrieve resource permissions");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to retrieve resource permissions", xe);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRegisterDatabase.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRegisterDatabase.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRegisterDatabase.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -72,7 +72,6 @@
*/
public Sequence eval(Sequence args[], Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
String driverName = args[0].getStringValue();
boolean createDatabase = args[1].effectiveBooleanValue();
try {
@@ -84,10 +83,8 @@
DatabaseManager.registerDatabase(database);
} catch (Exception e) {
logger.error("failed to initiate XMLDB database driver: " + driverName);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.TRUE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBReindex.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBReindex.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBReindex.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -66,14 +66,12 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
// this is "/db"
String ROOTCOLLECTION = XmldbURI.ROOT_COLLECTION_URI.toString();
// Check for DBA user
if (!context.getUser().hasDbaRole()) {
logger.error("Permission denied, user '" + context.getUser().getName() + "' must be a DBA to reindex the database");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
@@ -83,7 +81,6 @@
// Collection should start with /db
if (!collectionArg.startsWith(ROOTCOLLECTION)) {
logger.error("Collection should start with " + ROOTCOLLECTION);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
@@ -92,7 +89,6 @@
Collection coll = context.getBroker().getCollection(colName);
if (coll == null) {
logger.error("Collection " + colName.toString() + " does not exist.");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
@@ -102,11 +98,9 @@
} catch (PermissionDeniedException ex) {
logger.error(ex.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.TRUE;
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRemove.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRemove.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRemove.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -74,20 +74,17 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if(getSignature().getArgumentCount() == 2) {
String doc = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI().toString();
try {
Resource resource = collection.getResource(doc);
if (resource == null) {
logger.error("Resource " + doc + " not found");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Resource " + doc + " not found");
}
collection.removeResource(resource);
} catch (XMLDBException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "XMLDB exception caught: " + e.getMessage(), e);
}
} else {
@@ -97,11 +94,9 @@
service.removeCollection(collection.getName());
} catch (XMLDBException e) {
logger.error("Cannot remove collection: " + e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Cannot remove collection: " + e.getMessage(), e);
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRename.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRename.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBRename.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -79,7 +79,6 @@
*/
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
if(getSignature().getArgumentCount() == 3) {
XmldbURI doc = new AnyURIValue(args[1].itemAt(0).getStringValue()).toXmldbURI();
@@ -87,7 +86,6 @@
Resource resource = collection.getResource(doc.toString());
if (resource == null) {
logger.error("Resource " + doc + " not found");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Resource " + doc + " not found");
}
@@ -98,13 +96,11 @@
XmldbURI.xmldbUriFor(newName));
} catch (XMLDBException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "XMLDB exception caught: " + e.getMessage(), e);
} catch (URISyntaxException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "URI exception: " + e.getMessage(), e);
}
@@ -119,18 +115,15 @@
} catch (XMLDBException e) {
logger.error("Cannot rename collection: " + e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Cannot rename collection: " + e.getMessage(), e);
} catch (URISyntaxException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "URI exception: " + e.getMessage(), e);
}
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetCollectionPermissions.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetCollectionPermissions.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetCollectionPermissions.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -76,7 +76,7 @@
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
try {
UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
String user = args[1].getStringValue();
@@ -85,13 +85,11 @@
if (null == user || 0 == user.length()) {
logger.error("Needs a valid user name, not: " + user);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Needs a valid user name, not: " + user);
}
if (null == group || 0 == group.length()) {
logger.error("Needs a valid group name, not: " + group);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Needs a valid group name, not: " + group);
}
@@ -101,7 +99,6 @@
User usr = ums.getUser(user);
if (usr == null) {
logger.error("Needs a valid user name, not: " + user);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Needs a valid user name, not: " + user);
}
@@ -110,12 +107,10 @@
ums.setPermissions(collection, perms);
} catch (XMLDBException xe) {
logger.error("Unable to change collection permissions");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to change collection permissions", xe);
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetResourcePermissions.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetResourcePermissions.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSetResourcePermissions.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -79,7 +79,7 @@
public Sequence evalWithCollection(Collection collection, Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
try {
Resource res = collection.getResource(new AnyURIValue(args[1].getStringValue()).toXmldbURI().toString());
if (res != null) {
@@ -90,13 +90,11 @@
if (null == user || 0 == user.length()) {
logger.error("Needs a valid user name, not: " + user);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Needs a valid user name, not: " + user);
}
if (null == group || 0 == group.length()) {
logger.error("Needs a valid group name, not: " + group);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Needs a valid group name, not: " + group);
}
@@ -106,7 +104,6 @@
User usr = ums.getUser(user);
if (usr == null) {
logger.error("Needs a valid user name, not: " + user);
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Needs a valid user name, not: " + user);
}
@@ -115,18 +112,15 @@
ums.setPermissions(res, perms);
} else {
logger.error("Unable to locate resource " + args[1].getStringValue());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to locate resource " + args[1].getStringValue());
}
} catch (XMLDBException xe) {
logger.error("Unable to change resource permissions");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Unable to change resource permissions", xe);
}
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSize.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSize.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBSize.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -71,14 +71,12 @@
protected Sequence evalWithCollection(Collection collection, Sequence[] args,
Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
+
try {
Resource resource = collection.getResource(new AnyURIValue(args[1].getStringValue()).toXmldbURI().toString());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(((EXistResource)resource).getContentLength(), Type.LONG);
} catch (XMLDBException e) {
logger.error("Failed to retrieve size: " + e.getMessage());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Failed to retrieve size: " + e.getMessage(), e);
}
}
Modified: trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBStore.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBStore.java 2009-07-31 05:42:47 UTC (rev 9596)
+++ trunk/eXist/src/org/exist/xquery/functions/xmldb/XMLDBStore.java 2009-07-31 05:45:04 UTC (rev 9597)
@@ -116,7 +116,6 @@
public Sequence evalWithCollection(Collection collection, Sequence args[],
Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
String docName = args[1].isEmpty() ? null : args[1].getStringValue();
if(docName != null && docName.length() == 0)
docName = null;
@@ -146,7 +145,6 @@
Object obj = ((JavaObjectValue)item).getObject();
if(!(obj instanceof File)) {
logger.error("Passed java object should be a File");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Passed java object should be a File");
}
resource = loadFromFile(collection, (File)obj, docName, binary, mimeType);
@@ -156,7 +154,6 @@
resource = loadFromURI(collection, uri, docName, binary, mimeType);
} catch (URISyntaxException e) {
logger.error("Invalid URI: " + item.getStringValue());
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(this, "Invalid URI: " + item.getStringValue(), e);
}
} else {
@@ -183,7 +180,6 @@
}
} else {
logger.error("Data should be either a node or a string");
- logger.info("Exiting " + XMLDBModule.PREFIX + ":" + getName().getLocalName());
...
[truncated message content] |
|
From: <ix...@us...> - 2009-07-31 05:42:58
|
Revision: 9596
http://exist.svn.sourceforge.net/exist/?rev=9596&view=rev
Author: ixitar
Date: 2009-07-31 05:42:47 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[ignore] removing all of the logger calls for entering and exiting from the function modules.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Query.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Score.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGMLProducers.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGeometricProperties.java
trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunSpatialSearch.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/CountDayInMonthFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateForFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateFromDateTimeFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateRangeFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DayInWeekFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DaysInMonthFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateTimeFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatTimeFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/TimeFromDateTimeFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/WeekInMonthFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/example/EchoFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/DirectoryListFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileDelete.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileExists.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsDirectory.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsReadable.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsWriteable.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileRead.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadBinary.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadUnicode.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/SerializeToFile.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/ClearPersistentCookiesFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/DELETEFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/GETFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/HEADFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/OPTIONSFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/POSTFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/PUTFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetHeightFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetMetadataFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetThumbnailsFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetWidthFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/ScaleFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeCharting.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CloseContextFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CreateFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/DeleteFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/GetDirContextFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/ModifyFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/RenameFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/SearchFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/mail/MailFolderFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/mail/MailSessionFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/mail/MailStoreFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/mail/MessageListFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/mail/SendEmailFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/math/NoParamFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/math/OneParamFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/math/TwoParamFunctions.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/metadata/MetadataFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/simpleql/ParseSimpleQL.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/sql/ExecuteFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/sql/GetConnectionFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/sql/GetJNDIConnectionFunction.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xmldiff/Compare.java
trunk/eXist/extensions/modules/src/org/exist/xquery/modules/xslfo/RenderFunction.java
trunk/eXist/extensions/xprocxq/main/src/java/DirectoryListFunction.java
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Query.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Query.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Query.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -149,8 +149,6 @@
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
- logger.info("Entering " + LuceneModule.PREFIX + ":" + getName().getLocalName());
-
if (contextItem != null)
contextSequence = contextItem.toSequence();
@@ -187,7 +185,6 @@
contextStep.setPreloadedData(contextSequence.getDocumentSet(), preselectResult);
result = getArgument(0).eval(contextSequence).toNodeSet();
}
- logger.info("Exiting " + LuceneModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Score.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Score.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Score.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -59,11 +59,9 @@
}
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + LuceneModule.PREFIX + ":" + getName().getLocalName());
NodeValue nodeValue = (NodeValue) args[0].itemAt(0);
if (nodeValue.getImplementationType() != NodeValue.PERSISTENT_NODE) {
- logger.info("Exiting " + LuceneModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
NodeProxy proxy = (NodeProxy) nodeValue;
@@ -76,7 +74,6 @@
}
match = match.getNextMatch();
}
- logger.info("Exiting " + LuceneModule.PREFIX + ":" + getName().getLocalName());
return new FloatValue(score);
}
}
Modified: trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGMLProducers.java
===================================================================
--- trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGMLProducers.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGMLProducers.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -179,13 +179,11 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
Sequence result = null;
- logger.info("Entering " + SpatialModule.PREFIX + ":" + getName().getLocalName());
try {
AbstractGMLJDBCIndexWorker indexWorker = (AbstractGMLJDBCIndexWorker)
context.getBroker().getIndexController().getWorkerByIndexId(AbstractGMLJDBCIndex.ID);
if (indexWorker == null) {
logger.error("Unable to find a spatial index worker");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to find a spatial index worker");
}
Geometry geometry = null;
@@ -209,7 +207,6 @@
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
targetSRS = args[1].itemAt(0).getStringValue().trim();
@@ -226,12 +223,10 @@
geometry = wktReader.read(wkt);
} catch (ParseException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(e);
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
targetSRS = args[1].itemAt(0).getStringValue().trim();
@@ -254,7 +249,6 @@
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
@@ -274,7 +268,6 @@
default:
{
logger.error("Invalid line end style");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Invalid line end style");
}
}
@@ -298,7 +291,6 @@
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
@@ -322,7 +314,6 @@
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
@@ -346,7 +337,6 @@
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
@@ -390,13 +380,11 @@
if (geometry1 == null) {
logger.error("Unable to get a geometry from the first node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the first node");
}
if (geometry2 == null) {
logger.error("Unable to get a geometry from the second node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the second node");
}
@@ -425,7 +413,6 @@
String gmlPrefix = context.getPrefixForURI(AbstractGMLJDBCIndexWorker.GML_NS);
if (gmlPrefix == null) {
logger.error("namespace is not defined:" + SpatialModule.PREFIX);
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("'" + AbstractGMLJDBCIndexWorker.GML_NS + "' namespace is not defined");
}
@@ -441,12 +428,10 @@
}
} catch (SpatialIndexException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(e);
}
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGeometricProperties.java
===================================================================
--- trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGeometricProperties.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunGeometricProperties.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -259,10 +259,7 @@
Sequence result = null;
Sequence nodes = args[0];
- logger.info("Entering " + SpatialModule.PREFIX + ":" + getName().getLocalName());
-
if (nodes.isEmpty()) {
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
result = Sequence.EMPTY_SEQUENCE;
} else {
try {
@@ -272,7 +269,6 @@
context.getBroker().getIndexController().getWorkerByIndexId(AbstractGMLJDBCIndex.ID);
if (indexWorker == null) {
logger.error("Unable to find a spatial index worker");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to find a spatial index worker");
}
String propertyName = null;
@@ -324,7 +320,6 @@
propertyName = "IS_VALID";
} else {
logger.error("Unknown spatial property: " + mySignature.getName().getLocalName());
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unknown spatial property: " + mySignature.getName().getLocalName());
}
@@ -341,7 +336,6 @@
}
if (geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
@@ -397,19 +391,16 @@
result = new BooleanValue(geometry.isValid());
} else {
logger.error("Unknown spatial property: " + mySignature.getName().getLocalName());
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unknown spatial property: " + mySignature.getName().getLocalName());
}
}
} catch (SpatialIndexException e) {
logger.error(e.getMessage());
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException(e);
}
}
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunSpatialSearch.java
===================================================================
--- trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunSpatialSearch.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/indexes/spatial/src/org/exist/xquery/modules/spatial/FunSpatialSearch.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -135,10 +135,8 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
Sequence result = null;
Sequence nodes = args[0];
- logger.info("Entering " + SpatialModule.PREFIX + ":" + getName().getLocalName());
if (nodes.isEmpty()) {
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
result = Sequence.EMPTY_SEQUENCE;
}
else if (args[1].isEmpty())
@@ -150,7 +148,6 @@
context.getBroker().getIndexController().getWorkerByIndexId(AbstractGMLJDBCIndex.ID);
if (indexWorker == null) {
logger.error("Unable to find a spatial index worker");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to find a spatial index worker");
}
Geometry EPSG4326_geometry = null;
@@ -165,7 +162,6 @@
}
if (EPSG4326_geometry == null) {
logger.error("Unable to get a geometry from the node");
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
throw new XPathException("Unable to get a geometry from the node");
}
int spatialOp = SpatialOperator.UNKNOWN;
@@ -189,12 +185,10 @@
result = indexWorker.search(context.getBroker(), nodes.toNodeSet(), EPSG4326_geometry, spatialOp);
hasUsedIndex = true;
} catch (SpatialIndexException e) {
- logger.error(e.getMessage());
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
+ logger.error(e.getMessage(), e);
throw new XPathException(e);
}
}
- logger.info("Exiting " + SpatialModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/CountDayInMonthFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/CountDayInMonthFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/CountDayInMonthFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -65,8 +65,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
int dayOfInterest = ((IntegerValue)args[0].itemAt(0)).getInt();
DateValue d = (DateValue)args[1].itemAt(0);
@@ -87,7 +85,6 @@
cal.add(Calendar.DATE, 7);
}
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(dayOfInterestCount);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateForFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateForFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateForFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -66,8 +66,6 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
int yearOfInterest = ((IntegerValue)args[0].itemAt(0)).getInt();
int monthOfInterest = ((IntegerValue)args[1].itemAt(0)).getInt();
int weekInMonth = ((IntegerValue)args[2].itemAt(0)).getInt();
@@ -90,8 +88,6 @@
cal.set(Calendar.WEEK_OF_MONTH, weekInMonth);
cal.set(Calendar.DAY_OF_WEEK, dayInWeek);
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return new DateValue(TimeUtils.getInstance().newXMLGregorianCalendar(cal));
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateFromDateTimeFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateFromDateTimeFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateFromDateTimeFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -60,10 +60,6 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return args[0].itemAt(0).convertTo(Type.DATE);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateRangeFunctions.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateRangeFunctions.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DateRangeFunctions.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -91,8 +91,6 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
Item item = (Item)args[0].itemAt(0);
if(!(item instanceof AbstractDateTimeValue))
@@ -113,8 +111,6 @@
d1 = (AbstractDateTimeValue)d1.plus(diff);
}
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return result;
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DayInWeekFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DayInWeekFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DayInWeekFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -60,12 +60,9 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
DateValue d = (DateValue) args[0].itemAt(0);
GregorianCalendar cal = d.calendar.toGregorianCalendar();
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(dayOfWeek);
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DaysInMonthFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DaysInMonthFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/DaysInMonthFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -64,12 +64,9 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
DateValue d = (DateValue)args[0].itemAt(0);
GregorianCalendar cal = d.calendar.toGregorianCalendar();
int days = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
return new IntegerValue(days);
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -64,8 +64,6 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
DateValue d = (DateValue)args[0].itemAt(0);
String dateFormat = args[1].itemAt(0).toString();
@@ -74,8 +72,6 @@
GregorianCalendar cal = d.calendar.toGregorianCalendar();
String formattedDate = sdf.format(cal.getTime());
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return new StringValue(formattedDate);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateTimeFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateTimeFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatDateTimeFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -66,8 +66,6 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
DateTimeValue dt = (DateTimeValue)args[0].itemAt(0);
String dateTimeFormat = args[1].itemAt(0).toString();
@@ -76,8 +74,6 @@
GregorianCalendar cal = dt.calendar.toGregorianCalendar();
String formattedDate = sdf.format(cal.getTime());
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return new StringValue(formattedDate);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatTimeFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatTimeFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/FormatTimeFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -65,8 +65,6 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
TimeValue t = (TimeValue)args[0].itemAt(0);
String timeFormat = args[1].itemAt(0).toString();
@@ -75,8 +73,6 @@
GregorianCalendar cal = t.calendar.toGregorianCalendar();
String formattedDate = sdf.format(cal.getTime());
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return new StringValue(formattedDate);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/TimeFromDateTimeFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/TimeFromDateTimeFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/TimeFromDateTimeFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -60,10 +60,6 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
return args[0].itemAt(0).convertTo(Type.TIME);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/WeekInMonthFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/WeekInMonthFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/datetime/WeekInMonthFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -65,12 +65,10 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
-
DateValue d = (DateValue)args[0].itemAt(0);
GregorianCalendar cal = d.calendar.toGregorianCalendar();
int weekInMonth = cal.get(Calendar.WEEK_OF_MONTH);
- logger.info("Exiting " + DateTimeModule.PREFIX + ":" + getName().getLocalName());
+
return new IntegerValue(weekInMonth);
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/example/EchoFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/example/EchoFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/example/EchoFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -60,11 +60,9 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + ExampleModule.NAMESPACE_URI + ":" + getName().getLocalName());
// is argument the empty sequence?
if (args[0].isEmpty()) {
- logger.info("Exiting " + ExampleModule.NAMESPACE_URI + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -74,7 +72,6 @@
String str = i.nextItem().getStringValue();
result.add(new StringValue("echo: " + str));
}
- logger.info("Exiting " + ExampleModule.NAMESPACE_URI + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/DirectoryListFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/DirectoryListFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/DirectoryListFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -107,8 +107,6 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
-
File baseDir = new File( args[0].getStringValue() );
Sequence patterns = args[1];
@@ -160,8 +158,6 @@
xmlResponse = (NodeValue) builder.getDocument().getDocumentElement();
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
-
return(xmlResponse);
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileDelete.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileDelete.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileDelete.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -69,8 +69,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
-
Sequence deleted = BooleanValue.FALSE;
String path = args[0].itemAt(0).getStringValue();
File file = new File( path );
@@ -79,7 +77,6 @@
deleted = BooleanValue.TRUE;
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( deleted );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileExists.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileExists.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileExists.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -68,7 +68,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
Sequence exists = BooleanValue.FALSE;
String path = args[0].itemAt(0).getStringValue();
File file = new File( path );
@@ -77,7 +76,6 @@
exists = BooleanValue.TRUE;
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( exists );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsDirectory.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsDirectory.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsDirectory.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -70,7 +70,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
Sequence isDir = BooleanValue.FALSE;
String path = args[0].itemAt(0).getStringValue();
File file = new File( path );
@@ -79,7 +78,6 @@
isDir = BooleanValue.TRUE;
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( isDir );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsReadable.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsReadable.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsReadable.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -70,7 +70,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
Sequence readable = BooleanValue.FALSE;
String path = args[0].itemAt(0).getStringValue();
File file = new File( path );
@@ -79,7 +78,6 @@
readable = BooleanValue.TRUE;
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( readable );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsWriteable.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsWriteable.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileIsWriteable.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -70,7 +70,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
Sequence writeable = BooleanValue.FALSE;
String path = args[0].itemAt(0).getStringValue();
File file = new File( path );
@@ -79,7 +78,6 @@
writeable = BooleanValue.TRUE;
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( writeable );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileRead.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileRead.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileRead.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -84,7 +84,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
String arg = args[0].itemAt(0).getStringValue();
StringWriter sw;
@@ -116,8 +115,6 @@
throw( new XPathException( this, e.getMessage() ) );
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
-
//TODO : return an *Item* built with sw.toString()
return( new StringValue( sw.toString() ) );
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadBinary.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadBinary.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadBinary.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -75,7 +75,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
String arg = args[0].itemAt(0).getStringValue();
byte[] buffer;
@@ -101,7 +100,6 @@
throw( new XPathException( this, e.getMessage() ) );
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( new Base64Binary( buffer ) );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadUnicode.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadUnicode.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/FileReadUnicode.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -83,8 +83,6 @@
*/
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
-
String arg = args[0].itemAt(0).getStringValue();
StringWriter sw;
@@ -118,7 +116,6 @@
//TODO : return an *Item* built with sw.toString()
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return( new StringValue( sw.toString() ) );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/SerializeToFile.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/SerializeToFile.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/file/SerializeToFile.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -96,10 +96,8 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + FileModule.PREFIX + ":" + getName().getLocalName());
-
+
if(args[0].isEmpty()) {
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -111,14 +109,12 @@
if(file.isDirectory())
{
logger.debug("Cannot serialize file. Output file is a directory: " + file.getAbsolutePath());
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
if(file.exists() && !file.canWrite())
{
logger.debug("Cannot serialize file. Cannot write to file " + file.getAbsolutePath() );
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.FALSE;
}
@@ -139,7 +135,6 @@
throw new XPathException(this, "Unknown function name");
}
- logger.info("Exiting " + FileModule.PREFIX + ":" + getName().getLocalName());
return BooleanValue.TRUE;
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/ClearPersistentCookiesFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/ClearPersistentCookiesFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/ClearPersistentCookiesFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -58,10 +58,7 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
context.setXQueryContextVar( HTTP_MODULE_PERSISTENT_COOKIES, null );
-
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/DELETEFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/DELETEFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/DELETEFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -62,12 +62,10 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
Sequence response = null;
// must be a URL
if( args[0].isEmpty() ) {
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -95,7 +93,6 @@
delete.releaseConnection();
}
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( response );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/GETFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/GETFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/GETFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -62,12 +62,10 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
Sequence response = null;
// must be a URL
if( args[0].isEmpty() ) {
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -95,7 +93,6 @@
get.releaseConnection();
}
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( response );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/HEADFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/HEADFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/HEADFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -66,12 +66,10 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
Sequence response = null;
// must be a URL
if( args[0].isEmpty() ) {
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -99,7 +97,6 @@
head.releaseConnection();
}
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( response );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/OPTIONSFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/OPTIONSFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/OPTIONSFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -64,12 +64,10 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
Sequence response = null;
// must be a URL
if( args[0].isEmpty() ) {
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -97,7 +95,6 @@
options.releaseConnection();
}
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( response );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/POSTFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/POSTFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/POSTFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -95,13 +95,11 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
Sequence response = null;
// must be a URL
if(args[0].isEmpty())
{
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return(Sequence.EMPTY_SEQUENCE);
}
@@ -179,7 +177,6 @@
}
else
{
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return(Sequence.EMPTY_SEQUENCE);
}
@@ -205,7 +202,6 @@
post.releaseConnection();
}
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return(response);
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/PUTFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/PUTFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/httpclient/PUTFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -72,12 +72,10 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + PREFIX + ":" + getName().getLocalName());
Sequence response = null;
// must be a URL
if( args[0].isEmpty() ) {
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -134,7 +132,6 @@
put.releaseConnection();
}
- logger.info("Exiting " + PREFIX + ":" + getName().getLocalName());
return( response );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetHeightFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetHeightFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetHeightFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -87,11 +87,8 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + ImageModule.PREFIX + ":" + getName().getLocalName());
-
//was an image speficifed
if (args[0].isEmpty()) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -104,14 +101,12 @@
catch(IOException ioe)
{
logger.error("Unable to read image data!", ioe);
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
if(image == null)
{
logger.error("Unable to read image data!");
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -123,12 +118,10 @@
{
//no, log the error
logger.error("Unable to read image data!");
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
else
{
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
//return the Height of the image
return new IntegerValue(iHeight);
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetMetadataFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetMetadataFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetMetadataFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -101,11 +101,8 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + ImageModule.PREFIX + ":" + getName().getLocalName());
-
//was an image and format speficifed
if (args[0].isEmpty() || args[1].isEmpty()) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -143,7 +140,6 @@
//check we have the metadata
if(nMetadata == null) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -159,7 +155,6 @@
streamer.serialize(nMetadata);
Document docMetadata = receiver.getDocument();
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return (NodeValue)docMetadata;
}
catch(SAXException se)
@@ -177,7 +172,6 @@
throw new XPathException(this, ioe.getMessage(), ioe);
}
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetThumbnailsFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetThumbnailsFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetThumbnailsFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -81,14 +81,11 @@
public Sequence eval(Sequence[] args, Sequence contextSequence)
throws XPathException {
- logger.info("Entering " + ImageModule.PREFIX + ":" + getName().getLocalName());
-
ValueSequence result = new ValueSequence();
// boolean isDatabasePath = false;
boolean isSaveToDataBase = false;
if (args[0].isEmpty()) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -151,7 +148,6 @@
pool = BrokerPool.getInstance();
} catch (Exception e) {
result.add(new StringValue(e.getMessage()));
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return result;
}
TransactionManager transact = pool.getTransactionManager();
@@ -184,7 +180,6 @@
.toXmldbURI());
if (allPictures == null) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -295,7 +290,6 @@
transact.getJournal().flushToLog(true);
dbbroker.closeDocument();
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return result;
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetWidthFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetWidthFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/GetWidthFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -88,11 +88,8 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + ImageModule.PREFIX + ":" + getName().getLocalName());
-
//was an image speficifed
if (args[0].isEmpty()) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -105,14 +102,12 @@
catch(IOException ioe)
{
logger.error("Unable to read image data!", ioe);
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
if(image == null)
{
logger.error("Unable to read image data!");
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -124,12 +119,10 @@
{
//no, log the error
logger.error("Unable to read image data!");
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
else
{
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
//return the width of the image
return new IntegerValue(iWidth);
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/ScaleFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/ScaleFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/image/ScaleFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -96,11 +96,8 @@
*/
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException
{
- logger.info("Entering " + ImageModule.PREFIX + ":" + getName().getLocalName());
-
//was an image and a mime-type speficifed
if(args[0].isEmpty() || args[2].isEmpty()) {
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -130,7 +127,6 @@
if(image == null)
{
logger.error("Unable to read image data!");
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -141,8 +137,6 @@
ByteArrayOutputStream os = new ByteArrayOutputStream();
ImageIO.write(bImage, formatName, os);
- logger.info("Exiting " + ImageModule.PREFIX + ":" + getName().getLocalName());
-
//return the new scaled image data
return new Base64Binary(os.toByteArray());
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeCharting.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeCharting.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeCharting.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -117,11 +117,8 @@
@Override
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
- logger.info("Entering " + JFreeChartModule.PREFIX + ":" + getName().getLocalName());
-
//was an image and a mime-type speficifed
if(args[1].isEmpty() || args[2].isEmpty()){
- logger.info("Exiting " + JFreeChartModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
@@ -154,7 +151,6 @@
// Render output
if(isCalledAs("render")){
byte[] image=writePNG(config, chart);
- logger.info("Exiting " + JFreeChartModule.PREFIX + ":" + getName().getLocalName());
return new Base64Binary(image);
} else {
@@ -168,7 +164,6 @@
throw new XPathException(this, ex.getMessage());
}
- logger.info("Exiting " + JFreeChartModule.PREFIX + ":" + getName().getLocalName());
return Sequence.EMPTY_SEQUENCE;
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CloseContextFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CloseContextFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CloseContextFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -91,11 +91,8 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + JNDIModule.PREFIX + ":" + getName().getLocalName());
-
// Was a Dir Context handle specified
if( args[0].isEmpty() ) {
- logger.info("Exiting " + JNDIModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
@@ -103,7 +100,6 @@
JNDIModule.closeJNDIContext( context, ctxID );
- logger.info("Exiting " + JNDIModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CreateFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CreateFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/CreateFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -102,8 +102,6 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + JNDIModule.PREFIX + ":" + getName().getLocalName());
-
// Was context handle or DN specified?
if( !( args[0].isEmpty() ) && !( args[1].isEmpty() ) ) {
@@ -132,7 +130,6 @@
}
}
- logger.info("Exiting " + JNDIModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/DeleteFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/DeleteFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/DeleteFunction.java 2009-07-31 05:42:47 UTC (rev 9596)
@@ -98,8 +98,6 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
- logger.info("Entering " + JNDIModule.PREFIX + ":" + getName().getLocalName());
-
// Was context handle or DN specified?
if( !( args[0].isEmpty() ) && !( args[1].isEmpty() ) ) {
@@ -122,7 +120,6 @@
}
}
- logger.info("Exiting " + JNDIModule.PREFIX + ":" + getName().getLocalName());
return( Sequence.EMPTY_SEQUENCE );
}
Modified: trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/GetDirContextFunction.java
===================================================================
--- trunk/eXist/extensions/modules/src/org/exist/xquery/modules/jndi/GetDirContextFunction.java 2009-07-31 03:58:55 UTC (rev 9595)
+++ trunk/eXist/extensions/modules/src/org/exist/xquery/mod...
[truncated message content] |
|
From: <ix...@us...> - 2009-07-31 03:59:03
|
Revision: 9595
http://exist.svn.sourceforge.net/exist/?rev=9595&view=rev
Author: ixitar
Date: 2009-07-31 03:58:55 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function module documentation.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunIRIToURI.java
trunk/eXist/src/org/exist/xquery/functions/FunInScopePrefixes.java
trunk/eXist/src/org/exist/xquery/functions/FunIndexOf.java
trunk/eXist/src/org/exist/xquery/functions/FunInsertBefore.java
trunk/eXist/src/org/exist/xquery/functions/FunLang.java
trunk/eXist/src/org/exist/xquery/functions/FunLast.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunIRIToURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunIRIToURI.java 2009-07-31 02:42:17 UTC (rev 9594)
+++ trunk/eXist/src/org/exist/xquery/functions/FunIRIToURI.java 2009-07-31 03:58:55 UTC (rev 9595)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2007 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -30,6 +30,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.util.URIUtils;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -38,14 +40,48 @@
public class FunIRIToURI extends Function {
+ protected static final String FUNCTION_DESCRIPTION =
+
+ "This function converts an xs:string containing an " +
+ "IRI into a URI according to the rules spelled out " +
+ "in Section 3.1 of [RFC 3987]. It is idempotent but " +
+ "not invertible.\n\n" +
+ "If $iri contains a character that is invalid in an " +
+ "IRI, such as the space character (see note below), " +
+ "the invalid character is replaced by its percent-encoded " +
+ "form as described in [RFC 3986] before the conversion is performed.\n\n" +
+ "If $iri is the empty sequence, returns the zero-length string.\n\n" +
+ "Since [RFC 3986] recommends that, for consistency, " +
+ "URI producers and normalizers should use uppercase " +
+ "hexadecimal digits for all percent-encodings, this " +
+ "function must always generate hexadecimal values " +
+ "using the upper-case letters A-F.\n\n" +
+ "Notes:\n\n" +
+
+ "This function does not check whether $iri is a legal " +
+ "IRI. It treats it as an xs:string and operates on " +
+ "the characters in the xs:string.\n\n" +
+
+ "The following printable ASCII characters are invalid " +
+ "in an IRI: \"<\", \">\", \" \" \" (double quote), " +
+ "space, \"{\", \"}\", \"|\", \"\\\", \"^\", and \"`\". " +
+ "Since these characters should not appear in an IRI, " +
+ "if they do appear in $iri they will be percent-encoded. " +
+ "In addition, characters outside the range x20-x126 " +
+ "will be percent-encoded because they are invalid in a URI.\n\n" +
+
+ "Since this function does not escape the PERCENT SIGN " +
+ "\"%\" and this character is not allowed in data within " +
+ "a URI, users wishing to convert character strings, " +
+ "such as file names, that include \"%\" to a URI " +
+ "should manually escape \"%\" by replacing it with \"%25\".";
+
public final static FunctionSignature signature =
new FunctionSignature(
new QName("iri-to-uri", Function.BUILTIN_FUNCTION_NS),
- "Returns an URI as a xs:string if the value of $a is a valid IRI. " +
- "Invald characters are escape sequence encoded before the conversion. " +
- "If $a is the empty sequence, returns the zero-length string.",
- new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE));
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { new FunctionParameterSequenceType("iri", Type.STRING, Cardinality.ZERO_OR_ONE, "an IRI") },
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "the URI"));
public FunIRIToURI(XQueryContext context, FunctionSignature signature) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunInScopePrefixes.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunInScopePrefixes.java 2009-07-31 02:42:17 UTC (rev 9594)
+++ trunk/eXist/src/org/exist/xquery/functions/FunInScopePrefixes.java 2009-07-31 03:58:55 UTC (rev 9595)
@@ -1,3 +1,24 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
package org.exist.xquery.functions;
@@ -17,6 +38,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -31,11 +54,12 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("in-scope-prefixes", Function.BUILTIN_FUNCTION_NS),
- "Returns the prefixes of the in-scope namespaces for $a. For namespaces that have " +
- "a prefix, it returns the prefix as an xs:NCName. For the default namespace, which has " +
- "no prefix, it returns the zero-length string.",
- new SequenceType[] { new SequenceType(Type.ELEMENT, Cardinality.EXACTLY_ONE) },
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_MORE));
+ "Returns the prefixes of the in-scope namespaces for $element. " +
+ "For namespaces that have a prefix, it returns the prefix as an " +
+ "xs:NCName. For the default namespace, which has no prefix, " +
+ "it returns the zero-length string",
+ new SequenceType[] { new FunctionParameterSequenceType("element", Type.ELEMENT, Cardinality.EXACTLY_ONE, "") },
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.ZERO_OR_MORE, "the prefixes"));
public FunInScopePrefixes(XQueryContext context) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunIndexOf.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunIndexOf.java 2009-07-31 02:42:17 UTC (rev 9594)
+++ trunk/eXist/src/org/exist/xquery/functions/FunIndexOf.java 2009-07-31 03:58:55 UTC (rev 9595)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-04 Wolfgang M. Meier
+ * Copyright (C) 2001-09 Wolfgang M. Meier
* wol...@ex...
* http://exist.sourceforge.net
*
@@ -36,6 +36,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AtomicValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceIterator;
@@ -51,30 +53,50 @@
*/
public class FunIndexOf extends BasicFunction {
+ protected static final String FUNCTION_DESCRIPTION =
+
+ "Returns a sequence of positive integers giving the " +
+ "positions within the sequence $seqParam of items " +
+ "that are equal to $srchParam.\n\n" +
+ "The collation used by the invocation of this function " +
+ "is determined according to the rules in 7.3.1 Collations. " +
+ "The collation is used when string comparison is required.\n\n" +
+ "The items in the sequence $seqParam are compared with " +
+ "$srchParam under the rules for the eq operator. Values of " +
+ "type xs:untypedAtomic are compared as if they were of " +
+ "type xs:string. Values that cannot be compared, i.e. " +
+ "the eq operator is not defined for their types, are " +
+ "considered to be distinct. If an item compares equal, " +
+ "then the position of that item in the sequence " +
+ "$seqParam is included in the result.\n\n" +
+
+ "If the value of $seqParam is the empty sequence, or " +
+ "if no item in $seqParam matches $srchParam, then the " +
+ "empty sequence is returned.\n\n" +
+
+ "The first item in a sequence is at position 1, not position 0.\n\n" +
+
+ "The result sequence is in ascending numeric order.";
+
public final static FunctionSignature fnIndexOf[] = {
new FunctionSignature(
new QName("index-of", Function.BUILTIN_FUNCTION_NS),
- "Returns a sequence of positive integers giving the positions within the sequence " +
- "$a of items that are equal to $b. If the value of $a is the empty sequence, or if " +
- "no item in $a matches $b, then the empty sequence is returned.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.ATOMIC, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("seqParam", Type.ATOMIC, Cardinality.ZERO_OR_MORE, ""),
+ new FunctionParameterSequenceType("srchParam", Type.ATOMIC, Cardinality.EXACTLY_ONE, "")
},
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE, "a sequence of positive integers giving the positions within the sequence")
),
new FunctionSignature(
new QName("index-of", Function.BUILTIN_FUNCTION_NS),
- "Returns a sequence of positive integers giving the positions within the sequence " +
- "$a of items that are equal to $b. If the value of $a is the empty sequence, or if " +
- "no item in $a matches $b, then the empty sequence is returned. Values are compared " +
- "according to the collation specified in $c.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.ATOMIC, Cardinality.EXACTLY_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("seqParam", Type.ATOMIC, Cardinality.ZERO_OR_MORE, ""),
+ new FunctionParameterSequenceType("srchParam", Type.ATOMIC, Cardinality.EXACTLY_ONE, ""),
+ new FunctionParameterSequenceType("collation", Type.STRING, Cardinality.EXACTLY_ONE, "")
},
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE, "a sequence of positive integers giving the positions within the sequence")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunInsertBefore.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunInsertBefore.java 2009-07-31 02:42:17 UTC (rev 9594)
+++ trunk/eXist/src/org/exist/xquery/functions/FunInsertBefore.java 2009-07-31 03:58:55 UTC (rev 9595)
@@ -1,3 +1,23 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 the eXist team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
package org.exist.xquery.functions;
import org.exist.dom.QName;
@@ -9,6 +29,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.DoubleValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -22,17 +44,35 @@
*/
public class FunInsertBefore extends Function {
+ protected static final String FUNCTION_DESCRIPTION =
+
+ "Returns a new sequence constructed from the value " +
+ "of $target with the value of $inserts inserted at " +
+ "the position specified by the value of $position. " +
+ "(The value of $target is not affected by the sequence construction.)\n\n" +
+
+ "If $target is the empty sequence, $inserts is returned. If $inserts is the empty sequence, $target is returned.\n\n" +
+
+ "The value returned by the function consists of all items " +
+ "of $target whose index is less than $position, followed " +
+ "by all items of $inserts, followed by the remaining elements " +
+ "of $target, in that sequence.\n\n" +
+
+ "If $position is less than one (1), the first position, the effective " +
+ "value of $position is one (1). If $position is greater than the number " +
+ "of items in $target, then the effective value of $position is " +
+ "equal to the number of items in $target plus 1.";
+
public final static FunctionSignature signature =
new FunctionSignature(
new QName("insert-before", Function.BUILTIN_FUNCTION_NS),
- "Returns a new sequence constructed from the value of the target sequence" +
- "with the value of the sequence to insert inserted at the position specified.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.INTEGER, Cardinality.ONE),
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)
+ new FunctionParameterSequenceType("target", Type.ITEM, Cardinality.ZERO_OR_MORE, ""),
+ new FunctionParameterSequenceType("position", Type.INTEGER, Cardinality.ONE, ""),
+ new FunctionParameterSequenceType("inserts", Type.ITEM, Cardinality.ZERO_OR_MORE, "")
},
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE));
+ new FunctionReturnSequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE, "the new sequence"));
public FunInsertBefore(XQueryContext context) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunLang.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunLang.java 2009-07-31 02:42:17 UTC (rev 9594)
+++ trunk/eXist/src/org/exist/xquery/functions/FunLang.java 2009-07-31 03:58:55 UTC (rev 9595)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 the eXist team
+ * Copyright (C) 2001-2009 the eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -33,6 +33,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -46,24 +48,44 @@
public static String queryString = "(ancestor-or-self::*/@xml:lang)[position() = last()]";
public CompiledXQuery query;
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "This function tests whether the language of $node, or the context item if " +
+ "the second argument is omitted, as specified by xml:lang attributes is the " +
+ "same as, or is a sublanguage of, the language specified by $testlang. The " +
+ "behavior of the function if the second argument is omitted is exactly the " +
+ "same as if the context item (.) had been passed as the second argument. The " +
+ "language of the argument node, or the context item if the second argument is " +
+ "omitted, is determined by the value of the xml:lang attribute on the node, " +
+ "or, if the node has no such attribute, by the value of the xml:lang attribute " +
+ "on the nearest ancestor of the node that has an xml:lang attribute. If there " +
+ "is no such ancestor, then the function returns false\n\n" +
+
+ "The following errors may be raised: if the context item is undefined [err:XPDY0002]XP; " +
+ "if the context item is not a node [err:XPTY0004]XP.\n\n" +
+
+ "If $testlang is the empty sequence it is interpreted as the zero-length string.";
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("lang", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the context items xml:lang attribute is equal " +
- "to the value of $a, false otherwise.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)),
+ new FunctionParameterSequenceType("testLang", Type.STRING, Cardinality.ZERO_OR_ONE, "the language code")
+ },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true if the language code matches")
+ ),
new FunctionSignature(
new QName("lang", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the context items xml:lang attribute is equal " +
- "to the value of $a, false otherwise.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.NODE, Cardinality.EXACTLY_ONE)},
- new SequenceType(Type.BOOLEAN, Cardinality.ONE))
- };
+ new FunctionParameterSequenceType("testLang", Type.STRING, Cardinality.ZERO_OR_ONE, "the language code"),
+ new FunctionParameterSequenceType("node", Type.NODE, Cardinality.EXACTLY_ONE, "")
+ },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ONE, "true if the language code matches")
+ )
+ };
public FunLang(XQueryContext context, FunctionSignature signature) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunLast.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunLast.java 2009-07-31 02:42:17 UTC (rev 9594)
+++ trunk/eXist/src/org/exist/xquery/functions/FunLast.java 2009-07-31 03:58:55 UTC (rev 9595)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2000-2006 The eXist team
+ * Copyright (C) 2000-2009 The eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -29,10 +29,10 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
-import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.Type;
/**
@@ -48,7 +48,7 @@
"Returns the context size from the dynamic context. " +
"If the context item is undefined, an error is raised.",
null,
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE));
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE, "the context size from the dynamic context"));
public FunLast(XQueryContext context) {
super(context, signature);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-31 02:42:30
|
Revision: 9594
http://exist.svn.sourceforge.net/exist/?rev=9594&view=rev
Author: ixitar
Date: 2009-07-31 02:42:17 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function module documentation.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunLocalName.java
trunk/eXist/src/org/exist/xquery/functions/FunMatches.java
trunk/eXist/src/org/exist/xquery/functions/FunMax.java
trunk/eXist/src/org/exist/xquery/functions/FunMin.java
trunk/eXist/src/org/exist/xquery/functions/FunName.java
trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURI.java
trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURIForPrefix.java
trunk/eXist/src/org/exist/xquery/functions/FunNilled.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunLocalName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunLocalName.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunLocalName.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -1,5 +1,5 @@
/* eXist Open Source Native XML Database
- * Copyright (C) 2000-2006, the eXist team
+ * Copyright (C) 2000-2009, the eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -28,6 +28,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
@@ -41,23 +43,36 @@
*
*/
public class FunLocalName extends Function {
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns the local part of the name of $arg as an xs:string that " +
+ "will either be the zero-length string or will have the lexical form of an xs:NCName.\n\n" +
+ "If the argument is omitted, it defaults to the context item (.). " +
+ "The behavior of the function if the argument is omitted is exactly " +
+ "the same as if the context item had been passed as the argument.\n\n" +
+ "The following errors may be raised: if the context item is undefined " +
+ "[err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.\n\n" +
+ "If the argument is supplied and is the empty sequence, the function " +
+ "returns the zero-length string.\n\n" +
+ "If the target node has no name (that is, if it is a document node, a " +
+ "comment, or a text node), the function returns the zero-length string.\n\n" +
+ "Otherwise, the value returned will be the local part of the expanded-QName " +
+ "of the target node (as determined by the dm:node-name accessor in Section " +
+ "5.11 node-name AccessorDM. This will be an xs:string whose lexical form is an xs:NCName." ;
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("local-name", Function.BUILTIN_FUNCTION_NS),
- "Returns the local part of the name of the context item as an xs:string " +
- "that will either be the zero-length string or will have the lexical " +
- "form of an xs:NCName.",
+ FUNCTION_DESCRIPTION,
new SequenceType[0],
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "the local name")
),
new FunctionSignature(
new QName("local-name", Function.BUILTIN_FUNCTION_NS),
- "Returns the local part of the name of the value of $a as an xs:string " +
- "that will either be the zero-length string or will have the lexical " +
- "form of an xs:NCName.",
- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.NODE, Cardinality.ZERO_OR_ONE, "") },
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "the local name")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunMatches.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunMatches.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunMatches.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
+ * Copyright (C) 2001-09 Wolfgang M. Meier
* wol...@ex...
* http://exist.sourceforge.net
*
@@ -37,6 +37,8 @@
import org.exist.xquery.util.RegexTranslator;
import org.exist.xquery.util.RegexTranslator.RegexSyntaxException;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -57,31 +59,45 @@
*/
public class FunMatches extends Function implements Optimizable, IndexUseReporter {
+ protected static final String FUNCTION_DESCRIPTION =
+ "The function returns true if $input matches the regular expression " +
+ "supplied as $pattern as influenced by the value of $flags, if present; " +
+ "otherwise, it returns false.\n\n" +
+ "The effect of calling the first version of this function (omitting the " +
+ "argument $flags) is the same as the effect of calling the second version " +
+ "with the $flags argument set to a zero-length string. " +
+ "Flags are defined in 7.6.1.1 Flags.\n\n" +
+ "If $input is the empty sequence, it is interpreted as the zero-length string.\n\n" +
+ "Unless the metacharacters ^ and $ are used as anchors, the string is considered " +
+ "to match the pattern if any substring matches the pattern. But if anchors are used, " +
+ "the anchors must match the start/end of the string (in string mode), or the " +
+ "start/end of a line (in multiline mode).\n\n" +
+ "Note:\n\n" +
+ "This is different from the behavior of patterns in [XML Schema Part 2: Datatypes " +
+ "Second Edition], where regular expressions are implicitly anchored.\n\n" +
+ "Please note that - in contrast - with the " +
+ "specification - this method allows zero or more items for the string argument.\n\n" +
+ "An error is raised [err:FORX0002] if the value of $pattern is invalid " +
+ "according to the rules described in section 7.6.1 Regular Expression Syntax.\n\n" +
+ "An error is raised [err:FORX0001] if the value of $flags is invalid " +
+ "according to the rules described in section 7.6.1 Regular Expression Syntax.";
+
+ protected static final FunctionParameterSequenceType INPUT_ARG = new FunctionParameterSequenceType("input", Type.STRING, Cardinality.ZERO_OR_MORE, "the input string");
+ protected static final FunctionParameterSequenceType PATTERN_ARG = new FunctionParameterSequenceType("pattern", Type.STRING, Cardinality.EXACTLY_ONE, "the pattern");
+ protected static final FunctionParameterSequenceType FLAGS_ARG = new FunctionParameterSequenceType("flags", Type.STRING, Cardinality.EXACTLY_ONE, "");
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("matches", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the first argument string matches the regular expression specified " +
- "by the second argument. This function is optimized internally if a range index of type xs:string " +
- "is defined on the nodes passed to the first argument. Please note that - in contrast - with the " +
- "specification - this method allows zero or more items for the string argument.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
- },
- new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { INPUT_ARG, PATTERN_ARG },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE, "true if the pattern is a match")
),
new FunctionSignature(
new QName("matches", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the first argument string matches the regular expression specified " +
- "by the second argument. This function is optimized internally if a range index of type xs:string " +
- "is defined on the nodes passed to the first argument. Please note that - in contrast - with the " +
- "specification - this method allows zero or more items for the string argument.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
- },
- new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { INPUT_ARG, PATTERN_ARG, FLAGS_ARG },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE, "true if the pattern is a match")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunMax.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunMax.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunMax.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -37,6 +37,8 @@
import org.exist.xquery.value.ComputableValue;
import org.exist.xquery.value.DoubleValue;
import org.exist.xquery.value.FloatValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NumericValue;
import org.exist.xquery.value.QNameValue;
@@ -50,28 +52,57 @@
*/
public class FunMax extends CollatingFunction {
+ protected static final String FUNCTION_DESCRIPTION =
+ "Selects an item from the input sequence $arg whose value is " +
+ "greater than or equal to the value of every other item in the " +
+ "input sequence. If there are two or more such items, then the " +
+ "specific item whose value is returned is implementation dependent.\n\n" +
+ "The following rules are applied to the input sequence:\n\n" +
+ "- Values of type xs:untypedAtomic in $arg are cast to xs:double.\n" +
+ "- Numeric and xs:anyURI values are converted to the least common " +
+ "type that supports the ge operator by a combination of type " +
+ "promotion and subtype substitution. See Section B.1 Type " +
+ "PromotionXP and Section B.2 Operator MappingXP.\n\n" +
+ "The items in the resulting sequence may be reordered in an arbitrary " +
+ "order. The resulting sequence is referred to below as the converted " +
+ "sequence. This function returns an item from the converted sequence " +
+ "rather than the input sequence.\n\n" +
+ "If the converted sequence is empty, the empty sequence is returned.\n\n" +
+ "All items in $arg must be numeric or derived from a single base type " +
+ "for which the ge operator is defined. In addition, the values in the " +
+ "sequence must have a total order. If date/time values do not have a " +
+ "timezone, they are considered to have the implicit timezone provided " +
+ "by the dynamic context for purposes of comparison. Duration values " +
+ "must either all be xs:yearMonthDuration values or must all be " +
+ "xs:dayTimeDuration values.\n\n" +
+ "If any of these conditions is not met, then a type error is raised [err:FORG0006].\n\n" +
+ "If the converted sequence contains the value NaN, the value NaN is returned.\n\n" +
+ "If the items in the value of $arg are of type xs:string or types " +
+ "derived by restriction from xs:string, then the determination of " +
+ "the item with the largest value is made according to the collation " +
+ "that is used. If the type of the items in $arg is not xs:string " +
+ "and $collation is specified, the collation is ignored.\n\n" +
+ "The collation used by the invocation of this function is " +
+ "determined according to the rules in 7.3.1 Collations.";
+
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("max", Function.BUILTIN_FUNCTION_NS),
- "Selects an item from the input sequence $a whose value " +
- "is greater than or equal to the value of every other item in the " +
- "input sequence.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)
+ new FunctionParameterSequenceType("arg", Type.ATOMIC, Cardinality.ZERO_OR_MORE, "")
},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE, "the max value")
),
new FunctionSignature(
new QName("max", Function.BUILTIN_FUNCTION_NS),
- "Selects an item from the input sequence $a whose value " +
- "is greater than or equal to the value of every other item in the " +
- "input sequence. The collation URI specified in $b will be used for " +
- "string comparisons.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("arg", Type.ATOMIC, Cardinality.ZERO_OR_MORE, ""),
+ new FunctionParameterSequenceType("collation", Type.STRING, Cardinality.EXACTLY_ONE, "")
},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE, "the max value")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunMin.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunMin.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunMin.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
+ * Copyright (C) 2001-09 Wolfgang M. Meier
* wol...@ex...
* http://exist.sourceforge.net
*
@@ -37,6 +37,8 @@
import org.exist.xquery.value.ComputableValue;
import org.exist.xquery.value.DoubleValue;
import org.exist.xquery.value.FloatValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NumericValue;
import org.exist.xquery.value.QNameValue;
@@ -50,24 +52,62 @@
*/
public class FunMin extends CollatingFunction {
+ protected static final String FUNCTION_DESCRIPTION =
+
+ "selects an item from the input sequence $arg whose value is " +
+ "less than or equal to the value of every other item in the " +
+ "input sequence. If there are two or more such items, then " +
+ "the specific item whose value is returned is implementation dependent.\n\n" +
+ "The following rules are applied to the input sequence:\n\n" +
+ "- Values of type xs:untypedAtomic in $arg are cast to xs:double.\n" +
+ "- Numeric and xs:anyURI values are converted to the least common " +
+ "type that supports the le operator by a combination of type promotion " +
+ "and subtype substitution. See Section B.1 Type PromotionXP and " +
+ "Section B.2 Operator MappingXP.\n\n" +
+
+ "The items in the resulting sequence may be reordered in an arbitrary " +
+ "order. The resulting sequence is referred to below as the converted " +
+ "sequence. This function returns an item from the converted sequence " +
+ "rather than the input sequence.\n\n" +
+
+ "If the converted sequence is empty, the empty sequence is returned.\n\n" +
+
+ "All items in $arg must be numeric or derived from a single base type " +
+ "for which the le operator is defined. In addition, the values in the " +
+ "sequence must have a total order. If date/time values do not have a " +
+ "timezone, they are considered to have the implicit timezone provided " +
+ "by the dynamic context for the purpose of comparison. Duration values " +
+ "must either all be xs:yearMonthDuration values or must all be " +
+ "xs:dayTimeDuration values.\n\n" +
+
+ "If any of these conditions is not met, a type error is raised [err:FORG0006].\n\n" +
+
+ "If the converted sequence contains the value NaN, the value NaN is returned.\n\n" +
+
+ "If the items in the value of $arg are of type xs:string or types derived " +
+ "by restriction from xs:string, then the determination of the item with " +
+ "the smallest value is made according to the collation that is used. If " +
+ "the type of the items in $arg is not xs:string and $collation is " +
+ "specified, the collation is ignored.\n\n" +
+
+ "The collation used by the invocation of this function is determined " +
+ "according to the rules in 7.3.1 Collations.";
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("min", Function.BUILTIN_FUNCTION_NS),
- "Selects an item from the input sequence $a whose value is less than or equal to " +
- "the value of every other item in the input sequence.",
- new SequenceType[] { new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE)},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.ATOMIC, Cardinality.ZERO_OR_MORE, "")},
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE, "the minimum value")
),
new FunctionSignature(
new QName("min", Function.BUILTIN_FUNCTION_NS),
- "Selects an item from the input sequence $a whose value is less than or equal to " +
- "the value of every other item in the input sequence. The collation specified in $b is " +
- "used for string comparisons.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("arg", Type.ATOMIC, Cardinality.ZERO_OR_MORE, ""),
+ new FunctionParameterSequenceType("collation", Type.STRING, Cardinality.EXACTLY_ONE, "")
},
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE, "the minimum value")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunName.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunName.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -1,5 +1,5 @@
/* eXist Open Source Native XML Database
- * Copyright (C) 2000-03, Wolfgang M. Meier (me...@if...)
+ * Copyright (C) 2000-09, Wolfgang M. Meier (me...@if...)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
@@ -29,6 +29,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
@@ -43,20 +45,39 @@
*/
public class FunName extends Function {
+ protected static final String FUNCTION_DESCRIPTION =
+
+ "Returns the name of a node, as an xs:string that is either " +
+ "the zero-length string, or has the lexical form of an xs:QName.\n\n" +
+
+ "If the argument is omitted, it defaults to the context item (.). " +
+ "The behavior of the function if the argument is omitted is exactly " +
+ "the same as if the context item had been passed as the argument.\n\n" +
+
+ "The following errors may be raised: if the context item is undefined " +
+ "[err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.\n\n" +
+
+ "If the argument is supplied and is the empty sequence, the function " +
+ "returns the zero-length string.\n\n" +
+
+ "If the target node has no name (that is, if it is a document node, a comment, " +
+ "a text node, or a namespace binding having no name), the function returns " +
+ "the zero-length string.\n\n" +
+
+ "Otherwise, the value returned is fn:string(fn:node-name($arg)).";
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("name", Function.BUILTIN_FUNCTION_NS),
- "Returns the name of a node, as an xs:string that is " +
- "either the zero-length string, or has the lexical form of an xs:QName",
+ FUNCTION_DESCRIPTION,
new SequenceType[0],
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.ZERO_OR_ONE, "the name")
),
new FunctionSignature(
new QName("name", Function.BUILTIN_FUNCTION_NS),
- "Returns the name of a node, as an xs:string that is " +
- "either the zero-length string, or has the lexical form of an xs:QName",
- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.NODE, Cardinality.ZERO_OR_ONE, "") },
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.ZERO_OR_ONE, "the name")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURI.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURI.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -30,6 +30,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AnyURIValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
@@ -43,26 +45,37 @@
*/
public class FunNamespaceURI extends Function {
+ protected static final String FUNCTION_DESCRIPTION =
+
+ "Returns the namespace URI of the xs:QName of $arg.\n\n" +
+
+ "If the argument is omitted, it defaults to the context node (.). " +
+ "The behavior of the function if the argument is omitted is exactly " +
+ "the same as if the context item had been passed as the argument.\n\n" +
+
+ "The following errors may be raised: if the context item is undefined " +
+ "[err:XPDY0002]XP; if the context item is not a node [err:XPTY0004]XP.\n\n" +
+
+ "If $arg is neither an element nor an attribute node, or if it is an " +
+ "element or attribute node whose expanded-QName (as determined by the " +
+ "dm:node-name accessor in the Section 5.11 node-name AccessorDM) is " +
+ "in no namespace, then the function returns the xs:anyURI " +
+ "corresponding to the zero-length string.";
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("namespace-uri", Function.BUILTIN_FUNCTION_NS),
- "Returns the namespace URI of the xs:QName of the context item. " +
- "If the context item is in no namespace or is neither an element nor attribute node, " +
- "returns the xs:anyURI equivalent to the zero-length string." +
- " Raises an error if the context item is undefined or not a node.",
+ FUNCTION_DESCRIPTION,
new SequenceType[0],
- new SequenceType(Type.ANY_URI, Cardinality.EXACTLY_ONE),
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.EXACTLY_ONE, "the namespace URI"),
false),
new FunctionSignature(
new QName("namespace-uri", Function.BUILTIN_FUNCTION_NS),
- "Returns the namespace URI of the xs:QName value of $a. " +
- "If $a is in no namespace or is neither an element nor attribute node, " +
- "returns the xs:anyURI eqvivalent to the zero-length string." +
- " Raises an error if the context item is undefined or not a node.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE)
+ new FunctionParameterSequenceType("arg", Type.NODE, Cardinality.ZERO_OR_ONE, "")
},
- new SequenceType(Type.ANY_URI, Cardinality.EXACTLY_ONE),
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.EXACTLY_ONE, "the namespace URI"),
false)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURIForPrefix.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURIForPrefix.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNamespaceURIForPrefix.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2008 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -40,6 +40,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AnyURIValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -47,20 +49,29 @@
import org.w3c.dom.Node;
public class FunNamespaceURIForPrefix extends BasicFunction {
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns the namespace URI of one of the in-scope namespaces " +
+ "for $element, identified by its namespace prefix.\n\n" +
+ "If $element has an in-scope namespace whose namespace prefix " +
+ "is equal to $prefix, it returns the namespace URI of that namespace. " +
+ "If $prefix is the zero-length string or the empty sequence, it " +
+ "returns the namespace URI of the default (unnamed) namespace. " +
+ "Otherwise, it returns the empty sequence.\n\n" +
+
+ "Prefixes are equal only if their Unicode code points match exactly.";
+
+
public final static FunctionSignature signature =
new FunctionSignature(
new QName("namespace-uri-for-prefix", Function.BUILTIN_FUNCTION_NS),
- "Returns the namespace URI of one of the in-scope namespaces for $b, identified by its namespace prefix. " +
- "If $b has an in-scope namespace whose namespace prefix is equal to $a, it returns the namespace " +
- "URI of that namespace. If $b is the zero-length string or the empty sequence, " +
- "it returns the namespace URI of the default (unnamed) namespace. Otherwise, " +
- "it returns the empty sequence.",
+ FUNCTION_DESCRIPTION,
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.ELEMENT, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("prefix", Type.STRING, Cardinality.ZERO_OR_ONE, ""),
+ new FunctionParameterSequenceType("element", Type.ELEMENT, Cardinality.EXACTLY_ONE, "")
},
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE));
+ new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE, "the namespace URI"));
public FunNamespaceURIForPrefix(XQueryContext context) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNilled.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNilled.java 2009-07-31 01:17:01 UTC (rev 9593)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNilled.java 2009-07-31 02:42:17 UTC (rev 9594)
@@ -32,6 +32,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.Sequence;
@@ -49,9 +51,11 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("nilled", Function.BUILTIN_FUNCTION_NS),
- "Returns whether $a is nilled of not.",
- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE));
+ "Returns an xs:boolean indicating whether the argument node is \"nilled\". " +
+ "If the argument is not an element node, returns the empty sequence. " +
+ "If the argument is the empty sequence, returns the empty sequence.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.NODE, Cardinality.ZERO_OR_ONE, "") },
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE, "true if the argument node is \"nilled\""));
public FunNilled(XQueryContext context) {
super(context, signature);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-31 01:17:12
|
Revision: 9593
http://exist.svn.sourceforge.net/exist/?rev=9593&view=rev
Author: ixitar
Date: 2009-07-31 01:17:01 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function module documentation.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunNodeName.java
trunk/eXist/src/org/exist/xquery/functions/FunNormalizeSpace.java
trunk/eXist/src/org/exist/xquery/functions/FunNormalizeUnicode.java
trunk/eXist/src/org/exist/xquery/functions/FunNot.java
trunk/eXist/src/org/exist/xquery/functions/FunNumber.java
trunk/eXist/src/org/exist/xquery/functions/FunOneOrMore.java
trunk/eXist/src/org/exist/xquery/functions/FunPosition.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNodeName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNodeName.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNodeName.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-04 Wolfgang M. Meier
+ * Copyright (C) 2001-09 Wolfgang M. Meier
* wol...@ex...
* http://exist-db.org
*
@@ -31,6 +31,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.QNameValue;
@@ -51,10 +53,10 @@
new FunctionSignature(
new QName("node-name", Function.BUILTIN_FUNCTION_NS),
"Returns an expanded-QName for node kinds that can have names. For other kinds " +
- "of nodes it returns the empty sequence. If $a is the empty sequence, the " +
+ "of nodes it returns the empty sequence. If $arg is the empty sequence, the " +
"empty sequence is returned.",
- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE));
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.NODE, Cardinality.ZERO_OR_ONE, "") },
+ new FunctionReturnSequenceType(Type.QNAME, Cardinality.ZERO_OR_ONE, "the expanded QName"));
/**
* @param context
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNormalizeSpace.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNormalizeSpace.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNormalizeSpace.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2007 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -31,6 +31,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -43,23 +45,35 @@
*/
public class FunNormalizeSpace extends Function {
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns the value of $arg with whitespace normalized by stripping leading " +
+ "and trailing whitespace and replacing sequences of one or more than one " +
+ "whitespace character with a single space, #x20.\n\n" +
+ "The whitespace characters are defined in the metasymbol S (Production 3) " +
+ "of [Extensible Markup Language (XML) 1.0 Recommendation (Third Edition)].\n\n" +
+ "Note:\n\n" +
+ "The definition of the metasymbol S (Production 3), is " +
+ "unchanged in [Extensible Markup Language (XML) 1.1 Recommendation].\n\n" +
+ "If the value of $arg is the empty sequence, returns the zero-length string.\n\n" +
+ "If no argument is supplied, $arg defaults to the string value (calculated " +
+ "using fn:string()) of the context item (.). If no argument is supplied or " +
+ "if the argument is the context item and the context item is undefined an " +
+ "error is raised: [err:XPDY0002].";
+
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "the normalized text");
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("normalize-space", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of the context item with whitespace normalized by stripping leading and trailing whitespace and replacing sequences of one or more whitespace character with a single space.",
+ FUNCTION_DESCRIPTION,
new SequenceType[0],
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ RETURN_TYPE
),
new FunctionSignature(
new QName("normalize-space", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of $a with whitespace normalized by stripping " +
- "leading and trailing whitespace and replacing sequences of one " +
- "or more whitespace character with a single space." +
- "If the value of $a is the empty sequence, returns the " +
- "zero-length string. If no argument is supplied $a defaults " +
- "to the string value of the context item.",
- new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.STRING, Cardinality.ZERO_OR_ONE, "the string to normalize") },
+ RETURN_TYPE
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNormalizeUnicode.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNormalizeUnicode.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNormalizeUnicode.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,5 +1,5 @@
/* eXist Native XML Database
- * Copyright (C) 2000-2006, The eXist Project
+ * Copyright (C) 2000-2009, The eXist Project
* http://exist-db.org/
*
* This library is free software; you can redistribute it and/or
@@ -29,6 +29,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -48,25 +50,53 @@
private static Integer DUMMY_INTEGER = new Integer(0);
private Constructor constructor = null;
private Method method = null;
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns the value of $arg normalized according to the " +
+ "normalization criteria for a normalization form identified " +
+ "by the value of $normalizationForm. The effective value of " +
+ "the $normalizationForm is computed by removing leading and " +
+ "trailing blanks, if present, and converting to upper case.\n\n" +
+ "If the value of $arg is the empty sequence, returns the zero-length string.\n\n" +
+ "See [Character Model for the World Wide Web 1.0: Normalization] " +
+ "for a description of the normalization forms.\n\n" +
+ "If the $normalizationForm is absent, as in the first format above, " +
+ "it shall be assumed to be \"NFC\"\n\n" +
+ "- If the effective value of $normalizationForm is \"NFC\", then the value " +
+ "returned by the function is the value of $arg in Unicode Normalization Form C (NFC).\n" +
+ "- If the effective value of $normalizationForm is \"NFD\", then the value " +
+ "returned by the function is the value of $arg in Unicode Normalization Form D (NFD).\n" +
+ "- If the effective value of $normalizationForm is \"NFKC\", then the value " +
+ "returned by the function is the value of $arg in Unicode Normalization Form KC (NFKC).\n" +
+ "- If the effective value of $normalizationForm is \"NFKD\", then the value " +
+ "returned by the function is the value of $arg in Unicode Normalization Form KD (NFKD).\n" +
+ "- If the effective value of $normalizationForm is \"FULLY-NORMALIZED\", then the value " +
+ "returned by the function is the value of $arg in the fully normalized form.\n" +
+ "- If the effective value of $normalizationForm is the zero-length string, " +
+ "no normalization is performed and $arg is returned.\n\n" +
+ "Conforming implementations must support normalization form \"NFC\" and may " +
+ "support normalization forms \"NFD\", \"NFKC\", \"NFKD\", \"FULLY-NORMALIZED\". " +
+ "They may also support other normalization forms with implementation-defined semantics. " +
+ "If the effective value of the $normalizationForm is other than one of the values " +
+ "supported by the implementation, then an error is raised [err:FOCH0003].";
- public final static FunctionSignature signatures [] = {
+ protected static final FunctionParameterSequenceType ARG_PARAM = new FunctionParameterSequenceType("arg", Type.STRING, Cardinality.ZERO_OR_ONE, "the unicode string to normalize");
+ protected static final FunctionParameterSequenceType NF_PARAM = new FunctionParameterSequenceType("normalizationForm", Type.STRING, Cardinality.ONE, "the normalization form");
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.STRING, Cardinality.ONE, "the normalized text");
+
+ public final static FunctionSignature signatures [] = {
new FunctionSignature(
new QName("normalize-unicode", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of $a normalized according to the normalization form NFC. ",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
- },
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG_PARAM },
+ RETURN_TYPE
),
new FunctionSignature (
- new QName("normalize-unicode", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of $a normalized according to the normalization criteria for a " +
- "normalization form identified by the value of $b. ",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ONE)
- },
- new SequenceType(Type.BOOLEAN, Cardinality.ONE)),
+ new QName("normalize-unicode", Function.BUILTIN_FUNCTION_NS),
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG_PARAM, NF_PARAM },
+ RETURN_TYPE
+ )
};
public FunNormalizeUnicode(XQueryContext context, FunctionSignature signature) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNot.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNot.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNot.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 The eXist team
+ * Copyright (C) 2001-2009 The eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -35,6 +35,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceIterator;
@@ -46,10 +48,12 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("not", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the effective boolean value (ebv) is false, true otherwise.",
+ "$arg is first reduced to an effective boolean value by applying " +
+ "the fn:boolean() function. Returns true if the effective boolean " +
+ "value is false, and false if the effective boolean value is true.",
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)},
- new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE));
+ new FunctionParameterSequenceType("arg", Type.ITEM, Cardinality.ZERO_OR_MORE, "")},
+ new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE, "the negative of the $arg"));
private boolean inWhereClause = false;
Modified: trunk/eXist/src/org/exist/xquery/functions/FunNumber.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunNumber.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunNumber.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2000-2006 The eXist team
+ * Copyright (C) 2000-2009 The eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -30,6 +30,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.DoubleValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -40,22 +42,36 @@
*
*/
public class FunNumber extends Function {
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns the value indicated by $arg or, if $arg is not specified, " +
+ "the context item after atomization, converted to an xs:double\n\n" +
+ "Calling the zero-argument version of the function is defined to " +
+ "give the same result as calling the single-argument version with " +
+ "the context item (.). That is, fn:number() is equivalent to fn:number(.).\n\n" +
+ "If $arg is the empty sequence or if $arg or the context item cannot be " +
+ "converted to an xs:double, the xs:double value NaN is returned. If the " +
+ "context item is undefined an error is raised: [err:XPDY0002]XP.\n\n" +
+ "If $arg is the empty sequence, NaN is returned. Otherwise, $arg, or " +
+ "the context item after atomization, is converted to an xs:double " +
+ "following the rules of 17.1.3.2 Casting to xs:double. If the conversion " +
+ "to xs:double fails, the xs:double value NaN is returned.";
+ protected static final FunctionParameterSequenceType ARG_PARAM = new FunctionParameterSequenceType("arg", Type.ATOMIC, Cardinality.ZERO_OR_ONE, "");
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE, "the numerical value converted from $arg");
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("number", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of the context item as a xs:double. " +
- "If the context item cannot be converted to a xs:double, NaN is returned.",
+ FUNCTION_DESCRIPTION,
new SequenceType[0],
- new SequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE)
+ RETURN_TYPE
),
new FunctionSignature(
new QName("number", Function.BUILTIN_FUNCTION_NS),
- "Returns the value of $a as a xs:double. " +
- "If the value of $a is the empty sequence or cannot be converted to a xs:double, NaN is returned.",
- new SequenceType[] {
- new SequenceType(Type.ATOMIC, Cardinality.ZERO_OR_ONE)},
- new SequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG_PARAM },
+ RETURN_TYPE
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunOneOrMore.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunOneOrMore.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunOneOrMore.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
+ * Copyright (C) 2001-09 Wolfgang M. Meier
* wol...@ex...
* http://exist.sourceforge.net
*
@@ -30,6 +30,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -48,9 +50,9 @@
"Returns the argument sequence if it contains one or more items. Otherwise, " +
"raises an error.",
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)
+ new FunctionParameterSequenceType("arg", Type.ITEM, Cardinality.ZERO_OR_MORE, "")
},
- new SequenceType(Type.ITEM, Cardinality.ONE_OR_MORE));
+ new FunctionReturnSequenceType(Type.ITEM, Cardinality.ONE_OR_MORE, "the Sequence passed in by $arg"));
/**
* @param context
Modified: trunk/eXist/src/org/exist/xquery/functions/FunPosition.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunPosition.java 2009-07-31 00:07:09 UTC (rev 9592)
+++ trunk/eXist/src/org/exist/xquery/functions/FunPosition.java 2009-07-31 01:17:01 UTC (rev 9593)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 The eXist team
+ * Copyright (C) 2001-2009 The eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -29,10 +29,10 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
-import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.Type;
/**
@@ -47,7 +47,7 @@
"Returns the context position from the dynamic context." +
"If the context item is undefined, raises an error.",
null,
- new SequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE));
+ new FunctionReturnSequenceType(Type.INTEGER, Cardinality.ZERO_OR_ONE, "the context position"));
public FunPosition(XQueryContext context) {
super(context, signature);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-31 00:07:26
|
Revision: 9592
http://exist.svn.sourceforge.net/exist/?rev=9592&view=rev
Author: ixitar
Date: 2009-07-31 00:07:09 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
[documentation] enhancing function module documentation.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java 2009-07-30 23:17:13 UTC (rev 9591)
+++ trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java 2009-07-31 00:07:09 UTC (rev 9592)
@@ -32,36 +32,50 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.BooleanValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.Type;
public class FunStartsWith extends CollatingFunction {
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns an xs:boolean indicating whether or not " +
+ "the value of $arg1 starts with a sequence of collation " +
+ "units that provides a minimal match to the collation " +
+ "units of $arg2 according to the collation that is used.\n\n" +
+ "Note:\n\n" +
+ "\"Minimal match\" is defined in [Unicode Collation Algorithm].\n\n" +
+ "If the value of $arg1 or $arg2 is the empty sequence, or " +
+ "contains only ignorable collation units, it is interpreted " +
+ "as the zero-length string.\n\nIf the value of $arg2 is the " +
+ "zero-length string, then the function returns true. If the " +
+ "value of $arg1 is the zero-length string and the value of " +
+ "$arg2 is not the zero-length string, then the function " +
+ "returns false.\n\n" +
+ "The collation used by the invocation of this function is " +
+ "determined according to the rules in 7.3.1 Collations. " +
+ "If the specified collation does not support collation " +
+ "units an error may be raised [err:FOCH0004].";
+ protected static final FunctionParameterSequenceType ARG1_PARAM = new FunctionParameterSequenceType("arg1", Type.STRING, Cardinality.ZERO_OR_ONE, "the input test string");
+ protected static final FunctionParameterSequenceType ARG2_PARAM = new FunctionParameterSequenceType("arg2", Type.STRING, Cardinality.ZERO_OR_ONE, "the string to deterine if it is at the beginning of $arg1");
+ protected static final FunctionParameterSequenceType COLLATION_PARAM = new FunctionParameterSequenceType("collation", Type.STRING, Cardinality.EXACTLY_ONE, "");
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE, "true if $arg2 is at the beginning of the string $arg1");
+
public final static FunctionSignature signatures[] = {
new FunctionSignature (
new QName("starts-with", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the string value of $b is a prefix of the " +
- "string value of $a, false otherwise. If either $a or $b is the empty " +
- "sequence, the empty sequence is returned.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
- },
- new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE)),
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG1_PARAM, ARG2_PARAM },
+ RETURN_TYPE),
new FunctionSignature (
new QName("starts-with", Function.BUILTIN_FUNCTION_NS),
- "Returns true if the string value of $b is a prefix of the " +
- "string value of $a using collation $c, " + " false otherwise. If " +
- "either $a or $b is the empty sequence, the empty sequence" +
- " is returned.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
- },
- new SequenceType(Type.BOOLEAN, Cardinality.ZERO_OR_ONE))
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG1_PARAM, ARG2_PARAM, COLLATION_PARAM },
+ RETURN_TYPE)
};
public FunStartsWith(XQueryContext context, FunctionSignature signature) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2009-07-30 23:17:21
|
Revision: 9591
http://exist.svn.sourceforge.net/exist/?rev=9591&view=rev
Author: jmfg
Date: 2009-07-30 23:17:13 +0000 (Thu, 30 Jul 2009)
Log Message:
-----------
[ignore] Added JUnit tests for sorting routines, contributed by Paul Murray.
These tests are disabled because they uncover a bug which "hangs"
the sorting routines.
Modified Paths:
--------------
trunk/eXist/build/scripts/junit.xml
Added Paths:
-----------
trunk/eXist/test/src/org/exist/util/SortTests.java
trunk/eXist/test/src/org/exist/util/sorters/
trunk/eXist/test/src/org/exist/util/sorters/ComparatorChecker.java
trunk/eXist/test/src/org/exist/util/sorters/FastQSortTester.java
trunk/eXist/test/src/org/exist/util/sorters/HeapSortTester.java
trunk/eXist/test/src/org/exist/util/sorters/InsertionSortTester.java
trunk/eXist/test/src/org/exist/util/sorters/ListChecker.java
trunk/eXist/test/src/org/exist/util/sorters/LongArrayAndObjectChecker.java
trunk/eXist/test/src/org/exist/util/sorters/NodeProxyByIdChecker.java
trunk/eXist/test/src/org/exist/util/sorters/NodeProxyChecker.java
trunk/eXist/test/src/org/exist/util/sorters/ObjectAndIntArrayChecker.java
trunk/eXist/test/src/org/exist/util/sorters/PlainArrayChecker.java
trunk/eXist/test/src/org/exist/util/sorters/SortMethodChecker.java
trunk/eXist/test/src/org/exist/util/sorters/SortTestCase.java
trunk/eXist/test/src/org/exist/util/sorters/SortTestComparator.java
trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeId.java
trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeProxy.java
trunk/eXist/test/src/org/exist/util/sorters/SortingAlgorithmTester.java
Modified: trunk/eXist/build/scripts/junit.xml
===================================================================
--- trunk/eXist/build/scripts/junit.xml 2009-07-30 23:04:27 UTC (rev 9590)
+++ trunk/eXist/build/scripts/junit.xml 2009-07-30 23:17:13 UTC (rev 9591)
@@ -99,6 +99,9 @@
<formatter type="plain"/>
<formatter type="xml"/>
<test fork="yes" name="xquery.RunTests" todir="${junit.reports.dat}"/>
+ <!--
+ <test fork="yes" name="org.exist.util.SortTests" todir="${junit.reports.dat}"/>
+ -->
<test fork="yes" name="org.exist.xmldb.XmldbLocalTests" todir="${junit.reports.dat}"/>
<test fork="yes" name="org.exist.xupdate.AllXupdateTests" todir="${junit.reports.dat}"/>
<test fork="yes" name="org.exist.xquery.AllXqueryTests" todir="${junit.reports.dat}"/>
Added: trunk/eXist/test/src/org/exist/util/SortTests.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/SortTests.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/SortTests.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,73 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.exist.util.sorters.SortMethodChecker;
+import org.exist.util.sorters.SortingAlgorithmTester;
+
+/**
+ * Perform comprehensive testing of the eXist sort algorithms.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+
+public class SortTests extends TestSuite {
+
+ public static Test suite() {
+ return new SortTests("Test suite for org.exist.util sorting algorithms");
+ }
+
+ public static Test suite(String name) {
+ return new SortTests(name);
+ }
+
+ private void init() {
+ for (SortingAlgorithmTester s : SortingAlgorithmTester.allSorters()) {
+ for (SortMethodChecker c : SortMethodChecker.allCheckers(s)) {
+ addTest(c.suite());
+ }
+ }
+ }
+
+ public SortTests() {
+ init();
+ }
+
+ public SortTests(String name) {
+ super(name);
+ init();
+ }
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/ComparatorChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/ComparatorChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/ComparatorChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,77 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.lang.reflect.Method;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test case to check methods that use comparators.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+
+public abstract class ComparatorChecker extends SortMethodChecker {
+
+ enum SortOrder {
+ ASCENDING, DESCENDING, UNSTABLE, RANDOM
+ };
+
+ ComparatorChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ abstract void check(SortOrder sortOrder, int lo, int hi) throws Exception;
+
+ abstract void sort(SortOrder sortOrder, int lo, int hi) throws Exception;
+
+ void sort(SortOrder sortOrder) throws Exception {
+ sort(sortOrder, 0, getLength() - 1);
+ }
+
+ void check(SortOrder sortOrder) throws Exception {
+ check(sortOrder, 0, getLength() - 1);
+ }
+
+ public Test suite() {
+ TestSuite s = new TestSuite();
+ for (Method m : SortTestComparator.class.getMethods()) {
+ if (m.getName().startsWith("test")) {
+ s.addTest(new SortTestComparator<ComparatorChecker>(this, m
+ .getName()));
+ }
+ }
+ s.setName(sorter.getClass().getSimpleName() + " "
+ + getClass().getSimpleName());
+
+ return s;
+ }
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/FastQSortTester.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/FastQSortTester.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/FastQSortTester.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,100 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.exist.dom.NodeProxy;
+import org.exist.util.FastQSort;
+
+/**
+ * Interface to the quicksort methods.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ * @see FastQSort
+ *
+ */
+
+class FastQSortTester extends SortingAlgorithmTester {
+ public <T> void invokeSort(T a[], Comparator<T> c, int lo, int hi)
+ throws Exception
+ {
+ FastQSort.sort(a, c, lo, hi);
+ }
+
+ public void invokeSort(Comparable<?>[] a, int lo, int hi)
+ throws Exception
+ {
+ FastQSort.sort(a, lo, hi);
+ }
+
+ public void sort(Comparable<?>[] a, int lo, int hi)
+ throws Exception
+ {
+ FastQSort.sort(a, lo, hi);
+ }
+
+ public void sort(Comparable<?>[] a, int lo, int hi, int[] b)
+ throws Exception
+ {
+ FastQSort.sort(a, lo, hi, b);
+ }
+
+ public <T extends Comparable<T>> void sort(T[] a, Comparator<T> c, int lo,
+ int hi)
+ throws Exception
+ {
+ FastQSort.sort(a, c, lo, hi);
+
+ }
+
+ public <T extends Comparable<T>> void sort(List<T> a, int lo, int hi)
+ throws Exception
+ {
+ FastQSort.sort(a, lo, hi);
+ }
+
+ public void sort(int lo, int hi,NodeProxy[] a)
+ throws Exception
+ {
+ FastQSort.sort(a, lo, hi);
+ }
+
+ public void sort(long[] a, int lo, int hi, Object[] b)
+ throws Exception
+ {
+ FastQSort.sort(a, lo, hi, b);
+ }
+
+ public void sortByNodeId(NodeProxy[] a, int lo, int hi)
+ throws Exception
+ {
+ FastQSort.sortByNodeId(a, lo, hi);
+ }
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/HeapSortTester.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/HeapSortTester.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/HeapSortTester.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,100 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.exist.dom.NodeProxy;
+import org.exist.util.HeapSort;
+
+/**
+ * Interface to the heapsort methods.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ * @see HeapSort
+ *
+ */
+
+class HeapSortTester extends SortingAlgorithmTester {
+ public void invokeSort(Comparable<?>[] a, int lo, int hi)
+ throws Exception
+ {
+ HeapSort.sort(a, lo, hi);
+ }
+
+ public <T> void invokeSort(T a[], Comparator<T> c, int lo, int hi)
+ throws Exception
+ {
+ HeapSort.sort(a, c, lo, hi);
+ }
+
+ public void sort(Comparable<?>[] a, int lo, int hi)
+ throws Exception
+ {
+ HeapSort.sort(a, lo, hi);
+ }
+
+ public void sort(Comparable<?>[] a, int lo, int hi, int[] b)
+ throws Exception
+ {
+ HeapSort.sort(a, lo, hi, b);
+ }
+
+ public <T extends Comparable<T>> void sort(T[] a, Comparator<T> c, int lo,
+ int hi)
+ throws Exception
+ {
+ HeapSort.sort(a, c, lo, hi);
+
+ }
+
+ public <T extends Comparable<T>> void sort(List<T> a, int lo, int hi)
+ throws Exception
+ {
+ HeapSort.sort(a, lo, hi);
+ }
+
+ public void sort(int lo, int hi,NodeProxy[] a)
+ throws Exception
+ {
+ HeapSort.sort(a, lo, hi);
+ }
+
+ public void sort(long[] a, int lo, int hi, Object[] b)
+ throws Exception
+ {
+ HeapSort.sort(a, lo, hi, b);
+ }
+
+ public void sortByNodeId(NodeProxy[] a, int lo, int hi)
+ throws Exception
+ {
+ HeapSort.sortByNodeId(a, lo, hi);
+ }
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/InsertionSortTester.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/InsertionSortTester.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/InsertionSortTester.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,98 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.exist.dom.NodeProxy;
+import org.exist.util.InsertionSort;
+
+/**
+ * Interface to the insertion sort methods.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ * @see InsertionSort
+ */
+
+class InsertionSortTester extends SortingAlgorithmTester {
+ public void invokeSort(Comparable<?>[] a, int lo, int hi)
+ throws Exception
+ {
+ InsertionSort.sort(a, lo, hi);
+ }
+
+ public <T> void invokeSort(T a[], Comparator<T> c, int lo, int hi)
+ throws Exception
+ {
+ InsertionSort.sort(a, c, lo, hi);
+ }
+
+ public void sort(Comparable<?>[] a, int lo, int hi)
+ throws Exception
+ {
+ InsertionSort.sort(a, lo, hi);
+ }
+
+ public void sort(Comparable<?>[] a, int lo, int hi, int[] b)
+ throws Exception
+ {
+ InsertionSort.sort(a, lo, hi, b);
+ }
+
+ public <T extends Comparable<T>> void sort(T[] a, Comparator<T> c, int lo,
+ int hi)
+ throws Exception
+ {
+ InsertionSort.sort(a, c, lo, hi);
+ }
+
+ public <T extends Comparable<T>> void sort(List<T> a, int lo, int hi)
+ throws Exception
+ {
+ InsertionSort.sort(a, lo, hi);
+ }
+
+ public void sort(int lo, int hi, NodeProxy[] a)
+ throws Exception
+ {
+ InsertionSort.sort(a, lo, hi);
+ }
+
+ public void sort(long[] a, int lo, int hi, Object[] b)
+ throws Exception
+ {
+ InsertionSort.sort(a, lo, hi, b);
+ }
+
+ public void sortByNodeId(NodeProxy[] a, int lo, int hi)
+ throws Exception
+ {
+ InsertionSort.sortByNodeId(a, lo, hi);
+ }
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/ListChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/ListChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/ListChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,89 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Check sort(List).
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+
+class ListChecker extends SortMethodChecker {
+ ListChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ List<Integer> a;
+
+ /**
+ * It asserts the ascending ordering of an Integer List
+ */
+ void check(int lo, int hi) {
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(a.get(i).intValue() <= a.get(i + 1).intValue());
+ }
+ }
+
+ /**
+ * It returns the length of the list to be used on assertion
+ */
+ int getLength() {
+ return a.size();
+ }
+
+ /**
+ * It loads an input int array into the internal Integer list
+ */
+ void init(int[] values) throws Exception {
+ a = new ArrayList<Integer>(values.length);
+ for (int i = 0; i < values.length; i++) {
+ a.add(Integer.valueOf(values[i]));
+ }
+ }
+
+ /**
+ * This method invokes sort routine on selected sorter
+ */
+ void sort(int lo, int hi) throws Exception {
+ sorter.sort(a, lo, hi);
+ }
+
+ /**
+ * This method asserts single values
+ */
+ void checkValue(int idx, int v) {
+ assertEquals("@" + idx, v, a.get(idx).intValue());
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/LongArrayAndObjectChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/LongArrayAndObjectChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/LongArrayAndObjectChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,92 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * check sort(long[], Object[])
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+class LongArrayAndObjectChecker extends SortMethodChecker {
+ LongArrayAndObjectChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ long[] a;
+ Integer[] b;
+
+ /**
+ * It returns the length of the array to be used on assertion
+ */
+ int getLength() {
+ return a.length;
+ }
+
+ /**
+ * It asserts the ascending ordering of the couple of
+ * Integer and long arrays given an specific comparator
+ */
+ void check(int lo, int hi) {
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(a[i] <= a[i + 1]);
+ assertEquals(a[i], b[i].intValue());
+ }
+ assertEquals(a[hi], b[hi].intValue());
+ }
+
+ /**
+ * It loads an input int array into the internal Integer one
+ */
+ void init(int[] values) throws Exception {
+ a = new long[values.length];
+ b = new Integer[values.length];
+ for (int i = 0; i < values.length; i++) {
+ a[i] = values[i];
+ b[i] = Integer.valueOf(values[i]);
+ }
+ }
+
+ /**
+ * This method invokes sort routine on selected sorter
+ */
+ void sort(int lo, int hi) throws Exception {
+ sorter.sort(a, lo, hi, b);
+ }
+
+ /**
+ * This method asserts single values
+ */
+ void checkValue(int idx, int v) {
+ assertEquals("@" + idx, v, a[idx]);
+ assertEquals("@" + idx, v, b[idx].intValue());
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/NodeProxyByIdChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/NodeProxyByIdChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/NodeProxyByIdChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,83 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import org.exist.dom.NodeProxy;
+
+/**
+ * check sortByNodeId(NodeProxy[])
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+
+class NodeProxyByIdChecker extends NodeProxyChecker {
+ NodeProxyByIdChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ /**
+ * It asserts the ascending ordering of an NodeProxy array
+ * based on NodeId
+ */
+ void check(int lo, int hi) {
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(((SortTestNodeProxy) a[i]).getNodeId().i <= ((SortTestNodeProxy) a[i + 1])
+ .getNodeId().i);
+ }
+ }
+
+ /**
+ * It asserts the ascending ordering of a NodeProxy array
+ * based on the NodeIds
+ */
+ void init(int[] values) throws Exception {
+ a = new NodeProxy[values.length];
+ for (int i = 0; i < values.length; i++) {
+ a[i] = new SortTestNodeProxy(values[i], -rnd.nextInt(1000));
+ }
+ }
+
+ /**
+ * This method invokes sort routine on selected sorter
+ * based on NodeId from NodeProxy elements
+ */
+ void sort(int lo, int hi) throws Exception {
+ sorter.sortByNodeId(a, lo, hi);
+ }
+
+ /**
+ * This method asserts single values
+ */
+ void checkValue(int idx, int v) {
+ assertEquals("@" + idx, v, ((SortTestNodeProxy) a[idx]).getNodeId().i);
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/NodeProxyChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/NodeProxyChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/NodeProxyChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,88 @@
+/**
+ *
+ */
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import org.exist.dom.NodeProxy;
+
+/**
+ * check sort(NodeProxy)
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+
+class NodeProxyChecker extends SortMethodChecker {
+ NodeProxyChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ NodeProxy[] a;
+
+ int getLength() {
+ return a.length;
+ }
+
+ /**
+ * It asserts the ascending ordering of a NodeProxy array
+ */
+ void check(int lo, int hi) {
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(((SortTestNodeProxy) a[i]).val <= ((SortTestNodeProxy) a[i + 1]).val);
+ }
+ }
+
+ /**
+ * It loads an input int array into the internal NodeProxy one
+ */
+ void init(int[] values) throws Exception {
+ a = new NodeProxy[values.length];
+ for (int i = 0; i < values.length; i++) {
+ a[i] = new SortTestNodeProxy(-rnd.nextInt(1000), values[i]);
+ }
+ }
+
+ /**
+ * This method invokes sort routine on selected sorter
+ */
+ void sort(int lo, int hi) throws Exception {
+ sorter.sort(a, lo, hi);
+ }
+
+ /**
+ * This method asserts single values
+ */
+ void checkValue(int idx, int v) {
+ assertEquals("@" + idx, v, ((SortTestNodeProxy) a[idx]).val);
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/ObjectAndIntArrayChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/ObjectAndIntArrayChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/ObjectAndIntArrayChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,97 @@
+/**
+ *
+ */
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+/**
+ * check sort(Object[], int[])
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+
+class ObjectAndIntArrayChecker extends SortMethodChecker {
+ ObjectAndIntArrayChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ Integer[] a;
+ int[] b;
+
+ /**
+ * It asserts the ascending ordering of an Integer array
+ * given an specific comparator
+ */
+ void check(int lo, int hi) {
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(a[i].intValue() <= a[i + 1].intValue());
+ assertEquals(a[i].intValue(), b[i]);
+ }
+ assertEquals(a[hi].intValue(), b[hi]);
+ }
+
+ /**
+ * It returns the length of the array to be used on assertion
+ */
+ int getLength() {
+ return a.length;
+ }
+
+ /**
+ * It loads an input int array into the internal
+ * Integer and int ones
+ */
+ void init(int[] values) throws Exception {
+ a = new Integer[values.length];
+ b = new int[values.length];
+ for (int i = 0; i < values.length; i++) {
+ a[i] = Integer.valueOf(values[i]);
+ b[i] = values[i];
+ }
+ }
+
+ /**
+ * This method invokes sort routine on selected sorter
+ */
+ void sort(int lo, int hi) throws Exception {
+ sorter.sort(a, lo, hi, b);
+ }
+
+ /**
+ * This method asserts single values
+ */
+ void checkValue(int idx, int v) {
+ assertEquals("@" + idx, v, a[idx].intValue());
+ assertEquals("@" + idx, v, b[idx]);
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/PlainArrayChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/PlainArrayChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/PlainArrayChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,147 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertTrue;
+
+import java.util.Comparator;
+
+/**
+ * check sort(Comparable[])
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+class PlainArrayChecker extends ComparatorChecker {
+ PlainArrayChecker(SortingAlgorithmTester sorter) {
+ super(sorter);
+ }
+
+ Integer[] a;
+
+ /**
+ * It asserts the ascending ordering of an Integer array
+ */
+ void check(int lo, int hi) {
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(a[i].intValue() <= a[i + 1].intValue());
+ }
+ }
+
+ /**
+ * It loads an input int array into the internal Integer one
+ */
+ void init(int[] values) throws Exception {
+ a = new Integer[values.length];
+ for (int i = 0; i < values.length; i++) {
+ a[i] = Integer.valueOf(values[i]);
+ }
+
+ }
+
+ /**
+ * It returns the length of the array to be used on assertion
+ */
+ int getLength() {
+ return a.length;
+ }
+
+ /**
+ * This method invokes sort routine on selected sorter
+ */
+ void sort(int lo, int hi) throws Exception {
+ sorter.sort(a, lo, hi);
+ }
+
+ /**
+ * This method invokes sort routine with a given
+ * comparator on selected sorter
+ */
+ void sort(SortOrder sortOrder, int lo, int hi) throws Exception {
+ sorter.sort(a, getComparator(sortOrder), lo, hi);
+ }
+
+ /**
+ * This method asserts single values
+ */
+ void checkValue(int idx, int v) {
+ assertEquals("@" + idx, v, a[idx].intValue());
+ }
+
+ /**
+ * It asserts the ascending ordering of an Integer array
+ * given an specific comparator
+ */
+ void check(SortOrder sortOrder, int lo, int hi) throws Exception {
+ Comparator<Integer> c = getComparator(sortOrder);
+ for (int i = lo; i < hi - 1; i++) {
+ assertTrue(c.compare(a[i], a[i + 1]) <= 0);
+ }
+ }
+
+ /**
+ * This method returns an Integer comparator based
+ * on input sort order
+ * @param sortOrder
+ * @return
+ */
+ Comparator<Integer> getComparator(SortOrder sortOrder) {
+ switch (sortOrder) {
+ case ASCENDING:
+ return new Comparator<Integer>() {
+ public int compare(Integer o1, Integer o2) {
+ return o1.intValue() - o2.intValue();
+ }
+ };
+ case DESCENDING:
+ return new Comparator<Integer>() {
+ public int compare(Integer o1, Integer o2) {
+ return o2.intValue() - o1.intValue();
+ }
+ };
+ case RANDOM:
+ return new Comparator<Integer>() {
+ public int compare(Integer o1, Integer o2) {
+ return rnd.nextBoolean() ? -1 : 1;
+ }
+ };
+ case UNSTABLE:
+ return new Comparator<Integer>() {
+ public int compare(Integer o1, Integer o2) {
+ if (o1.intValue() <= o2.intValue())
+ return (o2.intValue() - o1.intValue()) % 3 - 1;
+ else
+ return 1 - (o1.intValue() - o2.intValue()) % 3;
+ }
+ };
+ }
+ return null; // should never happen
+ }
+
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/SortMethodChecker.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/SortMethodChecker.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/SortMethodChecker.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,96 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.lang.reflect.Method;
+import java.util.Random;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Check one of the sort() methods, given an algorithm to use.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+public abstract class SortMethodChecker {
+ final SortingAlgorithmTester sorter;
+ protected final Random rnd = new Random();
+
+ SortMethodChecker(SortingAlgorithmTester sorter) {
+ this.sorter = sorter;
+ }
+
+ abstract void checkValue(int idx, int v) throws Exception;
+
+ public String toString() {
+ return getClass().getSimpleName() + " "
+ + sorter.getClass().getSimpleName();
+ }
+
+ abstract void init(int[] values) throws Exception;
+
+ abstract int getLength() throws Exception;
+
+ abstract void sort(int lo, int hi) throws Exception;
+
+ abstract void check(int lo, int hi) throws Exception;
+
+ void sort() throws Exception {
+ sort(0, getLength() - 1);
+ }
+
+ void check() throws Exception {
+ check(0, getLength() - 1);
+ }
+
+ public Test suite() {
+ TestSuite s = new TestSuite();
+ for (Method m : SortTestCase.class.getMethods()) {
+ if (m.getName().startsWith("test")) {
+ s.addTest(new SortTestCase<SortMethodChecker>(this, m.getName()));
+ }
+ }
+ s.setName(sorter.getClass().getSimpleName() + " "
+ + getClass().getSimpleName());
+ return s;
+ }
+
+ public static SortMethodChecker[] allCheckers(SortingAlgorithmTester s) {
+ return new SortMethodChecker[] {
+ new PlainArrayChecker(s),
+ new ListChecker(s),
+ new ObjectAndIntArrayChecker(s),
+ new LongArrayAndObjectChecker(s),
+ new NodeProxyChecker(s),
+ new NodeProxyByIdChecker(s)
+ };
+ }
+
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/SortTestCase.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/SortTestCase.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/SortTestCase.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,187 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+
+import java.util.Random;
+
+import junit.framework.TestCase;
+
+/**
+ * TestCase - given a sort() method and an algorithm via a checker, do a variety
+ * of tests.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+public class SortTestCase<CH extends SortMethodChecker> extends TestCase {
+
+ protected final Random rnd = new Random();
+ protected final CH checker;
+
+ SortTestCase(CH checker, String method) {
+ super(method);
+ this.checker = checker;
+ }
+
+ protected int[] getRandomIntArray(int sz) {
+ int[] a = new int[sz];
+ for (int i = 0; i < sz; i++) {
+ a[i] = rnd.nextInt(1000);
+ }
+ return a;
+ }
+
+ protected int[] getConstantIntArray(int sz) {
+ int[] a = new int[sz];
+ for (int i = 0; i < sz; i++) {
+ a[i] = 0;
+ }
+ return a;
+ }
+
+ protected int[] getAscendingIntArray(int sz) {
+ int[] a = new int[sz];
+ for (int i = 0; i < sz; i++) {
+ a[i] = i;
+ }
+ return a;
+ }
+
+ protected int[] getDescendingIntArray(int sz) {
+ int[] a = new int[sz];
+ for (int i = 0; i < sz; i++) {
+ a[i] = sz - i - 1;
+ }
+ return a;
+ }
+
+ public void testSingleElement() throws Exception {
+ checker.init(getConstantIntArray(1));
+ checker.sort();
+ }
+
+ public void testRandom() throws Exception {
+ for (int i = 0; i < 10; i++) {
+ checker.init(getRandomIntArray(100));
+ checker.sort();
+ checker.check();
+ }
+ }
+
+ public void testConstant() throws Exception {
+ checker.init(getConstantIntArray(100));
+ checker.sort();
+ checker.check();
+ }
+
+ public void testAscending() throws Exception {
+ checker.init(getAscendingIntArray(100));
+ checker.sort();
+ checker.check();
+ }
+
+ public void testDecending() throws Exception {
+ checker.init(getDescendingIntArray(100));
+ checker.sort();
+ checker.check();
+ }
+
+ public void testSortSubsection1() throws Exception {
+
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000)
+ : 999 - ii;
+ }
+
+ checker.init(a);
+ checker.sort(i, i + 99);
+ checker.check(i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, 999 - ii);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, 999 - ii);
+ }
+
+ }
+ }
+
+ public void testSortSubsection2() throws Exception {
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000) : ii;
+ }
+
+ checker.init(a);
+ checker.sort(i, i + 99);
+ checker.check(i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, ii);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, ii);
+ }
+
+ }
+ }
+
+ public void testSortSubsection3() throws Exception {
+
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000)
+ : (ii % 7);
+ }
+
+ checker.init(a);
+ checker.sort(i, i + 99);
+ checker.check(i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, ii % 7);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, ii % 7);
+ }
+
+ }
+ }
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/SortTestComparator.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/SortTestComparator.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/SortTestComparator.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,175 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import org.exist.util.sorters.ComparatorChecker.SortOrder;
+
+/**
+ * TestCase - given a sort() method and an algorithm via a checker, do a variety
+ * of tests that rely on the comparator methods.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+public class SortTestComparator<CH extends ComparatorChecker>
+ extends SortTestCase<CH>
+{
+ SortTestComparator(CH checker, String method) {
+ super(checker, method);
+ }
+
+ public void testComparatorAscending() throws Exception {
+ System.out.println("ComparatorAscending on "+getName());
+ for (int i = 0; i < 10; i++) {
+ checker.init(getRandomIntArray(100));
+ checker.sort(SortOrder.ASCENDING);
+ checker.check(SortOrder.ASCENDING);
+ }
+ }
+
+ public void testComparatorDescending() throws Exception {
+ System.out.println("ComparatorDescending on "+getName());
+ for (int i = 0; i < 10; i++) {
+ checker.init(getRandomIntArray(100));
+ checker.sort(SortOrder.DESCENDING);
+ checker.check(SortOrder.DESCENDING);
+ }
+ }
+
+ public void testBadComparatorUnstable() throws Exception {
+ System.out.println("BadComparatorUnstable on "+getName());
+ for (int i = 0; i < 10; i++) {
+ checker.init(getRandomIntArray(100));
+ checker.sort(SortOrder.UNSTABLE);
+ }
+ }
+
+ public void testBadComparatorRandom() throws Exception {
+ System.out.println("BadComparatorRandom on "+getName());
+ checker.init(getRandomIntArray(100));
+ checker.sort(SortOrder.RANDOM);
+ }
+
+ public void testSortSubsection1asc() throws Exception {
+ System.out.println("SortSubsection1 asc on "+getName());
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000)
+ : 999 - ii;
+ }
+
+ checker.init(a);
+ checker.sort(SortOrder.ASCENDING, i, i + 99);
+ checker.check(SortOrder.ASCENDING, i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, 999 - ii);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, 999 - ii);
+ }
+ }
+ }
+
+ public void testSortSubsection2asc() throws Exception {
+ System.out.println("SortSubsection2 asc on "+getName());
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000) : ii;
+ }
+
+ checker.init(a);
+ checker.sort(SortOrder.ASCENDING, i, i + 99);
+ checker.check(SortOrder.ASCENDING, i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, ii);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, ii);
+ }
+ }
+ }
+
+ public void testSortSubsection1desc() throws Exception {
+ System.out.println("SortSubsection1 desc on "+getName());
+
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000)
+ : 999 - ii;
+ }
+
+ checker.init(a);
+ checker.sort(SortOrder.DESCENDING, i, i + 99);
+ checker.check(SortOrder.DESCENDING, i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, 999 - ii);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, 999 - ii);
+ }
+
+ }
+ }
+
+ public void testSortSubsection2desc() throws Exception {
+ System.out.println("SortSubsection2 desc on "+getName());
+ for (int i = 0; i < 1000; i += 100) {
+ int[] a = new int[1000];
+
+ for (int ii = 0; ii < 1000; ii++) {
+ a[ii] = (ii >= i && ii < i + 100) ? rnd.nextInt(1000) : ii;
+ }
+
+ checker.init(a);
+ checker.sort(SortOrder.DESCENDING, i, i + 99);
+ checker.check(SortOrder.DESCENDING, i, i + 99);
+
+ // check that the other values have not been disturbed
+ for (int ii = 0; ii < i; ii++) {
+ checker.checkValue(ii, ii);
+ }
+ for (int ii = i + 100; ii < 1000; ii++) {
+ checker.checkValue(ii, ii);
+ }
+
+ }
+ }
+
+}
Added: trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeId.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeId.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeId.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,152 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.io.IOException;
+
+import org.exist.numbering.NodeId;
+import org.exist.storage.io.VariableByteOutputStream;
+
+/**
+ * Mock NodeId.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ * @see NodeId
+ *
+ */
+class SortTestNodeId implements NodeId {
+ final int i;
+
+ SortTestNodeId(int i) {
+ this.i = i;
+ }
+
+ public boolean after(NodeId arg0, boolean arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean before(NodeId arg0, boolean arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int compareTo(SortTestNodeId arg0) {
+ if (i < 0)
+ throw new IllegalStateException(
+ "Sort ought not be looking at the nodeid");
+ return i - arg0.i;
+ }
+
+ public int compareTo(NodeId arg0) {
+ return compareTo((SortTestNodeId) arg0);
+ }
+
+ public int compareTo(Object arg0) {
+ return compareTo((SortTestNodeId) arg0);
+ }
+
+ public int computeRelation(NodeId arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean equals(NodeId arg0) {
+ return i == ((SortTestNodeId) arg0).i;
+ }
+
+ public NodeId getChild(int arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId getParentId() {
+ throw new UnsupportedOperationException();
+ }
+
+ public int getTreeLevel() {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId insertBefore() {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId insertNode(NodeId arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isChildOf(NodeId arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isDescendantOf(NodeId arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isDescendantOrSelfOf(NodeId arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isSiblingOf(NodeId arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId newChild() {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId nextSibling() {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId precedingSibling() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void serialize(byte[] arg0, int arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int size() {
+ throw new UnsupportedOperationException();
+ }
+
+ public int units() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void write(VariableByteOutputStream arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId write(NodeId arg0, VariableByteOutputStream arg1)
+ throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ public NodeId append(NodeId other) {
+ throw new UnsupportedOperationException();
+ }
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeProxy.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeProxy.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/SortTestNodeProxy.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,69 @@
+/**
+ *
+ */
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import org.exist.dom.NodeProxy;
+
+/**
+ * Mock NodeProxy.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ * @see NodeProxy
+ *
+ */
+class SortTestNodeProxy extends NodeProxy {
+ final int val;
+
+ public SortTestNodeProxy(int id, int val) {
+ super(null, new SortTestNodeId(id));
+ this.val = val;
+ }
+
+ public int compareTo(SortTestNodeProxy o) {
+ if (val < 0)
+ throw new IllegalStateException(
+ "Sort ought not be looking at the value");
+ return val - o.val;
+ };
+
+ public int compareTo(NodeProxy o) {
+ return compareTo((SortTestNodeProxy) o);
+ }
+
+ public int compareTo(Object o) {
+ return compareTo((SortTestNodeProxy) o);
+ };
+
+ public SortTestNodeId getNodeId() {
+ return (SortTestNodeId) super.getNodeId();
+ }
+
+}
\ No newline at end of file
Added: trunk/eXist/test/src/org/exist/util/sorters/SortingAlgorithmTester.java
===================================================================
--- trunk/eXist/test/src/org/exist/util/sorters/SortingAlgorithmTester.java (rev 0)
+++ trunk/eXist/test/src/org/exist/util/sorters/SortingAlgorithmTester.java 2009-07-30 23:17:13 UTC (rev 9591)
@@ -0,0 +1,68 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2009 The eXist Project
+ * http://exist.sourceforge.net
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.exist.util.sorters;
+
+import java.util.Comparator;
+import java.util.List;
+
+import org.exist.dom.NodeProxy;
+
+/**
+ * Interface to some sorting algorithm.
+ * <p>
+ * This work was undertaken as part of the development of the taxonomic
+ * repository at http://biodiversity.org.au . See <A
+ * href="ghw-at-anbg.gov.au">Greg Whitbread</A> for further details.
+ *
+ * @author pm...@bi...
+ * @author pm...@an...
+ * @author https://sourceforge.net/users/paulmurray
+ * @author http://www.users.bigpond.com/pmurray
+ *
+ */
+public abstract class SortingAlgorithmTester {
+ abstract void sort(Comparable<?>[] a, int lo, int hi) throws Exception;
+
+ abstract void sort(Comparable<?>[] a, int lo, int hi, int[] b)
+ throws Exception;
+
+ abstract <T extends Comparable<T>> void sort(T[] a, Comparator<T> c,
+ int lo, int hi) throws Exception;
+
+ abstract <T extends Comparable<T>> void sort(List<T> a, int lo, int hi)
+ throws Exception;
+
+ // This one must change its parameters so some Java compilers do not
+ // get fooled
+ abstract void sort(int lo, int hi,NodeProxy[] a) throws Exception;
+
+ abstract void sortByNodeId(NodeProxy[] a, int lo, int hi) throws Exception;
+
+ abstract void sort(long[] a, int lo, int hi, Object b[]) throws Exception;
+
+ public static SortingAlgorithmTester[] allSorters() {
+ return new SortingAlgorithmTester[] {
+ new InsertionSortTester(),
+ new HeapSortTester(),
+ new FastQSortTester()
+ };
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-30 23:04:41
|
Revision: 9590
http://exist.svn.sourceforge.net/exist/?rev=9590&view=rev
Author: ixitar
Date: 2009-07-30 23:04:27 +0000 (Thu, 30 Jul 2009)
Log Message:
-----------
[documentation] enhancing function module documentation.
Modified Paths:
--------------
trunk/eXist/webapp/xquery/functions.xql
trunk/eXist/webapp/xquery/styles/fundocs.css
Modified: trunk/eXist/webapp/xquery/functions.xql
===================================================================
--- trunk/eXist/webapp/xquery/functions.xql 2009-07-30 21:55:29 UTC (rev 9589)
+++ trunk/eXist/webapp/xquery/functions.xql 2009-07-30 23:04:27 UTC (rev 9590)
@@ -79,7 +79,7 @@
<h3>{$match/xqdoc:name/text()}</h3>
<div class="f-signature">{$match/xqdoc:signature/text()}</div>
<div class="f-description">
- <div>{$match/xqdoc:comment/xqdoc:description/text()}</div>
+ { xqdoc:print-description($match/xqdoc:comment) }
{ xqdoc:print-parameters($match/xqdoc:comment) }
{ xqdoc:print-return($match/xqdoc:comment) }
</div>{
@@ -97,6 +97,12 @@
()
};
+declare function xqdoc:print-description($comment as element(xqdoc:comment)) {
+ for $desc in tokenize($comment/xqdoc:description, "\n")
+ return
+ <div class="f-description-para">{$desc}</div>
+};
+
declare function xqdoc:print-parameters($comment as element(xqdoc:comment)) {
let $params := $comment/xqdoc:param
return
Modified: trunk/eXist/webapp/xquery/styles/fundocs.css
===================================================================
--- trunk/eXist/webapp/xquery/styles/fundocs.css 2009-07-30 21:55:29 UTC (rev 9589)
+++ trunk/eXist/webapp/xquery/styles/fundocs.css 2009-07-30 23:04:27 UTC (rev 9590)
@@ -69,6 +69,10 @@
text-align: justify;
}
+.f-description-para {
+ margin-bottom: 8px;
+}
+
#f-loading {
visibility: hidden;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ix...@us...> - 2009-07-30 21:55:41
|
Revision: 9589
http://exist.svn.sourceforge.net/exist/?rev=9589&view=rev
Author: ixitar
Date: 2009-07-30 21:55:29 +0000 (Thu, 30 Jul 2009)
Log Message:
-----------
[documentation] enhancing function module documentation.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/FunQName.java
trunk/eXist/src/org/exist/xquery/functions/FunRemove.java
trunk/eXist/src/org/exist/xquery/functions/FunReplace.java
trunk/eXist/src/org/exist/xquery/functions/FunResolveQName.java
trunk/eXist/src/org/exist/xquery/functions/FunResolveURI.java
trunk/eXist/src/org/exist/xquery/functions/FunReverse.java
trunk/eXist/src/org/exist/xquery/functions/FunRoot.java
trunk/eXist/src/org/exist/xquery/functions/FunRound.java
trunk/eXist/src/org/exist/xquery/functions/FunRoundHalfToEven.java
trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java
Modified: trunk/eXist/src/org/exist/xquery/functions/FunQName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunQName.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunQName.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2007 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -30,6 +30,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.QNameValue;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -44,15 +46,19 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("QName", Function.BUILTIN_FUNCTION_NS),
- "Returns an xs:QName with the namespace URI given in $a. If $a is the empty " +
- "string or the empty sequence, it represents 'no namespace'. The prefix in $b " +
- "is retained in the returned xs:QName value. The local name in the result is " +
- "taken from the local part of $b",
+ "Returns an xs:QName with the namespace URI given in $paramURI. If $paramURI is " +
+ "the zero-length string or the empty sequence, it represents \"no namespace\"; in " +
+ "this case, if the value of $paramQName contains a colon (:), an error is " +
+ "raised [err:FOCA0002]. The prefix (or absence of a prefix) in $paramQName is " +
+ "retained in the returned xs:QName value. The local name in the result is " +
+ "taken from the local part of $paramQName.\n\nIf $paramQName does not have " +
+ "the correct lexical form for xs:QName an error is raised [err:FOCA0002].\n\n" +
+ "Note that unlike xs:QName this function does not require a xs:string literal as the argument.",
new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
+ new FunctionParameterSequenceType("paramURI", Type.STRING, Cardinality.ZERO_OR_ONE, "namespace URI"),
+ new FunctionParameterSequenceType("paramQName", Type.STRING, Cardinality.EXACTLY_ONE, "the prefix")
},
- new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
+ new FunctionReturnSequenceType(Type.QNAME, Cardinality.EXACTLY_ONE, "an xs:QName with the namespace URI given in $paramURI"));
/**
* @param context
Modified: trunk/eXist/src/org/exist/xquery/functions/FunRemove.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunRemove.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunRemove.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,3 +1,24 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 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 program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
package org.exist.xquery.functions;
import org.exist.dom.ExtArrayNodeSet;
@@ -11,6 +32,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.DoubleValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -27,13 +50,18 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("remove", Function.BUILTIN_FUNCTION_NS),
- "Returns a new sequence constructed from the value of the target sequence" +
- "with the item at the position specified removed.",
+ "Returns a new sequence constructed from the value of $target with the item " +
+ "at the position specified by the value of $position removed.\n\nIf $position " +
+ "is less than 1 or greater than the number of items in $target, $target is returned. " +
+ "Otherwise, the value returned by the function consists of all items of $target " +
+ "whose index is less than $position, followed by all items of $target whose index " +
+ "is greater than $position. If $target is the empty sequence, the empty sequence " +
+ "is returned.",
new SequenceType[] {
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE),
- new SequenceType(Type.INTEGER, Cardinality.ONE)
+ new FunctionParameterSequenceType("target", Type.ITEM, Cardinality.ZERO_OR_MORE, "the input sequence"),
+ new FunctionParameterSequenceType("position", Type.INTEGER, Cardinality.ONE, "the position of the value to be removed")
},
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE));
+ new FunctionReturnSequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE, "the new sequence"));
Modified: trunk/eXist/src/org/exist/xquery/functions/FunReplace.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunReplace.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunReplace.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2007 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -37,6 +37,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.util.Error;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -47,30 +49,49 @@
* @author Wolfgang Meier (wol...@ex...)
*/
public class FunReplace extends FunMatches {
+
+ private static final String FUNCTION_DESCRIPTION = "The function returns the xs:string that is obtained by replacing each non-overlapping substring " +
+ "of $input that matches the given $pattern with an occurrence of the $replacement string.\n\n" +
+ "The effect of calling the first version of this function (omitting the argument $flags) is the " +
+ "same as the effect of calling the second version with the $flags argument set to a zero-length " +
+ "string.\n\nThe $flags argument is interpreted in the same manner as for the fn:matches() function.\n\n" +
+ "If $input is the empty sequence, it is interpreted as the zero-length string.\n\nIf two overlapping " +
+ "substrings of $input both match the $pattern, then only the first one (that is, the one whose first " +
+ "character comes first in the $input string) is replaced.\n\nWithin the $replacement string, a variable " +
+ "$N may be used to refer to the substring captured by the Nth parenthesized sub-expression in the " +
+ "regular expression. For each match of the pattern, these variables are assigned the value of the " +
+ "content matched by the relevant sub-expression, and the modified replacement string is then " +
+ "substituted for the characters in $input that matched the pattern. $0 refers to the substring " +
+ "captured by the regular expression as a whole.\n\nMore specifically, the rules are as follows, " +
+ "where S is the number of parenthesized sub-expressions in the regular expression, and N is the " +
+ "decimal number formed by taking all the digits that consecutively follow the $ character:\n\n" +
+ "1. If N=0, then the variable is replaced by the substring matched by the regular expression as a whole.\n\n" +
+ "2. If 1<=N<=S, then the variable is replaced by the substring captured by the Nth parenthesized " +
+ "sub-expression. If the Nth parenthesized sub-expression was not matched, then the variable " +
+ "is replaced by the zero-length string.\n\n" +
+ "3. If S<N<=9, then the variable is replaced by the zero-length string.\n\n" +
+ "4. Otherwise (if N>S and N>9), the last digit of N is taken to be a literal character to be " +
+ "included \"as is\" in the replacement string, and the rules are reapplied using the number N " +
+ "formed by stripping off this last digit.";
+ protected static final FunctionParameterSequenceType INPUT_ARG = new FunctionParameterSequenceType("input", Type.STRING, Cardinality.ZERO_OR_ONE, "the input string");
+ protected static final FunctionParameterSequenceType PATTERN_ARG = new FunctionParameterSequenceType("pattern", Type.STRING, Cardinality.EXACTLY_ONE, "the pattern to match");
+ protected static final FunctionParameterSequenceType REPLACEMENT_ARG = new FunctionParameterSequenceType("replacement", Type.STRING, Cardinality.EXACTLY_ONE, "the string to replace the pattern with");
+ protected static final FunctionParameterSequenceType FLAGS_ARG = new FunctionParameterSequenceType("flags", Type.STRING, Cardinality.EXACTLY_ONE, "");
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.STRING, Cardinality.ZERO_OR_ONE, "the altered string");
+
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("replace", Function.BUILTIN_FUNCTION_NS),
- "The function returns the xs:string that is obtained by replacing all non-overlapping "
- + "substrings of $a that match the given pattern $b with an occurrence of the $c replacement string.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
- },
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { INPUT_ARG, PATTERN_ARG, REPLACEMENT_ARG },
+ RETURN_TYPE
),
new FunctionSignature(
new QName("replace", Function.BUILTIN_FUNCTION_NS),
- "The function returns the xs:string that is obtained by replacing all non-overlapping "
- + "substrings of $a that match the given pattern $b with an occurrence of the $c replacement string.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE),
- new SequenceType(Type.STRING, Cardinality.EXACTLY_ONE)
- },
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { INPUT_ARG, PATTERN_ARG, REPLACEMENT_ARG, FLAGS_ARG },
+ RETURN_TYPE
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunResolveQName.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunResolveQName.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunResolveQName.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2007 The eXist Project
+ * Copyright (C) 2001-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -37,6 +37,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.EmptySequence;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.NodeValue;
import org.exist.xquery.value.QNameValue;
import org.exist.xquery.value.Sequence;
@@ -47,12 +49,27 @@
public class FunResolveQName extends BasicFunction {
- public final static FunctionSignature signature = new FunctionSignature(new QName("resolve-QName",
- Function.BUILTIN_FUNCTION_NS), "Returns an xs:QName value (that is, an expanded-QName) by taking an "
- + "xs:string that has the lexical form of an xs:QName (a string in the form "
- + "\"prefix:local-name\" or \"local-name\") and resolving it using the in-scope "
- + "namespaces for a given element.", new SequenceType[] { new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.ELEMENT, Cardinality.EXACTLY_ONE) }, new SequenceType(Type.QNAME, Cardinality.EXACTLY_ONE));
+ public final static FunctionSignature signature =
+ new FunctionSignature(new QName("resolve-QName", Function.BUILTIN_FUNCTION_NS),
+ "Returns an xs:QName value (that is, an expanded-QName) by taking an xs:string that has the lexical " +
+ "form of an xs:QName (a string in the form \"prefix:local-name\" or \"local-name\") and resolving it " +
+ "using the in-scope namespaces for a given element.\n\nIf $qname does not have the correct lexical " +
+ "form for xs:QName an error is raised [err:FOCA0002].\n\nIf $qname is the empty sequence, returns " +
+ "the empty sequence.\n\nMore specifically, the function searches the namespace bindings of " +
+ "$element for a binding whose name matches the prefix of $qname, or the zero-length string if " +
+ "it has no prefix, and constructs an expanded-QName whose local name is taken from the supplied " +
+ "$qname, and whose namespace URI is taken from the string value of the namespace binding.\n\n" +
+ "If the $qname has a prefix and if there is no namespace binding for $element that matches this " +
+ "prefix, then an error is raised [err:FONS0004].\n\nIf the $qname has no prefix, and there is " +
+ "no namespace binding for $element corresponding to the default (unnamed) namespace, then the " +
+ "resulting expanded-QName has no namespace part.\n\nThe prefix (or absence of a prefix) in the " +
+ "supplied $qname argument is retained in the returned expanded-QName.",
+ new SequenceType[] {
+ new FunctionParameterSequenceType("qname", Type.STRING, Cardinality.ZERO_OR_ONE, "the QName name"),
+ new FunctionParameterSequenceType("element", Type.ELEMENT, Cardinality.EXACTLY_ONE, "")
+ },
+ new FunctionReturnSequenceType(Type.QNAME, Cardinality.EXACTLY_ONE, "the QName")
+ );
public FunResolveQName(XQueryContext context) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunResolveURI.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunResolveURI.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunResolveURI.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2000-2007 The eXist Project
+ * Copyright (C) 2000-2009 The eXist Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -33,6 +33,8 @@
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
import org.exist.xquery.value.AnyURIValue;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
@@ -40,23 +42,42 @@
public class FunResolveURI extends Function {
+ protected static final String FUNCTION_DESCRIPTION =
+ "The purpose of this function is to enable a relative URI " +
+ "to be resolved against an absolute URI.\n\nThe first form " +
+ "of this function resolves $relative against the value of " +
+ "the base-uri property from the static context. If the " +
+ "base-uri property is not initialized in the static context " +
+ "an error is raised [err:FONS0005].\n\n" +
+ "If $relative is a relative URI reference, it is resolved " +
+ "against $base, or the base-uri property from the static " +
+ "context, using an algorithm such as the ones described " +
+ "in [RFC 2396] or [RFC 3986], and the resulting absolute " +
+ "URI reference is returned. An error may be raised " +
+ "[err:FORG0009] in the resolution process.\n\n" +
+ "If $relative is an absolute URI reference, it is returned " +
+ "unchanged.\n\n" +
+ "If $relative or $base is not a valid xs:anyURI an error " +
+ "is raised [err:FORG0002].\n\n" +
+ "If $relative is the empty sequence, the empty sequence is returned.";
+
+ protected static final FunctionParameterSequenceType RELATIVE_ARG = new FunctionParameterSequenceType("relative", Type.STRING, Cardinality.ZERO_OR_ONE, "The relative URI");
+ protected static final FunctionParameterSequenceType BASE_ARG = new FunctionParameterSequenceType("base", Type.STRING, Cardinality.ONE, "The base URI");
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE, "the absolute URI");
+
public final static FunctionSignature signatures [] = {
new FunctionSignature(
new QName("resolve-uri", Function.BUILTIN_FUNCTION_NS),
- "The purpose of this function is to enable a relative URI $a to be resolved against the static context's base URI.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE)
- },
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { RELATIVE_ARG },
+ RETURN_TYPE
),
new FunctionSignature (
new QName("resolve-uri", Function.BUILTIN_FUNCTION_NS),
- "The purpose of this function is to enable a relative URI $a to be resolved against the absolute URI $b. If $a is the empty sequence, the empty sequence is returned.",
- new SequenceType[] {
- new SequenceType(Type.STRING, Cardinality.ZERO_OR_ONE),
- new SequenceType(Type.STRING, Cardinality.ONE)
- },
- new SequenceType(Type.ANY_URI, Cardinality.ZERO_OR_ONE)),
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { RELATIVE_ARG, BASE_ARG },
+ RETURN_TYPE
+ ),
};
public FunResolveURI(XQueryContext context, FunctionSignature signature) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunReverse.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunReverse.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunReverse.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,3 +1,24 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-2009 The eXist team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
+
package org.exist.xquery.functions;
import org.exist.dom.QName;
@@ -2,2 +23,4 @@
import org.exist.xquery.*;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
@@ -21,8 +44,8 @@
new QName("reverse", Function.BUILTIN_FUNCTION_NS),
"Reverses the order of items in a sequence. If the argument is an empty" +
"sequence, the empty sequence is returned.",
- new SequenceType[] {new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE)},
- new SequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE));
+ new SequenceType[] {new FunctionParameterSequenceType("arg", Type.ITEM, Cardinality.ZERO_OR_MORE, "the sequence to reverse")},
+ new FunctionReturnSequenceType(Type.ITEM, Cardinality.ZERO_OR_MORE, "the reverse order sequence"));
public FunReverse(XQueryContext context) {
super(context, signature);
Modified: trunk/eXist/src/org/exist/xquery/functions/FunRoot.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunRoot.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunRoot.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-06 Wolfgang M. Meier
+ * Copyright (C) 2001-09 Wolfgang M. Meier
* wol...@ex...
* http://exist.sourceforge.net
*
@@ -33,6 +33,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceIterator;
@@ -44,21 +46,29 @@
* @author Wolfgang Meier (wol...@ex...)
*/
public class FunRoot extends Function {
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "Returns the root of the tree to which $arg belongs. " +
+ "This will usually, but not necessarily, be a document node.\n\n" +
+ "If $arg is the empty sequence, the empty sequence is returned.\n\n" +
+ "If $arg is a document node, $arg is returned.\n\n" +
+ "If the function is called without an argument, the context " +
+ "item (.) is used as the default argument. The behavior of the " +
+ "function if the argument is omitted is exactly the same as " +
+ "if the context item had been passed as the argument.";
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("root", Function.BUILTIN_FUNCTION_NS),
- "Returns the root of the tree to which the context node belongs. This will usually, "
- + "but not necessarily, be a document node.",
+ FUNCTION_DESCRIPTION,
new SequenceType[0],
- new SequenceType(Type.NODE, Cardinality.EXACTLY_ONE)
+ new FunctionReturnSequenceType(Type.NODE, Cardinality.EXACTLY_ONE, "the root node of the tree to which the context node belongs")
),
new FunctionSignature(
new QName("root", Function.BUILTIN_FUNCTION_NS),
- "Returns the root of the tree to which $arg belongs. This will usually, "
- + "but not necessarily, be a document node.",
- new SequenceType[] { new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE)},
- new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE)
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.NODE, Cardinality.ZERO_OR_ONE, "the input tree")},
+ new FunctionReturnSequenceType(Type.NODE, Cardinality.ZERO_OR_ONE, "the root node of the tree")
)
};
Modified: trunk/eXist/src/org/exist/xquery/functions/FunRound.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunRound.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunRound.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2001-2006 The eXist team
+ * Copyright (C) 2001-2009 The eXist team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -29,6 +29,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NumericValue;
import org.exist.xquery.value.Sequence;
@@ -40,9 +42,27 @@
public final static FunctionSignature signature =
new FunctionSignature(
new QName("round", Function.BUILTIN_FUNCTION_NS),
- "Returns the number with no fractional part that is closest to the value of $a. Always returns the number closest to +INF if there are two such numbers.",
- new SequenceType[] { new SequenceType(Type.NUMBER, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.NUMBER, Cardinality.EXACTLY_ONE)
+ "Returns the number with no fractional part that is closest " +
+ "to the argument. If there are two such numbers, then the one " +
+ "that is closest to positive infinity is returned. If type of " +
+ "$arg is one of the four numeric types xs:float, xs:double, " +
+ "xs:decimal or xs:integer the type of the result is the same " +
+ "as the type of $arg. If the type of $arg is a type derived " +
+ "from one of the numeric types, the result is an instance of " +
+ "the base numeric type.\n\n" +
+ "For xs:float and xs:double arguments, if the argument is " +
+ "positive infinity, then positive infinity is returned. " +
+ "If the argument is negative infinity, then negative infinity " +
+ "is returned. If the argument is positive zero, then positive " +
+ "zero is returned. If the argument is negative zero, then " +
+ "negative zero is returned. If the argument is less than zero, " +
+ "but greater than or equal to -0.5, then negative zero is returned. " +
+ "In the cases where positive zero or negative zero is returned, " +
+ "negative zero or positive zero may be returned as " +
+ "[XML Schema Part 2: Datatypes Second Edition] does not " +
+ "distinguish between the values positive zero and negative zero.",
+ new SequenceType[] { new FunctionParameterSequenceType("arg", Type.NUMBER, Cardinality.ZERO_OR_ONE, "the input number") },
+ new FunctionReturnSequenceType(Type.NUMBER, Cardinality.EXACTLY_ONE, "the rounded value")
);
public FunRound(XQueryContext context) {
Modified: trunk/eXist/src/org/exist/xquery/functions/FunRoundHalfToEven.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunRoundHalfToEven.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunRoundHalfToEven.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,3 +1,23 @@
+/* eXist Open Source Native XML Database
+ * Copyright (C) 2000-2009, The eXist team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $Id$
+ */
+
package org.exist.xquery.functions;
import org.exist.dom.QName;
@@ -8,6 +28,8 @@
import org.exist.xquery.Profiler;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
+import org.exist.xquery.value.FunctionReturnSequenceType;
import org.exist.xquery.value.IntegerValue;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.NumericValue;
@@ -16,27 +38,49 @@
import org.exist.xquery.value.Type;
public class FunRoundHalfToEven extends Function {
+
+ protected static final String FUNCTION_DESCRIPTION =
+ "The value returned is the nearest (that is, numerically closest) " +
+ "value to $arg that is a multiple of ten to the power of minus " +
+ "$precision. If two such values are equally near (e.g. if the " +
+ "fractional part in $arg is exactly .500...), the function returns " +
+ "the one whose least significant digit is even.\n\nIf the type of " +
+ "$arg is one of the four numeric types xs:float, xs:double, " +
+ "xs:decimal or xs:integer the type of the result is the same as " +
+ "the type of $arg. If the type of $arg is a type derived from one " +
+ "of the numeric types, the result is an instance of the " +
+ "base numeric type.\n\n" +
+ "The first signature of this function produces the same result " +
+ "as the second signature with $precision=0.\n\n" +
+ "For arguments of type xs:float and xs:double, if the argument is " +
+ "NaN, positive or negative zero, or positive or negative infinity, " +
+ "then the result is the same as the argument. In all other cases, " +
+ "the argument is cast to xs:decimal, the function is applied to this " +
+ "xs:decimal value, and the resulting xs:decimal is cast back to " +
+ "xs:float or xs:double as appropriate to form the function result. " +
+ "If the resulting xs:decimal value is zero, then positive or negative " +
+ "zero is returned according to the sign of the original argument.\n\n" +
+ "Note that the process of casting to xs:decimal " +
+ "may result in an error [err:FOCA0001].\n\n" +
+ "If $arg is of type xs:float or xs:double, rounding occurs on the " +
+ "value of the mantissa computed with exponent = 0.";
+
+ protected static final FunctionParameterSequenceType ARG_PARAM = new FunctionParameterSequenceType("arg", Type.NUMBER, Cardinality.ZERO_OR_ONE, "the input number");
+ protected static final FunctionParameterSequenceType PRECISION_PARAM = new FunctionParameterSequenceType("precision", Type.NUMBER, Cardinality.ZERO_OR_ONE, "the precision factor");
+ protected static final FunctionReturnSequenceType RETURN_TYPE = new FunctionReturnSequenceType(Type.NUMBER, Cardinality.EXACTLY_ONE, "the rounded value");
public final static FunctionSignature signatures[] = {
new FunctionSignature(
new QName("round-half-to-even", Function.BUILTIN_FUNCTION_NS),
- "The first signature of this function produces the same " +
- "result as the second signature with $b=0.",
- new SequenceType[] {
- new SequenceType(Type.NUMBER, Cardinality.ZERO_OR_ONE) },
- new SequenceType(Type.NUMBER, Cardinality.EXACTLY_ONE)),
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG_PARAM },
+ RETURN_TYPE),
new FunctionSignature(new QName("round-half-to-even",
Function.BUILTIN_FUNCTION_NS),
- "The value returned is the nearest (that is, numerically closest) " +
- "numeric to $a that is a multiple of ten to the power of minus "+
- "$b. If two such values are equally near (e.g. if the "+
- "fractional part in $a is exactly .500...), returns the one whose "+
- "least significant digit is even.",
- new SequenceType[] {
- new SequenceType( Type.NUMBER, Cardinality.ZERO_OR_ONE ),
- new SequenceType( Type.NUMBER, Cardinality.ZERO_OR_ONE ) },
- new SequenceType( Type.NUMBER, Cardinality.EXACTLY_ONE) )
+ FUNCTION_DESCRIPTION,
+ new SequenceType[] { ARG_PARAM, PRECISION_PARAM },
+ RETURN_TYPE )
};
public FunRoundHalfToEven(XQueryContext context,
Modified: trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java 2009-07-30 19:33:54 UTC (rev 9588)
+++ trunk/eXist/src/org/exist/xquery/functions/FunStartsWith.java 2009-07-30 21:55:29 UTC (rev 9589)
@@ -1,5 +1,5 @@
/* eXist Open Source Native XML Database
- * Copyright (C) 2000-2006, The eXist team
+ * Copyright (C) 2000-2009, The eXist team
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <di...@us...> - 2009-07-30 19:34:03
|
Revision: 9588
http://exist.svn.sourceforge.net/exist/?rev=9588&view=rev
Author: dizzzz
Date: 2009-07-30 19:33:54 +0000 (Thu, 30 Jul 2009)
Log Message:
-----------
[ignore] Added 2nd uuid() function, for generating version 3 type UUIDs
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/functions/util/UUID.java
trunk/eXist/src/org/exist/xquery/functions/util/UtilModule.java
Modified: trunk/eXist/src/org/exist/xquery/functions/util/UUID.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/UUID.java 2009-07-30 18:52:56 UTC (rev 9587)
+++ trunk/eXist/src/org/exist/xquery/functions/util/UUID.java 2009-07-30 19:33:54 UTC (rev 9588)
@@ -19,61 +19,76 @@
*
* $Id$
*/
-
package org.exist.xquery.functions.util;
import org.apache.log4j.Logger;
+
import org.exist.dom.QName;
import org.exist.security.UUIDGenerator;
+import org.exist.xquery.BasicFunction;
import org.exist.xquery.Cardinality;
-import org.exist.xquery.Function;
import org.exist.xquery.FunctionSignature;
import org.exist.xquery.XPathException;
import org.exist.xquery.XQueryContext;
+import org.exist.xquery.value.FunctionParameterSequenceType;
import org.exist.xquery.value.FunctionReturnSequenceType;
-import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
import org.exist.xquery.value.SequenceType;
import org.exist.xquery.value.StringValue;
import org.exist.xquery.value.Type;
+import org.exist.xquery.value.ValueSequence;
+
/**
- *
* @author wessels
* @author Loren Cahlander
*/
-public class UUID extends Function {
+public class UUID extends BasicFunction {
- private static final Logger logger = Logger.getLogger(UUID.class);
-
- public final static FunctionSignature signature =
+ private static final Logger logger = Logger.getLogger(UUID.class);
+
+ public final static FunctionSignature signatures[] = {
new FunctionSignature(
- new QName("uuid", UtilModule.NAMESPACE_URI, UtilModule.PREFIX),
- "Generate a version 4 (random) Universally Unique Identifier string, e.g. " +
- "154ad200-9c79-44f3-8cff-9780d91552a6",
- FunctionSignature.NO_ARGS,
- new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "a generated Universally Unique IDentifier string"));
-
- public UUID(XQueryContext context) {
+ new QName("uuid", UtilModule.NAMESPACE_URI, UtilModule.PREFIX),
+ "Generate a version 4 (random) Universally Unique Identifier string, e.g. 154ad200-9c79-44f3-8cff-9780d91552a6",
+ FunctionSignature.NO_ARGS,
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "a generated Universally Unique IDentifier string")
+ ),
+
+ new FunctionSignature (
+ new QName("uuid", UtilModule.NAMESPACE_URI, UtilModule.PREFIX),
+ "Generate a version 3 Universally Unique Identifier string, e.g. 154ad200-9c79-44f3-8cff-9780d91552a6",
+ new SequenceType[]{
+ new FunctionParameterSequenceType("name", Type.ITEM, Cardinality.EXACTLY_ONE,
+ "Input value for UUID calculation."),
+ },
+ new FunctionReturnSequenceType(Type.STRING, Cardinality.EXACTLY_ONE, "a generated Universally Unique IDentifier string")
+ )
+ };
+
+ public UUID(XQueryContext context, FunctionSignature signature) {
super(context, signature);
}
-
- /* (non-Javadoc)
- * @see org.exist.xquery.Expression#eval(org.exist.dom.DocumentSet, org.exist.xquery.value.Sequence, org.exist.xquery.value.Item)
- */
- public Sequence eval(Sequence contextSequence, Item contextItem)
- throws XPathException {
- logger.info("Entering " + UtilModule.PREFIX + ":" + getName().getLocalName());
-
- String uuid = UUIDGenerator.getUUID();
-
- if(uuid==null) {
- throw new XPathException(this, "Could not create UUID.");
+
+ @Override
+ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
+
+ Sequence result = new ValueSequence();
+
+ // Check input parameters
+ if (args.length == 0) {
+ String uuid = UUIDGenerator.getUUIDversion4();
+ result.add(new StringValue(uuid));
+
+ } else if (args.length == 1) {
+ String parameter = args[0].getStringValue();
+ String uuid = UUIDGenerator.getUUIDversion3(parameter);
+ result.add(new StringValue(uuid));
+
+ } else {
+ throw new XPathException("Not supported nr of parameters");
}
-
- logger.info("Exiting " + UtilModule.PREFIX + ":" + getName().getLocalName());
- return new StringValue(uuid);
+ return result;
}
-
}
Modified: trunk/eXist/src/org/exist/xquery/functions/util/UtilModule.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/util/UtilModule.java 2009-07-30 18:52:56 UTC (rev 9587)
+++ trunk/eXist/src/org/exist/xquery/functions/util/UtilModule.java 2009-07-30 19:33:54 UTC (rev 9588)
@@ -99,7 +99,8 @@
new FunctionDef(RandomFunction.signatures[0], RandomFunction.class),
new FunctionDef(RandomFunction.signatures[1], RandomFunction.class),
new FunctionDef(FunUnEscapeURI.signature, FunUnEscapeURI.class),
- new FunctionDef(UUID.signature, UUID.class),
+ new FunctionDef(UUID.signatures[0], UUID.class),
+ new FunctionDef(UUID.signatures[1], UUID.class),
new FunctionDef(DeepCopyFunction.signature, DeepCopyFunction.class),
new FunctionDef(GetSequenceType.signature, GetSequenceType.class),
new FunctionDef(Parse.signatures[0], Parse.class),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|