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) |
|
3
(2) |
4
(8) |
5
(7) |
6
|
7
(2) |
8
(2) |
9
(5) |
|
10
(5) |
11
(3) |
12
(6) |
13
(10) |
14
(8) |
15
(6) |
16
(5) |
|
17
(6) |
18
(8) |
19
(4) |
20
(3) |
21
|
22
|
23
(4) |
|
24
|
25
(1) |
26
(2) |
27
(1) |
28
(4) |
29
(2) |
30
(7) |
|
31
(5) |
|
|
|
|
|
|
|
From: <wol...@us...> - 2009-05-31 16:39:18
|
Revision: 9093
http://exist.svn.sourceforge.net/exist/?rev=9093&view=rev
Author: wolfgang_m
Date: 2009-05-31 16:39:16 +0000 (Sun, 31 May 2009)
Log Message:
-----------
[bugfix] versioning extension: don't store xmlns:v namespace declaration into the db; fixed configuration.
Modified Paths:
--------------
trunk/eXist/conf.xml.tmpl
trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningHelper.java
trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningTrigger.java
trunk/eXist/extensions/versioning/src/org/exist/versioning/xquery/versioning.xqm
Modified: trunk/eXist/conf.xml.tmpl
===================================================================
--- trunk/eXist/conf.xml.tmpl 2009-05-31 12:06:24 UTC (rev 9092)
+++ trunk/eXist/conf.xml.tmpl 2009-05-31 16:39:16 UTC (rev 9093)
@@ -585,8 +585,9 @@
-->
<serializer add-exist-id="none" compress-output="no" enable-xinclude="yes"
enable-xsl="no" indent="yes" match-tagging-attributes="no"
- match-tagging-elements="no"/>
+ match-tagging-elements="no">
<!--custom-filter class="org.exist.versioning.VersioningFilter"/-->
+ </serializer>
<!--
Default settings for the XSLT Transformer. Allow's for a choice of
Modified: trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningHelper.java
===================================================================
--- trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningHelper.java 2009-05-31 12:06:24 UTC (rev 9092)
+++ trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningHelper.java 2009-05-31 16:39:16 UTC (rev 9093)
@@ -59,6 +59,23 @@
private final static StringSource GET_CONFLICTING_REV_SOURCE = new StringSource(GET_CONFLICTING_REV);
+ private final static String GET_BASE_REV_FOR_KEY =
+ "declare namespace v=\"http://exist-db.org/versioning\";\n" +
+ "declare variable $collection external;\n" +
+ "declare variable $document external;\n" +
+ "declare variable $base external;\n" +
+ "declare variable $key external;\n" +
+ "let $p := collection($collection)//v:properties[v:document = $document]\n" +
+ "let $withKey := for $r in $p[v:revision > $base][v:key = $key] " +
+ " order by $r/v:revision descending return $r\n" +
+ "return\n" +
+ " if ($withKey) then\n" +
+ " xs:long($withKey[1]/v:revision)\n" +
+ " else\n" +
+ " xs:long($p[v:revision = $base]/v:revision)";
+
+ private final static StringSource GET_BASE_REV_FOR_KEY_SOURCE = new StringSource(GET_BASE_REV_FOR_KEY);
+
public static long getCurrentRevision(DBBroker broker, XmldbURI docPath) throws XPathException, IOException {
String docName = docPath.lastSegment().toString();
XmldbURI collectionPath = docPath.removeLastSegment();
@@ -111,4 +128,35 @@
pool.returnCompiledXQuery(GET_CONFLICTING_REV_SOURCE, compiled);
}
}
+
+ public static long getBaseRevision(DBBroker broker, XmldbURI docPath, long baseRev, String sessionKey) throws XPathException, IOException {
+ String docName = docPath.lastSegment().toString();
+ XmldbURI collectionPath = docPath.removeLastSegment();
+ XmldbURI path = VersioningTrigger.VERSIONS_COLLECTION.append(collectionPath);
+ XQuery xquery = broker.getXQueryService();
+ XQueryPool pool = xquery.getXQueryPool();
+ XQueryContext context;
+ CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, GET_BASE_REV_FOR_KEY_SOURCE);
+ if(compiled == null)
+ context = xquery.newContext(AccessContext.VALIDATION_INTERNAL);
+ else
+ context = compiled.getContext();
+ context.declareVariable("collection", path.toString());
+ context.declareVariable("document", docName);
+ context.declareVariable("base", new IntegerValue(baseRev));
+ context.declareVariable("key", sessionKey);
+
+ if(compiled == null)
+ compiled = xquery.compile(context, GET_BASE_REV_FOR_KEY_SOURCE);
+ try {
+ Sequence s = xquery.execute(compiled, Sequence.EMPTY_SEQUENCE);
+ if (s.isEmpty())
+ return 0;
+
+ IntegerValue iv = (IntegerValue) s.itemAt(0);
+ return iv.getLong();
+ } finally {
+ pool.returnCompiledXQuery(GET_BASE_REV_FOR_KEY_SOURCE, compiled);
+ }
+ }
}
Modified: trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningTrigger.java
===================================================================
--- trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningTrigger.java 2009-05-31 12:06:24 UTC (rev 9092)
+++ trunk/eXist/extensions/versioning/src/org/exist/versioning/VersioningTrigger.java 2009-05-31 16:39:16 UTC (rev 9093)
@@ -316,9 +316,12 @@
}
}
if (documentKey != null && documentRev != null) {
+ LOG.debug("v:key = " + documentKey + "; v:revision = " + documentRev);
try {
long rev = Long.parseLong(documentRev);
if (VersioningHelper.newerRevisionExists(broker, documentPath, rev, documentKey)) {
+ long baseRev = VersioningHelper.getBaseRevision(broker, documentPath, rev, documentKey);
+ LOG.debug("base revision: " + baseRev);
throw new TriggerException("Possible version conflict detected for document: " + documentPath);
}
} catch (XPathException e) {
@@ -331,6 +334,8 @@
}
}
if (elementStack == 0) {
+ // Remove the versioning attributes which were inserted during serialization. We don't want
+ // to store them in the db
AttributesImpl nattrs = new AttributesImpl();
for (int i = 0; i < attributes.getLength(); i++) {
if (!StandardDiff.NAMESPACE.equals(attributes.getURI(i)))
@@ -347,4 +352,10 @@
elementStack--;
super.endElement(namespaceURI, localName, qname);
}
+
+ public void startPrefixMapping(String prefix, String namespaceURI) throws SAXException {
+ if (StandardDiff.NAMESPACE.equals(namespaceURI))
+ return;
+ super.startPrefixMapping(prefix, namespaceURI);
+ }
}
\ No newline at end of file
Modified: trunk/eXist/extensions/versioning/src/org/exist/versioning/xquery/versioning.xqm
===================================================================
--- trunk/eXist/extensions/versioning/src/org/exist/versioning/xquery/versioning.xqm 2009-05-31 12:06:24 UTC (rev 9092)
+++ trunk/eXist/extensions/versioning/src/org/exist/versioning/xquery/versioning.xqm 2009-05-31 16:39:16 UTC (rev 9093)
@@ -133,11 +133,13 @@
doc(concat($vCollection, "/", $docName, ".base"))
else
v:doc($doc, $revisions[$p - 1])
+ let $diff := collection($vCollection)/v:version[
+ v:properties[v:document = $docName]
+ [v:revision = $rev]
+ ]
return
version:annotate(
- $previous,
- collection($vCollection)/v:version[v:properties[v:document = $docName]
- [v:revision = $rev]]
+ $previous, $diff
)
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2009-05-31 12:06:26
|
Revision: 9092
http://exist.svn.sourceforge.net/exist/?rev=9092&view=rev
Author: jmfg
Date: 2009-05-31 12:06:24 +0000 (Sun, 31 May 2009)
Log Message:
-----------
Reverting the encoding changes from commit r9091.
Modified Paths:
--------------
trunk/eXist/src/org/exist/client/messages_es_ES.properties
Modified: trunk/eXist/src/org/exist/client/messages_es_ES.properties
===================================================================
--- trunk/eXist/src/org/exist/client/messages_es_ES.properties 2009-05-31 11:58:53 UTC (rev 9091)
+++ trunk/eXist/src/org/exist/client/messages_es_ES.properties 2009-05-31 12:06:24 UTC (rev 9092)
@@ -1,11 +1,11 @@
ClientFrame.0=Cortar
ClientFrame.1=Copiar
ClientFrame.2=Pegar
-ClientFrame.3=Cliente de Administración eXist
-ClientFrame.5=Ir a la colección padre
-ClientFrame.7=Refrescar la vista de la colección
-ClientFrame.9=Crear nueva colección
-ClientFrame.11=Almacena uno o más ficheros en la base de datos
+ClientFrame.3=Cliente de Administraci\xF3n eXist
+ClientFrame.5=Ir a la colecci\xF3n padre
+ClientFrame.7=Refrescar la vista de la colecci\xF3n
+ClientFrame.9=Crear nueva colecci\xF3n
+ClientFrame.11=Almacena uno o m\xE1s ficheros en la base de datos
ClientFrame.13=Borrar ficheros o colecciones seleccionados
ClientFrame.14=icons/Preferences24.gif
ClientFrame.15=Editar propietarios/permisos de los recursos seleccionados
@@ -14,46 +14,46 @@
ClientFrame.20=icons/keyring-small.png
ClientFrame.21=Administrar usuarios
ClientFrame.23=Consultar la base de datos usando XPath
-ClientFrame.24=Menú de Consola
-ClientFrame.27=Cliente de Administración de eXist conectado -
+ClientFrame.24=Men\xFA de Consola
+ClientFrame.27=Cliente de Administraci\xF3n de eXist conectado -
ClientFrame.31=Fichero
ClientFrame.32=Almacenar ficheros/directorios
-ClientFrame.34=Crear colección
-ClientFrame.36=Crear documento vacío
-ClientFrame.38=Nombre del recurso XML (incluída la extensión)
+ClientFrame.34=Crear colecci\xF3n
+ClientFrame.36=Crear documento vac\xEDo
+ClientFrame.38=Nombre del recurso XML (inclu\xEDda la extensi\xF3n)
ClientFrame.39=<template></template>
ClientFrame.40=Eliminar
ClientFrame.42=Copiar
ClientFrame.44=Mover
ClientFrame.46=Renombrar
ClientFrame.47=Exportar recurso a fichero ...
-ClientFrame.48=Reindexar colección
+ClientFrame.48=Reindexar colecci\xF3n
ClientFrame.50=Propiedades del recurso
ClientFrame.52=Salir
ClientFrame.54=Herramientas
ClientFrame.55=Encontrar
ClientFrame.57=Editar Usuarios
-ClientFrame.59=Editar Índices
-ClientFrame.61=Editar Políticas
+ClientFrame.59=Editar \xCDndices
+ClientFrame.61=Editar Pol\xEDticas
ClientFrame.63=Copia de seguridad
-ClientFrame.64=Restauración
-ClientFrame.65=Conexión
+ClientFrame.64=Restauraci\xF3n
+ClientFrame.65=Conexi\xF3n
ClientFrame.66=Desconectar
ClientFrame.67=desconectado\n
ClientFrame.69=Conectar
-ClientFrame.70=Abrir panel de login para cambiar el servidor o identidad de la conexión.
-ClientFrame.71=Cliente de Administración de eXist conectado -
-ClientFrame.75=¡La conexión a
-ClientFrame.77=\ falló\!
+ClientFrame.70=Abrir panel de login para cambiar el servidor o identidad de la conexi\xF3n.
+ClientFrame.71=Cliente de Administraci\xF3n de eXist conectado -
+ClientFrame.75=\xA1La conexi\xF3n a
+ClientFrame.77=\ fall\xF3\!
ClientFrame.78=Imposible reconectar a
ClientFrame.80=Opciones
ClientFrame.81=Indentar
-ClientFrame.82=sí
-ClientFrame.83=sí
+ClientFrame.82=s\xED
+ClientFrame.83=s\xED
ClientFrame.84=no
ClientFrame.85=Expandir XIncludes
-ClientFrame.86=sí
-ClientFrame.87=sí
+ClientFrame.86=s\xED
+ClientFrame.87=s\xED
ClientFrame.88=no
ClientFrame.89=Ayuda
ClientFrame.90=Acerca de
@@ -61,17 +61,17 @@
ClientFrame.92=\
ClientFrame.93=Backspace
ClientFrame.94=cd ..\n
-ClientFrame.96=Por favor, introduzca el nombre de la nueva colección
+ClientFrame.96=Por favor, introduzca el nombre de la nueva colecci\xF3n
ClientFrame.99=Por favor, introduzca una URI base XML:DB (sin
-ClientFrame.100=la ruta a la colección)
-ClientFrame.102=¡La conexión a
-ClientFrame.103=\ falló\!
-ClientFrame.104=¿Está seguro de que quiere eliminar los recursos
+ClientFrame.100=la ruta a la colecci\xF3n)
+ClientFrame.102=\xA1La conexi\xF3n a
+ClientFrame.103=\ fall\xF3\!
+ClientFrame.104=\xBFEst\xE1 seguro de que quiere eliminar los recursos
ClientFrame.105=seleccionados?
ClientFrame.106=Confirmar borrado
-ClientFrame.107=Eliminación en Progreso
+ClientFrame.107=Eliminaci\xF3n en Progreso
ClientFrame.108=
-ClientFrame.111=Seleccioar colección de destino
+ClientFrame.111=Seleccioar colecci\xF3n de destino
ClientFrame.112=Copiar
ClientFrame.115=Moviendo
ClientFrame.116=\ a
@@ -79,22 +79,22 @@
ClientFrame.118=Traslado completado.
ClientFrame.119=Por favor, introduzca un nuevo nombre de fichero
ClientFrame.120=Renombrar
-ClientFrame.121=No pudo procesarse el nuevo nombre como una uri válidad:
+ClientFrame.121=No pudo procesarse el nuevo nombre como una uri v\xE1lidad:
ClientFrame.124=Renombrando
ClientFrame.125=\ a
ClientFrame.126=...
ClientFrame.127=Renombrado completado.
-ClientFrame.128=Seleccionar colección de destino
+ClientFrame.128=Seleccionar colecci\xF3n de destino
ClientFrame.129=Copiar
ClientFrame.132=Copiando
ClientFrame.133=\ a
ClientFrame.134=...
ClientFrame.135=Copia completada.
-ClientFrame.136=Sólo se puede reindexar las colecciones.
+ClientFrame.136=S\xF3lo se puede reindexar las colecciones.
ClientFrame.137=Error
-ClientFrame.138=¿Está seguro de que quiere reindexar las colecciones seleccionadas \ny todos los recursos dentro de ellas?
+ClientFrame.138=\xBFEst\xE1 seguro de que quiere reindexar las colecciones seleccionadas \ny todos los recursos dentro de ellas?
ClientFrame.139=Confirmar reindexado
-ClientFrame.142=Reindexando colección
+ClientFrame.142=Reindexando colecci\xF3n
ClientFrame.143=...
ClientFrame.144=Reindexado completado.
ClientFrame.145=working-dir
@@ -105,15 +105,15 @@
ClientFrame.167=__contents__.xml
ClientFrame.168=__contents__.xml files
ClientFrame.169=Seleccionar el archivo de copia de seguridad a restaurar
-ClientFrame.170=contraseña de dba/admin a usar para el proceso de restauración:
-ClientFrame.171=Contraseña de Administración
+ClientFrame.170=contrase\xF1a de dba/admin a usar para el proceso de restauraci\xF3n:
+ClientFrame.171=Contrase\xF1a de Administraci\xF3n
ClientFrame.181=Exception:
ClientFrame.184=Editar Usuarios
-ClientFrame.185=Falló recuperar UserManagementService
-ClientFrame.186=Editar Índices
-ClientFrame.187=No se pudo obtener la colección del sistema
-ClientFrame.190=XACML no está habilitado. Para habilitarlo, añade\n\n <xacml enable="yes"/>\n\na conf.xml y reinicia eXist.
-ClientFrame.191=No se pudo contactar con el administración de instancias de la base de datos para determinar si está habilitado XACML
+ClientFrame.185=Fall\xF3 recuperar UserManagementService
+ClientFrame.186=Editar \xCDndices
+ClientFrame.187=No se pudo obtener la colecci\xF3n del sistema
+ClientFrame.190=XACML no est\xE1 habilitado. Para habilitarlo, a\xF1ade\n\n <xacml enable="yes"/>\n\na conf.xml y reinicia eXist.
+ClientFrame.191=No se pudo contactar con el administraci\xF3n de instancias de la base de datos para determinar si est\xE1 habilitado XACML
ClientFrame.194=...
ClientFrame.195=
ClientFrame.196=
@@ -142,23 +142,23 @@
LoginPanel.1=favoritos
-LoginPanel.3=Contraseña
+LoginPanel.3=Contrase\xF1a
-LoginPanel.4=Conexión
+LoginPanel.4=Conexi\xF3n
LoginPanel.5=Remota
LoginPanel.6=Embebida
-LoginPanel.8=Configuración
+LoginPanel.8=Configuraci\xF3n
-LoginPanel.9=Un fichero de configuración eXist para una instancia embebida
+LoginPanel.9=Un fichero de configuraci\xF3n eXist para una instancia embebida
LoginPanel.10=Seleccionar
-LoginPanel.11=Selecciona un fichero de configuración alternativo para el modo embebido.
+LoginPanel.11=Selecciona un fichero de configuraci\xF3n alternativo para el modo embebido.
LoginPanel.12=URL
-LoginPanel.13=Título
+LoginPanel.13=T\xEDtulo
LoginPanel.14=Favoritos
@@ -168,9 +168,9 @@
LoginPanel.17=Grabar
-LoginPanel.18=Graba la configuración
+LoginPanel.18=Graba la configuraci\xF3n
-LoginPanel.19=Ya existe una conexión con este nombre. ¿Quiere sobrescribirla?
+LoginPanel.19=Ya existe una conexi\xF3n con este nombre. \xBFQuiere sobrescribirla?
LoginPanel.20=Conflicto
@@ -184,7 +184,7 @@
LoginPanel.25=favourites.xml
-LoginPanel.26=No seleccionó ningún fichero de favoritos
+LoginPanel.26=No seleccion\xF3 ning\xFAn fichero de favoritos
LoginPanel.27=Error
@@ -196,7 +196,7 @@
LoginPanel.31=Importar favoritos desde fichero
-LoginPanel.33=No seleccionó ningún fichero de favoritos
+LoginPanel.33=No seleccion\xF3 ning\xFAn fichero de favoritos
LoginPanel.34=Error
@@ -204,7 +204,7 @@
LoginPanel.36=Error
-LoginPanel.37=Seleccione un fichero de configuración de instancia de eXist
+LoginPanel.37=Seleccione un fichero de configuraci\xF3n de instancia de eXist
#Leave this value
LoginPanel.42=name
#Leave this value
@@ -220,13 +220,13 @@
UploadDialog.1=Almacenado\:
-UploadDialog.2=Calculando tamaño de los ficheros ...
+UploadDialog.2=Calculando tama\xF1o de los ficheros ...
UploadDialog.3=Directorio\:
UploadDialog.4=Cargando fichero\:
-UploadDialog.5=Tamaño\:
+UploadDialog.5=Tama\xF1o\:
UploadDialog.6=0K
@@ -256,13 +256,13 @@
DocumentView.0=Ver el Documento
-DocumentView.6=El recursos ya está bloqueado por el usuario
+DocumentView.6=El recursos ya est\xE1 bloqueado por el usuario
-DocumentView.7=. ¿Debería intentar readquirir el bloqueo?
+DocumentView.7=. \xBFDeber\xEDa intentar readquirir el bloqueo?
DocumentView.8=Recurso bloqueado
-DocumentView.9=El recurso no puede ser bloqueado. Abriendo en sólo lectura.
+DocumentView.9=El recurso no puede ser bloqueado. Abriendo en s\xF3lo lectura.
DocumentView.10=XMLDB error\:
@@ -278,11 +278,11 @@
DocumentView.24=Exportar a fichero.
-DocumentView.26=Copiar selección.
+DocumentView.26=Copiar selecci\xF3n.
-DocumentView.28=Cortar selección.
+DocumentView.28=Cortar selecci\xF3n.
-DocumentView.30=Pegar selección.
+DocumentView.30=Pegar selecci\xF3n.
DocumentView.32=Refrescar Documento.
@@ -296,7 +296,7 @@
DocumentView.37=XMLDBException\:
-DocumentView.38=Nombre del recurso XML (incluída la extensión)
+DocumentView.38=Nombre del recurso XML (inclu\xEDda la extensi\xF3n)
DocumentView.39=Almacenando
@@ -306,9 +306,9 @@
DocumentView.44=Seleccione el fichero a exportar
-DocumentView.45=El fichero ya existe. ¿Quiere sobrescribirlo?
+DocumentView.45=El fichero ya existe. \xBFQuiere sobrescribirlo?
-DocumentView.46=¿Quiere sobrescribir?
+DocumentView.46=\xBFQuiere sobrescribir?
DocumentView.48=XMLDBException\:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2009-05-31 11:58:55
|
Revision: 9091
http://exist.svn.sourceforge.net/exist/?rev=9091&view=rev
Author: jmfg
Date: 2009-05-31 11:58:53 +0000 (Sun, 31 May 2009)
Log Message:
-----------
[bugfix] Encoding of Spanish client messages file has been changed to UTF-8
Modified Paths:
--------------
trunk/eXist/src/org/exist/client/messages_es_ES.properties
Modified: trunk/eXist/src/org/exist/client/messages_es_ES.properties
===================================================================
--- trunk/eXist/src/org/exist/client/messages_es_ES.properties 2009-05-31 09:15:32 UTC (rev 9090)
+++ trunk/eXist/src/org/exist/client/messages_es_ES.properties 2009-05-31 11:58:53 UTC (rev 9091)
@@ -1,11 +1,11 @@
ClientFrame.0=Cortar
ClientFrame.1=Copiar
ClientFrame.2=Pegar
-ClientFrame.3=Cliente de Administraci\xF3n eXist
-ClientFrame.5=Ir a la colecci\xF3n padre
-ClientFrame.7=Refrescar la vista de la colecci\xF3n
-ClientFrame.9=Crear nueva colecci\xF3n
-ClientFrame.11=Almacena uno o m\xE1s ficheros en la base de datos
+ClientFrame.3=Cliente de Administración eXist
+ClientFrame.5=Ir a la colección padre
+ClientFrame.7=Refrescar la vista de la colección
+ClientFrame.9=Crear nueva colección
+ClientFrame.11=Almacena uno o más ficheros en la base de datos
ClientFrame.13=Borrar ficheros o colecciones seleccionados
ClientFrame.14=icons/Preferences24.gif
ClientFrame.15=Editar propietarios/permisos de los recursos seleccionados
@@ -14,46 +14,46 @@
ClientFrame.20=icons/keyring-small.png
ClientFrame.21=Administrar usuarios
ClientFrame.23=Consultar la base de datos usando XPath
-ClientFrame.24=Men\xFA de Consola
-ClientFrame.27=Cliente de Administraci\xF3n de eXist conectado -
+ClientFrame.24=Menú de Consola
+ClientFrame.27=Cliente de Administración de eXist conectado -
ClientFrame.31=Fichero
ClientFrame.32=Almacenar ficheros/directorios
-ClientFrame.34=Crear colecci\xF3n
-ClientFrame.36=Crear documento vac\xEDo
-ClientFrame.38=Nombre del recurso XML (inclu\xEDda la extensi\xF3n)
+ClientFrame.34=Crear colección
+ClientFrame.36=Crear documento vacío
+ClientFrame.38=Nombre del recurso XML (incluída la extensión)
ClientFrame.39=<template></template>
ClientFrame.40=Eliminar
ClientFrame.42=Copiar
ClientFrame.44=Mover
ClientFrame.46=Renombrar
ClientFrame.47=Exportar recurso a fichero ...
-ClientFrame.48=Reindexar colecci\xF3n
+ClientFrame.48=Reindexar colección
ClientFrame.50=Propiedades del recurso
ClientFrame.52=Salir
ClientFrame.54=Herramientas
ClientFrame.55=Encontrar
ClientFrame.57=Editar Usuarios
-ClientFrame.59=Editar \xCDndices
-ClientFrame.61=Editar Pol\xEDticas
+ClientFrame.59=Editar Índices
+ClientFrame.61=Editar Políticas
ClientFrame.63=Copia de seguridad
-ClientFrame.64=Restauraci\xF3n
-ClientFrame.65=Conexi\xF3n
+ClientFrame.64=Restauración
+ClientFrame.65=Conexión
ClientFrame.66=Desconectar
ClientFrame.67=desconectado\n
ClientFrame.69=Conectar
-ClientFrame.70=Abrir panel de login para cambiar el servidor o identidad de la conexi\xF3n.
-ClientFrame.71=Cliente de Administraci\xF3n de eXist conectado -
-ClientFrame.75=\xA1La conexi\xF3n a
-ClientFrame.77=\ fall\xF3\!
+ClientFrame.70=Abrir panel de login para cambiar el servidor o identidad de la conexión.
+ClientFrame.71=Cliente de Administración de eXist conectado -
+ClientFrame.75=¡La conexión a
+ClientFrame.77=\ falló\!
ClientFrame.78=Imposible reconectar a
ClientFrame.80=Opciones
ClientFrame.81=Indentar
-ClientFrame.82=s\xED
-ClientFrame.83=s\xED
+ClientFrame.82=sí
+ClientFrame.83=sí
ClientFrame.84=no
ClientFrame.85=Expandir XIncludes
-ClientFrame.86=s\xED
-ClientFrame.87=s\xED
+ClientFrame.86=sí
+ClientFrame.87=sí
ClientFrame.88=no
ClientFrame.89=Ayuda
ClientFrame.90=Acerca de
@@ -61,17 +61,17 @@
ClientFrame.92=\
ClientFrame.93=Backspace
ClientFrame.94=cd ..\n
-ClientFrame.96=Por favor, introduzca el nombre de la nueva colecci\xF3n
+ClientFrame.96=Por favor, introduzca el nombre de la nueva colección
ClientFrame.99=Por favor, introduzca una URI base XML:DB (sin
-ClientFrame.100=la ruta a la colecci\xF3n)
-ClientFrame.102=\xA1La conexi\xF3n a
-ClientFrame.103=\ fall\xF3\!
-ClientFrame.104=\xBFEst\xE1 seguro de que quiere eliminar los recursos
+ClientFrame.100=la ruta a la colección)
+ClientFrame.102=¡La conexión a
+ClientFrame.103=\ falló\!
+ClientFrame.104=¿Está seguro de que quiere eliminar los recursos
ClientFrame.105=seleccionados?
ClientFrame.106=Confirmar borrado
-ClientFrame.107=Eliminaci\xF3n en Progreso
+ClientFrame.107=Eliminación en Progreso
ClientFrame.108=
-ClientFrame.111=Seleccioar colecci\xF3n de destino
+ClientFrame.111=Seleccioar colección de destino
ClientFrame.112=Copiar
ClientFrame.115=Moviendo
ClientFrame.116=\ a
@@ -79,22 +79,22 @@
ClientFrame.118=Traslado completado.
ClientFrame.119=Por favor, introduzca un nuevo nombre de fichero
ClientFrame.120=Renombrar
-ClientFrame.121=No pudo procesarse el nuevo nombre como una uri v\xE1lidad:
+ClientFrame.121=No pudo procesarse el nuevo nombre como una uri válidad:
ClientFrame.124=Renombrando
ClientFrame.125=\ a
ClientFrame.126=...
ClientFrame.127=Renombrado completado.
-ClientFrame.128=Seleccionar colecci\xF3n de destino
+ClientFrame.128=Seleccionar colección de destino
ClientFrame.129=Copiar
ClientFrame.132=Copiando
ClientFrame.133=\ a
ClientFrame.134=...
ClientFrame.135=Copia completada.
-ClientFrame.136=S\xF3lo se puede reindexar las colecciones.
+ClientFrame.136=Sólo se puede reindexar las colecciones.
ClientFrame.137=Error
-ClientFrame.138=\xBFEst\xE1 seguro de que quiere reindexar las colecciones seleccionadas \ny todos los recursos dentro de ellas?
+ClientFrame.138=¿Está seguro de que quiere reindexar las colecciones seleccionadas \ny todos los recursos dentro de ellas?
ClientFrame.139=Confirmar reindexado
-ClientFrame.142=Reindexando colecci\xF3n
+ClientFrame.142=Reindexando colección
ClientFrame.143=...
ClientFrame.144=Reindexado completado.
ClientFrame.145=working-dir
@@ -105,15 +105,15 @@
ClientFrame.167=__contents__.xml
ClientFrame.168=__contents__.xml files
ClientFrame.169=Seleccionar el archivo de copia de seguridad a restaurar
-ClientFrame.170=contrase\xF1a de dba/admin a usar para el proceso de restauraci\xF3n:
-ClientFrame.171=Contrase\xF1a de Administraci\xF3n
+ClientFrame.170=contraseña de dba/admin a usar para el proceso de restauración:
+ClientFrame.171=Contraseña de Administración
ClientFrame.181=Exception:
ClientFrame.184=Editar Usuarios
-ClientFrame.185=Fall\xF3 recuperar UserManagementService
-ClientFrame.186=Editar \xCDndices
-ClientFrame.187=No se pudo obtener la colecci\xF3n del sistema
-ClientFrame.190=XACML no est\xE1 habilitado. Para habilitarlo, a\xF1ade\n\n <xacml enable="yes"/>\n\na conf.xml y reinicia eXist.
-ClientFrame.191=No se pudo contactar con el administraci\xF3n de instancias de la base de datos para determinar si est\xE1 habilitado XACML
+ClientFrame.185=Falló recuperar UserManagementService
+ClientFrame.186=Editar Índices
+ClientFrame.187=No se pudo obtener la colección del sistema
+ClientFrame.190=XACML no está habilitado. Para habilitarlo, añade\n\n <xacml enable="yes"/>\n\na conf.xml y reinicia eXist.
+ClientFrame.191=No se pudo contactar con el administración de instancias de la base de datos para determinar si está habilitado XACML
ClientFrame.194=...
ClientFrame.195=
ClientFrame.196=
@@ -142,23 +142,23 @@
LoginPanel.1=favoritos
-LoginPanel.3=Contrase\xF1a
+LoginPanel.3=Contraseña
-LoginPanel.4=Conexi\xF3n
+LoginPanel.4=Conexión
LoginPanel.5=Remota
LoginPanel.6=Embebida
-LoginPanel.8=Configuraci\xF3n
+LoginPanel.8=Configuración
-LoginPanel.9=Un fichero de configuraci\xF3n eXist para una instancia embebida
+LoginPanel.9=Un fichero de configuración eXist para una instancia embebida
LoginPanel.10=Seleccionar
-LoginPanel.11=Selecciona un fichero de configuraci\xF3n alternativo para el modo embebido.
+LoginPanel.11=Selecciona un fichero de configuración alternativo para el modo embebido.
LoginPanel.12=URL
-LoginPanel.13=T\xEDtulo
+LoginPanel.13=Título
LoginPanel.14=Favoritos
@@ -168,9 +168,9 @@
LoginPanel.17=Grabar
-LoginPanel.18=Graba la configuraci\xF3n
+LoginPanel.18=Graba la configuración
-LoginPanel.19=Ya existe una conexi\xF3n con este nombre. \xBFQuiere sobrescribirla?
+LoginPanel.19=Ya existe una conexión con este nombre. ¿Quiere sobrescribirla?
LoginPanel.20=Conflicto
@@ -184,7 +184,7 @@
LoginPanel.25=favourites.xml
-LoginPanel.26=No seleccion\xF3 ning\xFAn fichero de favoritos
+LoginPanel.26=No seleccionó ningún fichero de favoritos
LoginPanel.27=Error
@@ -196,7 +196,7 @@
LoginPanel.31=Importar favoritos desde fichero
-LoginPanel.33=No seleccion\xF3 ning\xFAn fichero de favoritos
+LoginPanel.33=No seleccionó ningún fichero de favoritos
LoginPanel.34=Error
@@ -204,7 +204,7 @@
LoginPanel.36=Error
-LoginPanel.37=Seleccione un fichero de configuraci\xF3n de instancia de eXist
+LoginPanel.37=Seleccione un fichero de configuración de instancia de eXist
#Leave this value
LoginPanel.42=name
#Leave this value
@@ -220,13 +220,13 @@
UploadDialog.1=Almacenado\:
-UploadDialog.2=Calculando tama\xF1o de los ficheros ...
+UploadDialog.2=Calculando tamaño de los ficheros ...
UploadDialog.3=Directorio\:
UploadDialog.4=Cargando fichero\:
-UploadDialog.5=Tama\xF1o\:
+UploadDialog.5=Tamaño\:
UploadDialog.6=0K
@@ -256,13 +256,13 @@
DocumentView.0=Ver el Documento
-DocumentView.6=El recursos ya est\xE1 bloqueado por el usuario
+DocumentView.6=El recursos ya está bloqueado por el usuario
-DocumentView.7=. \xBFDeber\xEDa intentar readquirir el bloqueo?
+DocumentView.7=. ¿Debería intentar readquirir el bloqueo?
DocumentView.8=Recurso bloqueado
-DocumentView.9=El recurso no puede ser bloqueado. Abriendo en s\xF3lo lectura.
+DocumentView.9=El recurso no puede ser bloqueado. Abriendo en sólo lectura.
DocumentView.10=XMLDB error\:
@@ -278,11 +278,11 @@
DocumentView.24=Exportar a fichero.
-DocumentView.26=Copiar selecci\xF3n.
+DocumentView.26=Copiar selección.
-DocumentView.28=Cortar selecci\xF3n.
+DocumentView.28=Cortar selección.
-DocumentView.30=Pegar selecci\xF3n.
+DocumentView.30=Pegar selección.
DocumentView.32=Refrescar Documento.
@@ -296,7 +296,7 @@
DocumentView.37=XMLDBException\:
-DocumentView.38=Nombre del recurso XML (inclu\xEDda la extensi\xF3n)
+DocumentView.38=Nombre del recurso XML (incluída la extensión)
DocumentView.39=Almacenando
@@ -306,9 +306,9 @@
DocumentView.44=Seleccione el fichero a exportar
-DocumentView.45=El fichero ya existe. \xBFQuiere sobrescribirlo?
+DocumentView.45=El fichero ya existe. ¿Quiere sobrescribirlo?
-DocumentView.46=\xBFQuiere sobrescribir?
+DocumentView.46=¿Quiere sobrescribir?
DocumentView.48=XMLDBException\:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-31 09:15:40
|
Revision: 9090
http://exist.svn.sourceforge.net/exist/?rev=9090&view=rev
Author: wolfgang_m
Date: 2009-05-31 09:15:32 +0000 (Sun, 31 May 2009)
Log Message:
-----------
[performance] changed optimizer to handle index lookups along the "self" axis more efficiently, e.g. //a[.//b = 'c'].
also changed: query optimizer did not descend into union and intersection expressions, e.g. (//a[b = 'c'] | //d[e = 'c']).
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/BasicExpressionVisitor.java
trunk/eXist/src/org/exist/xquery/DefaultExpressionVisitor.java
trunk/eXist/src/org/exist/xquery/ExpressionVisitor.java
trunk/eXist/src/org/exist/xquery/Intersection.java
trunk/eXist/src/org/exist/xquery/Optimizer.java
trunk/eXist/src/org/exist/xquery/Union.java
trunk/eXist/test/src/org/exist/xquery/OptimizerTest.java
Modified: trunk/eXist/src/org/exist/xquery/BasicExpressionVisitor.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/BasicExpressionVisitor.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/src/org/exist/xquery/BasicExpressionVisitor.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -43,6 +43,8 @@
public void visitUnionExpr(Union union) {
}
+ public void visitIntersectionExpr(Intersection intersect) {
+ }
public void visitAndExpr(OpAnd and) {
}
Modified: trunk/eXist/src/org/exist/xquery/DefaultExpressionVisitor.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/DefaultExpressionVisitor.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/src/org/exist/xquery/DefaultExpressionVisitor.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -114,4 +114,14 @@
if (constructor.getContentExpr() != null)
constructor.getContentExpr().accept(this);
}
+
+ public void visitUnionExpr(Union union) {
+ union.left.accept(this);
+ union.right.accept(this);
+ }
+
+ public void visitIntersectionExpr(Intersection intersect) {
+ intersect.left.accept(this);
+ intersect.right.accept(this);
+ }
}
Modified: trunk/eXist/src/org/exist/xquery/ExpressionVisitor.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/ExpressionVisitor.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/src/org/exist/xquery/ExpressionVisitor.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -36,6 +36,8 @@
public void visitUnionExpr(Union union);
+ public void visitIntersectionExpr(Intersection intersect);
+
public void visitAndExpr(OpAnd and);
public void visitOrExpr(OpOr or);
Modified: trunk/eXist/src/org/exist/xquery/Intersection.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/Intersection.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/src/org/exist/xquery/Intersection.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -105,5 +105,9 @@
result.append(" intersect ");
result.append(right.toString());
return result.toString();
- }
+ }
+
+ public void accept(ExpressionVisitor visitor) {
+ visitor.visitIntersectionExpr(this);
+ }
}
Modified: trunk/eXist/src/org/exist/xquery/Optimizer.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/Optimizer.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/src/org/exist/xquery/Optimizer.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -34,7 +34,7 @@
* Analyzes the query and marks optimizable expressions for the query engine.
* This class just searches for potentially optimizable expressions in the query tree and
* encloses those expressions with an (#exist:optimize#) pragma. The real optimization
- * work is not done by this class but by the pragma (see {@link org.exist.xquery.Optimize}).
+ * work is not done by this class but by the pragma (see {@link org.exist.xquery.pragmas.Optimize}).
* The pragma may also decide that the optimization is not applicable and just execute
* the expression without any optimization.
*
@@ -185,7 +185,6 @@
}
}
-
public void visitPredicate(Predicate predicate) {
++predicates;
super.visitPredicate(predicate);
@@ -198,7 +197,7 @@
int axis = optimizable.getOptimizeAxis();
if (!(axis == Constants.CHILD_AXIS || axis == Constants.DESCENDANT_AXIS ||
axis == Constants.DESCENDANT_SELF_AXIS || axis == Constants.ATTRIBUTE_AXIS ||
- axis == Constants.DESCENDANT_ATTRIBUTE_AXIS
+ axis == Constants.DESCENDANT_ATTRIBUTE_AXIS || axis == Constants.SELF_AXIS
)) {
return false;
}
Modified: trunk/eXist/src/org/exist/xquery/Union.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/Union.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/src/org/exist/xquery/Union.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -97,5 +97,9 @@
result.append(" union ");
result.append(right.toString());
return result.toString();
- }
+ }
+
+ public void accept(ExpressionVisitor visitor) {
+ visitor.visitUnionExpr(this);
+ }
}
Modified: trunk/eXist/test/src/org/exist/xquery/OptimizerTest.java
===================================================================
--- trunk/eXist/test/src/org/exist/xquery/OptimizerTest.java 2009-05-31 09:08:12 UTC (rev 9089)
+++ trunk/eXist/test/src/org/exist/xquery/OptimizerTest.java 2009-05-31 09:15:32 UTC (rev 9090)
@@ -212,6 +212,9 @@
r = execute("//mods:mods[*/mods:title &= 'ethnic']", false);
execute("//mods:mods[*/mods:title &= 'ethnic']", true, MSG_OPT_ERROR, r);
+ r = execute("//mods:mods[.//mods:title &= 'ethnic']", false);
+ execute("//mods:mods[.//mods:title &= 'ethnic']", true, MSG_OPT_ERROR, r);
+
r = execute("//mods:mods[mods:physicalDescription/mods:internetMediaType = 'text/html']", false);
execute("//mods:mods[mods:physicalDescription/mods:internetMediaType = 'text/html']", true, MSG_OPT_ERROR, r);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-31 09:08:20
|
Revision: 9089
http://exist.svn.sourceforge.net/exist/?rev=9089&view=rev
Author: wolfgang_m
Date: 2009-05-31 09:08:12 +0000 (Sun, 31 May 2009)
Log Message:
-----------
[bugfix] lucene index: fixed errors when shutting down the database. reset index state after removing a document.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndex.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndex.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndex.java 2009-05-30 15:55:22 UTC (rev 9088)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndex.java 2009-05-31 09:08:12 UTC (rev 9089)
@@ -94,15 +94,15 @@
}
public void remove() throws DBException {
- close();
try {
String[] files = directory.list();
for (int i = 0; i < files.length; i++) {
String file = files[i];
directory.deleteFile(file);
}
- } catch (IOException e) {
- e.printStackTrace();
+ close();
+ } catch (Exception e) {
+ LOG.warn(e.getMessage(), e);
}
}
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-05-30 15:55:22 UTC (rev 9088)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-05-31 09:08:12 UTC (rev 9089)
@@ -229,6 +229,7 @@
LOG.warn("Error while removing lucene index: " + e.getMessage(), e);
} finally {
index.releaseWritingReader(reader);
+ mode = StreamListener.STORE;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 15:55:25
|
Revision: 9088
http://exist.svn.sourceforge.net/exist/?rev=9088&view=rev
Author: wolfgang_m
Date: 2009-05-30 15:55:22 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[ignore] build broken by mistake.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java 2009-05-30 15:34:56 UTC (rev 9087)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java 2009-05-30 15:55:22 UTC (rev 9088)
@@ -11,9 +11,7 @@
public static final FunctionDef[] functions = {
new FunctionDef(Query.signature, Query.class),
- new FunctionDef(Score.signature, Score.class),
- new FunctionDef(IndexTerms.signatures[0], IndexTerms.class),
- new FunctionDef(IndexTerms.signatures[1], IndexTerms.class)
+ new FunctionDef(Score.signature, Score.class)
};
public LuceneModule() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 15:34:58
|
Revision: 9087
http://exist.svn.sourceforge.net/exist/?rev=9087&view=rev
Author: wolfgang_m
Date: 2009-05-30 15:34:56 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[documentation] Moving the documentation search to Lucene.
Modified Paths:
--------------
trunk/eXist/webapp/docsetup.xql
trunk/eXist/webapp/kwic.xql
trunk/eXist/webapp/search.xql
trunk/eXist/webapp/styles/docsearch.css
Modified: trunk/eXist/webapp/docsetup.xql
===================================================================
--- trunk/eXist/webapp/docsetup.xql 2009-05-30 15:29:02 UTC (rev 9086)
+++ trunk/eXist/webapp/docsetup.xql 2009-05-30 15:34:56 UTC (rev 9087)
@@ -11,10 +11,17 @@
declare variable $setup:config :=
<collection xmlns="" rel="nofollow">http://exist-db.org/collection-config/1.0">
<index xmlns:xqdoc="" rel="nofollow">http://www.xqdoc.org/1.0">
- <fulltext default="none" attributes="no">
- <create qname="title"/>
- <create qname="para"/>
- </fulltext>
+ <fulltext default="none" attributes="no"/>
+ <lucene>
+ <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+ <text qname="section">
+ <ignore qname="title"/>
+ <ignore qname="programlisting"/>
+ <ignore qname="screen"/>
+ <ignore qname="synopsis"/>
+ </text>
+ <text qname="title" boost="2.0"/>
+ </lucene>
<ngram qname="xqdoc:name"/>
<ngram qname="xqdoc:description"/>
</index>
Modified: trunk/eXist/webapp/kwic.xql
===================================================================
--- trunk/eXist/webapp/kwic.xql 2009-05-30 15:29:02 UTC (rev 9086)
+++ trunk/eXist/webapp/kwic.xql 2009-05-30 15:34:56 UTC (rev 9087)
@@ -9,13 +9,14 @@
@param $match the text node containing the match
@param $mode the selection mode: either "previous" or "following"
:)
-declare function kwic:get-context($match as element(exist:match), $mode as xs:string) as node()* {
+declare function kwic:get-context($root as element(), $match as element(exist:match), $mode as xs:string) as node()* {
let $sibs :=
if ($mode eq 'previous') then
$match/preceding::text()
else
$match/text()/following::text()
for $sib in $sibs
+ where exists($root[.//$sib])
return
if ($sib/parent::exist:match) then
<span class="hi">{$sib}</span>
@@ -97,8 +98,8 @@
Print a summary of the match in $node. Output a predefined amount of text to
the left and the right of the match.
- @param $root the root element containing the match. This is the original element
- stored in the database.
+ @param $root root element which should be used as context for the match. It defines the
+ boundaries for the text extraction. Text will be taken from this context.
@param $node the exist:match element to process.
@param $config configuration element which determines the behaviour of the function
:)
@@ -106,14 +107,14 @@
$config as element(config)) as element() {
let $chars := xs:int($config/@width)
let $table := $config/@table = ('yes', 'true')
- let $prev := kwic:get-context($node, 'previous')
+ let $prev := kwic:get-context($root, $node, 'previous')
let $prevTrunc := kwic:truncate-previous($prev, (), $chars, 0)
let $remain :=
if (not($table)) then
$chars * 2 - kwic:string-length($prevTrunc)
else
$chars
- let $following := kwic:get-context($node, 'following')
+ let $following := kwic:get-context($root, $node, 'following')
let $followingTrunc := kwic:truncate-following($following, (), $remain, 0)
return
if (not($table)) then
@@ -143,6 +144,19 @@
};
(:~
+ Return all matches within the specified element, $hit. Matches are returned as
+ exist:match elements. The returned nodes are part of a new document whose
+ root element is a copy of the specified $hit element.
+
+ @param $hit an arbitrary XML element which has been selected by one of the full text
+ operations or an ngram search.
+:)
+declare function kwic:get-matches($hit as element()) as element(exist:match)* {
+ let $expanded := util:expand($hit)
+ return $expanded//exist:match
+};
+
+(:~
Main function of the KWIC module: takes the passed element and returns an
XHTML fragment containing a chunk of text before and after the first full text
match in the node.
@@ -168,8 +182,7 @@
:)
declare function kwic:summarize($hit as element(), $config as element(config))
as element()* {
- let $expanded := util:expand($hit)
- for $match in $expanded//exist:match[1]
+ for $match in kwic:get-matches($hit)
return
- kwic:get-summary($hit, $match, $config)
+ kwic:get-summary($expanded, $match, $config)
};
Modified: trunk/eXist/webapp/search.xql
===================================================================
--- trunk/eXist/webapp/search.xql 2009-05-30 15:29:02 UTC (rev 9086)
+++ trunk/eXist/webapp/search.xql 2009-05-30 15:34:56 UTC (rev 9087)
@@ -1,5 +1,8 @@
xquery version "1.0";
+(:~ ================================================
+ Implements the documentation search.
+ ================================================ :)
import module namespace xdb="http://exist-db.org/xquery/xmldb";
import module namespace kwic="http://exist-db.org/xquery/kwic" at "kwic.xql";
@@ -14,8 +17,8 @@
declare variable $dq:FIELDS :=
<fields>
- <field name="title">section/title</field>
- <field>para</field>
+ <field name="title">section[ft:query(.//title, "$q")]</field>
+ <field>section[ft:query(., "$q")]</field>
</fields>;
declare variable $dq:CHARS_SUMMARY := 120;
@@ -25,10 +28,9 @@
Display the hits: this function iterates through all hits and calls
kwic:summarize to print out a summary of each match.
:)
-declare function dq:print($hits as element()+, $docXPath as xs:string, $mode as xs:string)
+declare function dq:print($hit as element(), $docXPath as xs:string, $mode as xs:string)
as element()* {
- for $hit in $hits
- let $nodeId := util:node-id($hit)
+ let $nodeId := util:node-id($hit)
let $uri := concat(
util:document-name(root($hit)), "?q=",
(: "docs.xql?path=", document-uri(root($hit)), "&q=", :)
@@ -38,8 +40,11 @@
<config xmlns="" width="{if ($mode eq 'summary') then $dq:CHARS_SUMMARY else $dq:CHARS_KWIC}"
table="{if ($mode eq 'summary') then 'no' else 'yes'}"
link="{$uri}"/>
- return
- kwic:summarize($hit, $config)
+
+ let $matches := kwic:get-matches($hit)
+ for $ancestor in $matches/ancestor::para | $matches/ancestor::title | $matches/ancestor::td
+ return
+ kwic:get-summary($ancestor, ($ancestor//exist:match)[1], $config)
};
(:~
@@ -50,7 +55,6 @@
for $s at $p in $section/ancestor-or-self::section
let $nodeId := util:node-id($s)
let $uri := concat(
- (: "docs.xql?path=", document-uri(root($s)), "&q=", :)
util:document-name(root($s)), "?q=",
escape-uri($docXPath, true()), "&id=", $nodeId, "#", $nodeId
)
@@ -63,31 +67,32 @@
:)
declare function dq:print-results($hits as element()*, $docXPath as xs:string) {
let $mode := request:get-parameter("view", "summary")
- let $sections := $hits/ancestor::section[1]
return
<div id="f-results">
- <p id="f-results-heading">Found: {count($hits)} in {count($sections)} sections.</p>
+ <p id="f-results-heading">Found: {count($hits)}.</p>
{
if ($mode eq 'summary') then
- for $section in $sections
- let $hitsInSect := $section//$hits
+ for $section in $hits
+ let $score := ft:score($section)
+ order by $score descending
return
- <div class="section">
+ <div class="section">
+ <span class="score">Score: {round-half-to-even($score, 2)}</span>
<div class="headings">{ dq:print-headings($section, $docXPath) }</div>
- { dq:print($hitsInSect, $docXPath, $mode) }
+ { dq:print($section, $docXPath, $mode) }
</div>
else
<table class="kwic">
{
- for $section in $sections
- let $hitsInSect := $section//$hits
+ for $section in $hits
+ order by ft:score($section) descending
return (
<tr>
<td class="headings" colspan="3">
{dq:print-headings($section, $docXPath)}
</td>
</tr>,
- dq:print($hitsInSect, $docXPath, $mode)
+ dq:print($section, $docXPath, $mode)
)
}
</table>
@@ -102,7 +107,7 @@
declare function dq:create-query($fields as element(field)*, $query as xs:string) {
for $field in $fields
return
- concat($field/string(), "[. &= '", $query, "']")
+ concat($field/string(), "[ft:contains(., '", $query, "')]")
};
(:~
@@ -115,7 +120,9 @@
if ($query) then
let $fields :=
if ($field ne "all") then $dq:FIELDS/field[@name = $field] else $dq:FIELDS/field
- let $queryParts := dq:create-query($fields, $query)
+ let $queryParts :=
+ for $f in $fields return
+ replace($f, "\$q", $query)
let $xpath := string-join(
for $p in $queryParts return
concat("collection('/db/", $dq:COLLECTION, "')/book//", $p),
Modified: trunk/eXist/webapp/styles/docsearch.css
===================================================================
--- trunk/eXist/webapp/styles/docsearch.css 2009-05-30 15:29:02 UTC (rev 9086)
+++ trunk/eXist/webapp/styles/docsearch.css 2009-05-30 15:34:56 UTC (rev 9087)
@@ -42,6 +42,14 @@
font-size: .9em;
}
+.score {
+ float: right;
+ width: 120px;
+ text-align: right;
+ font-size: .85em;
+ color: #C0C0C0;
+}
+
td.previous {
text-align: right;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 15:29:05
|
Revision: 9086
http://exist.svn.sourceforge.net/exist/?rev=9086&view=rev
Author: wolfgang_m
Date: 2009-05-30 15:29:02 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[feature] Lucene index module is now enabled by default. It will replace eXist's old full text index.
Modified Paths:
--------------
trunk/eXist/conf.xml.tmpl
trunk/eXist/extensions/indexes/build.properties
trunk/eXist/extensions/indexes/lucene/build.xml
trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java
Added Paths:
-----------
trunk/eXist/extensions/indexes/lucene/lib/lucene-core-2.4.1.jar
Modified: trunk/eXist/conf.xml.tmpl
===================================================================
--- trunk/eXist/conf.xml.tmpl 2009-05-30 12:39:47 UTC (rev 9085)
+++ trunk/eXist/conf.xml.tmpl 2009-05-30 15:29:02 UTC (rev 9086)
@@ -368,9 +368,7 @@
connectionTimeout="10000" flushAfter="300" />
-->
- <!--
<module id="lucene-index" class="org.exist.indexing.lucene.LuceneIndex"/>
- -->
<!--
The full text index is always required and should
@@ -707,10 +705,9 @@
<module class="org.exist.xquery.modules.spatial.SpatialModule"
uri="http://exist-db.org/xquery/spatial" />
-->
- <!--
+
<module class="org.exist.xquery.modules.lucene.LuceneModule"
uri="" rel="nofollow">http://exist-db.org/xquery/lucene"/>
- -->
<!-- Versioning -->
<module src="resource:org/exist/versioning/xquery/versioning.xqm"
Modified: trunk/eXist/extensions/indexes/build.properties
===================================================================
--- trunk/eXist/extensions/indexes/build.properties 2009-05-30 12:39:47 UTC (rev 9085)
+++ trunk/eXist/extensions/indexes/build.properties 2009-05-30 15:29:02 UTC (rev 9086)
@@ -9,8 +9,8 @@
# N-gram module
include.index.ngram = true
+# Lucene integration
+include.index.lucene = true
+
# Spatial module
-include.index.spatial = false
-
-# Lucene integration
-include.index.lucene = false
+include.index.spatial = false
\ No newline at end of file
Modified: trunk/eXist/extensions/indexes/lucene/build.xml
===================================================================
--- trunk/eXist/extensions/indexes/lucene/build.xml 2009-05-30 12:39:47 UTC (rev 9085)
+++ trunk/eXist/extensions/indexes/lucene/build.xml 2009-05-30 15:29:02 UTC (rev 9086)
@@ -4,20 +4,7 @@
<property name="lib.dir" value="./lib"/>
- <condition property="libs.available">
- <available file="${lib.dir}/lucene-core-2.3.2.jar"/>
- </condition>
-
- <target name="prepare-libs" unless="libs.available">
- <mkdir dir="${lib.dir}"/>
- <echo message="-----------------------------------------------------"/>
- <echo message="Downloading libraries required by the Lucene index..."/>
- <echo message="-----------------------------------------------------"/>
- <get src="http://repo1.maven.org/maven2/org/apache/lucene/lucene-core/2.3.2/lucene-core-2.3.2.jar"
- dest="${lib.dir}/lucene-core-2.3.2.jar" verbose="true" usetimestamp="true" />
- </target>
-
- <target name="jar" depends="prepare-libs, compile">
+ <target name="jar" depends="compile">
<jar destfile="${top.dir}/${lib.extensions}/exist-lucene-module.jar" basedir="${module.classes}">
<manifest>
<attribute name="Project-Name" value="${project.name}"/>
Added: trunk/eXist/extensions/indexes/lucene/lib/lucene-core-2.4.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/eXist/extensions/indexes/lucene/lib/lucene-core-2.4.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java 2009-05-30 12:39:47 UTC (rev 9085)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/LuceneModule.java 2009-05-30 15:29:02 UTC (rev 9086)
@@ -11,7 +11,9 @@
public static final FunctionDef[] functions = {
new FunctionDef(Query.signature, Query.class),
- new FunctionDef(Score.signature, Score.class)
+ new FunctionDef(Score.signature, Score.class),
+ new FunctionDef(IndexTerms.signatures[0], IndexTerms.class),
+ new FunctionDef(IndexTerms.signatures[1], IndexTerms.class)
};
public LuceneModule() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 13:22:17
|
Revision: 9083
http://exist.svn.sourceforge.net/exist/?rev=9083&view=rev
Author: wolfgang_m
Date: 2009-05-30 12:30:30 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[documentation] updated contributor list. added Jim, Dmitriy, Evgeny, Loren, Jose-Maria. Please shout if a name is missing.
Modified Paths:
--------------
trunk/eXist/webapp/credits.xml
Modified: trunk/eXist/webapp/credits.xml
===================================================================
--- trunk/eXist/webapp/credits.xml 2009-05-30 11:11:33 UTC (rev 9082)
+++ trunk/eXist/webapp/credits.xml 2009-05-30 12:30:30 UTC (rev 9083)
@@ -77,13 +77,22 @@
<para>Pierrick Brihaye (developer)</para>
</listitem>
<listitem>
+ <para>Loren Cahlander (developer)</para>
+ </listitem>
+ <listitem>
<para>Mark R. Diggory (tomcat realm)</para>
</listitem>
<listitem>
+ <para>James R. Fuller (developer, XProc support)</para>
+ </listitem>
+ <listitem>
+ <para>José María Fernández González (patches)</para>
+ </listitem>
+ <listitem>
<para>Mark Harrah (XACML)</para>
</listitem>
<listitem>
- <para>Piotr Kaminski (patches)</para>
+ <para>Piotr Kaminski (patches, fluent interfaces)</para>
</listitem>
<listitem>
<para>Stephan Körnig (hashtables)</para>
@@ -92,13 +101,16 @@
<para>Igor Abade V. Leite (patches)</para>
</listitem>
<listitem>
+ <para>Evgeny Gazdovsky (developer)</para>
+ </listitem>
+ <listitem>
<para>Chris Marasti-Georg (developer)</para>
</listitem>
<listitem>
<para>Wolfgang Meier (main developer)</para>
</listitem>
<listitem>
- <para>Alex Milowski (patches; LDAP security manager)</para>
+ <para>Alex Milowski (patches; LDAP security manager, Atom interface)</para>
</listitem>
<listitem>
<para>Per Nyfelt (JBoss integration)</para>
@@ -110,6 +122,9 @@
<para>Adam Retter (developer)</para>
</listitem>
<listitem>
+ <para>Dmitriy Shabanov (developer)</para>
+ </listitem>
+ <listitem>
<para>Giulio Valentino (developer)</para>
</listitem>
<listitem>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 12:53:33
|
Revision: 9084
http://exist.svn.sourceforge.net/exist/?rev=9084&view=rev
Author: wolfgang_m
Date: 2009-05-30 12:34:39 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[feature] Lucene index: options <ignore> and <inline> can now be specified for each created index, not just globally:
<text qname="section">
<ignore qname="title"/>
</text>
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/AbstractTextExtractor.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneConfig.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexConfig.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneMatchListener.java
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/TextExtractor.java
trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java
trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneMatchListenerTest.java
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/AbstractTextExtractor.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/AbstractTextExtractor.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/AbstractTextExtractor.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -27,11 +27,13 @@
public abstract class AbstractTextExtractor implements TextExtractor {
protected LuceneConfig config;
+ protected LuceneIndexConfig idxConfig;
protected XMLString buffer = new XMLString();
- public void configure(LuceneConfig config) {
+ public void configure(LuceneConfig config, LuceneIndexConfig idxConfig) {
this.config = config;
+ this.idxConfig = idxConfig;
}
public float getBoost() {
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/DefaultTextExtractor.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -29,9 +29,9 @@
private int stack = 0;
public int startElement(QName name) {
- if (config.isIgnoredNode(name))
+ if (config.isIgnoredNode(name) || (idxConfig != null && idxConfig.isIgnoredNode(name)))
stack++;
- else if (!config.isInlineNode(name)) {
+ else if (!(config.isInlineNode(name) || (idxConfig != null && idxConfig.isInlineNode(name)))) {
buffer.append(' ');
return 1;
}
@@ -39,9 +39,9 @@
}
public int endElement(QName name) {
- if (config.isIgnoredNode(name))
+ if (config.isIgnoredNode(name) || (idxConfig != null && idxConfig.isIgnoredNode(name)))
stack--;
- else if (!config.isInlineNode(name)) {
+ else if (!(config.isInlineNode(name) || (idxConfig != null && idxConfig.isInlineNode(name)))) {
buffer.append(' ');
return 1;
}
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneConfig.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneConfig.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneConfig.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -165,7 +165,6 @@
if (ignoreNodes == null)
ignoreNodes = new TreeSet<QName>();
ignoreNodes.add(qname);
-
}
}
}
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexConfig.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexConfig.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexConfig.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -5,16 +5,24 @@
import org.exist.storage.NodePath;
import org.exist.util.DatabaseConfigurationException;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import java.util.Map;
+import java.util.TreeMap;
public class LuceneIndexConfig {
+ private final static String N_INLINE = "inline";
+ private final static String N_IGNORE = "ignore";
+
private final static String ANALYZER_ID_ATTR = "analyzer";
private static final String QNAME_ATTR = "qname";
private static final String MATCH_ATTR = "match";
private final static String BOOST_ATTRIB = "boost";
+ private final static String IGNORE_ELEMENT = "ignore";
+ private final static String INLINE_ELEMENT = "inline";
+
private String analyzerId = null;
private QName qname = null;
@@ -23,6 +31,8 @@
private float boost = -1;
+ private Map<QName, String> specialNodes = null;
+
public LuceneIndexConfig(Element config, Map namespaces, AnalyzerConfig analyzers) throws DatabaseConfigurationException {
if (config.hasAttribute(QNAME_ATTR)) {
qname = parseQName(config, namespaces);
@@ -49,8 +59,33 @@
"got: " + boostAttr);
}
}
+ parse(config, namespaces);
}
+ private void parse(Element root, Map namespaces) throws DatabaseConfigurationException {
+ Node child = root.getFirstChild();
+ while (child != null) {
+ if (child.getNodeType() == Node.ELEMENT_NODE) {
+ if (IGNORE_ELEMENT.equals(child.getLocalName())) {
+ String qnameAttr = ((Element) child).getAttribute(QNAME_ATTR);
+ if (qnameAttr == null || qnameAttr.length() == 0)
+ throw new DatabaseConfigurationException("Lucene configuration element 'ignore' needs an attribute 'qname'");
+ if (specialNodes == null)
+ specialNodes = new TreeMap<QName, String>();
+ specialNodes.put(parseQName(qnameAttr, namespaces), N_IGNORE);
+ } else if (INLINE_ELEMENT.equals(child.getLocalName())) {
+ String qnameAttr = ((Element) child).getAttribute(QNAME_ATTR);
+ if (qnameAttr == null || qnameAttr.length() == 0)
+ throw new DatabaseConfigurationException("Lucene configuration element 'inline' needs an attribute 'qname'");
+ if (specialNodes == null)
+ specialNodes = new TreeMap<QName, String>();
+ specialNodes.put(parseQName(qnameAttr, namespaces), N_INLINE);
+ }
+ }
+ child = child.getNextSibling();
+ }
+ }
+
public String getAnalyzerId() {
return analyzerId;
}
@@ -66,7 +101,15 @@
public float getBoost() {
return boost;
}
-
+
+ public boolean isIgnoredNode(QName qname) {
+ return specialNodes != null && specialNodes.get(qname) == N_IGNORE;
+ }
+
+ public boolean isInlineNode(QName qname) {
+ return specialNodes != null && specialNodes.get(qname) == N_INLINE;
+ }
+
protected static QName parseQName(Element config, Map namespaces) throws DatabaseConfigurationException {
String name = config.getAttribute(QNAME_ATTR);
if (name == null || name.length() == 0)
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -681,10 +681,11 @@
extractor.startElement(element.getQName());
}
}
- if (config.matches(path)) {
+ LuceneIndexConfig idxConf = config.getConfig(path);
+ if (idxConf != null) {
if (contentStack == null) contentStack = new Stack();
TextExtractor extractor = new DefaultTextExtractor();
- extractor.configure(config);
+ extractor.configure(config, idxConf);
contentStack.push(extractor);
}
}
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneMatchListener.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneMatchListener.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneMatchListener.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -27,16 +27,13 @@
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
-import org.exist.dom.Match;
-import org.exist.dom.NewArrayNodeSet;
-import org.exist.dom.NodeProxy;
-import org.exist.dom.NodeSet;
-import org.exist.dom.QName;
+import org.exist.dom.*;
import org.exist.indexing.AbstractMatchListener;
import org.exist.numbering.NodeId;
import org.exist.stax.EmbeddedXMLStreamReader;
import org.exist.storage.DBBroker;
import org.exist.storage.IndexSpec;
+import org.exist.storage.NodePath;
import org.exist.util.serializer.AttrList;
import org.xml.sax.SAXException;
@@ -165,8 +162,10 @@
private void scanMatches(NodeProxy p) {
// Collect the text content of all descendants of p. Remember the start offsets
// of the text nodes for later use.
+ NodePath path = getPath(p);
+ LuceneIndexConfig idxConf = config.getConfig(path);
TextExtractor extractor = new DefaultTextExtractor();
- extractor.configure(config);
+ extractor.configure(config, idxConf);
OffsetList offsets = new OffsetList();
int level = 0;
int textOffset = 0;
@@ -220,6 +219,21 @@
}
}
+ private NodePath getPath(NodeProxy proxy) {
+ NodePath path = new NodePath();
+ StoredNode node = (StoredNode) proxy.getNode();
+ walkAncestor(node, path);
+ return path;
+ }
+
+ private void walkAncestor(StoredNode node, NodePath path) {
+ if (node == null)
+ return;
+ StoredNode parent = node.getParentStoredNode();
+ walkAncestor(parent, path);
+ path.addComponent(node.getQName());
+ }
+
/**
* Get all query terms from the original queries.
*/
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/TextExtractor.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/TextExtractor.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/TextExtractor.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -31,7 +31,7 @@
*/
public interface TextExtractor {
- public void configure(LuceneConfig config);
+ public void configure(LuceneConfig config, LuceneIndexConfig idxConfig);
public int startElement(QName name);
Modified: trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneIndexTest.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -6,10 +6,7 @@
import java.io.File;
import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import org.exist.Indexer;
import org.exist.collections.Collection;
@@ -86,6 +83,7 @@
" <p>A simple paragraph with <hi>highlighted</hi> text <note>and a note</note> " +
" in it.</p>" +
" <p>Paragraphs with <s>mix</s><s>ed</s> content are <s>danger</s>ous.</p>" +
+ " <p><note1>ignore</note1> <s2>warn</s2>ings</p>" +
"</article>";
private static String XML6 =
@@ -170,11 +168,17 @@
" <fulltext default=\"none\" attributes=\"no\">" +
" </fulltext>" +
" <lucene>" +
- " <text qname=\"article\"/>" +
- " <text qname=\"p\"/>" +
+ " <text qname=\"article\">" +
+ " <ignore qname=\"note\"/>" +
+ " <inline qname=\"s\"/>" +
+ " </text>" +
+ " <text qname=\"p\">" +
+ " <ignore qname=\"note\"/>" +
+ " <inline qname=\"s\"/>" +
+ " </text>" +
" <text qname=\"head\"/>" +
- " <inline qname=\"s\"/>" +
- " <ignore qname=\"note\"/>" +
+ " <ignore qname=\"note1\"/>" +
+ " <inline qname=\"s2\"/>" +
" </lucene>" +
" </index>" +
"</collection>";
@@ -292,6 +296,8 @@
checkIndex(docs, broker, new QName[] { new QName("p", "") }, "mixed", 1);
checkIndex(docs, broker, new QName[] { new QName("p", "") }, "dangerous", 1);
checkIndex(docs, broker, new QName[] { new QName("p", "") }, "note", 0);
+ checkIndex(docs, broker, new QName[] { new QName("p", "") }, "ignore", 0);
+ checkIndex(docs, broker, new QName[] { new QName("p", "") }, "warnings", 1);
XQuery xquery = broker.getXQueryService();
assertNotNull(xquery);
@@ -339,6 +345,10 @@
assertNotNull(seq);
assertEquals(1, seq.getItemCount());
+ seq = xquery.execute("/article[ft:query(., 'warnings')]", null, AccessContext.TEST);
+ assertNotNull(seq);
+ assertEquals(1, seq.getItemCount());
+
seq = xquery.execute("/article[ft:query(., 'danger')]", null, AccessContext.TEST);
assertNotNull(seq);
assertEquals(0, seq.getItemCount());
@@ -346,6 +356,10 @@
seq = xquery.execute("/article[ft:query(., 'note')]", null, AccessContext.TEST);
assertNotNull(seq);
assertEquals(0, seq.getItemCount());
+
+ seq = xquery.execute("/article[ft:query(., 'ignore')]", null, AccessContext.TEST);
+ assertNotNull(seq);
+ assertEquals(0, seq.getItemCount());
} catch (Exception e) {
e.printStackTrace();
fail(e.getMessage());
@@ -1219,15 +1233,14 @@
if (term != null)
hints.put(OrderedValuesIndex.START_VALUE, term);
if (qn != null && qn.length > 0) {
- List qnames = new ArrayList();
- for (int i = 0; i < qn.length; i++) {
- qnames.add(qn[i]);
- }
- hints.put(QNamedKeysIndex.QNAMES_KEY, qnames);
+ List<QName> qnlist = new ArrayList<QName>(qn.length);
+ for (int i = 0; i < qn.length; i++)
+ qnlist.add(qn[i]);
+ hints.put(QNamedKeysIndex.QNAMES_KEY, qnlist);
}
XQueryContext context = new XQueryContext(broker, AccessContext.TEST);
Occurrences[] occur = index.scanIndex(context, docs, docs.docsToNodeSet(), hints);
- if (expected != occur.length) {
+ if (occur != null && expected != occur.length) {
for (int i = 0; i < occur.length; i++) {
System.out.println("term: " + occur[i].getTerm());
}
Modified: trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneMatchListenerTest.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneMatchListenerTest.java 2009-05-30 12:30:30 UTC (rev 9083)
+++ trunk/eXist/extensions/indexes/lucene/test/src/org/exist/indexing/lucene/LuceneMatchListenerTest.java 2009-05-30 12:34:39 UTC (rev 9084)
@@ -68,8 +68,7 @@
private static String XML1 =
"<article>" +
" <head>The <b>title</b>of it</head>" +
- " <p>A simple paragraph with <hi>highlighted</hi> text <note>and a note</note> " +
- " in it.</p>" +
+ " <p>A simple<note>sic</note> paragraph with <hi>highlighted</hi> text <note>and a note</note> to be ignored.</p>" +
" <p>Paragraphs with <s>mix</s><s>ed</s> content are <s>danger</s>ous.</p>" +
"</article>";
@@ -107,10 +106,11 @@
" <fulltext default=\"none\" attributes=\"no\">" +
" </fulltext>" +
" <lucene>" +
- " <text qname=\"p\"/>" +
+ " <text qname=\"p\">" +
+ " <ignore qname=\"note\"/>" +
+ " </text>" +
" <text qname=\"head\"/>" +
" <inline qname=\"s\"/>" +
- " <ignore qname=\"note\"/>" +
" </lucene>" +
" </index>" +
"</collection>";
@@ -266,6 +266,30 @@
XMLAssert.assertEquals("<p>Paragraphs with <s>" + MATCH_START + "mix" + MATCH_END +
"</s><s>ed</s> content are <s>danger</s>ous.</p>", result);
+ seq = xquery.execute("//p[ft:query(., 'ignored')]", null, AccessContext.TEST);
+ assertNotNull(seq);
+ assertEquals(1, seq.getItemCount());
+ result = queryResult2String(broker, seq);
+ System.out.println("RESULT: " + result);
+ XMLAssert.assertEquals("<p>A simple<note>sic</note> paragraph with <hi>highlighted</hi> text <note>and a note</note> to be " +
+ MATCH_START + "ignored" + MATCH_END + ".</p>", result);
+
+ seq = xquery.execute("//p[ft:query(., 'highlighted')]", null, AccessContext.TEST);
+ assertNotNull(seq);
+ assertEquals(1, seq.getItemCount());
+ result = queryResult2String(broker, seq);
+ System.out.println("RESULT: " + result);
+ XMLAssert.assertEquals("<p>A simple<note>sic</note> paragraph with <hi>" + MATCH_START +
+ "highlighted" + MATCH_END + "</hi> text <note>and a note</note> to be " +
+ "ignored.</p>", result);
+
+ seq = xquery.execute("//p[ft:query(., 'highlighted')]/hi", null, AccessContext.TEST);
+ assertNotNull(seq);
+ assertEquals(1, seq.getItemCount());
+ result = queryResult2String(broker, seq);
+ System.out.println("RESULT: " + result);
+ XMLAssert.assertEquals("<hi>" + MATCH_START + "highlighted" + MATCH_END + "</hi>", result);
+
seq = xquery.execute("//head[ft:query(., 'title')]", null, AccessContext.TEST);
assertNotNull(seq);
assertEquals(1, seq.getItemCount());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 12:53:32
|
Revision: 9085
http://exist.svn.sourceforge.net/exist/?rev=9085&view=rev
Author: wolfgang_m
Date: 2009-05-30 12:39:47 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[documentation] Lucene index
Modified Paths:
--------------
trunk/eXist/webapp/lucene.xml
Modified: trunk/eXist/webapp/lucene.xml
===================================================================
--- trunk/eXist/webapp/lucene.xml 2009-05-30 12:34:39 UTC (rev 9084)
+++ trunk/eXist/webapp/lucene.xml 2009-05-30 12:39:47 UTC (rev 9085)
@@ -99,10 +99,13 @@
<analyzer id="ws" class="org.apache.lucene.analysis.WhitespaceAnalyzer"/>
<text match="//SPEECH//*"/>
<text qname="TITLE" analyzer="ws"/>
-
- <inline qname="span"/>
+ <text qname="p">
+ <inline qname="em"/>
+ </text>
+ <!-- "inline" and "ignore" can be specified globally or per-index as
+ shown above -->
<inline qname="b"/>
- <ignore qname="footnote"/>
+ <ignore qname="note"/>
</lucene>
</index>
</collection>
@@ -201,6 +204,13 @@
<synopsis><![CDATA[<inline qname="b"/>]]></synopsis></section>
+ <para>The <sgmltag>inline</sgmltag> option can be specified globally, which means it will
+ be applied to all <sgmltag>b</sgmltag> elements, or per-index:</para>
+
+ <synopsis language="xml"><![CDATA[<text qname="p">
+ <inline qname="em"/>
+</text>]]></synopsis>
+
<section>
<title>Ignored elements</title>
@@ -219,6 +229,9 @@
<synopsis><![CDATA[<ignore qname="note"/>]]></synopsis>
+ <para>Like the <sgmltag>inline</sgmltag> tag, <sgmltag>ignore</sgmltag> may appear
+ globally or within a single index definition.</para>
+
<para>The <sgmltag>ignore</sgmltag> only applies to descendants of an indexed
element. You can still create another index on the ignored element itself. For
example, you can have index definitions for <sgmltag>p</sgmltag> and
@@ -245,9 +258,47 @@
<synopsis language="xquery">//p[ft:query(note, "note")] </synopsis>
<para>may still find a match.</para></section>
+
</section>
<section>
+ <title>Boost</title>
+
+ <para>A boost value can be assigned to an index to give it a higher
+ score. The score for each match will be multiplied by the boost
+ factor (default is: 1.0). For example, you may want to rank
+ matches in titles higher than other matches. Here's how we configure
+ the documentation search indexes in eXist:</para>
+
+ <example>
+ <title>collection.xconf using boost</title>
+ <programlisting><markup><![CDATA[<lucene>
+ <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+ <text qname="section">
+ <ignore qname="title"/>
+ <ignore qname="programlisting"/>
+ <ignore qname="screen"/>
+ <ignore qname="synopsis"/>
+ </text>
+ <text qname="title" boost="2.0"/>
+</lucene>]]></markup></programlisting>
+ </example>
+
+ <para>The title index gets a boost of 2.0 to make sure that title matches
+ get a higher score. Since the <sgmltag>title</sgmltag> element does occur
+ within <sgmltag>section</sgmltag>, we add an ignore rule to the index definition
+ on the section and create a separate index on title. Without this, title would
+ be matched two times.</para>
+
+ <para>Because the title is now indexed separately, we also need to query it explicitely.
+ For example, to search the section and the title at the same time, the documentation
+ search interface issues the following query:</para>
+
+ <synopsis language="xquery">for $sect in /book//section[ft:query(., "ngram")] | /book//section[ft:query(title, "ngram")]
+order by ft:score($sect) descending return $sect</synopsis>
+ </section>
+
+ <section>
<title>Analyzers</title>
<para>One of the strengths of Lucene is that it allows the developer to determine
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-30 11:12:16
|
Revision: 9082
http://exist.svn.sourceforge.net/exist/?rev=9082&view=rev
Author: wolfgang_m
Date: 2009-05-30 11:11:33 +0000 (Sat, 30 May 2009)
Log Message:
-----------
[bugfix] Lucene index: ft:score should not just return the max score, but sum up all individual scores of matches within the current context element. For example, if you search for elements title and para within a section, you want a higher score if both of them have matches.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Score.java
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-05-29 15:05:17 UTC (rev 9081)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/xquery/modules/lucene/Score.java 2009-05-30 11:11:33 UTC (rev 9082)
@@ -62,8 +62,7 @@
while (match != null) {
if (match.getIndexId() == LuceneIndex.ID) {
float currentScore = ((LuceneIndexWorker.LuceneMatch)match).getScore();
- if (currentScore > score)
- score = currentScore;
+ score += currentScore;
}
match = match.getNextMatch();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2009-05-29 15:05:19
|
Revision: 9081
http://exist.svn.sourceforge.net/exist/?rev=9081&view=rev
Author: jmfg
Date: 2009-05-29 15:05:17 +0000 (Fri, 29 May 2009)
Log Message:
-----------
[bugfix] There is a corner case in restore which was already being caught, but its
exception had no meaningful description.
Modified Paths:
--------------
trunk/eXist/src/org/exist/backup/Restore.java
Modified: trunk/eXist/src/org/exist/backup/Restore.java
===================================================================
--- trunk/eXist/src/org/exist/backup/Restore.java 2009-05-29 14:06:52 UTC (rev 9080)
+++ trunk/eXist/src/org/exist/backup/Restore.java 2009-05-29 15:05:17 UTC (rev 9081)
@@ -285,6 +285,9 @@
}
}
EXistInputSource is=contents.getInputSource(filename);
+ if(is==null)
+ listener.warn("Failed to restore resource '" + name + "'\nfrom file '" +
+ contents.getSymbolicPath(name,false) + "'.\nReason: Unable to obtain its EXistInputSource");
try {
if (dialog != null && current instanceof Observable) {
((Observable) current).addObserver(dialog.getObserver());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2009-05-29 14:06:54
|
Revision: 9080
http://exist.svn.sourceforge.net/exist/?rev=9080&view=rev
Author: jmfg
Date: 2009-05-29 14:06:52 +0000 (Fri, 29 May 2009)
Log Message:
-----------
[bugfix] In some cases (collections inside /db/system/config, for instance) the group can remain as
null, which fires problems in org.exist.xmlrpc.RpcConnection at describeCollection's output
generation (group is null), leading to null answers.
Modified Paths:
--------------
trunk/eXist/src/org/exist/collections/Collection.java
Modified: trunk/eXist/src/org/exist/collections/Collection.java
===================================================================
--- trunk/eXist/src/org/exist/collections/Collection.java 2009-05-28 09:22:15 UTC (rev 9079)
+++ trunk/eXist/src/org/exist/collections/Collection.java 2009-05-29 14:06:52 UTC (rev 9080)
@@ -185,7 +185,7 @@
child.setCreationTime(System.currentTimeMillis());
child.permissions.setOwner(user);
CollectionConfiguration config = getConfiguration(broker);
- String group = null;
+ String group = user.getPrimaryGroup();
if (config != null){
group = config.getDefCollGroup(user);
child.permissions.setPermissions(config.getDefCollPermissions());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-28 09:22:35
|
Revision: 9079
http://exist.svn.sourceforge.net/exist/?rev=9079&view=rev
Author: wolfgang_m
Date: 2009-05-28 09:22:15 +0000 (Thu, 28 May 2009)
Log Message:
-----------
[documentation] added link to function search to reload the function documentation after the setup was changed.
Modified Paths:
--------------
trunk/eXist/webapp/xquery/functions.xql
Modified: trunk/eXist/webapp/xquery/functions.xql
===================================================================
--- trunk/eXist/webapp/xquery/functions.xql 2009-05-28 07:00:49 UTC (rev 9078)
+++ trunk/eXist/webapp/xquery/functions.xql 2009-05-28 09:22:15 UTC (rev 9079)
@@ -172,6 +172,8 @@
</table>
<input type="hidden" name="prev" value="{$action}"/>
</form>
+ <p class="f-reload"><a href="?action=reload">Reload documentation</a>
+ (click here if you enabled/disabled additional modules)</p>
<p class="f-info">(<b>eXist version: {util:system-property("product-version")},
build: {util:system-property("product-build")},
functions: {count(//xqdoc:function)}</b>). Modules have to be enabled
@@ -221,10 +223,11 @@
already been extracted. If not, ask for the admin password and
call xqdoc:setup() to generate the documentation.
:)
+let $action := request:get-parameter("action", "Search")
+let $generate := request:get-parameter("generate", ())
let $askPass :=
- if (empty(//xqdoc:module)) then
+ if (empty(//xqdoc:module) or $generate) then
let $adminPass := request:get-parameter("pass", ())
- let $generate := request:get-parameter("generate", ())
return
if ($generate) then
let $dummy := setup:setup($adminPass)
@@ -232,9 +235,8 @@
else
true()
else
- false()
+ $action eq 'reload'
let $log := xqdoc:debug-parameters()
-let $action := request:get-parameter("action", "Search")
let $query := request:get-parameter("q", ())
let $type := request:get-parameter("type", "name")
let $mode := request:get-parameter("mode", ())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-28 07:00:53
|
Revision: 9078
http://exist.svn.sourceforge.net/exist/?rev=9078&view=rev
Author: wolfgang_m
Date: 2009-05-28 07:00:49 +0000 (Thu, 28 May 2009)
Log Message:
-----------
[ignore] XQueryURLRewrite: for debugging purposes, log original request uri if trace log is enabled.
Modified Paths:
--------------
trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
Modified: trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java
===================================================================
--- trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-05-28 06:59:12 UTC (rev 9077)
+++ trunk/eXist/src/org/exist/http/urlrewrite/XQueryURLRewrite.java 2009-05-28 07:00:49 UTC (rev 9078)
@@ -253,6 +253,8 @@
}
}
+ if (LOG.isTraceEnabled())
+ LOG.trace("Processing request URI: " + request.getRequestURI());
RequestWrapper modifiedRequest = new RequestWrapper(request);
// check if the request URI is already in the url cache
ModelAndView modelView = (ModelAndView) urlCache.get(request.getRequestURI());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-28 06:59:20
|
Revision: 9077
http://exist.svn.sourceforge.net/exist/?rev=9077&view=rev
Author: wolfgang_m
Date: 2009-05-28 06:59:12 +0000 (Thu, 28 May 2009)
Log Message:
-----------
[bugfix] fixed simple step expressions like $a//$b to work properly with in-memory documents.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/SimpleStep.java
Modified: trunk/eXist/src/org/exist/xquery/SimpleStep.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/SimpleStep.java 2009-05-28 06:58:17 UTC (rev 9076)
+++ trunk/eXist/src/org/exist/xquery/SimpleStep.java 2009-05-28 06:59:12 UTC (rev 9077)
@@ -26,6 +26,7 @@
import org.exist.dom.NodeSet;
import org.exist.xquery.value.Item;
import org.exist.xquery.value.Sequence;
+import org.exist.xquery.value.MemoryNodeSet;
/**
* Represents a primary expression in a simple path step like
@@ -73,23 +74,35 @@
if (contextItem != null)
contextSequence = contextItem.toSequence();
- Sequence result;
- NodeSet set = expression.eval(contextSequence).toNodeSet();
+ Sequence result = Sequence.EMPTY_SEQUENCE;
+ Sequence set = expression.eval(contextSequence);
- if(set.isEmpty())
- result = Sequence.EMPTY_SEQUENCE;
- else {
- switch(axis) {
- case Constants.DESCENDANT_SELF_AXIS:
- set = set.selectAncestorDescendant(contextSequence.toNodeSet(), NodeSet.DESCENDANT, true, contextId);
- break;
- case Constants.CHILD_AXIS:
- set = set.selectParentChild(contextSequence.toNodeSet(), NodeSet.DESCENDANT, contextId);
- break;
- default:
- throw new XPathException(this, "Wrong axis specified");
- }
- result = set;
+ if (!set.isEmpty()) {
+ if (set.isPersistentSet()) {
+ NodeSet nodeSet = set.toNodeSet();
+ switch(axis) {
+ case Constants.DESCENDANT_SELF_AXIS:
+ result = nodeSet.selectAncestorDescendant(contextSequence.toNodeSet(), NodeSet.DESCENDANT, true, contextId);
+ break;
+ case Constants.CHILD_AXIS:
+ result = nodeSet.selectParentChild(contextSequence.toNodeSet(), NodeSet.DESCENDANT, contextId);
+ break;
+ default:
+ throw new XPathException(this, "Wrong axis specified");
+ }
+ } else {
+ MemoryNodeSet ctxNodes = contextSequence.toMemNodeSet();
+ MemoryNodeSet nodes = set.toMemNodeSet();
+ switch(axis) {
+ case Constants.DESCENDANT_SELF_AXIS:
+ result = ctxNodes.selectDescendants(nodes);
+ break;
+ case Constants.CHILD_AXIS:
+ result = ctxNodes.selectChildren(nodes);
+ break;
+ }
+
+ }
}
if (context.getProfiler().isEnabled())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-28 06:58:26
|
Revision: 9076
http://exist.svn.sourceforge.net/exist/?rev=9076&view=rev
Author: wolfgang_m
Date: 2009-05-28 06:58:17 +0000 (Thu, 28 May 2009)
Log Message:
-----------
[bugfix] fixed simple step expressions like $a//$b to work properly with in-memory documents.
Modified Paths:
--------------
trunk/eXist/src/org/exist/xquery/Predicate.java
trunk/eXist/src/org/exist/xquery/value/MemoryNodeSet.java
trunk/eXist/src/org/exist/xquery/value/ValueSequence.java
Modified: trunk/eXist/src/org/exist/xquery/Predicate.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/Predicate.java 2009-05-27 20:32:39 UTC (rev 9075)
+++ trunk/eXist/src/org/exist/xquery/Predicate.java 2009-05-28 06:58:17 UTC (rev 9076)
@@ -175,7 +175,7 @@
innerSeq = inner.eval(contextSequence);
//Try to promote a boolean evaluation to a nodeset one
//We are now sure of the inner sequence return type
- if (Type.subTypeOf(innerSeq.getItemType(), Type.NODE)) {
+ if (Type.subTypeOf(innerSeq.getItemType(), Type.NODE) && innerSeq.isPersistentSet()) {
recomputedExecutionMode = NODE;
//Try to promote a boolean evaluation to a positional one
//Only if we have an actual *singleton* of numeric items
Modified: trunk/eXist/src/org/exist/xquery/value/MemoryNodeSet.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/value/MemoryNodeSet.java 2009-05-27 20:32:39 UTC (rev 9075)
+++ trunk/eXist/src/org/exist/xquery/value/MemoryNodeSet.java 2009-05-28 06:58:17 UTC (rev 9076)
@@ -32,4 +32,12 @@
public Sequence getFollowing(NodeTest test) throws XPathException;
public Sequence getChildrenForParent(NodeImpl parent);
+
+ public Sequence selectDescendants(MemoryNodeSet descendants);
+
+ public Sequence selectChildren(MemoryNodeSet children);
+
+ public int size();
+
+ public NodeImpl get(int which);
}
Modified: trunk/eXist/src/org/exist/xquery/value/ValueSequence.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/value/ValueSequence.java 2009-05-27 20:32:39 UTC (rev 9075)
+++ trunk/eXist/src/org/exist/xquery/value/ValueSequence.java 2009-05-28 06:58:17 UTC (rev 9076)
@@ -77,7 +77,7 @@
private Variable holderVar = null;
private int state = 0;
-
+
public ValueSequence() {
this(false);
}
@@ -579,6 +579,42 @@
return nodes;
}
+ public Sequence selectDescendants(MemoryNodeSet descendants) {
+ sortInDocumentOrder();
+ ValueSequence nodes = new ValueSequence(true);
+ for (int i = 0; i <= size; i++) {
+ NodeImpl node = (NodeImpl) values[i];
+ for (int j = 0; j < descendants.size(); j++) {
+ NodeImpl descendant = descendants.get(j);
+ if (descendant.getNodeId().isDescendantOrSelfOf(node.getNodeId()))
+ nodes.add(node);
+ }
+ }
+ return nodes;
+ }
+
+ public Sequence selectChildren(MemoryNodeSet children) {
+ sortInDocumentOrder();
+ ValueSequence nodes = new ValueSequence(true);
+ for (int i = 0; i <= size; i++) {
+ NodeImpl node = (NodeImpl) values[i];
+ for (int j = 0; j < children.size(); j++) {
+ NodeImpl descendant = children.get(j);
+ if (descendant.getNodeId().isChildOf(node.getNodeId()))
+ nodes.add(node);
+ }
+ }
+ return nodes;
+ }
+
+ public int size() {
+ return size + 1;
+ }
+
+ public NodeImpl get(int which) {
+ return (NodeImpl) values[which];
+ }
+
/* END methods of MemoryNodeSet */
public Iterator getCollectionIterator() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2009-05-27 20:33:25
|
Revision: 9075
http://exist.svn.sourceforge.net/exist/?rev=9075&view=rev
Author: jmfg
Date: 2009-05-27 20:32:39 +0000 (Wed, 27 May 2009)
Log Message:
-----------
[bugfix] Ant eXist tasks now honor 'failonerror' attribute, and also some error messages have been fixed.
Modified Paths:
--------------
trunk/eXist/src/org/exist/ant/AddUserTask.java
trunk/eXist/src/org/exist/ant/BackupTask.java
trunk/eXist/src/org/exist/ant/ChmodTask.java
trunk/eXist/src/org/exist/ant/ChownTask.java
trunk/eXist/src/org/exist/ant/ListGroupsTask.java
trunk/eXist/src/org/exist/ant/ListUsersTask.java
trunk/eXist/src/org/exist/ant/LockResourceTask.java
trunk/eXist/src/org/exist/ant/RemoveUserTask.java
trunk/eXist/src/org/exist/ant/RestoreTask.java
trunk/eXist/src/org/exist/ant/UserPasswordTask.java
trunk/eXist/src/org/exist/ant/UserTask.java
trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java
trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java
trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java
trunk/eXist/src/org/exist/ant/XMLDBListTask.java
trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java
trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java
trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java
trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java
trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java
trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java
trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java
trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java
Modified: trunk/eXist/src/org/exist/ant/AddUserTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/AddUserTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/AddUserTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -48,11 +48,19 @@
log("Adding user " + name, Project.MSG_INFO);
service.addUser(usr);
} catch (XMLDBException e) {
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
} catch (URISyntaxException e) {
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="URI syntax exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
+ }
}
- }
public void setName(String name)
{
Modified: trunk/eXist/src/org/exist/ant/BackupTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/BackupTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/BackupTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -23,6 +23,7 @@
package org.exist.ant;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.exist.backup.Backup;
import org.exist.xmldb.XmldbURI;
@@ -54,7 +55,11 @@
} catch (Exception e)
{
e.printStackTrace();
- throw new BuildException("Exception during backup: " + e.getMessage(), e);
+ String msg="Exception during backup: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/ChmodTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/ChmodTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/ChmodTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -8,6 +8,7 @@
package org.exist.ant;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.xmldb.api.base.Resource;
import org.xmldb.api.base.XMLDBException;
@@ -40,7 +41,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/ChownTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/ChownTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/ChownTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -4,6 +4,7 @@
package org.exist.ant;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.exist.security.User;
import org.xmldb.api.base.Resource;
import org.xmldb.api.base.XMLDBException;
@@ -41,7 +42,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/ListGroupsTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/ListGroupsTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/ListGroupsTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -50,7 +50,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/ListUsersTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/ListUsersTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/ListUsersTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -51,7 +51,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/LockResourceTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/LockResourceTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/LockResourceTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -8,6 +8,7 @@
package org.exist.ant;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.exist.security.User;
import org.xmldb.api.base.Resource;
import org.xmldb.api.base.XMLDBException;
@@ -34,15 +35,31 @@
try
{
Resource res = base.getResource(resource);
- if (res == null)
- throw new BuildException("Resource " + resource + " not found");
- User usr = service.getUser(name);
- if (usr == null)
- throw new BuildException("User " + name + " not found");
- service.lockResource(res, usr);
+ if (res == null) {
+ String msg="Resource " + resource + " not found";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ User usr = service.getUser(name);
+ if (usr == null) {
+ String msg="User " + name + " not found";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ service.lockResource(res, usr);
+ }
+ }
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/RemoveUserTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/RemoveUserTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/RemoveUserTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -8,6 +8,7 @@
package org.exist.ant;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.exist.security.User;
import org.xmldb.api.base.XMLDBException;
@@ -38,7 +39,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/RestoreTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/RestoreTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/RestoreTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -51,53 +51,78 @@
if (dir == null && dirSet == null && file == null)
throw new BuildException("Missing required argument: either dir, dirset or file required");
- if (dir != null && !dir.canRead())
- throw new BuildException("Cannot read restore file: " + dir.getAbsolutePath());
-
- registerDatabase();
- try
- {
- if (dir != null)
- {
- log("Restoring from " + dir.getAbsolutePath(), Project.MSG_INFO);
- File file = new File(dir, "__contents__.xml");
- if (!file.exists())
- {
- throw new BuildException("Did not found file "+file.getAbsolutePath());
- }
- Restore restore = new Restore(user, password, restorePassword, file, uri);
- restore.restore(false, null);
- } else if (dirSet != null) {
- DirectoryScanner scanner = dirSet.getDirectoryScanner(getProject());
- scanner.scan();
- String[] files = scanner.getIncludedFiles();
- log("Found " + files.length + " files.\n");
-
- File file = null;
- for (int i = 0; i < files.length; i++)
- {
- dir = new File(scanner.getBasedir() + File.separator + files[i]);
- file = new File(dir, "__contents__.xml");
- if (!file.exists())
- {
- throw new BuildException("Did not found file "+file.getAbsolutePath());
- }
- log("Restoring from " + file.getAbsolutePath() + " ...\n");
- // TODO subdirectories as sub-collections?
- Restore restore = new Restore(user, password, restorePassword, file, uri);
- restore.restore(false, null);
- }
- } else if (file != null) {
- log("Restoring from " + file.getAbsolutePath(), Project.MSG_INFO);
- if (!file.exists())
- throw new BuildException("File not found: " + file.getAbsolutePath());
- Restore restore = new Restore(user, password, restorePassword, file, uri);
- restore.restore(false, null);
- }
- } catch (Exception e)
- {
- e.printStackTrace();
- throw new BuildException("Exception during restore: " + e.getMessage(), e);
+ if (dir != null && !dir.canRead()) {
+ String msg="Cannot read restore file: " + dir.getAbsolutePath();
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ registerDatabase();
+ try
+ {
+ if (dir != null)
+ {
+ log("Restoring from " + dir.getAbsolutePath(), Project.MSG_INFO);
+ File file = new File(dir, "__contents__.xml");
+ if (!file.exists())
+ {
+ String msg="Did not found file "+file.getAbsolutePath();
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ Restore restore = new Restore(user, password, restorePassword, file, uri);
+ restore.restore(false, null);
+ }
+ } else if (dirSet != null) {
+ DirectoryScanner scanner = dirSet.getDirectoryScanner(getProject());
+ scanner.scan();
+ String[] files = scanner.getIncludedFiles();
+ log("Found " + files.length + " files.\n");
+
+ File file = null;
+ for (int i = 0; i < files.length; i++)
+ {
+ dir = new File(scanner.getBasedir() + File.separator + files[i]);
+ file = new File(dir, "__contents__.xml");
+ if (!file.exists())
+ {
+ String msg="Did not found file "+file.getAbsolutePath();
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ log("Restoring from " + file.getAbsolutePath() + " ...\n");
+ // TODO subdirectories as sub-collections?
+ Restore restore = new Restore(user, password, restorePassword, file, uri);
+ restore.restore(false, null);
+ }
+ }
+ } else if (file != null) {
+ log("Restoring from " + file.getAbsolutePath(), Project.MSG_INFO);
+ if (!file.exists()) {
+ String msg="File not found: " + file.getAbsolutePath();
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ Restore restore = new Restore(user, password, restorePassword, file, uri);
+ restore.restore(false, null);
+ }
+ }
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ String msg="Exception during restore: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
+ }
}
}
Modified: trunk/eXist/src/org/exist/ant/UserPasswordTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/UserPasswordTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/UserPasswordTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -22,7 +22,7 @@
{
super.execute();
if (name == null)
- throw new BuildException("Must specify at leat a user name");
+ throw new BuildException("Must specify at least a user name");
try
{
@@ -36,12 +36,20 @@
}
else
{
- throw new BuildException("user " + name + " not found");
+ String msg="user " + name + " not found";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
}
}
catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/UserTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/UserTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/UserTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -39,13 +39,21 @@
base = DatabaseManager.getCollection(uri, user, password);
if(base==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ service = (UserManagementService) base.getService("UserManagementService", "1.0");
}
-
- service = (UserManagementService) base.getService("UserManagementService", "1.0");
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBCopyTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -60,26 +60,40 @@
Collection base = DatabaseManager.getCollection(uri, user, password);
if(base==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ log("Create collection management service for collection " + base.getName(), Project.MSG_DEBUG);
+ CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) base.getService("CollectionManagementService", "1.0");
+ if (resource != null)
+ {
+ log("Copying resource: " + resource, Project.MSG_INFO);
+ Resource res = base.getResource(resource);
+ if (res == null) {
+ String msg="Resource " + resource + " not found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ service.copyResource(resource, destination, name);
+ }
+ } else
+ {
+ log("Copying collection: " + collection, Project.MSG_INFO);
+ service.copy(collection, destination, name);
+ }
}
-
- log("Create collection management service for collection " + base.getName(), Project.MSG_DEBUG);
- CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) base.getService("CollectionManagementService", "1.0");
- if (resource != null)
- {
- log("Copying resource: " + resource, Project.MSG_INFO);
- Resource res = base.getResource(resource);
- if (res == null)
- throw new BuildException("Resource " + resource + " not found.");
- service.copyResource(resource, destination, name);
- } else
- {
- log("Copying collection: " + collection, Project.MSG_INFO);
- service.copy(collection, destination, name);
- }
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception during remove: " + e.getMessage(), e);
+ String msg="XMLDB exception during copy: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBCreateTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -56,25 +56,37 @@
Collection base = DatabaseManager.getCollection(uri, user, password);
if(base==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ Collection root = null;
+ if (collection != null)
+ {
+ log("Creating collection " + collection + " in base collection " + uri, Project.MSG_DEBUG);
+ root = mkcol(base, uri, collection);
+ } else
+ {
+ root = base;
+ }
+ log("Created collection " + root.getName(), Project.MSG_INFO);
}
-
- Collection root = null;
- if (collection != null)
- {
- log("Creating collection " + collection + " in base collection " + uri, Project.MSG_DEBUG);
- root = mkcol(base, uri, collection);
- } else
- {
- root = base;
- }
- log("Created collection " + root.getName(), Project.MSG_INFO);
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
} catch (URISyntaxException e)
{
- throw new BuildException("URISyntaxException: " + e.getMessage(), e);
+ String msg="URISyntaxException: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBExtractTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -59,8 +59,11 @@
XMLResource res = (XMLResource) base.getResource(resource);
if (res == null)
{
- if (failonerror)
- throw new BuildException("Resource " + resource + " not found.");
+ String msg="Resource " + resource + " not found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
} else
{
writeResource(res, destFile);
@@ -75,12 +78,18 @@
}
} catch (XMLDBException e)
{
- if (failonerror)
- throw new BuildException("XMLDB exception caught while executing query: " + e.getMessage(), e);
+ String msg="XMLDB exception caught while executing query: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
} catch (IOException e)
{
- if (failonerror)
- throw new BuildException("XMLDB exception caught while writing destination file: " + e.getMessage(), e);
+ String msg="XMLDB exception caught while writing destination file: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
}
@@ -148,7 +157,7 @@
private void writeResource(XMLResource resource, File dest) throws IOException, XMLDBException
{
- if (dest != null || !dest.exists())
+ if (dest != null && !dest.exists())
{
Properties outputProperties = new Properties();
outputProperties.setProperty(OutputKeys.INDENT, "yes");
@@ -177,7 +186,11 @@
writer.close();
} else
{
- throw new BuildException("Destionation target does not exist.");
+ String msg="Destination target "+((dest!=null)?(dest.getAbsolutePath()+" "):"")+"does not exist.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBListTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBListTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBListTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -58,7 +58,11 @@
Collection base = DatabaseManager.getCollection(uri, user, password);
if(base==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
}
StringBuffer buf = new StringBuffer();
@@ -106,7 +110,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception during remove: " + e.getMessage(), e);
+ String msg="XMLDB exception during list: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBMoveTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -60,7 +60,11 @@
Collection base = DatabaseManager.getCollection(uri, user, password);
if(base==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
}
log("Create collection management service for collection " + base.getName(), Project.MSG_DEBUG);
@@ -69,9 +73,15 @@
{
log("Moving resource: " + resource, Project.MSG_INFO);
Resource res = base.getResource(resource);
- if (res == null)
- throw new BuildException("Resource " + resource + " not found.");
- service.moveResource(resource, destination, name);
+ if (res == null) {
+ String msg="Resource " + resource + " not found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ service.moveResource(resource, destination, name);
+ }
} else
{
log("Moving collection: " + collection, Project.MSG_INFO);
@@ -79,7 +89,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception during remove: " + e.getMessage(), e);
+ String msg="XMLDB exception during move: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBQueryTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -23,6 +23,7 @@
package org.exist.ant;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.PropertyHelper;
import org.xmldb.api.DatabaseManager;
import org.xmldb.api.base.Collection;
@@ -65,16 +66,23 @@
Collection collection = DatabaseManager.getCollection(uri, user, password);
if(collection==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ XPathQueryService service = (XPathQueryService)
+ collection.getService("XPathQueryService", "1.0");
+ ResourceSet results = service.query(query);
+ log("Found " + results.getSize());
}
-
- XPathQueryService service = (XPathQueryService)
- collection.getService("XPathQueryService", "1.0");
- ResourceSet results = service.query(query);
- log("Found " + results.getSize());
} catch (XMLDBException e) {
- throw new BuildException("XMLDB exception caught while executing query: " + e.getMessage(),
- e);
+ String msg="XMLDB exception caught while executing query: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBRemoveTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -68,9 +68,15 @@
{
log("Removing resource: " + resource, Project.MSG_INFO);
Resource res = base.getResource(resource);
- if (res == null)
- throw new BuildException("Resource " + resource + " not found.");
- base.removeResource(res);
+ if (res == null) {
+ String msg="Resource " + resource + " not found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ base.removeResource(res);
+ }
} else
{
log("Removing collection: " + collection, Project.MSG_INFO);
@@ -79,7 +85,11 @@
}
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception during remove: " + e.getMessage(), e);
+ String msg="XMLDB exception during remove: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBShutdownTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -55,15 +55,23 @@
Collection root = DatabaseManager.getCollection(uri, user, password);
if(root==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
+ log("Shutdown database instance", Project.MSG_INFO);
+ mgr.shutdown();
}
-
- DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");
- log("Shutdown database instance", Project.MSG_INFO);
- mgr.shutdown();
} catch (XMLDBException e)
{
- throw new BuildException("Error during database shutdown: " + e.getMessage(), e);
+ String msg="Error during database shutdown: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBStoreTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -98,88 +98,107 @@
root = DatabaseManager.getCollection(uri, user, password);
if(root==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ MimeType mime = null;
+ if (type != null) {
+ if (type.equals("xml"))
+ mime = MimeType.XML_TYPE;
+ else if (type.equals("binary"))
+ mime = MimeType.BINARY_TYPE;
+ else {
+ mime = MimeTable.getInstance().getContentType(type);
+ }
+ }
+
+ Resource res;
+ File file;
+ Collection col = root;
+ String relDir, prevDir = null, resourceType = "XMLResource";
+ if (srcFile != null)
+ {
+ log("Storing single file " + srcFile.getAbsolutePath(), Project.MSG_DEBUG);
+ // single file
+ if (mime == null)
+ mime = MimeTable.getInstance().getContentTypeFor(srcFile.getName());
+ if (mime == null) {
+ String msg="Cannot find mime-type for " + srcFile.getName();
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ resourceType = mime.isXMLType() ? "XMLResource" : "BinaryResource";
+ if (targetFile == null)
+ targetFile = srcFile.getName();
+ log("Creating resource " + targetFile + " in collection " + col.getName() + " of type " + resourceType + " with mime-type: " + mime.getName(), Project.MSG_DEBUG);
+ res = col.createResource(targetFile, resourceType);
+ res.setContent(srcFile);
+ ((EXistResource) res).setMimeType(mime.getName());
+ col.storeResource(res);
+ }
+ } else
+ {
+ log("Storing fileset", Project.MSG_DEBUG);
+ // using fileset
+ DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
+ scanner.scan();
+ String[] files = scanner.getIncludedFiles();
+ log("Found " + files.length + " files.\n");
+
+ MimeType currentMime = mime;
+ for (int i = 0; i < files.length; i++)
+ {
+ file = new File(scanner.getBasedir() + File.separator + files[i]);
+ log("Storing " + files[i] + " ...\n");
+ //TODO : use dedicated function in XmldbURI
+ // check whether the relative file path contains file seps
+ p = files[i].lastIndexOf(File.separatorChar);
+ if (p != Constants.STRING_NOT_FOUND)
+ {
+ relDir = files[i].substring(0, p);
+ // It's necessary to do this translation on Windows, and possibly MacOS:
+ relDir = relDir.replace(File.separatorChar, '/');
+ if (createSubcollections && (prevDir == null || (!relDir.equals(prevDir))))
+ {
+ //TODO : use dedicated function in XmldbURI
+ col = mkcol(root, baseURI, DBBroker.ROOT_COLLECTION + path, relDir);
+ prevDir = relDir;
+ }
+ } else {
+ // No file separator found in resource name, reset col to the root collection
+ col = root;
+ }
+ if (mime == null)
+ currentMime = MimeTable.getInstance().getContentTypeFor(file.getName());
+ if (currentMime == null) {
+ String msg="Cannot find mime-type for " + file.getName();
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ resourceType = currentMime.isXMLType() ? "XMLResource" : "BinaryResource";
+ log("Creating resource " + file.getName() + " in collection " + col.getName() + " of type " + resourceType + " with mime-type: " + currentMime.getName(), Project.MSG_DEBUG);
+ res = col.createResource(file.getName(), resourceType);
+ res.setContent(file);
+ ((EXistResource) res).setMimeType(currentMime.getName());
+ col.storeResource(res);
+ }
+ }
+ }
}
-
- MimeType mime = null;
- if (type != null) {
- if (type.equals("xml"))
- mime = MimeType.XML_TYPE;
- else if (type.equals("binary"))
- mime = MimeType.BINARY_TYPE;
- else {
- mime = MimeTable.getInstance().getContentType(type);
- }
- }
-
- Resource res;
- File file;
- Collection col = root;
- String relDir, prevDir = null, resourceType = "XMLResource";
- if (srcFile != null)
- {
- log("Storing single file " + srcFile.getAbsolutePath(), Project.MSG_DEBUG);
- // single file
- if (mime == null)
- mime = MimeTable.getInstance().getContentTypeFor(srcFile.getName());
- if (mime == null)
- throw new BuildException("Cannot find mime-type for " + srcFile.getName());
-
- resourceType = mime.isXMLType() ? "XMLResource" : "BinaryResource";
- if (targetFile == null)
- targetFile = srcFile.getName();
- log("Creating resource " + targetFile + " in collection " + col.getName() + " of type " + resourceType + " with mime-type: " + mime.getName(), Project.MSG_DEBUG);
- res = col.createResource(targetFile, resourceType);
- res.setContent(srcFile);
- ((EXistResource) res).setMimeType(mime.getName());
- col.storeResource(res);
- } else
- {
- log("Storing fileset", Project.MSG_DEBUG);
- // using fileset
- DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
- scanner.scan();
- String[] files = scanner.getIncludedFiles();
- log("Found " + files.length + " files.\n");
-
- MimeType currentMime = mime;
- for (int i = 0; i < files.length; i++)
- {
- file = new File(scanner.getBasedir() + File.separator + files[i]);
- log("Storing " + files[i] + " ...\n");
- //TODO : use dedicated function in XmldbURI
- // check whether the relative file path contains file seps
- p = files[i].lastIndexOf(File.separatorChar);
- if (p != Constants.STRING_NOT_FOUND)
- {
- relDir = files[i].substring(0, p);
- // It's necessary to do this translation on Windows, and possibly MacOS:
- relDir = relDir.replace(File.separatorChar, '/');
- if (createSubcollections && (prevDir == null || (!relDir.equals(prevDir))))
- {
- //TODO : use dedicated function in XmldbURI
- col = mkcol(root, baseURI, DBBroker.ROOT_COLLECTION + path, relDir);
- prevDir = relDir;
- }
- } else {
- // No file separator found in resource name, reset col to the root collection
- col = root;
- }
- if (mime == null)
- currentMime = MimeTable.getInstance().getContentTypeFor(file.getName());
- if (currentMime == null)
- throw new BuildException("Cannot find mime-type for " + file.getName());
- resourceType = currentMime.isXMLType() ? "XMLResource" : "BinaryResource";
- log("Creating resource " + file.getName() + " in collection " + col.getName() + " of type " + resourceType + " with mime-type: " + currentMime.getName(), Project.MSG_DEBUG);
- res = col.createResource(file.getName(), resourceType);
- res.setContent(file);
- ((EXistResource) res).setMimeType(currentMime.getName());
- col.storeResource(res);
- }
- }
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception caught: " + e.getMessage(), e);
+ String msg="XMLDB exception caught: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBXPathTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -90,67 +90,75 @@
.getCollection(uri, user, password);
if (base == null){
- throw new BuildException("Collection " + uri + " could not be found.");
- }
-
- XPathQueryService service = (XPathQueryService) base.getService(
- "XPathQueryService", "1.0");
- // set pretty-printing on
- service.setProperty(OutputKeys.INDENT, "yes");
- service.setProperty(OutputKeys.ENCODING, "UTF-8");
-
- if (namespace != null) {
- log("Using namespace: " + namespace, Project.MSG_DEBUG);
- service.setNamespace("ns", namespace);
- }
-
- ResourceSet results = null;
- if (resource != null) {
- log("Query resource: " + resource, Project.MSG_DEBUG);
- results = service.queryResource(resource, query);
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
} else {
- log("Query collection", Project.MSG_DEBUG);
- results = service.query(query);
+ XPathQueryService service = (XPathQueryService) base.getService(
+ "XPathQueryService", "1.0");
+ // set pretty-printing on
+ service.setProperty(OutputKeys.INDENT, "yes");
+ service.setProperty(OutputKeys.ENCODING, "UTF-8");
+
+ if (namespace != null) {
+ log("Using namespace: " + namespace, Project.MSG_DEBUG);
+ service.setNamespace("ns", namespace);
+ }
+
+ ResourceSet results = null;
+ if (resource != null) {
+ log("Query resource: " + resource, Project.MSG_DEBUG);
+ results = service.queryResource(resource, query);
+ } else {
+ log("Query collection", Project.MSG_DEBUG);
+ results = service.query(query);
+ }
+ log("Found " + results.getSize() + " results", Project.MSG_INFO);
+
+ if (destDir != null && results != null) {
+ log("write results to directory " + destDir.getAbsolutePath(),
+ Project.MSG_INFO);
+ ResourceIterator iter = results.getIterator();
+ XMLResource res = null;
+
+ log(
+ "Writing results to directory "
+ + destDir.getAbsolutePath(), Project.MSG_DEBUG);
+ while (iter.hasMoreResources()) {
+ res = (XMLResource) iter.nextResource();
+ log("Writing resource " + res.getId(), Project.MSG_DEBUG);
+ writeResource(res, destDir);
+ }
+ } else if (outputproperty != null) {
+ if (count) {
+ getProject().setNewProperty(outputproperty,
+ String.valueOf(results.getSize()));
+ } else {
+ ResourceIterator iter = results.getIterator();
+ XMLResource res = null;
+ String result = null;
+ while (iter.hasMoreResources()) {
+ res = (XMLResource) iter.nextResource();
+ result = res.getContent().toString();
+ }
+ getProject().setNewProperty(outputproperty, result);
+ }
+ }
}
- log("Found " + results.getSize() + " results", Project.MSG_INFO);
-
- if (destDir != null && results != null) {
- log("write results to directory " + destDir.getAbsolutePath(),
- Project.MSG_INFO);
- ResourceIterator iter = results.getIterator();
- XMLResource res = null;
-
- log(
- "Writing results to directory "
- + destDir.getAbsolutePath(), Project.MSG_DEBUG);
- while (iter.hasMoreResources()) {
- res = (XMLResource) iter.nextResource();
- log("Writing resource " + res.getId(), Project.MSG_DEBUG);
- writeResource(res, destDir);
- }
- } else if (outputproperty != null) {
- if (count) {
- getProject().setNewProperty(outputproperty,
- String.valueOf(results.getSize()));
- } else {
- ResourceIterator iter = results.getIterator();
- XMLResource res = null;
- String result = null;
- while (iter.hasMoreResources()) {
- res = (XMLResource) iter.nextResource();
- result = res.getContent().toString();
- }
- getProject().setNewProperty(outputproperty, result);
- }
- }
} catch (XMLDBException e) {
- throw new BuildException(
- "XMLDB exception caught while executing query: "
- + e.getMessage(), e);
+ String msg="XMLDB exception caught while executing query: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
} catch (IOException e) {
- throw new BuildException(
- "XMLDB exception caught while writing destination file: "
- + e.getMessage(), e);
+ String msg="XMLDB exception caught while writing destination file: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
@@ -185,7 +193,11 @@
SerializerPool.getInstance().returnObject(serializer);
} else {
- throw new BuildException("Destionation target does not exist.");
+ String msg="Destination target does not exist.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBXQueryTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -119,72 +119,80 @@
.getCollection(uri, user, password);
if (base == null){
- throw new BuildException("Collection " + uri + " could not be found.");
- }
-
- XQueryService service = (XQueryService) base.getService(
- "XQueryService", "1.0");
- // set pretty-printing on
- service.setProperty(OutputKeys.INDENT, "yes");
- service.setProperty(OutputKeys.ENCODING, "UTF-8");
-
- for (Iterator i = variables.iterator(); i.hasNext();) {
- Variable var = (Variable) i.next();
- System.out.println("Name: " + var.name);
- System.out.println("Value: " + var.value);
- service.declareVariable(var.name, var.value);
- }
-
- ResourceSet results = null;
- Source source = null;
- if (queryUri != null) {
- log("XQuery url " + queryUri, Project.MSG_DEBUG);
- source = new URLSource(new URL(queryUri));
-
- } else if (queryFile != null) {
- log("XQuery file " + queryFile.getAbsolutePath(),
- Project.MSG_DEBUG);
- source = new FileSource(queryFile, "UTF-8", true);
-
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
} else {
- log("XQuery string: " + query, Project.MSG_DEBUG);
- source = new StringSource(query);
+ XQueryService service = (XQueryService) base.getService(
+ "XQueryService", "1.0");
+ // set pretty-printing on
+ service.setProperty(OutputKeys.INDENT, "yes");
+ service.setProperty(OutputKeys.ENCODING, "UTF-8");
+
+ for (Iterator i = variables.iterator(); i.hasNext();) {
+ Variable var = (Variable) i.next();
+ System.out.println("Name: " + var.name);
+ System.out.println("Value: " + var.value);
+ service.declareVariable(var.name, var.value);
+ }
+
+ ResourceSet results = null;
+ Source source = null;
+ if (queryUri != null) {
+ log("XQuery url " + queryUri, Project.MSG_DEBUG);
+ source = new URLSource(new URL(queryUri));
+
+ } else if (queryFile != null) {
+ log("XQuery file " + queryFile.getAbsolutePath(),
+ Project.MSG_DEBUG);
+ source = new FileSource(queryFile, "UTF-8", true);
+
+ } else {
+ log("XQuery string: " + query, Project.MSG_DEBUG);
+ source = new StringSource(query);
+ }
+ results = service.execute(source);
+ log("Found " + results.getSize() + " results", Project.MSG_INFO);
+
+ if (destDir != null && results != null) {
+ log("write results to directory " + destDir.getAbsolutePath(),
+ Project.MSG_INFO);
+ ResourceIterator iter = results.getIterator();
+ XMLResource res = null;
+
+ log(
+ "Writing results to directory "
+ + destDir.getAbsolutePath(), Project.MSG_DEBUG);
+ while (iter.hasMoreResources()) {
+ res = (XMLResource) iter.nextResource();
+ log("Writing resource " + res.getId(), Project.MSG_DEBUG);
+ writeResource(res, destDir);
+ }
+ } else if (outputproperty != null) {
+ ResourceIterator iter = results.getIterator();
+ XMLResource res = null;
+ String result = null;
+ while (iter.hasMoreResources()) {
+ res = (XMLResource) iter.nextResource();
+ result = res.getContent().toString();
+ }
+ getProject().setNewProperty(outputproperty, result);
+ }
}
- results = service.execute(source);
- log("Found " + results.getSize() + " results", Project.MSG_INFO);
-
- if (destDir != null && results != null) {
- log("write results to directory " + destDir.getAbsolutePath(),
- Project.MSG_INFO);
- ResourceIterator iter = results.getIterator();
- XMLResource res = null;
-
- log(
- "Writing results to directory "
- + destDir.getAbsolutePath(), Project.MSG_DEBUG);
- while (iter.hasMoreResources()) {
- res = (XMLResource) iter.nextResource();
- log("Writing resource " + res.getId(), Project.MSG_DEBUG);
- writeResource(res, destDir);
- }
- } else if (outputproperty != null) {
- ResourceIterator iter = results.getIterator();
- XMLResource res = null;
- String result = null;
- while (iter.hasMoreResources()) {
- res = (XMLResource) iter.nextResource();
- result = res.getContent().toString();
- }
- getProject().setNewProperty(outputproperty, result);
- }
} catch (XMLDBException e) {
- throw new BuildException(
- "XMLDB exception caught while executing query: "
- + e.getMessage(), e);
+ String msg="XMLDB exception caught while executing query: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
} catch (IOException e) {
- throw new BuildException(
- "XMLDB exception caught while writing destination file: "
- + e.getMessage(), e);
+ String msg="XMLDB exception caught while writing destination file: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
@@ -216,7 +224,11 @@
writer.close();
SerializerPool.getInstance().returnObject(serializer);
} else {
- throw new BuildException("Destionation target does not exist.");
+ String msg="Destination target does not exist.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
}
}
Modified: trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java
===================================================================
--- trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java 2009-05-26 18:47:01 UTC (rev 9074)
+++ trunk/eXist/src/org/exist/ant/XMLDBXUpdateTask.java 2009-05-27 20:32:39 UTC (rev 9075)
@@ -57,25 +57,39 @@
Collection base = DatabaseManager.getCollection(uri, user, password);
if(base==null){
- throw new BuildException("Collection " + uri + " could not be found.");
+ String msg="Collection " + uri + " could not be found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ XUpdateQueryService service = (XUpdateQueryService) base.getService("XUpdateQueryService", "1.0");
+ if (resource != null)
+ {
+ log("Updating resource: " + resource, Project.MSG_INFO);
+ Resource res = base.getResource(resource);
+ if (res == null) {
+ String msg="Resource " + resource + " not found.";
+ if(failonerror)
+ throw new BuildException(msg);
+ else
+ log(msg,Project.MSG_ERR);
+ } else {
+ service.updateResource(resource, commands);
+ }
+ } else
+ {
+ log("Updating collection: " + base.getName(), Project.MSG_INFO);
+ service.update(commands);
+ }
}
-
- XUpdateQueryService service = (XUpdateQueryService) base.getService("XUpdateQueryService", "1.0");
- if (resource != null)
- {
- log("Updating resource: " + resource, Project.MSG_INFO);
- Resource res = base.getResource(resource);
- if (res == null)
- throw new BuildException("Resource " + resource + " not found.");
- service.updateResource(resource, commands);
- } else
- {
- log("Updating collection: " + base.getName(), Project.MSG_INFO);
- service.update(commands);
- }
} catch (XMLDBException e)
{
- throw new BuildException("XMLDB exception during remove: " + e.getMessage(), e);
+ String msg="XMLDB exception during XUpdate: " + e.getMessage();
+ if(failonerror)
+ throw new BuildException(msg,e);
+ else
+ log(msg,e,Project.MSG_ERR);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-26 18:47:40
|
Revision: 9074
http://exist.svn.sourceforge.net/exist/?rev=9074&view=rev
Author: wolfgang_m
Date: 2009-05-26 18:47:01 +0000 (Tue, 26 May 2009)
Log Message:
-----------
[documentation] Extended documentation on the lucene index.
Modified Paths:
--------------
trunk/eXist/webapp/lucene.xml
Modified: trunk/eXist/webapp/lucene.xml
===================================================================
--- trunk/eXist/webapp/lucene.xml 2009-05-26 11:49:50 UTC (rev 9073)
+++ trunk/eXist/webapp/lucene.xml 2009-05-26 18:47:01 UTC (rev 9074)
@@ -8,7 +8,7 @@
</bookinfo>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sidebar.xml"/>
<chapter>
- <title>New Full Text Index</title>
+ <title>Lucene-based Full Text Index</title>
<section>
<title>Introduction</title>
@@ -115,6 +115,11 @@
/ and // to denote a child or descendant step, plus the wildcard to match an
arbitrary element.</para>
+ <synopsis>//SPEECH/LINE</synopsis>
+
+ <para>only indexes <sgmltag>LINE</sgmltag> children of <sgmltag>SPEECH</sgmltag>
+ parents.</para>
+
<synopsis>//SPEECH/*</synopsis>
<para>will index all child elements of SPEECH, while</para>
@@ -127,10 +132,49 @@
query engine often needs to decide at compile time if an index can be used or not,
which means that we have to limit the possible configuration choices.</para>
+ <para>It is important to <emphasis>choose the right context</emphasis> for your index,
+ which has to be the same as in your query. In the two examples above, the index will
+ be created on the children or descendants of <sgmltag>SPEECH</sgmltag>, not the
+ SPEECH tag itself. This means you can query for the LINE, SPEAKER or STAGEDIR
+ children of SPEECH, but if you search for SPEECH, you won't get any results.</para>
+
+ <para>However, it is possible to define indexes on nested elements. For example, assume
+ you have a document with encoded place names:</para>
+
+ <example>
+ <title>Paragraph with place name</title>
+ <programlisting><markup><![CDATA[<p>He loves <placeName>Paris</placeName>.</p>]]></markup></programlisting>
+ </example>
+
+ <para>For a general query you probably want to search through all paragraphs. However,
+ you may also want to provide an advanced search option, which allows the user to
+ restrict his query to place names. To make this possible, simply define an index on
+ placeName as well:</para>
+
+ <example>
+ <title>collection.xconf fragment</title>
+ <programlisting><markup><![CDATA[<lucene>
+ <text qname="p"/>
+ <text qname="placeName"/>
+</lucene>]]></markup></programlisting>
+ </example>
+
+ <para>Based on this setup, you'll be able to query for the word 'Paris' anywhere in a
+ paragraph:</para>
+
+ <synopsis language="xquery">//p[ft:query(., 'paris')]</synopsis>
+
+ <para>as well as 'Paris' occurring within a <sgmltag>placeName</sgmltag>:</para>
+
+ <synopsis language="xquery">//p[ft:query(placeName, 'paris')]</synopsis>
+
<section>
<title>Whitespace Treatment and Ignored Content</title>
- <para>By default, eXist's indexer assumes that element boundaries break a word or
+ <section>
+ <title>Inlined elements</title>
+
+ <para>By default, eXist's indexer assumes that element boundaries break a word or
token. For example, if you have an element:</para>
<example>
@@ -155,22 +199,52 @@
by telling eXist which nodes are "inline" nodes. The example configuration above
defines:</para>
- <synopsis><![CDATA[<inline qname="b"/>]]></synopsis>
+ <synopsis><![CDATA[<inline qname="b"/>]]></synopsis></section>
- <para>Also, it is sometimes necessary to skip the content of an inlined element,
- which can appear in the middle of a text sequence you want to index. Note or
- footnotes are a good example:</para>
+ <section>
+ <title>Ignored elements</title>
+
+ <para>Also, it is sometimes necessary to skip the content of an inlined element,
+ which can appear in the middle of a text sequence you want to index. Notes or
+ are a good example:</para>
<example>
- <title>Paragraph With Inline Footnote</title>
+ <title>Paragraph With Inline Note</title>
<programlisting><markup><![CDATA[<p>This is a paragraph
- <footnote>containing an inline footnote</footnote>.</p>]]></markup></programlisting>
+<note>containing an inline note</note>.</p>]]></markup></programlisting>
</example>
<para>Use an <sgmltag>ignore</sgmltag> element in the collection configuration to
- have eXist ignore the footnote:</para>
+ have eXist ignore the note:</para>
- <synopsis><![CDATA[<ignore qname="footnote"/>]]></synopsis>
+ <synopsis><![CDATA[<ignore qname="note"/>]]></synopsis>
+
+ <para>The <sgmltag>ignore</sgmltag> only applies to descendants of an indexed
+ element. You can still create another index on the ignored element itself. For
+ example, you can have index definitions for <sgmltag>p</sgmltag> and
+ <sgmltag>note</sgmltag>:</para>
+
+ <example>
+ <title>collection.xconf fragment</title>
+ <programlisting><markup><![CDATA[<lucene>
+ <text qname="p"/>
+ <text qname="note"/>
+ <ignore qname="note"/>
+</lucene>]]></markup></programlisting>
+ </example>
+
+ <para>If <sgmltag>note</sgmltag> appears within <sgmltag>p</sgmltag>, it will not be
+ added to the index on <sgmltag>p</sgmltag>, but only to the index on
+ <sgmltag>note</sgmltag>. This means that the query</para>
+
+ <synopsis language="xquery">//p[ft:query(., "note")]</synopsis>
+
+ <para>may not return a hit if "note" occurs within a <sgmltag>note</sgmltag>,
+ while</para>
+
+ <synopsis language="xquery">//p[ft:query(note, "note")] </synopsis>
+
+ <para>may still find a match.</para></section>
</section>
<section>
@@ -179,12 +253,37 @@
<para>One of the strengths of Lucene is that it allows the developer to determine
nearly every aspect of the text analysis. This is mostly done through analyzer
classes, which combine a tokenizer with a chain of filters to post-process the
- tokenized text. As shown in the configuration above, eXist's Lucene module does
- already allow different analyzers to be used for different indexes. We will
- certainly add more features in the future, e.g. a possibility to construct a new
- analyzer from a set of filters. For the time being, you can always provide your
- own analyzer or use one of those supplied by Lucene or compatible
- software.</para>
+ tokenized text. eXist's Lucene module does already allow different analyzers to
+ be used for different indexes.</para>
+
+ <example>
+ <title/>
+ <programlisting><markup><![CDATA[<lucene>
+ <analyzer class="org.apache.lucene.analysis.standard.StandardAnalyzer"/>
+ <analyzer id="ws" class="org.apache.lucene.analysis.WhitespaceAnalyzer"/>
+ <text match="//SPEECH//*"/>
+ <text qname="TITLE" analyzer="ws"/>
+</lucene>]]></markup></programlisting>
+ </example>
+
+ <para>In the example above, we define that Lucene's <ulink
+ url="http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/analysis/standard/StandardAnalyzer.html"
+ >StandardAnalyzer</ulink> should be used by default (the
+ <sgmltag>analyzer</sgmltag> element without <option>id</option> attribute).
+ We provide an additional analyzer and assign it the id <option>ws</option>, by
+ which the analyzer can be referenced in the actual index definitions.</para>
+
+ <para>The <ulink
+ url="http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/analysis/WhitespaceAnalyzer.html"
+ >whitespace analyzer</ulink> is the most basic one. As the name says, it
+ tokenizes the text at white space characters, but treats all other characters -
+ including punctuation - as part of the token. The tokens are not converted to
+ lower case and there's no stopword filter applied.</para>
+
+ <para>We will certainly add more features in the future, e.g. a possibility to
+ construct a new analyzer from a set of filters. For the time being, you can
+ always provide your own analyzer or use one of those supplied by Lucene or
+ compatible software.</para>
</section>
</section>
@@ -211,9 +310,9 @@
<para>Please note that the score is computed relative to the root context of the index.
If you created an index on SPEECH, all scores will be computed on basis of the text
- in the SPEECH nodes, even though your actual query does only search for LINE children of
+ in the SPEECH nodes, even though your actual query may only return LINE children of
SPEECH.</para>
-
+
<para>The Lucene module is fully supported by eXist's query-rewriting optimizer, which
means that the query engine can rewrite the XQuery expression to make best use of
the available indexes. All the rules and hints given in the <ulink url="tuning.xml"
@@ -225,10 +324,10 @@
<para>Lucene's default query syntax does not provide access to all available
features. However, eXist's <function>ft:query</function> function also accepts a
description of the query in XML as an alternative to passing a query string. The
- XML description is transformed into an internal tree of query objects, which is
- directly passed to Lucene for execution. This has some advantages. For example,
- you can specify if the order of terms should be relevant for a phrase
- query:</para>
+ XML description closely mirrors Lucene's query API. It is transformed into an
+ internal tree of query objects, which is directly passed to Lucene for
+ execution. This has some advantages. For example, you can specify if the order
+ of terms should be relevant for a phrase query:</para>
<example>
<title>Using an XML Definition of the Query</title>
@@ -241,52 +340,62 @@
</example>
<para>The following elements may occur within a query description:</para>
-
+
<variablelist>
<varlistentry>
- <term><sgmltag>term</sgmltag></term>
+ <term>
+ <sgmltag>term</sgmltag>
+ </term>
<listitem>
- <para>Defines a single term to be searched in the index. If the
- root query element contains a sequence of term
- elements, they will be combined as in a boolean "or" query. For example:
- </para>
-
+ <para>Defines a single term to be searched in the index. If the root
+ query element contains a sequence of term elements, they will be
+ combined as in a boolean "or" query. For example: </para>
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<term>nation</term><term>miserable</term>
</query>
return
//SPEECH[ft:query(., $query)]]]></synopsis>
-
- <para>finds all SPEECH elements containing either "nation" or "miserable" or
- both.</para>
+
+ <para>finds all SPEECH elements containing either "nation" or
+ "miserable" or both.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><sgmltag>bool</sgmltag></term>
+ <term>
+ <sgmltag>bool</sgmltag>
+ </term>
<listitem>
- <para>Constructs a boolean query from its children. Each child element may
- have an occurrance indicator, which could be either <option>must</option>,
- <option>should</option> or <option>not</option>:</para>
-
+ <para>Constructs a boolean query from its children. Each child element
+ may have an occurrance indicator, which could be either
+ <option>must</option>, <option>should</option> or
+ <option>not</option>:</para>
+
<variablelist>
<varlistentry>
<term>must</term>
- <listitem><para>this part of the query <emphasis>must</emphasis>
- be matched</para></listitem>
+ <listitem>
+ <para>this part of the query <emphasis>must</emphasis> be
+ matched</para>
+ </listitem>
</varlistentry>
<varlistentry>
<term>should</term>
- <listitem><para>this part of the query <emphasis>should</emphasis>
- be matched, but doesn't need to</para></listitem>
+ <listitem>
+ <para>this part of the query <emphasis>should</emphasis> be
+ matched, but doesn't need to</para>
+ </listitem>
</varlistentry>
<varlistentry>
<term>not</term>
- <listitem><para>this part of the query <emphasis>must not</emphasis>
- be matched</para></listitem>
+ <listitem>
+ <para>this part of the query <emphasis>must not</emphasis>
+ be matched</para>
+ </listitem>
</varlistentry>
</variablelist>
-
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<bool><term occur="must">boil</term><term occur="should">bubble</term></bool>
@@ -295,33 +404,35 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><sgmltag>phrase</sgmltag></term>
+ <term>
+ <sgmltag>phrase</sgmltag>
+ </term>
<listitem>
- <para>Searches for a group of terms occurring in the correct order.
- The element may either contain explicit <sgmltag>term</sgmltag>
- elements or text content. Text will be automatically tokenized into
- a sequence of terms. For example:</para>
-
+ <para>Searches for a group of terms occurring in the correct order. The
+ element may either contain explicit <sgmltag>term</sgmltag> elements
+ or text content. Text will be automatically tokenized into a
+ sequence of terms. For example:</para>
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<phrase>cauldron boil</phrase>
</query>
return //SPEECH[ft:query(., $query)]
]]></synopsis>
-
+
<para>has the same effect as:</para>
-
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<phrase><term>cauldron</term><term>boil</term></phrase>
</query>
return //SPEECH[ft:query(., $query)]
]]></synopsis>
-
- <para>Attribute <parameter>slop</parameter> can be used for a
- proximity search: Lucene will try to find terms which are within the
- specified distance:</para>
-
+
+ <para>Attribute <parameter>slop</parameter> can be used for a proximity
+ search: Lucene will try to find terms which are within the specified
+ distance:</para>
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<phrase slop="10"><term>frog</term><term>dog</term></phrase>
@@ -331,42 +442,47 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><sgmltag>near</sgmltag></term>
+ <term>
+ <sgmltag>near</sgmltag>
+ </term>
<listitem>
- <para><sgmltag>near</sgmltag> is a powerful alternative to <sgmltag>phrase</sgmltag>
- and one of the features not available through the standard Lucene query parser.</para>
-
- <para>If the element has text content only, it will be tokenized into terms and the expression
- behaves like <sgmltag>phrase</sgmltag>. Otherwise it may contain any combination of
- <sgmltag>term</sgmltag>, <sgmltag>first</sgmltag> and nested <sgmltag>near</sgmltag>
- elements. This makes it possible to search for two sequences of terms which are within
- a specific distance. For example:</para>
-
+ <para><sgmltag>near</sgmltag> is a powerful alternative to
+ <sgmltag>phrase</sgmltag> and one of the features not available
+ through the standard Lucene query parser.</para>
+
+ <para>If the element has text content only, it will be tokenized into
+ terms and the expression behaves like <sgmltag>phrase</sgmltag>.
+ Otherwise it may contain any combination of <sgmltag>term</sgmltag>,
+ <sgmltag>first</sgmltag> and nested <sgmltag>near</sgmltag>
+ elements. This makes it possible to search for two sequences of
+ terms which are within a specific distance. For example:</para>
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<near slop="20"><term>snake</term><near>tongue dog</near></near>
</query>
return //SPEECH[ft:query(., $query)]]]></synopsis>
-
+
<para>Element <sgmltag>first</sgmltag> matches a span against the start
of the text in the context node. It takes an optional attribute
- <parameter>end</parameter> to specify the maximum distance from the
- start of the text. For example:</para>
-
- <synopsis language="xquery"><![CDATA[let $query :=
+ <parameter>end</parameter> to specify the maximum distance from
+ the start of the text. For example:</para>
+
+ <synopsis language="xquery"><![CDATA[let $query :=
<query>
<near slop="50"><first end="2"><near>second witch</near></first><near>tongue dog</near></near>
</query>
return //SPEECH[ft:query(., $query)]]]></synopsis>
-
+
<para>As shown above, the content of <sgmltag>first</sgmltag> can again
- be text, a <sgmltag>term</sgmltag> or <sgmltag>near</sgmltag>.</para>
-
+ be text, a <sgmltag>term</sgmltag> or
+ <sgmltag>near</sgmltag>.</para>
+
<para>Contrary to <sgmltag>phrase</sgmltag>, <sgmltag>near</sgmltag> can
be told to ignore the order of its components. Use parameter
- <parameter>ordered="yes|no"</parameter> to change near's behaviour.
- For example:</para>
-
+ <parameter>ordered="yes|no"</parameter> to change near's
+ behaviour. For example:</para>
+
<synopsis language="xquery"><![CDATA[let $query :=
<query>
<near slop="100" ordered="no"><term>snake</term><term>bake</term></near>
@@ -376,9 +492,9 @@
</varlistentry>
</variablelist>
<para>All elements in a query may have an optional <parameter>boost</parameter>
- parameter (a float value). The score of the nodes matching the corresponding
+ parameter (a float value). The score of the nodes matching the corresponding
query part will be multiplied by the <emphasis>boost</emphasis>.</para>
</section>
</section>
</chapter>
-</book>
\ No newline at end of file
+</book>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-26 11:50:35
|
Revision: 9073
http://exist.svn.sourceforge.net/exist/?rev=9073&view=rev
Author: wolfgang_m
Date: 2009-05-26 11:49:50 +0000 (Tue, 26 May 2009)
Log Message:
-----------
[bugfix] fixed text:index-terms function.
Modified Paths:
--------------
trunk/eXist/src/org/exist/storage/FulltextIndexSpec.java
trunk/eXist/src/org/exist/xquery/functions/text/IndexTerms.java
Modified: trunk/eXist/src/org/exist/storage/FulltextIndexSpec.java
===================================================================
--- trunk/eXist/src/org/exist/storage/FulltextIndexSpec.java 2009-05-25 21:10:28 UTC (rev 9072)
+++ trunk/eXist/src/org/exist/storage/FulltextIndexSpec.java 2009-05-26 11:49:50 UTC (rev 9073)
@@ -165,6 +165,15 @@
mixedPath = (NodePath[]) mixedList.toArray(ARRAY_TYPE);
}
+ public List getIndexedQNames() {
+ ArrayList qnames = new ArrayList(qnameSpecs.size());
+ for (Iterator i = qnameSpecs.keySet().iterator(); i.hasNext(); ) {
+ QName qname = (QName) i.next();
+ qnames.add(qname);
+ }
+ return qnames;
+ }
+
/**
* @return False if all elements are indexed, True if indexation is selective.
*/
Modified: trunk/eXist/src/org/exist/xquery/functions/text/IndexTerms.java
===================================================================
--- trunk/eXist/src/org/exist/xquery/functions/text/IndexTerms.java 2009-05-25 21:10:28 UTC (rev 9072)
+++ trunk/eXist/src/org/exist/xquery/functions/text/IndexTerms.java 2009-05-26 11:49:50 UTC (rev 9073)
@@ -27,6 +27,7 @@
import org.exist.security.PermissionDeniedException;
import org.exist.storage.DBBroker;
import org.exist.storage.IndexSpec;
+import org.exist.storage.FulltextIndexSpec;
import org.exist.util.Occurrences;
import org.exist.xquery.*;
import org.exist.xquery.value.*;
@@ -175,7 +176,8 @@
final org.exist.collections.Collection collection = (org.exist.collections.Collection) i.next();
final IndexSpec idxConf = collection.getIndexConfiguration(broker);
if (idxConf != null) {
- final List qnames = idxConf.getIndexedQNames();
+ FulltextIndexSpec fIdxConf = idxConf.getFulltextIndexSpec();
+ final List qnames = fIdxConf.getIndexedQNames();
for (int j = 0; j < qnames.size(); j++) {
final QName qName = (QName) qnames.get(j);
indexes.add(qName);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <wol...@us...> - 2009-05-25 20:50:17
|
Revision: 9071
http://exist.svn.sourceforge.net/exist/?rev=9071&view=rev
Author: wolfgang_m
Date: 2009-05-25 20:49:24 +0000 (Mon, 25 May 2009)
Log Message:
-----------
[bugfix] by default, Lucene only indexes the first 10,000 tokens of a field. This limit is now disabled in eXist.
Modified Paths:
--------------
trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
Modified: trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java
===================================================================
--- trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-05-25 20:29:30 UTC (rev 9070)
+++ trunk/eXist/extensions/indexes/lucene/src/org/exist/indexing/lucene/LuceneIndexWorker.java 2009-05-25 20:49:24 UTC (rev 9071)
@@ -612,6 +612,8 @@
IndexWriter writer = null;
try {
writer = index.getWriter();
+ // by default, Lucene only indexes the first 10,000 terms in a field
+ writer.setMaxFieldLength(Integer.MAX_VALUE);
for (int i = 0; i < nodesToWrite.size(); i++) {
PendingDoc pending = (PendingDoc) nodesToWrite.get(i);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-05-23 16:31:29
|
Revision: 9069
http://exist.svn.sourceforge.net/exist/?rev=9069&view=rev
Author: shabanovd
Date: 2009-05-23 16:31:25 +0000 (Sat, 23 May 2009)
Log Message:
-----------
[ignore] merge trunk
Modified Paths:
--------------
branches/shabanovd/xslt/.classpath
branches/shabanovd/xslt/conf.xml.tmpl
branches/shabanovd/xslt/mime-types.xml.tmpl
branches/shabanovd/xslt/nbproject/build-impl.xml
branches/shabanovd/xslt/nbproject/genfiles.properties
branches/shabanovd/xslt/nbproject/project.properties
branches/shabanovd/xslt/src/org/exist/collections/Collection.java
branches/shabanovd/xslt/src/org/exist/collections/CollectionConfiguration.java
branches/shabanovd/xslt/src/org/exist/util/Configuration.java
branches/shabanovd/xslt/test/src/org/exist/performance/xquery/RandomText.java
branches/shabanovd/xslt/tools/ircbot/src/org/exist/irc/XBot.java
Added Paths:
-----------
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java
branches/shabanovd/xslt/webapp/xproc/
branches/shabanovd/xslt/webapp/xproc/examples.xml
branches/shabanovd/xslt/webapp/xproc/hello.xproc
branches/shabanovd/xslt/webapp/xproc/run.xql
branches/shabanovd/xslt/webapp/xproc/sidebar.xml
branches/shabanovd/xslt/webapp/xproc/twitter-view.xql
branches/shabanovd/xslt/webapp/xproc/twitter.xproc
branches/shabanovd/xslt/webapp/xproc/xslt-identity.xproc
Removed Paths:
-------------
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java
branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java
branches/shabanovd/xslt/webapp/xproc/examples.xml
branches/shabanovd/xslt/webapp/xproc/hello.xproc
branches/shabanovd/xslt/webapp/xproc/run.xql
branches/shabanovd/xslt/webapp/xproc/sidebar.xml
branches/shabanovd/xslt/webapp/xproc/twitter-view.xql
branches/shabanovd/xslt/webapp/xproc/twitter.xproc
branches/shabanovd/xslt/webapp/xproc/xslt-identity.xproc
Modified: branches/shabanovd/xslt/.classpath
===================================================================
--- branches/shabanovd/xslt/.classpath 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/.classpath 2009-05-23 16:31:25 UTC (rev 9069)
@@ -110,7 +110,5 @@
<classpathentry kind="lib" path="lib/user/svnkit.jar"/>
<classpathentry kind="lib" path="lib/user/jfreechart-1.0.12.jar"/>
<classpathentry kind="lib" path="lib/user/jcommon-1.0.15.jar"/>
- <classpathentry kind="lib" path="lib/user/mina-core-2.0.0-M5.jar"/>
- <classpathentry kind="lib" path="lib/user/slf4j-api-1.5.2.jar"/>
<classpathentry kind="output" path="test/classes"/>
</classpath>
Modified: branches/shabanovd/xslt/conf.xml.tmpl
===================================================================
--- branches/shabanovd/xslt/conf.xml.tmpl 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/conf.xml.tmpl 2009-05-23 16:31:25 UTC (rev 9069)
@@ -713,9 +713,32 @@
-->
<!-- Versioning -->
- <!--module src="resource:org/exist/versioning/xquery/versioning.xqm"
- uri="" rel="nofollow">http://exist-db.org/versioning"/-->
+ <module src="resource:org/exist/versioning/xquery/versioning.xqm"
+ uri="" rel="nofollow">http://exist-db.org/versioning"/>
+ <!-- expath module imports (for p:http-request)//-->
+ <module class="org.exist.xquery.modules.httpclient.HTTPClientModule"
+ uri="http://exist-db.org/xquery/httpclient" />
+ <module src="resource:org/expath/www/mod/http-client/http-client.xqm"
+ uri="" rel="nofollow">http://www.expath.org/mod/http-client"/>
+ <!-- xprocxq module imports //-->
+ <module src="resource:net/xproc/xprocxq/src/xquery/const.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/const"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/xproc.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/util.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/util"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/functions.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/functions"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/std.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/std"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/ext.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/ext"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/opt.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/opt"/>
+ <module src="resource:net/xproc/xprocxq/src/xquery/naming.xqm"
+ uri="" rel="nofollow">http://xproc.net/xproc/naming"/>
+
<!-- Optional Modules -->
<!--
<module class="org.exist.xquery.modules.compression.CompressionModule"
Modified: branches/shabanovd/xslt/mime-types.xml.tmpl
===================================================================
--- branches/shabanovd/xslt/mime-types.xml.tmpl 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/mime-types.xml.tmpl 2009-05-23 16:31:25 UTC (rev 9069)
@@ -22,7 +22,7 @@
<!-- Mime types stored as XML -->
<mime-type name="text/xml" type="xml">
<description>XML document</description>
- <extensions>.xml,.xsl,.xslt,.xsd,.rng,.mods,.xmp,.xmi,.xconf,.xmap,.xsp,.wsdl,.x3d,.rdf,.owl,.dbx,.tei,.xces,.ead,.xqx,.xform,.gml,.fo,.nvdl,.sch</extensions>
+ <extensions>.xml,.xsl,.xslt,.xsd,.rng,.mods,.xmp,.xmi,.xconf,.xmap,.xsp,.wsdl,.x3d,.rdf,.owl,.dbx,.tei,.xces,.ead,.xqx,.xform,.gml,.fo,.nvdl,.sch,.imdi</extensions>
</mime-type>
<mime-type name="application/xml" type="xml">
<description>XML document</description>
Modified: branches/shabanovd/xslt/nbproject/build-impl.xml
===================================================================
--- branches/shabanovd/xslt/nbproject/build-impl.xml 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/nbproject/build-impl.xml 2009-05-23 16:31:25 UTC (rev 9069)
@@ -164,7 +164,7 @@
<attribute default="${includes}" name="includes"/>
<attribute default="${excludes}" name="excludes"/>
<attribute default="${javac.debug}" name="debug"/>
- <attribute default="" name="sourcepath"/>
+ <attribute default="/does/not/exist" name="sourcepath"/>
<element name="customize" optional="true"/>
<sequential>
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}">
Modified: branches/shabanovd/xslt/nbproject/genfiles.properties
===================================================================
--- branches/shabanovd/xslt/nbproject/genfiles.properties 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/nbproject/genfiles.properties 2009-05-23 16:31:25 UTC (rev 9069)
@@ -4,5 +4,5 @@
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=7cecdd33
-nbproject/build-impl.xml.script.CRC32=d244f64d
-nbproject/build-impl.xml.stylesheet.CRC32=e55b27f5
+nbproject/build-impl.xml.script.CRC32=bbeb66ae
+nbproject/build-impl.xml.stylesheet.CRC32=65b8de21
Modified: branches/shabanovd/xslt/nbproject/project.properties
===================================================================
--- branches/shabanovd/xslt/nbproject/project.properties 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/nbproject/project.properties 2009-05-23 16:31:25 UTC (rev 9069)
@@ -191,7 +191,7 @@
jmx.rmi.use.port=true
meta.inf.dir=${src.dir}/META-INF
file.reference.xalan-2.7.1.jar=lib/endorsed/xalan-2.7.1.jar
-excludes=**/spatial/*, **/modules/svn/*, **/modules/xslfo/*,**/modules/mail/*
+excludes=**/spatial/*, **/modules/svn/*, **/modules/xslfo/*,**/modules/mail/*,**/modules/jfreechart/*
application.title=eXist-1.3
file.reference.excalibur-sourceresolve-1.1.jar=lib/cocoon/excalibur-sourceresolve-1.1.jar
file.reference.logkit-1.2.2.jar=lib/cocoon/logkit-1.2.2.jar
Modified: branches/shabanovd/xslt/src/org/exist/collections/Collection.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/collections/Collection.java 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/src/org/exist/collections/Collection.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -181,9 +181,16 @@
if (!subcollections.contains(childName))
subcollections.add(childName);
if (isNew) {
+ User user = broker.getUser();
+ child.setCreationTime(System.currentTimeMillis());
+ child.permissions.setOwner(user);
CollectionConfiguration config = getConfiguration(broker);
- if (config != null)
+ String group = null;
+ if (config != null){
+ group = config.getDefCollGroup(user);
child.permissions.setPermissions(config.getDefCollPermissions());
+ }
+ child.permissions.setGroup(group);
}
}
@@ -1170,12 +1177,6 @@
DocumentImpl document = new DocumentImpl(broker.getBrokerPool(), this, docUri);
oldDoc = (DocumentImpl) documents.get(docUri.getRawCollectionPath());
- if (oldDoc == null) {
- if (config != null) {
- document.setPermissions(config.getDefResPermissions());
- }
- } else
- document.setPermissions(oldDoc.getPermissions().getPermissions());
checkPermissions(transaction, broker, oldDoc);
manageDocumentInformation(broker, oldDoc, document );
@@ -1295,9 +1296,18 @@
metadata.setLastModified(System.currentTimeMillis());
document.setPermissions(oldDoc.getPermissions());
} else {
+ User user = broker.getUser();
metadata.setCreated(System.currentTimeMillis());
- document.getPermissions().setOwner(broker.getUser());
- document.getPermissions().setGroup(broker.getUser().getPrimaryGroup());
+ document.getPermissions().setOwner(user);
+ String group;
+ CollectionConfiguration config = getConfiguration(broker);
+ if (config != null) {
+ document.setPermissions(config.getDefResPermissions());
+ group = config.getDefResGroup(user);
+ } else {
+ group = user.getPrimaryGroup();
+ }
+ document.getPermissions().setGroup(group);
}
document.setMetadata(metadata);
}
Modified: branches/shabanovd/xslt/src/org/exist/collections/CollectionConfiguration.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/collections/CollectionConfiguration.java 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/src/org/exist/collections/CollectionConfiguration.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -20,9 +20,15 @@
*/
package org.exist.collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
import org.apache.log4j.Logger;
import org.exist.collections.triggers.Trigger;
import org.exist.dom.DocumentImpl;
+import org.exist.security.SecurityManager;
+import org.exist.security.User;
import org.exist.storage.BrokerPool;
import org.exist.storage.DBBroker;
import org.exist.storage.IndexSpec;
@@ -34,10 +40,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.StringTokenizer;
-
public class CollectionConfiguration {
public final static String COLLECTION_CONFIG_SUFFIX = ".xconf";
@@ -58,8 +60,9 @@
/** First level element in a collection configuration document */
private final static String INDEX_ELEMENT = "index";
private final static String PERMISSIONS_ELEMENT = "default-permissions";
- private final static String RESOURCE_PERMISSIONS_ATTR = "resource";
- private final static String COLLECTION_PERMISSIONS_ATTR = "collection";
+ private final static String GROUP_ELEMENT = "default-group";
+ private final static String RESOURCE_ATTR = "resource";
+ private final static String COLLECTION_ATTR = "collection";
private final static String VALIDATION_ELEMENT = "validation";
private final static String VALIDATION_MODE_ATTR = "mode";
@@ -76,12 +79,18 @@
private int defCollPermissions;
private int defResPermissions;
- private int validationMode=XMLReaderObjectFactory.VALIDATION_UNKNOWN;
+ private String defCollGroup = null;
+ private String defResGroup = null;
+
+ private int validationMode=XMLReaderObjectFactory.VALIDATION_UNKNOWN;
+
+ private SecurityManager secman;
public CollectionConfiguration(BrokerPool pool) {
- this.defResPermissions = pool.getSecurityManager().getResourceDefaultPerms();
- this.defCollPermissions = pool.getSecurityManager().getCollectionDefaultPerms();
- }
+ secman = pool.getSecurityManager();
+ defResPermissions = secman.getResourceDefaultPerms();
+ defCollPermissions = secman.getCollectionDefaultPerms();
+ }
public static boolean isCollectionConfigDocument(XmldbURI docName) {
@@ -154,7 +163,7 @@
} else if (PERMISSIONS_ELEMENT.equals(node.getLocalName())) {
Element elem = (Element) node;
- String permsOpt = elem.getAttribute(RESOURCE_PERMISSIONS_ATTR);
+ String permsOpt = elem.getAttribute(RESOURCE_ATTR);
if (permsOpt != null && permsOpt.length() > 0) {
LOG.debug("RESOURCE: " + permsOpt);
try {
@@ -168,7 +177,7 @@
e.getMessage(), e);
}
}
- permsOpt = elem.getAttribute(COLLECTION_PERMISSIONS_ATTR);
+ permsOpt = elem.getAttribute(COLLECTION_ATTR);
if (permsOpt != null && permsOpt.length() > 0) {
LOG.debug("COLLECTION: " + permsOpt);
try {
@@ -183,6 +192,33 @@
}
}
+ } else if (GROUP_ELEMENT.equals(node.getLocalName())) {
+ Element elem = (Element) node;
+ String groupOpt = elem.getAttribute(RESOURCE_ATTR);
+ if (groupOpt != null && groupOpt.length() > 0) {
+ LOG.debug("RESOURCE: " + groupOpt);
+ if (secman.getGroup(groupOpt)!=null){
+ defResGroup = groupOpt;
+ } else {
+ if (checkOnly)
+ throw new CollectionConfigurationException("Ilegal value for group in configuration document : " + groupOpt);
+ else
+ LOG.warn("Ilegal value for group in configuration document : " + groupOpt);
+ }
+ }
+ groupOpt = elem.getAttribute(COLLECTION_ATTR);
+ if (groupOpt != null && groupOpt.length() > 0) {
+ LOG.debug("COLLECTION: " + groupOpt);
+ if (secman.getGroup(groupOpt)!=null){
+ defCollGroup = groupOpt;
+ } else {
+ if (checkOnly)
+ throw new CollectionConfigurationException("Ilegal value for group in configuration document : " + groupOpt);
+ else
+ LOG.warn("Ilegal value for group in configuration document : " + groupOpt);
+ }
+ }
+
} else if (VALIDATION_ELEMENT.equals(node.getLocalName())) {
Element elem = (Element) node;
String mode = elem.getAttribute(VALIDATION_MODE_ATTR);
@@ -223,6 +259,7 @@
public XmldbURI getSourceCollectionURI() {
return srcCollectionURI;
}
+
public int getDefCollPermissions() {
return defCollPermissions;
}
@@ -231,6 +268,14 @@
return defResPermissions;
}
+ public String getDefCollGroup(User user) {
+ return (defCollGroup != null) ? defCollGroup : user.getPrimaryGroup();
+ }
+
+ public String getDefResGroup(User user) {
+ return (defResGroup != null) ? defResGroup : user.getPrimaryGroup();
+ }
+
public int getValidationMode() {
return validationMode;
}
Modified: branches/shabanovd/xslt/src/org/exist/util/Configuration.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/util/Configuration.java 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/src/org/exist/util/Configuration.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -51,9 +51,7 @@
import org.exist.validation.GrammarPool;
import org.exist.validation.resolver.eXistXMLCatalogResolver;
import org.exist.xmldb.DatabaseImpl;
-import org.exist.xquery.FunctionFactory;
-import org.exist.xquery.XQueryContext;
-import org.exist.xquery.XQueryWatchDog;
+import org.exist.xquery.*;
import org.exist.xslt.TransformerFactoryAllocator;
import org.quartz.SimpleTrigger;
import org.w3c.dom.Document;
@@ -429,6 +427,9 @@
String raiseErrorOnFailedRetrieval = xquery.getAttribute(XQueryContext.XQUERY_RAISE_ERROR_ON_FAILED_RETRIEVAL_ATTRIBUTE);
config.put(XQueryContext.PROPERTY_XQUERY_RAISE_ERROR_ON_FAILED_RETRIEVAL, Configuration.parseBoolean(raiseErrorOnFailedRetrieval, XQueryContext.XQUERY_RAISE_ERROR_ON_FAILED_RETRIEVAL_DEFAULT));
LOG.debug(XQueryContext.PROPERTY_XQUERY_RAISE_ERROR_ON_FAILED_RETRIEVAL + ": " + config.get(XQueryContext.PROPERTY_XQUERY_RAISE_ERROR_ON_FAILED_RETRIEVAL));
+
+ String trace = xquery.getAttribute(PerformanceStats.CONFIG_ATTR_TRACE);
+ config.put(PerformanceStats.CONFIG_PROPERTY_TRACE, trace);
//built-in-modules
Map classMap = new HashMap();
Deleted: branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java
===================================================================
--- trunk/eXist/test/src/org/exist/http/underheavyload/Client.java 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,101 +0,0 @@
-/**
- *
- */
-package org.exist.http.underheavyload;
-
-import java.util.List;
-
-import org.apache.commons.httpclient.Header;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.URI;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.log4j.Logger;
-
-/**
- * @author dmitriy
- *
- */
-public class Client implements Runnable {
-
- private static final Logger LOG = Logger.getLogger(Client.class);
-
- private boolean running;
-
- private ClientsManager manager;
-
- public Client() {
- running = true;
- }
-
- public Client(ClientsManager clients) {
- this.manager = clients;
- running = true;
- }
-
-// @Override
- public void run() {
- HttpClient client = new HttpClient();
-
- // connect to a login page to retrieve session ID
- PostMethod method = new PostMethod(getURL());
-
- // post auth information with it
- method.setParameter("username", "admin");
- method.setParameter("password", "");
-
- try {
- client.executeMethod(method);
- String redirectLocation = null;
- Header locationHeader = method.getResponseHeader("location");
- if (locationHeader != null) {
- redirectLocation = locationHeader.getValue();
- } else {
- // The response is invalid and did not provide the new location for
- // the resource. Report an error or possibly handle the response
- // like a 404 Not Found error.
- //LOG.debug(method.getResponseBodyAsString());
- }
- method.setURI(new URI(redirectLocation, true));
- client.executeMethod(method);
-
- // store the session info for the next call
- Header[] headers = method.getResponseHeaders();
-
- //TODO: fetch links
-
- while (running) {
- Thread.sleep(1000);
-
- // connect to a page you're interested...
- PostMethod getMethod = new PostMethod("http://localhost:8080/exist/admin/admin.xql?panel=xqueries");
-
- // ...using the session ID retrieved before
- for (Header header : headers) {
- getMethod.setRequestHeader(header);
- }
- client.executeMethod(method);
-
- // log the page source
- //LOG.info(method.getResponseBodyAsString());
- }
- } catch (Exception e) {
- LOG.error(e);
- }
- }
-
- protected void shutdown() {
- running = false;
- }
-
- private String getURL() {
- if (manager == null)
- return "http://localhost:8080/exist/admin";
- else
- return manager.getURL();
- }
-
- public static void main(String[] args) {
- Client client = new Client();
- client.run();
- }
-}
Copied: branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java (from rev 9064, trunk/eXist/test/src/org/exist/http/underheavyload/Client.java)
===================================================================
--- branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java (rev 0)
+++ branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/Client.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,101 @@
+/**
+ *
+ */
+package org.exist.http.underheavyload;
+
+import java.util.List;
+
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.URI;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.log4j.Logger;
+
+/**
+ * @author dmitriy
+ *
+ */
+public class Client implements Runnable {
+
+ private static final Logger LOG = Logger.getLogger(Client.class);
+
+ private boolean running;
+
+ private ClientsManager manager;
+
+ public Client() {
+ running = true;
+ }
+
+ public Client(ClientsManager clients) {
+ this.manager = clients;
+ running = true;
+ }
+
+// @Override
+ public void run() {
+ HttpClient client = new HttpClient();
+
+ // connect to a login page to retrieve session ID
+ PostMethod method = new PostMethod(getURL());
+
+ // post auth information with it
+ method.setParameter("username", "admin");
+ method.setParameter("password", "");
+
+ try {
+ client.executeMethod(method);
+ String redirectLocation = null;
+ Header locationHeader = method.getResponseHeader("location");
+ if (locationHeader != null) {
+ redirectLocation = locationHeader.getValue();
+ } else {
+ // The response is invalid and did not provide the new location for
+ // the resource. Report an error or possibly handle the response
+ // like a 404 Not Found error.
+ //LOG.debug(method.getResponseBodyAsString());
+ }
+ method.setURI(new URI(redirectLocation, true));
+ client.executeMethod(method);
+
+ // store the session info for the next call
+ Header[] headers = method.getResponseHeaders();
+
+ //TODO: fetch links
+
+ while (running) {
+ Thread.sleep(1000);
+
+ // connect to a page you're interested...
+ PostMethod getMethod = new PostMethod("http://localhost:8080/exist/admin/admin.xql?panel=xqueries");
+
+ // ...using the session ID retrieved before
+ for (Header header : headers) {
+ getMethod.setRequestHeader(header);
+ }
+ client.executeMethod(method);
+
+ // log the page source
+ //LOG.info(method.getResponseBodyAsString());
+ }
+ } catch (Exception e) {
+ LOG.error(e);
+ }
+ }
+
+ protected void shutdown() {
+ running = false;
+ }
+
+ private String getURL() {
+ if (manager == null)
+ return "http://localhost:8080/exist/admin";
+ else
+ return manager.getURL();
+ }
+
+ public static void main(String[] args) {
+ Client client = new Client();
+ client.run();
+ }
+}
Deleted: branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java
===================================================================
--- trunk/eXist/test/src/org/exist/http/underheavyload/ClientsManager.java 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,78 +0,0 @@
-/*
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id:$
- */
-package org.exist.http.underheavyload;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:sha...@gm...">Dmitriy Shabanov</a>
- *
- */
-public class ClientsManager implements Runnable {
-
- private boolean running;
-
- private int number = 1;
- protected String url;
-
- List<Client> list = new ArrayList<Client>();
-
- public ClientsManager(int number, String url) {
- this.number = number;
- this.url = url;
-
- Thread thread = new Thread(this);
-
- running = true;
- thread.start();
- }
-
- public void shutdown() {
- running = false;
-
- for (Client client : list) {
- client.shutdown();
- }
- }
-
-// @Override
- public void run() {
- Client client = null;
- while (running) {
- if (list.size() >= number) {
- running = false;
- } else {
- client = new Client(this);
- Thread thread = new Thread(client);
- thread.start();
- list.add(client);
- }
- }
- }
-
- public String getURL() {
- return url;
- }
-
-
-}
Copied: branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java (from rev 9064, trunk/eXist/test/src/org/exist/http/underheavyload/ClientsManager.java)
===================================================================
--- branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java (rev 0)
+++ branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/ClientsManager.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,78 @@
+/*
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id:$
+ */
+package org.exist.http.underheavyload;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:sha...@gm...">Dmitriy Shabanov</a>
+ *
+ */
+public class ClientsManager implements Runnable {
+
+ private boolean running;
+
+ private int number = 1;
+ protected String url;
+
+ List<Client> list = new ArrayList<Client>();
+
+ public ClientsManager(int number, String url) {
+ this.number = number;
+ this.url = url;
+
+ Thread thread = new Thread(this);
+
+ running = true;
+ thread.start();
+ }
+
+ public void shutdown() {
+ running = false;
+
+ for (Client client : list) {
+ client.shutdown();
+ }
+ }
+
+// @Override
+ public void run() {
+ Client client = null;
+ while (running) {
+ if (list.size() >= number) {
+ running = false;
+ } else {
+ client = new Client(this);
+ Thread thread = new Thread(client);
+ thread.start();
+ list.add(client);
+ }
+ }
+ }
+
+ public String getURL() {
+ return url;
+ }
+
+
+}
Deleted: branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java
===================================================================
--- trunk/eXist/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,54 +0,0 @@
-/*
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id:$
- */
-package org.exist.http.underheavyload;
-
-
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:sha...@gm...">Dmitriy Shabanov</a>
- *
- */
-public class DatabaseUnderLoadTest {
-
- ClientsManager manager;
-
- org.exist.start.Main database;
-
- @Test
- public void testHeavyLoad() {
- database = new org.exist.start.Main("jetty");
- database.run(new String[]{"jetty"});
-
- manager = new ClientsManager(5, "http://localhost:8080/exist/admin");
-
- try {
- Thread.sleep(60*60*1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- //TODO: catch errors somehow
-
- manager.shutdown();
- database.shutdown();
- }
-}
Copied: branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java (from rev 9064, trunk/eXist/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java)
===================================================================
--- branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java (rev 0)
+++ branches/shabanovd/xslt/test/src/org/exist/http/underheavyload/DatabaseUnderLoadTest.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,54 @@
+/*
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id:$
+ */
+package org.exist.http.underheavyload;
+
+
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:sha...@gm...">Dmitriy Shabanov</a>
+ *
+ */
+public class DatabaseUnderLoadTest {
+
+ ClientsManager manager;
+
+ org.exist.start.Main database;
+
+ @Test
+ public void testHeavyLoad() {
+ database = new org.exist.start.Main("jetty");
+ database.run(new String[]{"jetty"});
+
+ manager = new ClientsManager(5, "http://localhost:8080/exist/admin");
+
+ try {
+ Thread.sleep(60*60*1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ //TODO: catch errors somehow
+
+ manager.shutdown();
+ database.shutdown();
+ }
+}
Modified: branches/shabanovd/xslt/test/src/org/exist/performance/xquery/RandomText.java
===================================================================
--- branches/shabanovd/xslt/test/src/org/exist/performance/xquery/RandomText.java 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/test/src/org/exist/performance/xquery/RandomText.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -78,7 +78,7 @@
words = new String[list.size()];
list.toArray(words);
} catch (PermissionDeniedException e) {
- throw new XPathException(getASTNode(), e.getMessage(), e);
+ throw new XPathException(this, e.getMessage(), e);
}
}
}
Modified: branches/shabanovd/xslt/tools/ircbot/src/org/exist/irc/XBot.java
===================================================================
--- branches/shabanovd/xslt/tools/ircbot/src/org/exist/irc/XBot.java 2009-05-23 16:28:37 UTC (rev 9068)
+++ branches/shabanovd/xslt/tools/ircbot/src/org/exist/irc/XBot.java 2009-05-23 16:31:25 UTC (rev 9069)
@@ -42,7 +42,7 @@
private final static String VERSION = "0.2";
- private final static String URI = "xmldb:exist://localhost:8080/xmlrpc/db";
+ private final static String URI = "xmldb:exist://localhost:8080/exist/xmlrpc/db";
private final static String COLLECTION = "ircbot";
Deleted: branches/shabanovd/xslt/webapp/xproc/examples.xml
===================================================================
--- trunk/eXist/webapp/xproc/examples.xml 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/webapp/xproc/examples.xml 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<article>
- <articleinfo>
- <graphic fileref="../logo.jpg"/>
- <productname>Open Source Native XML Database</productname>
- <title>XProc Examples</title>
- <author>
- <firstname>Wolfgang M.</firstname>
- <surname>Meier</surname>
- <affiliation>
- <address format="linespecific"><email>wolfgang at exist-db.org</email></address>
- </affiliation>
- </author>
- </articleinfo>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sidebar.xml"/>
- <section>
- <title>XProc Examples</title>
- <para>A few examples using the <ulink url="http://code.google.com/p/xprocxq/"
- >xprocxq</ulink> pure-Query implementation of the XProc standard, which is closely
- integrated with eXist.</para>
-
- <para>To run any of these examples, some files have to be stored into the database. This
- can be done through the "Examples Setup" page on the <ulink url="../admin/">admin web
- application</ulink>.</para>
- <table frame="void">
- <caption>Examples</caption>
- <tbody>
- <tr>
- <td>
- <ulink url="hello.xproc">hello.xproc</ulink>
- </td>
- <td>"Hello world" in XProc</td>
- </tr>
- <tr>
- <td>
- <ulink url="xslt-identity.xproc">xslt-identity.xproc</ulink>
- </td>
- <td>Pass an XML fragment through an XSLT identity transformation.</td>
- </tr>
- <tr>
- <td>
- <ulink url="twitter.xproc">twitter.xproc</ulink>
- </td>
- <td>Retrieve a feed from twitter in Atom format and display it.</td>
- </tr>
- </tbody>
- </table>
- </section>
-</article>
Copied: branches/shabanovd/xslt/webapp/xproc/examples.xml (from rev 9064, trunk/eXist/webapp/xproc/examples.xml)
===================================================================
--- branches/shabanovd/xslt/webapp/xproc/examples.xml (rev 0)
+++ branches/shabanovd/xslt/webapp/xproc/examples.xml 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<article>
+ <articleinfo>
+ <graphic fileref="../logo.jpg"/>
+ <productname>Open Source Native XML Database</productname>
+ <title>XProc Examples</title>
+ <author>
+ <firstname>Wolfgang M.</firstname>
+ <surname>Meier</surname>
+ <affiliation>
+ <address format="linespecific"><email>wolfgang at exist-db.org</email></address>
+ </affiliation>
+ </author>
+ </articleinfo>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sidebar.xml"/>
+ <section>
+ <title>XProc Examples</title>
+ <para>A few examples using the <ulink url="http://code.google.com/p/xprocxq/"
+ >xprocxq</ulink> pure-Query implementation of the XProc standard, which is closely
+ integrated with eXist.</para>
+
+ <para>To run any of these examples, some files have to be stored into the database. This
+ can be done through the "Examples Setup" page on the <ulink url="../admin/">admin web
+ application</ulink>.</para>
+ <table frame="void">
+ <caption>Examples</caption>
+ <tbody>
+ <tr>
+ <td>
+ <ulink url="hello.xproc">hello.xproc</ulink>
+ </td>
+ <td>"Hello world" in XProc</td>
+ </tr>
+ <tr>
+ <td>
+ <ulink url="xslt-identity.xproc">xslt-identity.xproc</ulink>
+ </td>
+ <td>Pass an XML fragment through an XSLT identity transformation.</td>
+ </tr>
+ <tr>
+ <td>
+ <ulink url="twitter.xproc">twitter.xproc</ulink>
+ </td>
+ <td>Retrieve a feed from twitter in Atom format and display it.</td>
+ </tr>
+ </tbody>
+ </table>
+ </section>
+</article>
Deleted: branches/shabanovd/xslt/webapp/xproc/hello.xproc
===================================================================
--- trunk/eXist/webapp/xproc/hello.xproc 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/webapp/xproc/hello.xproc 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<p:pipeline xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:p="http://www.w3.org/ns/xproc" name="pipeline"><p:identity><p:input port="source" primary="yes"><p:inline><p>Hello world!</p></p:inline></p:input></p:identity></p:pipeline>
\ No newline at end of file
Copied: branches/shabanovd/xslt/webapp/xproc/hello.xproc (from rev 9064, trunk/eXist/webapp/xproc/hello.xproc)
===================================================================
--- branches/shabanovd/xslt/webapp/xproc/hello.xproc (rev 0)
+++ branches/shabanovd/xslt/webapp/xproc/hello.xproc 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<p:pipeline xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:p="http://www.w3.org/ns/xproc" name="pipeline"><p:identity><p:input port="source" primary="yes"><p:inline><p>Hello world!</p></p:inline></p:input></p:identity></p:pipeline>
\ No newline at end of file
Deleted: branches/shabanovd/xslt/webapp/xproc/run.xql
===================================================================
--- trunk/eXist/webapp/xproc/run.xql 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/webapp/xproc/run.xql 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,14 +0,0 @@
-xquery version "1.0";
-
-import module namespace request = "http://exist-db.org/xquery/request";
-import module namespace const = "http://xproc.net/xproc/const";
-import module namespace xproc = "http://xproc.net/xproc";
-import module namespace u = "http://xproc.net/xproc/util";
-
-declare option exist:serialize "method=xhtml media-type=html";
-
-let $pipeline := request:get-parameter("xproc", ())
-let $stdin := request:get-parameter("stdin", ())
-let $indoc := if ($stdin) then doc($stdin) else ()
-return
- xproc:run(doc($pipeline), $indoc, "0")
\ No newline at end of file
Copied: branches/shabanovd/xslt/webapp/xproc/run.xql (from rev 9064, trunk/eXist/webapp/xproc/run.xql)
===================================================================
--- branches/shabanovd/xslt/webapp/xproc/run.xql (rev 0)
+++ branches/shabanovd/xslt/webapp/xproc/run.xql 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,14 @@
+xquery version "1.0";
+
+import module namespace request = "http://exist-db.org/xquery/request";
+import module namespace const = "http://xproc.net/xproc/const";
+import module namespace xproc = "http://xproc.net/xproc";
+import module namespace u = "http://xproc.net/xproc/util";
+
+declare option exist:serialize "method=xhtml media-type=html";
+
+let $pipeline := request:get-parameter("xproc", ())
+let $stdin := request:get-parameter("stdin", ())
+let $indoc := if ($stdin) then doc($stdin) else ()
+return
+ xproc:run(doc($pipeline), $indoc, "0")
\ No newline at end of file
Deleted: branches/shabanovd/xslt/webapp/xproc/sidebar.xml
===================================================================
--- trunk/eXist/webapp/xproc/sidebar.xml 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/webapp/xproc/sidebar.xml 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<sidebar title="Navigation" xmlns="" rel="nofollow">http://exist-db.org/NS/sidebar">
- <search href="../search.xql"/>
- <toolbar>
- <link href="../index.xml">Home</link>
- <link href="../download.xml">Download</link>
- <link href="http://atomic.exist-db.org">Wiki</link>
- <link href="../examples.xml">Demo</link>
- </toolbar>
-
- <group name="About Us">
- <item>
- <link href="../credits.xml">Who we are</link>
- </item>
- <item>
- <link href="../acknowledge.xml">Acknowledgements</link>
- </item>
- </group>
- <group name="Documentation">
- <item>
- <link href="../quickstart.xml">Quick Start</link>
- </item>
- <item>
- <link href="../xquery/functions.xql">Function Library</link>
- </item>
- <item>
- <link href="../extensions.xml">Extension Modules</link>
- </item>
- <item>
- <link href="../documentation.xml">Main Documentation</link>
- </item>
- <item>
- <link href="../facts.xml">Feature Sheet</link>
- </item>
- <item>
- <link href="XQuery" rel="nofollow">http://en.wikibooks.org/wiki/XQuery">XQuery Wikibook</link>
- </item>
- </group>
- <group name="Examples">
- <item>
- <link href="../sandbox/sandbox.xql">XQuery Sandbox</link>
- </item>
- <item>
- <link href="../xquery/acronyms.xql">XML Acronyms</link>
- </item>
- <item>
- <link href="../cocoon/biblio.xq">Bibliographic</link>
- </item>
- <item>
- <link href="../examples.xml">All Examples</link>
- </item>
- </group>
- <group name="Community">
- <item>
- <link href="../index.xml#mailing">Mailing List/IRC</link>
- </item>
- <item>
- <link href="applications.xml">Powered By eXist</link>
- </item>
- <!--item>
- <link href="" rel="nofollow">http://wiki.exist-db.org/space/ThirdPartyTools">
- Third Party Tools
- </link>
- </item-->
- </group>
- <group name="Development">
- <item>
- <link href="../roadmap.xml">Roadmap</link>
- </item>
- <item>
- <link href="../api/index.html">Javadocs</link>
- </item>
- <item>
- <link href="ChangeLog" rel="nofollow">http://demo.exist-db.org/exist/xquery/svnlog.xql">ChangeLog</link>
- </item>
- <item>
- <link href="Bug" rel="nofollow">http://sourceforge.net/tracker/?group_id=17691&atid=117691">Bug
- Tracker</link>
- </item>
- <item>
- <link href="Subversion" rel="nofollow">http://sourceforge.net/svn/?group_id=17691">Subversion</link>
- </item>
- <item>
- <link
- href="http://sourceforge.net/tracker/?atid=317691&group_id=17691&func=browse"
- >Submit Patches</link>
- </item>
- </group>
- <group name="Administration">
- <item>
- <link href="../admin/admin.xql">Admin</link>
- </item>
- <item>
- <link href="../cocoon/status">Server Status</link>
- </item>
- <item>
- <link href="../webstart/exist.jnlp">Webstart Client</link>
- </item>
- <item>
- <link href="../webstart/exist.jnlp">
- <img src="../resources/webstart.small.jpg" border="0"/>
- </link>
- </item>
- </group>
-
- <banner>
- <link href="http://exist-db.org">
- <img alt="powered by eXist" border="0" src="resources/powered.gif"/>
- </link>
- </banner>
-
- <banner name="" empty="true">
- <link href="" rel="nofollow">http://sourceforge.net/projects/exist">
- <img src="http://sourceforge.net/sflogo.php?group_id=17691&type=4" width="125"
- height="37" border="0" alt="SourceForge Logo"/>
- </link>
- </banner>
-
- <banner>
- <link href="http://www.java.net">
- <img src="resources/javanet_button_90.gif" border="0" alt="java.net Member Button"/>
- </link>
- </banner>
-
- <reference>
- <link href="" rel="nofollow">http://www.izforge.com/izpack/">
- <img src="resources/izpack-88x31.png" border="0" alt="IzPack Installer Generator"/>
- </link>
- </reference>
-</sidebar>
Copied: branches/shabanovd/xslt/webapp/xproc/sidebar.xml (from rev 9064, trunk/eXist/webapp/xproc/sidebar.xml)
===================================================================
--- branches/shabanovd/xslt/webapp/xproc/sidebar.xml (rev 0)
+++ branches/shabanovd/xslt/webapp/xproc/sidebar.xml 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<sidebar title="Navigation" xmlns="" rel="nofollow">http://exist-db.org/NS/sidebar">
+ <search href="../search.xql"/>
+ <toolbar>
+ <link href="../index.xml">Home</link>
+ <link href="../download.xml">Download</link>
+ <link href="http://atomic.exist-db.org">Wiki</link>
+ <link href="../examples.xml">Demo</link>
+ </toolbar>
+
+ <group name="About Us">
+ <item>
+ <link href="../credits.xml">Who we are</link>
+ </item>
+ <item>
+ <link href="../acknowledge.xml">Acknowledgements</link>
+ </item>
+ </group>
+ <group name="Documentation">
+ <item>
+ <link href="../quickstart.xml">Quick Start</link>
+ </item>
+ <item>
+ <link href="../xquery/functions.xql">Function Library</link>
+ </item>
+ <item>
+ <link href="../extensions.xml">Extension Modules</link>
+ </item>
+ <item>
+ <link href="../documentation.xml">Main Documentation</link>
+ </item>
+ <item>
+ <link href="../facts.xml">Feature Sheet</link>
+ </item>
+ <item>
+ <link href="XQuery" rel="nofollow">http://en.wikibooks.org/wiki/XQuery">XQuery Wikibook</link>
+ </item>
+ </group>
+ <group name="Examples">
+ <item>
+ <link href="../sandbox/sandbox.xql">XQuery Sandbox</link>
+ </item>
+ <item>
+ <link href="../xquery/acronyms.xql">XML Acronyms</link>
+ </item>
+ <item>
+ <link href="../cocoon/biblio.xq">Bibliographic</link>
+ </item>
+ <item>
+ <link href="../examples.xml">All Examples</link>
+ </item>
+ </group>
+ <group name="Community">
+ <item>
+ <link href="../index.xml#mailing">Mailing List/IRC</link>
+ </item>
+ <item>
+ <link href="applications.xml">Powered By eXist</link>
+ </item>
+ <!--item>
+ <link href="" rel="nofollow">http://wiki.exist-db.org/space/ThirdPartyTools">
+ Third Party Tools
+ </link>
+ </item-->
+ </group>
+ <group name="Development">
+ <item>
+ <link href="../roadmap.xml">Roadmap</link>
+ </item>
+ <item>
+ <link href="../api/index.html">Javadocs</link>
+ </item>
+ <item>
+ <link href="ChangeLog" rel="nofollow">http://demo.exist-db.org/exist/xquery/svnlog.xql">ChangeLog</link>
+ </item>
+ <item>
+ <link href="Bug" rel="nofollow">http://sourceforge.net/tracker/?group_id=17691&atid=117691">Bug
+ Tracker</link>
+ </item>
+ <item>
+ <link href="Subversion" rel="nofollow">http://sourceforge.net/svn/?group_id=17691">Subversion</link>
+ </item>
+ <item>
+ <link
+ href="http://sourceforge.net/tracker/?atid=317691&group_id=17691&func=browse"
+ >Submit Patches</link>
+ </item>
+ </group>
+ <group name="Administration">
+ <item>
+ <link href="../admin/admin.xql">Admin</link>
+ </item>
+ <item>
+ <link href="../cocoon/status">Server Status</link>
+ </item>
+ <item>
+ <link href="../webstart/exist.jnlp">Webstart Client</link>
+ </item>
+ <item>
+ <link href="../webstart/exist.jnlp">
+ <img src="../resources/webstart.small.jpg" border="0"/>
+ </link>
+ </item>
+ </group>
+
+ <banner>
+ <link href="http://exist-db.org">
+ <img alt="powered by eXist" border="0" src="resources/powered.gif"/>
+ </link>
+ </banner>
+
+ <banner name="" empty="true">
+ <link href="" rel="nofollow">http://sourceforge.net/projects/exist">
+ <img src="http://sourceforge.net/sflogo.php?group_id=17691&type=4" width="125"
+ height="37" border="0" alt="SourceForge Logo"/>
+ </link>
+ </banner>
+
+ <banner>
+ <link href="http://www.java.net">
+ <img src="resources/javanet_button_90.gif" border="0" alt="java.net Member Button"/>
+ </link>
+ </banner>
+
+ <reference>
+ <link href="" rel="nofollow">http://www.izforge.com/izpack/">
+ <img src="resources/izpack-88x31.png" border="0" alt="IzPack Installer Generator"/>
+ </link>
+ </reference>
+</sidebar>
Deleted: branches/shabanovd/xslt/webapp/xproc/twitter-view.xql
===================================================================
--- trunk/eXist/webapp/xproc/twitter-view.xql 2009-05-23 12:17:08 UTC (rev 9064)
+++ branches/shabanovd/xslt/webapp/xproc/twitter-view.xql 2009-05-23 16:31:25 UTC (rev 9069)
@@ -1,103 +0,0 @@
-xquery version "1.0";
-
-(: This is the view part of the twitter client app. twitter.xql forwards
- the twitter timeline in the request attribute "twitter.feed". :)
-
-declare namespace tc="http://exist-db.org/xquery/twitter-client";
-declare namespace atom="http://www.w3.org/2005/Atom";
-declare namespace html="http://www.w3.org/1999/xhtml";
-
-(: Parse the twitter message string. This function will recognize user names, links
- and tags. :)
-declare function tc:parse-content($content as xs:string) {
- let $filtered_text := $content
- let $filtered_text := replace($filtered_text,"(http://[A-z0-9/\.?=&\-_%]+)",'<a href="$1" class="url" target="new">$1</a>')
- let $filtered_text := replace($filtered_text,"@([A-z0-9/\.\-_]+)", '<a href="http://twitter.com/$1" class="username">@$1</a>')
- let $filtered_text := replace($filtered_text,"&#([x0-9]+);","entity:$1")
- let $filtered_text := replace($filtered_text,"(&)","$1amp;")
- let $filtered_text := replace($filtered_text,"#([A-z0-9/\-_]+)", '<a href="#$1')" rel="nofollow">http://search.twitter.com/search?q=%23$1">#$1</a>')
- let $filtered_text := replace($filtered_text,"\[\[entity:([x0-9]+)\]\]","&#$1;")
- let $filtered_text := concat("<span xmlns='http://www.w3.org/1999/xhtml' class='tw-body'>", $filtered_text, "</span>")
- return util:parse($filtered_text)
-};
-
-(: Format an atom entry :)
-declare function tc:print-entry($entry as element(atom:entry)) {
- let $currentDate := adjust-date-to-timezone(current-date(), xs:dayTimeDuration("PT0H"))
- let $date := xs:dateTime($entry/atom:published)
- let $dateLine :=
- if (xs:date($date) eq $currentDate) then
- xs:time($date)
- else
- $date
- return
- <li xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
- <span class="tw-thumb">
- <img src="{$entry/atom:link[@rel = 'image']/@href}" height="48" width="48"/>
- </span>
- <span class="tw-content">
- {tc:parse-content($entry/atom:content/node())}
- <span class="tw-date">{$dateLine}</span>
- </span>
- </li>
-};
-
-(: scan a set of HTML option elements and select the one whose value matches
- the $select argument :)
-declare function tc:set-options($select as xs:string, $options as element(html:option)+) {
- for $opt in $options
- return
- element { node-name($opt) } {
- if ($opt/@value eq $select) then
- attribute selected { "true" }
- else
- (),
- $opt/@*, $opt/node()
- }
-};
-
-(: twitter.xql passes the timeline feed in request attribute "twitter.feed" :)
-let $feed := (.//atom:feed)
-return
- <html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
- <head>
- <style type="text/css">
- body {{ margin: 0; font-family: "Bitstream Vera Sans", sans-serif; }}
- #container {{ margin: 20px auto; width: 620px; }}
- p {{ font-size: smaller; }}
- ul {{ list-style: none; padding: 0;}}
- .twitter li {{ position: relative; padding: 10px 0; }}
- .tw-thumb {{ height: 50px; display: block;
- position: absolute; left: 0; overflow: hidden;
- }}
- .tw-content {{ display: block; min-height: 50px; margin-left: 65px;
- line-height: 1.25em;
- }}
- .tw-body {{ display: block; }}
- .tw-date {{ display: block; font-size: small; color: #C0C0C0; padding-top: 4px;
- font-family: "Georgia", serif;
- }}
- .username {{ font-weight: bold; }}
- a {{ text-decoration: none; }}
- </style>
- </head>
- <body>
- <div id="container">
- <p>To view the friends timeline, edit twitter.xql and set variable
- $tc:login to a valid twitter user/password.</p>
- <ul class="twitter">
- {
- if ($feed) then
- if ($feed instance of xs:string) then
- <li>Twitter reported an error: {$feed}</li>
- else
- for $entry in $feed/atom:entry
- order by xs:dateTime($entry/atom:published) descending
- return
- tc:print-entry($entry)
- else ()
- }
- </ul>
- </div>
- </body>
- </html>
\ No newline at end of file
Copied: branches/shabanovd/xslt/webapp/xproc/twitter-view.xql (from rev 9064, trunk/eXist/webapp/xproc/twitter-view.xql)
===================================================================
--- branches/shabanovd/xslt/webapp/xproc/twitter-view.xql (rev 0)
+++ branches/shabanovd/xslt/webapp/xproc/twitter-view.xql 2009-05-23 16:31:25 UTC (rev 9069)
@@ -0,0 +1,103 @@
+xquery version "1.0";
+
+(: This is the view part of the twitter client app. twitter.xql forwards
+ the twitter timeline in the request attribute "twitter.feed". :)
+
+declare namespace tc="http://exist-db.org/xquery/twitter-client";
+declare namespace atom="http://www.w3.org/2005/Atom";
+declare namespace html="http://www.w3.org/1999/xhtml";
+
+(: Parse the twitter message string. This function will recognize user names, links
+ and tags. :)
+declare function tc:parse-content($content as xs:string) {
+ let $filtered_text := $content
+ let $filtered_text := replace($filtered_text,"(http://[A-z0-9/\.?=&\-_%]+)",'<a href="$1" class="url" target="new">$1</a>')
+ let $filtered_text := replace($filtered_text,"@([A-z0-9/\.\-_]+)", '<a href="http://twitter.com/$1" class="username">@$1</a>')
+ let $filtered_text := replace($filtered_text,"&#([x0-9]+);","entity:$1")
+ let $filtered_text := replace($filtered_text,"(&)","$1amp;")
+ let $filtered_text := replace($filtered_text,"#([A-z0-9/\-_]+)", '<a href="#$1')" rel="nofollow">http://search.twitter.com/search?q=%23$1">#$1</a>')
+ let $filtered_text := replace($filtered_text,"\[\[entity:([x0-9]+)\]\]","&#$1;")
+ let $filtered_text := concat("<span xmlns='http://www.w3.org/1999/xhtml' class='tw-body'>", $filtered_text, "</span>")
+ return util:parse($filtered_text)
+};
+
+(: Format an atom entry :)
+declare function tc:print-entry($entry as element(atom:entry)) {
+ let $currentDate := adjust-date-to-timezone(current-date(), xs:dayTimeDuration("PT0H"))
+ let $date := xs:dateTime($entry/atom:published)
+ let $dateLine :=
+ if (xs:date($date) eq $currentDate) then
+ xs:time($date)
+ else
+ $date
+ return
+ <li xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ <span class="tw-thumb">
+ <img src="{$entry/atom:link[@rel = 'image']/@href}" height="48" width="48"/>
+ </span>
+ <span class="tw-content">
+ {tc:parse-content($entry/atom:content/node())}
+ <span class="tw-date">{$dateLine}</span>
+ </span>
+ </li>
+};
+
+(: scan a set of HTML option elements and select the one whose value matches
+ the $select argument :)
+declare function tc:set-options($select as xs:string, $options as element(html:option)+) {
+ for $opt in $options
+ return
+ element { node-name($opt) } {
+ if ($opt/@value eq $select) then
+ attribute selected { "true" }
+ else
+ (),
+ $opt/@*, $opt/node()
+ }
+};
+
+(: twitter.xql passes the timeline feed in request attribute "twitter.feed" :)
+let $feed := (.//atom:feed)
+return
+ <html xmlns="" rel="nofollow">http://www.w3.org/1999/xhtml">
+ ...
[truncated message content] |
|
From: <sha...@us...> - 2009-05-23 16:28:39
|
Revision: 9068
http://exist.svn.sourceforge.net/exist/?rev=9068&view=rev
Author: shabanovd
Date: 2009-05-23 16:28:37 +0000 (Sat, 23 May 2009)
Log Message:
-----------
[ignore] merge trunk
Modified Paths:
--------------
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/metadata/MetadataFunction.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/GetScheduledJobs.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/ScheduleFunctions.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/simpleql/ParseSimpleQL.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/ExecuteFunction.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetConnectionFunction.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetJNDIConnectionFunction.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/svn/SVNLog.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xmldiff/Compare.java
branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xslfo/RenderFunction.java
branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/DiffFunction.java
branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/PatchFunction.java
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/metadata/MetadataFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/metadata/MetadataFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/metadata/MetadataFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -63,7 +63,7 @@
//must be a context to act on
if(contextSequence == null)
{
- throw new XPathException(getASTNode(), "FONC0001: undefined context item");
+ throw new XPathException(this, "FONC0001: undefined context item");
}
//iterate through the source documents
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/GetScheduledJobs.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/GetScheduledJobs.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/GetScheduledJobs.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -173,7 +173,7 @@
}
catch(SAXException se)
{
- throw(new XPathException(getASTNode(), se));
+ throw(new XPathException(this, se.getMessage(), se));
}
}
}
\ No newline at end of file
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/ScheduleFunctions.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/ScheduleFunctions.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/scheduler/ScheduleFunctions.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -317,7 +317,7 @@
String name = elem.getAttribute("name");
String value = elem.getAttribute("value");
if(name == null || value == null)
- throw new XPathException(getASTNode(), "Name or value attribute missing for stylesheet parameter");
+ throw new XPathException(this, "Name or value attribute missing for stylesheet parameter");
properties.setProperty(name, value);
}
child = child.getNextSibling();
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/simpleql/ParseSimpleQL.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/simpleql/ParseSimpleQL.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/simpleql/ParseSimpleQL.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -62,9 +62,9 @@
try {
return new StringValue(parser.expr());
} catch (RecognitionException e) {
- throw new XPathException(getASTNode(), "An error occurred while parsing the query expression: " + e.getMessage(), e);
+ throw new XPathException(this, "An error occurred while parsing the query expression: " + e.getMessage(), e);
} catch (TokenStreamException e) {
- throw new XPathException(getASTNode(), "An error occurred while parsing the query expression: " + e.getMessage(), e);
+ throw new XPathException(this, "An error occurred while parsing the query expression: " + e.getMessage(), e);
}
}
}
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/ExecuteFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/ExecuteFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/ExecuteFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -273,18 +273,14 @@
builder.characters(escapeXmlText(sql));
builder.endElement();
- XQueryAST astNode = getASTNode();
- if(astNode != null)
- {
- int line = astNode.getLine();
- int column = astNode.getColumn();
+ int line = getLine();
+ int column = getColumn();
builder.startElement(new QName("xquery", SQLModule.NAMESPACE_URI, SQLModule.PREFIX), null);
builder.addAttribute(new QName("line", null, null), String.valueOf(line));
builder.addAttribute(new QName("column", null, null), String.valueOf(column));
builder.endElement();
- }
-
+
builder.endElement();
builder.endDocument();
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetConnectionFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetConnectionFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetConnectionFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -160,27 +160,27 @@
LOG.error(
"sql:get-connection() Illegal Access to database driver class: "
+ dbDriver, iae);
- throw new XPathException(getASTNode(),
+ throw new XPathException(this,
"sql:get-connection() Illegal Access to database driver class: "
+ dbDriver, iae);
} catch (ClassNotFoundException cnfe) {
LOG.error(
"sql:get-connection() Cannot find database driver class: "
+ dbDriver, cnfe);
- throw new XPathException(getASTNode(),
+ throw new XPathException(this,
"sql:get-connection() Cannot find database driver class: "
+ dbDriver, cnfe);
} catch (InstantiationException ie) {
LOG.error(
"sql:get-connection() Cannot instantiate database driver class: "
+ dbDriver, ie);
- throw new XPathException(getASTNode(),
+ throw new XPathException(this,
"sql:get-connection() Cannot instantiate database driver class: "
+ dbDriver, ie);
} catch (SQLException sqle) {
LOG.error("sql:get-connection() Cannot connect to database: "
+ dbURL, sqle);
- throw new XPathException(getASTNode(),
+ throw new XPathException(this,
"sql:get-connection() Cannot connect to database: " + dbURL,
sqle);
}
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetJNDIConnectionFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetJNDIConnectionFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/sql/GetJNDIConnectionFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -129,7 +129,7 @@
// store the connection and return the uid handle of the connection
return new IntegerValue(SQLModule.storeConnection(context, con));
} catch (Exception e) {
- throw new XPathException(getASTNode(), e.getMessage());
+ throw new XPathException(this, e.getMessage());
}
}
}
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/svn/SVNLog.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/svn/SVNLog.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/svn/SVNLog.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -104,7 +104,7 @@
builder.endElement();
return builder.getDocument().getNode(nodeNr);
} catch (SVNException e) {
- throw new XPathException(getASTNode(), e.getMessage(), e);
+ throw new XPathException(this, e.getMessage(), e);
}
}
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xmldiff/Compare.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xmldiff/Compare.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xmldiff/Compare.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -114,7 +114,7 @@
}
result = new BooleanValue(identical);
} catch (Exception e) {
- throw new XPathException(getASTNode(), "An exception occurred while serializing node " +
+ throw new XPathException(this, "An exception occurred while serializing node " +
"for comparison: " + e.getMessage(), e);
}
Modified: branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xslfo/RenderFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xslfo/RenderFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/modules/src/org/exist/xquery/modules/xslfo/RenderFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -181,9 +181,9 @@
// return the result
return new Base64Binary(baos.toByteArray());
} catch (TransformerException te) {
- throw new XPathException(getASTNode(), te);
+ throw new XPathException(this, te.getMessageAndLocation(), te);
} catch (SAXException se) {
- throw new XPathException(getASTNode(), se);
+ throw new XPathException(this, se.getMessage(), se);
}
}
Modified: branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/DiffFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/DiffFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/DiffFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -70,7 +70,7 @@
NodeValue nv2 = (NodeValue) args[1].itemAt(0);
if (nv1.getImplementationType() != NodeValue.PERSISTENT_NODE ||
nv2.getImplementationType() != NodeValue.PERSISTENT_NODE)
- throw new XPathException(getASTNode(), "diff function only works on persistent documents stored in the db");
+ throw new XPathException(this, "diff function only works on persistent documents stored in the db");
DocumentImpl doc1 = ((NodeProxy)nv1).getDocument();
DocumentImpl doc2 = ((NodeProxy)nv2).getDocument();
@@ -94,9 +94,9 @@
builder.endElement();
return builder.getDocument().getNode(nodeNr);
} catch (SAXException e) {
- throw new XPathException(getASTNode(), "Caugt error while generating diff: " + e.getMessage(), e);
+ throw new XPathException(this, "Caugt error while generating diff: " + e.getMessage(), e);
} catch (DiffException e) {
- throw new XPathException(getASTNode(), "Caugt error while generating diff: " + e.getMessage(), e);
+ throw new XPathException(this, "Caugt error while generating diff: " + e.getMessage(), e);
} finally {
context.popDocumentContext();
}
Modified: branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/PatchFunction.java
===================================================================
--- branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/PatchFunction.java 2009-05-23 16:27:19 UTC (rev 9067)
+++ branches/shabanovd/xslt/extensions/versioning/src/org/exist/versioning/xquery/PatchFunction.java 2009-05-23 16:28:37 UTC (rev 9068)
@@ -107,11 +107,11 @@
NodeValue result = (NodeValue) builder.getDocument().getDocumentElement();
return result == null ? Sequence.EMPTY_SEQUENCE : result;
} catch (IOException e) {
- throw new XPathException(getASTNode(), e.getMessage(), e);
+ throw new XPathException(this, e.getMessage(), e);
} catch (XMLStreamException e) {
- throw new XPathException(getASTNode(), e.getMessage(), e);
+ throw new XPathException(this, e.getMessage(), e);
} catch (DiffException e) {
- throw new XPathException(getASTNode(), e.getMessage(), e);
+ throw new XPathException(this, e.getMessage(), e);
} finally {
context.popDocumentContext();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sha...@us...> - 2009-05-23 11:35:38
|
Revision: 9063
http://exist.svn.sourceforge.net/exist/?rev=9063&view=rev
Author: shabanovd
Date: 2009-05-23 11:35:31 +0000 (Sat, 23 May 2009)
Log Message:
-----------
[ignore] merge trunk
Modified Paths:
--------------
branches/shabanovd/xslt/src/org/exist/storage/BrokerPool.java
branches/shabanovd/xslt/src/org/exist/storage/ConsistencyCheckTask.java
branches/shabanovd/xslt/src/org/exist/storage/Indexable.java
branches/shabanovd/xslt/src/org/exist/storage/NativeBroker.java
branches/shabanovd/xslt/src/org/exist/storage/ValueIndexFactory.java
branches/shabanovd/xslt/src/org/exist/storage/XQueryPool.java
branches/shabanovd/xslt/src/org/exist/xquery/EnclosedExpr.java
branches/shabanovd/xslt/src/org/exist/xquery/XQueryContext.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/AsUser.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetIndexStatistics.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningJobs.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningXQueries.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetScheduledJobs.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/KillRunningXQuery.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Restore.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Shutdown.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/SystemModule.java
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/TriggerSystemTask.java
Added Paths:
-----------
branches/shabanovd/xslt/src/org/exist/xquery/functions/system/FunctionTrace.java
Property Changed:
----------------
branches/shabanovd/xslt/src/org/exist/storage/ConsistencyCheckTask.java
Modified: branches/shabanovd/xslt/src/org/exist/storage/BrokerPool.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/storage/BrokerPool.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/storage/BrokerPool.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -23,6 +23,8 @@
import org.apache.log4j.Logger;
import org.exist.EXistException;
+import org.exist.xquery.Profiler;
+import org.exist.xquery.PerformanceStats;
import org.exist.collections.Collection;
import org.exist.collections.CollectionCache;
import org.exist.collections.CollectionConfigurationManager;
@@ -484,6 +486,12 @@
private ProcessMonitor processMonitor;
/**
+ * Global performance stats to gather function execution statistics
+ * from all queries running on this database instance.
+ */
+ private PerformanceStats xqueryStats;
+
+ /**
* The global manager for accessing collection configuration files from the database instance.
*/
private CollectionConfigurationManager collectionConfigurationManager = null;
@@ -707,6 +715,8 @@
xQueryPool = new XQueryPool(conf);
//REFACTOR : construct then... configure
processMonitor = new ProcessMonitor();
+ xqueryStats = new PerformanceStats(this);
+
//REFACTOR : construct then... configure
xmlReaderPool = new XMLReaderPool(conf, new XMLReaderObjectFactory(this), 5, 0);
//REFACTOR : construct then... configure
@@ -1145,8 +1155,18 @@
*/
public ProcessMonitor getProcessMonitor() {
return processMonitor;
- }
-
+ }
+
+ /**
+ * Returns the global profiler used to gather execution statistics
+ * from all XQueries running on this db instance.
+ *
+ * @return the profiler
+ */
+ public PerformanceStats getPerformanceStats() {
+ return xqueryStats;
+ }
+
/**
* Returns a pool in which the database instance's readers are stored.
*
Modified: branches/shabanovd/xslt/src/org/exist/storage/ConsistencyCheckTask.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/storage/ConsistencyCheckTask.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/storage/ConsistencyCheckTask.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -51,8 +51,18 @@
private boolean incrementalCheck = false;
private int maxInc = -1;
+ private File lastExportedBackup = null;
+
+ public final static String OUTPUT_PROP_NAME = "output";
+ public final static String BACKUP_PROP_NAME = "backup";
+ public final static String INCREMENTAL_PROP_NAME = "incremental";
+ public final static String INCREMENTAL_CHECK_PROP_NAME = "incremental-check";
+ public final static String MAX_PROP_NAME = "max";
+
+
+
public void configure(Configuration config, Properties properties) throws EXistException {
- exportDir = properties.getProperty("output", "export");
+ exportDir = properties.getProperty(OUTPUT_PROP_NAME, "export");
File dir = new File(exportDir);
if (!dir.isAbsolute())
dir = new File((String)config.getProperty(BrokerPool.PROPERTY_DATA_DIR), exportDir);
@@ -62,13 +72,13 @@
if (LOG.isDebugEnabled())
LOG.debug("Using output directory " + exportDir);
- String backup = properties.getProperty("backup", "no");
+ String backup = properties.getProperty(BACKUP_PROP_NAME, "no");
createBackup = backup.equalsIgnoreCase("YES");
- String inc = properties.getProperty("incremental", "yes");
+ String inc = properties.getProperty(INCREMENTAL_PROP_NAME, "yes");
incremental = inc.equalsIgnoreCase("YES");
- String incCheck = properties.getProperty("incremental-check", "no");
+ String incCheck = properties.getProperty(INCREMENTAL_CHECK_PROP_NAME, "no");
incrementalCheck = incCheck.equalsIgnoreCase("YES");
- String max = properties.getProperty("max", "-1");
+ String max = properties.getProperty(MAX_PROP_NAME, "-1");
try {
maxInc = Integer.parseInt(max);
} catch (NumberFormatException e) {
@@ -112,9 +122,9 @@
if (LOG.isDebugEnabled())
LOG.debug("Starting backup...");
SystemExport sysexport = new SystemExport(broker, null, false);
- File exportFile = sysexport.export(exportDir, incremental, maxInc, true, errors);
+ lastExportedBackup = sysexport.export(exportDir, incremental, maxInc, true, errors);
if (LOG.isDebugEnabled())
- LOG.debug("Created backup to file: " + exportFile.getAbsolutePath());
+ LOG.debug("Created backup to file: " + lastExportedBackup.getAbsolutePath());
}
} finally {
if (report != null)
@@ -122,6 +132,14 @@
}
}
+ /**
+ * Gets the last exported backup
+ */
+ public File getLastExportedBackup()
+ {
+ return lastExportedBackup;
+ }
+
private boolean fatalErrorsFound(List errors) {
for (int i = 0; i < errors.size(); i++) {
ErrorReport error = (ErrorReport) errors.get(i);
Property changes on: branches/shabanovd/xslt/src/org/exist/storage/ConsistencyCheckTask.java
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/adam/t2/src/org/exist/storage/ConsistencyCheckTask.java:8802-9013
Modified: branches/shabanovd/xslt/src/org/exist/storage/Indexable.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/storage/Indexable.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/storage/Indexable.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -48,7 +48,7 @@
/**
* Serialize the value plus collection and possibly element information
* to an array of bytes.
- * @deprecated use following function instead; this API should be local
+ * @ deprecated use following function instead; this API should be local
* to value index class like {@link NativeValueIndex}
*
* The returned byte array has the following format:
@@ -68,7 +68,7 @@
*
* (offset-1 free bytes, byte type, byte[] value)
*
- * @deprecated use following function instead; this API should be local
+ * @ deprecated use following function instead; this API should be local
* to value index class like {@link NativeValueIndex}
* @param offset starting index for writing in array data
* @return the size actually writen in the array argument
Modified: branches/shabanovd/xslt/src/org/exist/storage/NativeBroker.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/storage/NativeBroker.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/storage/NativeBroker.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -625,10 +625,7 @@
}
LOG.debug("Creating collection '" + path + "'...");
sub = new Collection(path);
- sub.getPermissions().setOwner(getUser());
- sub.getPermissions().setGroup(getUser().getPrimaryGroup());
sub.setId(getNextCollectionId(transaction));
- sub.setCreationTime(System.currentTimeMillis());
if (transaction != null)
transaction.acquireLock(sub.getLock(), Lock.WRITE_LOCK);
//TODO : acquire lock manually if transaction is null ?
Modified: branches/shabanovd/xslt/src/org/exist/storage/ValueIndexFactory.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/storage/ValueIndexFactory.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/storage/ValueIndexFactory.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -167,7 +167,7 @@
*/
/**
- * @deprecated
+ * @ deprecated
* @param value
* @param collectionId
* @param caseSensitive
Modified: branches/shabanovd/xslt/src/org/exist/storage/XQueryPool.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/storage/XQueryPool.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/storage/XQueryPool.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -116,7 +116,7 @@
}
public void returnCompiledXQuery(Source source, CompiledXQuery xquery) {
- returnModules(xquery.getContext(), null);
+// returnModules(xquery.getContext(), null);
returnObject(source, xquery);
}
@@ -125,6 +125,7 @@
Module module = (Module) it.next();
if (module != self && !module.isInternalModule()) {
ExternalModule extModule = (ExternalModule) module;
+// ((ModuleContext)extModule.getContext()).setParentContext(null);
// Don't return recursively, since all modules are listed in the top-level context
returnObject(extModule.getSource(), extModule);
}
@@ -179,24 +180,25 @@
// it might become invalid if an imported module has changed.
XQueryContext context = query.getContext();
context.setBroker(broker);
- if (!borrowModules(broker, context)) {
- // the compiled query is no longer valid: one of the imported
- // modules may have changed
- remove(source);
- return null;
- } else {
- if (query instanceof PathExpr) try {
- // This is necessary because eXist performs whole-expression analysis, so a function
- // can only be analyzed as part of the expression it's called from. It might be better
- // to make module functions more stand-alone, so they only need to be analyzed
- // once.
- context.analyzeAndOptimizeIfModulesChanged((PathExpr) query);
- } catch (XPathException e) {
- remove(source);
- return null;
- }
- return query;
- }
+ return query;
+// if (!borrowModules(broker, context)) {
+// // the compiled query is no longer valid: one of the imported
+// // modules may have changed
+// remove(source);
+// return null;
+// } else {
+// if (query instanceof PathExpr) try {
+// // This is necessary because eXist performs whole-expression analysis, so a function
+// // can only be analyzed as part of the expression it's called from. It might be better
+// // to make module functions more stand-alone, so they only need to be analyzed
+// // once.
+// context.analyzeAndOptimizeIfModulesChanged((PathExpr) query);
+// } catch (XPathException e) {
+// remove(source);
+// return null;
+// }
+// return query;
+// }
}
private synchronized boolean borrowModules(DBBroker broker, XQueryContext context) {
@@ -246,7 +248,7 @@
if (module == null) return null;
XQueryContext context = module.getContext();
context.setBroker(broker);
- if (!module.moduleIsValid()) {
+ if (!module.moduleIsValid(broker)) {
LOG.debug("Module with URI " + module.getNamespaceURI() +
" has changed and needs to be reloaded");
remove(source);
@@ -257,6 +259,11 @@
return null;
}
((ModuleContext) module.getContext()).updateModuleRefs(rootContext);
+ try {
+ module.analyzeGlobalVars();
+ } catch (XPathException e) {
+ LOG.warn(e.getMessage(), e);
+ }
return module;
}
}
Modified: branches/shabanovd/xslt/src/org/exist/xquery/EnclosedExpr.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/EnclosedExpr.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/EnclosedExpr.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -100,7 +100,7 @@
buf.setLength(0);
}
if (next.getType() == Type.ATTRIBUTE && !allowAttribs)
- throw new XPathException(getASTNode(), "XQTY0024: An attribute may not appear after " +
+ throw new XPathException(this, "XQTY0024: An attribute may not appear after " +
"another child node.");
next.copyTo(context.getBroker(), receiver);
allowAttribs = next.getType() == Type.ATTRIBUTE;
@@ -112,7 +112,7 @@
receiver.characters(buf);
} catch (SAXException e) {
LOG.warn("SAXException during serialization: " + e.getMessage(), e);
- throw new XPathException(getASTNode(), e.getMessage());
+ throw new XPathException(this, e.getMessage());
//throw new XPathException(getASTNode(),
// "Encountered SAX exception while serializing enclosed expression: "
// + ExpressionDumper.dump(this));
Modified: branches/shabanovd/xslt/src/org/exist/xquery/XQueryContext.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/XQueryContext.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/XQueryContext.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -34,7 +34,6 @@
import org.exist.collections.triggers.DocumentTrigger;
import org.exist.collections.triggers.Trigger;
import org.exist.collections.triggers.TriggerStatePerThread;
-import org.exist.debuggee.Debuggee;
import org.exist.dom.BinaryDocument;
import org.exist.dom.DefaultDocumentSet;
import org.exist.dom.DocumentImpl;
@@ -2818,8 +2817,4 @@
}
}
-
- public Debuggee getDebuggee() {
- return null;
- }
}
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/AsUser.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/AsUser.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/AsUser.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -36,13 +36,13 @@
Sequence userSeq = getArgument(0).eval(contextSequence, contextItem);
Sequence passwdSeq = getArgument(1).eval(contextSequence, contextItem);
if (userSeq.isEmpty())
- throw new XPathException(getASTNode(), "No user specified");
+ throw new XPathException(this, "No user specified");
String userName = userSeq.getStringValue();
String passwd = passwdSeq.getStringValue();
org.exist.security.SecurityManager security = context.getBroker().getBrokerPool().getSecurityManager();
User user = security.getUser(userName);
if (user == null)
- throw new XPathException(getASTNode(), "Authentication failed");
+ throw new XPathException(this, "Authentication failed");
if (user.validate(passwd)) {
User oldUser = context.getBroker().getUser();
try {
@@ -52,7 +52,7 @@
context.getBroker().setUser(oldUser);
}
} else
- throw new XPathException(getASTNode(), "Authentication failed");
+ throw new XPathException(this, "Authentication failed");
}
/* (non-Javadoc)
Copied: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/FunctionTrace.java (from rev 9062, trunk/eXist/src/org/exist/xquery/functions/system/FunctionTrace.java)
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/FunctionTrace.java (rev 0)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/FunctionTrace.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -0,0 +1,86 @@
+/*
+ * eXist Open Source Native XML Database
+ * Copyright (C) 2001-07 The eXist Project
+ * http://exist-db.org
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * \$Id\$
+ */
+
+package org.exist.xquery.functions.system;
+
+import org.exist.xquery.*;
+import org.exist.xquery.value.*;
+import org.exist.dom.QName;
+import org.exist.memtree.MemTreeBuilder;
+import org.exist.storage.BrokerPool;
+
+public class FunctionTrace extends BasicFunction {
+
+ public final static FunctionSignature signatures[] = {
+ new FunctionSignature(
+ new QName( "trace", SystemModule.NAMESPACE_URI, SystemModule.PREFIX ),
+ "Returns function call statistics gathered by the trace log.",
+ null,
+ new SequenceType(Type.NODE, Cardinality.EXACTLY_ONE)
+ ),
+ new FunctionSignature(
+ new QName( "enable-tracing", SystemModule.NAMESPACE_URI, SystemModule.PREFIX ),
+ "Enable function tracing on the database instance.",
+ new SequenceType[] { new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE) },
+ new SequenceType(Type.ITEM, Cardinality.EMPTY)
+ ),
+ new FunctionSignature(
+ new QName( "tracing-enabled", SystemModule.NAMESPACE_URI, SystemModule.PREFIX ),
+ "Returns true if function tracing is currently enabled on the database instance.",
+ null,
+ new SequenceType(Type.BOOLEAN, Cardinality.EXACTLY_ONE)
+ ),
+ new FunctionSignature(
+ new QName( "clear-trace", SystemModule.NAMESPACE_URI, SystemModule.PREFIX ),
+ "Clear the global trace log.",
+ null,
+ new SequenceType(Type.ITEM, Cardinality.EMPTY)
+ )
+ };
+
+ public FunctionTrace(XQueryContext context, FunctionSignature signature) {
+ super(context, signature);
+ }
+
+ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
+ if (isCalledAs("clear-trace")) {
+ context.getBroker().getBrokerPool().getPerformanceStats().clear();
+
+ } else if (isCalledAs("enable-tracing")) {
+ boolean enable = args[0].effectiveBooleanValue();
+ context.getBroker().getBrokerPool().getPerformanceStats().setEnabled(enable);
+
+ } else if (isCalledAs("tracing-enabled")) {
+ return BooleanValue.valueOf(context.getBroker().getBrokerPool().getPerformanceStats().isEnabled());
+
+ } else {
+ MemTreeBuilder builder = context.getDocumentBuilder();
+
+ builder.startDocument();
+ BrokerPool brokerPool = context.getBroker().getBrokerPool();
+ brokerPool.getPerformanceStats().toXML(builder);
+ builder.endDocument();
+ return (NodeValue)builder.getDocument().getDocumentElement();
+ }
+ return Sequence.EMPTY_SEQUENCE;
+ }
+}
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetIndexStatistics.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetIndexStatistics.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetIndexStatistics.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -36,7 +36,7 @@
index.toSAX(adapter);
adapter.endDocument();
} catch (SAXException e) {
- throw new XPathException(getASTNode(), "Error caught while retrieving statistics: " + e.getMessage(), e);
+ throw new XPathException(this, "Error caught while retrieving statistics: " + e.getMessage(), e);
}
DocumentImpl doc = (DocumentImpl) adapter.getDocument();
return (NodeImpl) doc.getFirstChild();
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningJobs.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningJobs.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningJobs.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -36,7 +36,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
if( !context.getUser().hasDbaRole() ) {
- throw( new XPathException( getASTNode(), "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of running xqueries" ) );
+ throw( new XPathException( this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of running xqueries" ) );
}
MemTreeBuilder builder = context.getDocumentBuilder();
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningXQueries.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningXQueries.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetRunningXQueries.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -66,7 +66,7 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
if( !context.getUser().hasDbaRole() ) {
- throw( new XPathException( getASTNode(), "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of running xqueries" ) );
+ throw( new XPathException( this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of running xqueries" ) );
}
return( getRunningXQueries() );
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetScheduledJobs.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetScheduledJobs.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/GetScheduledJobs.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -39,7 +39,7 @@
public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException {
if( !context.getUser().hasDbaRole() ) {
- throw( new XPathException( getASTNode(), "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of scheduled jobs" ) );
+ throw( new XPathException( this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to get the list of scheduled jobs" ) );
}
MemTreeBuilder builder = context.getDocumentBuilder();
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/KillRunningXQuery.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/KillRunningXQuery.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/KillRunningXQuery.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -82,7 +82,7 @@
public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
{
if( !context.getUser().hasDbaRole() ) {
- throw( new XPathException( getASTNode(), "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to kill a running xquery" ) );
+ throw( new XPathException( this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to kill a running xquery" ) );
}
killXQuery( args );
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Restore.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Restore.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Restore.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -78,7 +78,7 @@
restore.setListener(new XMLRestoreListener(builder));
restore.restore(false, null);
} catch (Exception e) {
- throw new XPathException(getASTNode(), "restore failed with exception: " + e.getMessage(), e);
+ throw new XPathException(this, "restore failed with exception: " + e.getMessage(), e);
}
builder.endElement();
builder.endDocument();
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Shutdown.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Shutdown.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/Shutdown.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -103,7 +103,7 @@
}
else
{
- throw new XPathException(getASTNode(), "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to shutdown the database");
+ throw new XPathException(this, "Permission denied, calling user '" + context.getUser().getName() + "' must be a DBA to shutdown the database");
}
return Sequence.EMPTY_SEQUENCE;
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/SystemModule.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/SystemModule.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/SystemModule.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -56,7 +56,11 @@
new FunctionDef(KillRunningXQuery.signatures[1], KillRunningXQuery.class),
new FunctionDef(GetRunningJobs.signature, GetRunningJobs.class),
new FunctionDef(GetScheduledJobs.signature, GetScheduledJobs.class),
- new FunctionDef(Restore.signature, Restore.class)
+ new FunctionDef(Restore.signature, Restore.class),
+ new FunctionDef(FunctionTrace.signatures[0], FunctionTrace.class),
+ new FunctionDef(FunctionTrace.signatures[1], FunctionTrace.class),
+ new FunctionDef(FunctionTrace.signatures[2], FunctionTrace.class),
+ new FunctionDef(FunctionTrace.signatures[3], FunctionTrace.class)
};
public SystemModule() {
Modified: branches/shabanovd/xslt/src/org/exist/xquery/functions/system/TriggerSystemTask.java
===================================================================
--- branches/shabanovd/xslt/src/org/exist/xquery/functions/system/TriggerSystemTask.java 2009-05-23 05:19:12 UTC (rev 9062)
+++ branches/shabanovd/xslt/src/org/exist/xquery/functions/system/TriggerSystemTask.java 2009-05-23 11:35:31 UTC (rev 9063)
@@ -50,21 +50,21 @@
Class clazz = Class.forName(className);
SystemTask task = (SystemTask) clazz.newInstance();
if (!(task instanceof SystemTask))
- throw new XPathException(getASTNode(), className + " is not an instance of org.exist.storage.SystemTask");
+ throw new XPathException(this, className + " is not an instance of org.exist.storage.SystemTask");
task.configure(context.getBroker().getConfiguration(), properties);
LOG.info("Triggering SystemTask: " + className);
context.getBroker().getBrokerPool().triggerSystemTask(task);
}
catch (ClassNotFoundException e) {
- throw new XPathException(getASTNode(), "system task class '" + className + "' not found");
+ throw new XPathException(this, "system task class '" + className + "' not found");
}
catch (InstantiationException e) {
- throw new XPathException(getASTNode(), "system task '" + className + "' can not be instantiated");
+ throw new XPathException(this, "system task '" + className + "' can not be instantiated");
}
catch (IllegalAccessException e) {
- throw new XPathException(getASTNode(), "system task '" + className + "' can not be accessed");
+ throw new XPathException(this, "system task '" + className + "' can not be accessed");
} catch (EXistException e) {
- throw new XPathException(getASTNode(), "system task " + className + " reported an error during initialization: " +
+ throw new XPathException(this, "system task " + className + " reported an error during initialization: " +
e.getMessage(), e);
}
return Sequence.EMPTY_SEQUENCE;
@@ -79,7 +79,7 @@
String name = elem.getAttribute("name");
String value = elem.getAttribute("value");
if(name == null || value == null)
- throw new XPathException(getASTNode(), "Name or value attribute missing for stylesheet parameter");
+ throw new XPathException(this, "Name or value attribute missing for stylesheet parameter");
properties.setProperty(name, value);
}
child = child.getNextSibling();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|