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
(80) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:43
|
Update of /cvsroot/exist/eXist-1.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472 Modified Files: .project Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. Index: .project =================================================================== RCS file: /cvsroot/exist/eXist-1.0/.project,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .project 23 May 2003 14:58:37 -0000 1.2 --- .project 1 Apr 2004 14:12:45 -0000 1.3 *************** *** 7,12 **** <buildSpec> <buildCommand> ! <name>org.antlr.eclipse.core.antlrbuilder</name> <arguments> </arguments> </buildCommand> --- 7,16 ---- <buildSpec> <buildCommand> ! <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> <arguments> + <dictionary> + <key>LaunchConfigHandle</key> + <value>Ant builder.launch</value> + </dictionary> </arguments> </buildCommand> *************** *** 16,19 **** --- 20,28 ---- </arguments> </buildCommand> + <buildCommand> + <name>org.antlr.eclipse.core.antlrbuilder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:43
|
Update of /cvsroot/exist/eXist-1.0/samples/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472/samples/xmlrpc Modified Files: search.pl find.rb Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. Index: find.rb =================================================================== RCS file: /cvsroot/exist/eXist-1.0/samples/xmlrpc/find.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** find.rb 19 Feb 2004 16:24:07 -0000 1.1 --- find.rb 1 Apr 2004 14:12:45 -0000 1.2 *************** *** 6,10 **** # query = <<END ! for \$speech in //SPEECH[LINE &= 'tear*'] order by \$speech/SPEAKER[1] return --- 6,10 ---- # query = <<END ! for \$speech in //SPEECH[LINE &= \$query] order by \$speech/SPEAKER[1] return *************** *** 16,20 **** puts "Query: #{query}" ! outputOptions = { "encoding" => "UTF-8", "indent" => "yes" } begin --- 16,23 ---- puts "Query: #{query}" ! vars = { "query" => "adrian*" } ! outputOptions = { "encoding" => "UTF-8", "indent" => "yes", ! "variables" => vars ! } begin Index: search.pl =================================================================== RCS file: /cvsroot/exist/eXist-1.0/samples/xmlrpc/search.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** search.pl 19 Feb 2004 16:24:07 -0000 1.1 --- search.pl 1 Apr 2004 14:12:45 -0000 1.2 *************** *** 10,14 **** $query = <<END; ! for \$speech in //SPEECH[LINE &= 'corrupt*'] order by \$speech/SPEAKER[1] return --- 10,14 ---- $query = <<END; ! for \$speech in //SPEECH[LINE &= \$query] order by \$speech/SPEAKER[1] return *************** *** 16,19 **** --- 16,28 ---- END + # user-supplied variables + $vars = RPC::XML::struct->new('query' => 'corrupt*'); + # Output options + $options = RPC::XML::struct->new( + 'indent' => 'yes', + 'encoding' => 'UTF-8', + 'variables' => $vars + ); + $URL = "http://guest:guest\@localhost:8080/exist/xmlrpc"; print "connecting to $URL...\n"; *************** *** 24,28 **** $req = RPC::XML::request->new("executeQuery", RPC::XML::base64->new($query), ! "UTF-8"); $resp = process($req); $result_id = $resp->value; --- 33,37 ---- $req = RPC::XML::request->new("executeQuery", RPC::XML::base64->new($query), ! "UTF-8", $options); $resp = process($req); $result_id = $resp->value; *************** *** 34,42 **** print "Found $hits hits.\n"; - # Output options - $options = RPC::XML::struct->new( - 'indent' => 'yes', - 'encoding' => 'UTF-8'); - # Retrieve query results 1 to 10 for($i = 1; $i < 10 && $i < $hits; $i++) { --- 43,46 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:42
|
Update of /cvsroot/exist/eXist-1.0/.externalToolBuilders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23472/.externalToolBuilders Added Files: Ant builder.launch Log Message: Security issues fixed: resources were included in the XQuery context though the user had no permission to read the resource. REST-style interface did not correctly check permissions; /db/system/users.xml could be retrieved by ordinary users. --- NEW FILE: Ant builder.launch --- <?xml version="1.0" encoding="UTF-8"?> <launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType"> <stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/> <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/> <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/> <stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="j2sdk1.4.2"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx128M"/> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/eXist-1.0/build.xml}"/> <stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="/home/wolf/Devel/eXist/eXist-1.0"/> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> </launchConfiguration> |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:24:27
|
Update of /cvsroot/exist/eXist-1.0/.externalToolBuilders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23431/.externalToolBuilders Log Message: Directory /cvsroot/exist/eXist-1.0/.externalToolBuilders added to the repository |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:18:17
|
Update of /cvsroot/exist/eXist-1.0/webapp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22171/webapp Added Files: test.jsp Log Message: added jsp taglib to web.xml --- NEW FILE: test.jsp --- <%@ taglib uri="http://exist-db.org/exist" prefix="e" %> <html> <head> <title>JSP Test</title> </head> <body> <e:collection var="c" uri="xmldb:exist:///db"/> <p>Collection: <%= c.getName() %>.</p> </body> </html> |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:18:17
|
Update of /cvsroot/exist/eXist-1.0/webapp/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22171/webapp/WEB-INF Modified Files: web.xml Added Files: exist.tld Log Message: added jsp taglib to web.xml --- NEW FILE: exist.tld --- <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> <taglib> <tlib-version>1.0</tlib-version> <jsp-version>1.2</jsp-version> <short-name>eXist</short-name> <uri>http://exist-db.org/exist.tld</uri> <tag> <name>collection</name> <tag-class>org.exist.jsp.CollectionTag</tag-class> <tei-class>org.exist.jsp.CollectionTagInfo</tei-class> <attribute> <name>var</name> <required>yes</required> </attribute> <attribute> <name>uri</name> <required>yes</required> </attribute> <attribute> <name>user</name> <required>no</required> </attribute> <attribute> <name>password</name> <required>no</required> </attribute> </tag> </taglib> Index: web.xml =================================================================== RCS file: /cvsroot/exist/eXist-1.0/webapp/WEB-INF/web.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** web.xml 27 Feb 2004 12:36:56 -0000 1.14 --- web.xml 1 Apr 2004 14:06:19 -0000 1.15 *************** *** 488,493 **** <servlet-name>Jasper</servlet-name> <url-pattern>*.jsp</url-pattern> - </servlet-mapping> <!-- Some servlet engines (WebLogic) have defaults which are not overriden --- 488,493 ---- <servlet-name>Jasper</servlet-name> <url-pattern>*.jsp</url-pattern> + </servlet-mapping> <!-- Some servlet engines (WebLogic) have defaults which are not overriden *************** *** 536,543 **** </mime-mapping> ! <!--taglib> <taglib-uri>http://exist-db.org/exist</taglib-uri> <taglib-location>/WEB-INF/exist.tld</taglib-location> ! </taglib--> <!-- Add a security-constraint for the DatabaseAdminServlet: the servlet allows to --- 536,543 ---- </mime-mapping> ! <taglib> <taglib-uri>http://exist-db.org/exist</taglib-uri> <taglib-location>/WEB-INF/exist.tld</taglib-location> ! </taglib> <!-- Add a security-constraint for the DatabaseAdminServlet: the servlet allows to |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:16:44
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/jsp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21704/src/org/exist/jsp Added Files: CollectionTag.java CollectionTagInfo.java Log Message: Added package org.exist.jsp --- NEW FILE: CollectionTagInfo.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-03 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: CollectionTagInfo.java,v 1.1 2004/04/01 14:04:45 wolfgang_m Exp $ */ package org.exist.jsp; import javax.servlet.jsp.tagext.TagData; import javax.servlet.jsp.tagext.TagExtraInfo; import javax.servlet.jsp.tagext.VariableInfo; import org.xmldb.api.base.Collection; /** * @author Wolfgang Meier (wol...@ex...) * */ public final class CollectionTagInfo extends TagExtraInfo { /* (non-Javadoc) * @see javax.servlet.jsp.tagext.TagInfo#getVariableInfo(javax.servlet.jsp.tagext.TagData) */ public VariableInfo[] getVariableInfo(TagData data) { return new VariableInfo[] { new VariableInfo(data.getAttributeString("var"), Collection.class.getName(), true, VariableInfo.AT_END) }; } } --- NEW FILE: CollectionTag.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-03 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: CollectionTag.java,v 1.1 2004/04/01 14:04:45 wolfgang_m Exp $ */ package org.exist.jsp; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import org.xmldb.api.DatabaseManager; import org.xmldb.api.base.Collection; import org.xmldb.api.base.Database; import org.xmldb.api.base.XMLDBException; /** * @author Wolfgang Meier (wol...@ex...) * */ public class CollectionTag extends TagSupport { public final static String DRIVER = "org.exist.xmldb.DatabaseImpl"; private String varName; private String uri; private String user = "guest"; private String password = "guest"; private Collection collection = null; /* (non-Javadoc) * @see javax.servlet.jsp.tagext.TagSupport#doStartTag() */ public int doStartTag() throws JspException { try { Class clazz = Class.forName(DRIVER); Database database = (Database)clazz.newInstance(); DatabaseManager.registerDatabase(database); collection = DatabaseManager.getCollection(uri, user, password); } catch (ClassNotFoundException e) { throw new JspException("Database driver class not found", e); } catch (InstantiationException e) { throw new JspException("Failed to initialize database driver", e); } catch (IllegalAccessException e) { throw new JspException("Failed to initialize database driver", e); } catch (XMLDBException e) { throw new JspException(e.getMessage(), e); } pageContext.setAttribute(varName, collection); return EVAL_BODY_INCLUDE; } /* (non-Javadoc) * @see javax.servlet.jsp.tagext.TagSupport#doEndTag() */ public int doEndTag() throws JspException { return EVAL_PAGE; } public Collection getCollection() { return collection; } public void setVar(String var) { this.varName = var; } public String getVar() { return varName; } /** * @return Returns the password. */ public String getPassword() { return password; } /** * @param password The password to set. */ public void setPassword(String password) { this.password = password; } /** * @return Returns the uri. */ public String getUri() { return uri; } /** * @param uri The uri to set. */ public void setUri(String uri) { this.uri = uri; } /** * @return Returns the user. */ public String getUser() { return user; } /** * @param user The user to set. */ public void setUser(String user) { this.user = user; } } |
From: Wolfgang M. M. <wol...@us...> - 2004-04-01 14:16:11
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/jsp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21572/src/org/exist/jsp Log Message: Directory /cvsroot/exist/eXist-1.0/src/org/exist/jsp added to the repository |
From: Giulio V. <gva...@us...> - 2004-04-01 09:52:04
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv688/src/org/exist/xmlrpc Modified Files: RpcServer.java Log Message: Add COMPRESS_OUTPUT option on xmlrpc:getdocument method. The compression format are gzip. Default no Index: RpcServer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcServer.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** RpcServer.java 30 Mar 2004 16:56:31 -0000 1.31 --- RpcServer.java 1 Apr 2004 09:40:07 -0000 1.32 *************** *** 29,32 **** --- 29,34 ---- import java.util.Stack; import java.util.Vector; + import java.util.zip.*; + import java.io.*; import javax.xml.transform.OutputKeys; *************** *** 304,307 **** --- 306,311 ---- String encoding = "UTF-8"; + String compression ="no"; + if (((String) parametri.get("encoding")) == null) { *************** *** 310,313 **** --- 314,323 ---- encoding = (String) parametri.get("encoding"); } + + + if (((String) parametri.get(EXistOutputKeys.COMPRESS_OUTPUT)) != null) { + compression = (String) parametri.get(EXistOutputKeys.COMPRESS_OUTPUT); + } + RpcConnection con = pool.get(); try { *************** *** 316,322 **** throw new EXistException("document " + name + " not found!"); try { ! return xml.getBytes(encoding); } catch (UnsupportedEncodingException uee) { ! return xml.getBytes(); } } catch (Exception e) { --- 326,345 ---- throw new EXistException("document " + name + " not found!"); try { ! if (compression.equals("no")) { ! return xml.getBytes(encoding); ! } else { ! LOG.debug("getdocument with compression"); ! return compress(xml.getBytes(encoding)); ! } ! } catch (UnsupportedEncodingException uee) { ! ! if (compression.equals("no")) { ! return xml.getBytes(); ! } else { ! LOG.debug("getdocument with compression"); ! return compress(xml.getBytes()); ! } ! } } catch (Exception e) { *************** *** 1369,1371 **** --- 1392,1419 ---- } + private static byte[] compress(byte[] whatToCompress) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ZipOutputStream gzos = new ZipOutputStream(baos); + gzos.setMethod(gzos.DEFLATED); + gzos.putNextEntry(new ZipEntry(whatToCompress.length+"")); + gzos.write(whatToCompress); + gzos.closeEntry(); + gzos.finish(); + gzos.close(); + return baos.toByteArray(); + } + + private static byte[] uncompress(byte[] whatToUncompress) throws IOException { + ByteArrayInputStream bais = new ByteArrayInputStream(whatToUncompress); + ZipInputStream gzis = new ZipInputStream(bais); + ZipEntry zipentry = gzis.getNextEntry(); + int len = Integer.parseInt(zipentry.getName()); + ByteArrayOutputStream baos = new ByteArrayOutputStream(len); + byte[] buf = new byte[512]; + int bread; + while ((bread = gzis.read(buf)) != -1) baos.write(buf, 0, bread); + gzis.closeEntry(); + gzis.close(); + return baos.toByteArray(); + } } |
From: Giulio V. <gva...@us...> - 2004-04-01 09:48:39
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32543/src/org/exist/storage/serializers Modified Files: EXistOutputKeys.java Log Message: Add COMPRESS_OUTPUT option on xmlrpc:getdocument method. The compression format are gzip. Default no Index: EXistOutputKeys.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers/EXistOutputKeys.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** EXistOutputKeys.java 29 Jan 2004 15:06:44 -0000 1.4 --- EXistOutputKeys.java 1 Apr 2004 09:36:42 -0000 1.5 *************** *** 37,39 **** --- 37,41 ---- public final static String STYLESHEET_PARAM = "stylesheet-param"; + public final static String COMPRESS_OUTPUT = "compress-output"; + } |
From: Wolfgang M. M. <wol...@us...> - 2004-03-31 12:33:55
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/analysis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23288/src/org/exist/storage/analysis Modified Files: SimpleTokenizer.java Log Message: Text tokenizer got caught in an endless loop. Index: SimpleTokenizer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/analysis/SimpleTokenizer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SimpleTokenizer.java 2 Oct 2003 12:20:19 -0000 1.6 --- SimpleTokenizer.java 31 Mar 2004 12:22:07 -0000 1.7 *************** *** 43,50 **** char ch = LA(1); int count = 0; ! while (ch != (char) - 1) { if (ch == '\\' && isWildcard(LA(2))) { break; ! } else if (singleCharToken(ch)) { // if this is a single char token and first in the sequence, // consume it --- 43,51 ---- char ch = LA(1); int count = 0; ! while (ch != (char) -1) { if (ch == '\\' && isWildcard(LA(2))) { break; ! } ! if (singleCharToken(ch)) { // if this is a single char token and first in the sequence, // consume it *************** *** 55,59 **** } break; ! } else if (isNonBreakingCharacter(ch) || (allowWildcards && isWildcard(ch))) { token.consumeNext(); consume(); --- 56,60 ---- } break; ! } else if (Character.isLetter(ch) || nonBreakingChar(ch) || (allowWildcards && isWildcard(ch))) { token.consumeNext(); consume(); *************** *** 291,299 **** } - private boolean isNonBreakingCharacter(char ch) { - return Character.isLetter(ch) - && (!singleCharToken(ch)); - } - /** * The code ranges defined here should be interpreted as 1-char --- 292,295 ---- *************** *** 348,365 **** public static void main(String args[]) { ! String t1 = "\u30A8\u31A1\uACFF\u2FAA\u312A\u3045"; String t2 = "é¸å®çè¥ç©¶åºä¸æ³ä»¥é¸ä½éªå¸«åå ¶è¨æ¯ æ¬²è¶ "; String t3 = "문ì ì¬ì© ìì ì¤ë¥ë¥¼ ì°¾ìë´ê¸° ìí´ ê²ì¦ë ì¤êµì´ íì ì¬ê²í íê³ , ë³´ë¤ ì½ê¸° ì½ê² í기 ìí´ ì¸ì´ì ííì ë¤ë¬ëë¤."; ! for(int i = 0; i < t2.length(); i++) { ! char ch = t2.charAt(i); ! System.out.print( ! Integer.toHexString(ch) + ' ' ! ); ! } SimpleTokenizer tokenizer = new SimpleTokenizer(); ! tokenizer.setText(t3); TextToken token = tokenizer.nextToken(true); while(token != null && token.getType() != TextToken.EOF) { ! System.out.println(token.getText()); token = tokenizer.nextToken(true); } --- 344,361 ---- public static void main(String args[]) { ! String t1 = "\u30A8\u30FB\u31A1\uACFF\u2FAA\u312A\u3045"; String t2 = "é¸å®çè¥ç©¶åºä¸æ³ä»¥é¸ä½éªå¸«åå ¶è¨æ¯ æ¬²è¶ "; String t3 = "문ì ì¬ì© ìì ì¤ë¥ë¥¼ ì°¾ìë´ê¸° ìí´ ê²ì¦ë ì¤êµì´ íì ì¬ê²í íê³ , ë³´ë¤ ì½ê¸° ì½ê² í기 ìí´ ì¸ì´ì ííì ë¤ë¬ëë¤."; ! // for(int i = 0; i < t2.length(); i++) { ! // char ch = t2.charAt(i); ! // System.out.print( ! // Integer.toHexString(ch) + ' ' ! // ); ! // } SimpleTokenizer tokenizer = new SimpleTokenizer(); ! tokenizer.setText(t2); TextToken token = tokenizer.nextToken(true); while(token != null && token.getType() != TextToken.EOF) { ! //System.out.println(token.getText()); token = tokenizer.nextToken(true); } |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 17:24:31
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11617/src/org/exist/xquery/functions/text Added Files: TextRank.java Log Message: Added the text ranking example function. This is just an example and not meant for real use. --- NEW FILE: TextRank.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-03 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: TextRank.java,v 1.1 2004/03/30 17:12:52 wolfgang_m Exp $ */ package org.exist.xquery.functions.text; import java.util.Set; import java.util.TreeSet; import org.exist.dom.Match; import org.exist.dom.NodeProxy; import org.exist.dom.QName; import org.exist.xquery.BasicFunction; import org.exist.xquery.Cardinality; import org.exist.xquery.FunctionSignature; import org.exist.xquery.XPathException; import org.exist.xquery.XQueryContext; import org.exist.xquery.value.DoubleValue; import org.exist.xquery.value.NodeValue; import org.exist.xquery.value.Sequence; import org.exist.xquery.value.SequenceType; import org.exist.xquery.value.Type; /** * @author wolf */ public class TextRank extends BasicFunction { public final static FunctionSignature signature = new FunctionSignature( new QName("text-rank", TextModule.NAMESPACE_URI, TextModule.PREFIX), "This is just a skeleton for a possible ranking function. Don't use this.", new SequenceType[]{ new SequenceType(Type.NODE, Cardinality.ZERO_OR_ONE)}, new SequenceType(Type.DOUBLE, Cardinality.EXACTLY_ONE)); public TextRank(XQueryContext context) { super(context, signature); } /* (non-Javadoc) * @see org.exist.xquery.BasicFunction#eval(org.exist.xquery.value.Sequence[], org.exist.xquery.value.Sequence) */ public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException { // return 0.0 if the argument sequence is empty if(args[0].getLength() == 0) return DoubleValue.ZERO; NodeValue val = (NodeValue)args[0].itemAt(0); // Ranking cannot be applied to constructed nodes if(val.getImplementationType() == NodeValue.IN_MEMORY_NODE) return DoubleValue.ZERO; NodeProxy proxy = (NodeProxy)val; // this is a persistent node, so casting is safe Set distinctTerms = new TreeSet(); Match nextMatch = proxy.match; // we just count the number of distinct terms matched while(nextMatch != null) { distinctTerms.add(nextMatch.getMatchingTerm()); nextMatch = nextMatch.getNextMatch(); } return new DoubleValue(distinctTerms.size()); } } |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 17:08:13
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7528/src/org/dbxml/core/filer Modified Files: Paged.java Log Message: It is now possible to pass user declared variables via XMLRPC. Index: Paged.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/Paged.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Paged.java 29 Mar 2004 14:15:13 -0000 1.20 --- Paged.java 30 Mar 2004 16:56:32 -0000 1.21 *************** *** 270,274 **** fileHeader.write(); } catch (IOException ioe) { - ioe.printStackTrace(); } return true; --- 270,273 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 17:08:12
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7528/src/org/exist/xmlrpc Modified Files: RpcServer.java RpcAPI.java RpcConnection.java Log Message: It is now possible to pass user declared variables via XMLRPC. Index: RpcServer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcServer.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** RpcServer.java 8 Mar 2004 11:21:21 -0000 1.30 --- RpcServer.java 30 Mar 2004 16:56:31 -0000 1.31 *************** *** 107,115 **** } ! public int executeQuery(User user, String xpath) throws EXistException, PermissionDeniedException { RpcConnection con = pool.get(); try { ! return con.executeQuery(user, xpath); } catch (Exception e) { handleException(e); --- 107,115 ---- } ! public int executeQuery(User user, String xpath, Hashtable parameters) throws EXistException, PermissionDeniedException { RpcConnection con = pool.get(); try { ! return con.executeQuery(user, xpath, parameters); } catch (Exception e) { handleException(e); *************** *** 123,127 **** User user, byte[] xpath, ! String encoding) throws EXistException, PermissionDeniedException { String xpathString = null; --- 123,128 ---- User user, byte[] xpath, ! String encoding, ! Hashtable parameters) throws EXistException, PermissionDeniedException { String xpathString = null; *************** *** 136,145 **** LOG.debug("query: " + xpathString); ! return executeQuery(user, xpathString); } ! public int executeQuery(User user, byte[] xpath) throws EXistException, PermissionDeniedException { ! return executeQuery(user, xpath, null); } --- 137,146 ---- LOG.debug("query: " + xpathString); ! return executeQuery(user, xpathString, parameters); } ! public int executeQuery(User user, byte[] xpath, Hashtable parameters) throws EXistException, PermissionDeniedException { ! return executeQuery(user, xpath, null, parameters); } Index: RpcAPI.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcAPI.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** RpcAPI.java 8 Mar 2004 11:21:21 -0000 1.24 --- RpcAPI.java 30 Mar 2004 16:56:32 -0000 1.25 *************** *** 40,43 **** --- 40,44 ---- public final static String SORT_EXPR = "sort-expr"; public final static String NAMESPACES = "namespaces"; + public final static String VARIABLES = "variables"; public final static String BASE_URI = "base-uri"; *************** *** 486,495 **** *@exception PermissionDeniedException Description of the Exception */ ! int executeQuery(User user, byte[] xpath, String encoding) throws EXistException, PermissionDeniedException; ! int executeQuery(User user, byte[] xpath) throws EXistException, PermissionDeniedException; ! int executeQuery(User user, String xpath) throws EXistException, PermissionDeniedException; /** --- 487,496 ---- *@exception PermissionDeniedException Description of the Exception */ ! int executeQuery(User user, byte[] xpath, String encoding, Hashtable parameters) throws EXistException, PermissionDeniedException; ! int executeQuery(User user, byte[] xpath, Hashtable parameters) throws EXistException, PermissionDeniedException; ! int executeQuery(User user, String xpath, Hashtable parameters) throws EXistException, PermissionDeniedException; /** Index: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** RpcConnection.java 25 Mar 2004 12:50:51 -0000 1.49 --- RpcConnection.java 30 Mar 2004 16:56:32 -0000 1.50 *************** *** 156,159 **** --- 156,168 ---- context.declareNamespaces(namespaces); } + // declare static variables + Hashtable variableDecls = (Hashtable)parameters.get(RpcAPI.VARIABLES); + if(variableDecls != null) { + for (Iterator i = variableDecls.entrySet().iterator(); i.hasNext();) { + Map.Entry entry = (Map.Entry) i.next(); + LOG.debug("declaring " + entry.getKey().toString() + " = " + entry.getValue()); + context.declareVariable((String) entry.getKey(), entry.getValue()); + } + } LOG.debug("compiling " + xquery); XQueryLexer lexer = new XQueryLexer(new StringReader(xquery)); *************** *** 206,209 **** --- 215,227 ---- context.declareNamespaces(namespaces); } + // declare static variables + Hashtable variableDecls = (Hashtable)parameters.get(RpcAPI.VARIABLES); + if(variableDecls != null) { + for (Iterator i = variableDecls.entrySet().iterator(); i.hasNext();) { + Map.Entry entry = (Map.Entry) i.next(); + LOG.debug("declaring " + entry.getKey().toString() + " = " + entry.getValue()); + context.declareVariable((String) entry.getKey(), entry.getValue()); + } + } // set the current broker object when reusing a compiled query: context.setBroker(broker); *************** *** 216,220 **** } ! public int executeQuery(User user, String xpath) throws Exception { long startTime = System.currentTimeMillis(); LOG.debug("query: " + xpath); --- 234,238 ---- } ! public int executeQuery(User user, String xpath, Hashtable parameters) throws Exception { long startTime = System.currentTimeMillis(); LOG.debug("query: " + xpath); *************** *** 223,227 **** broker = brokerPool.get(user); Sequence resultValue = doQuery(user, broker, xpath, null, null, ! new Hashtable()); QueryResult qr = new QueryResult(resultValue, (System .currentTimeMillis() - startTime)); --- 241,245 ---- broker = brokerPool.get(user); Sequence resultValue = doQuery(user, broker, xpath, null, null, ! parameters); QueryResult qr = new QueryResult(resultValue, (System .currentTimeMillis() - startTime)); *************** *** 1674,1679 **** for (Iterator i = parameters.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); ! properties.setProperty((String) entry.getKey(), (String) entry ! .getValue()); } return properties; --- 1692,1696 ---- for (Iterator i = parameters.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); ! properties.setProperty((String) entry.getKey(), entry.getValue().toString()); } return properties; |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 17:08:11
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmldb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7528/src/org/exist/xmldb Modified Files: RemoteXPathQueryService.java Log Message: It is now possible to pass user declared variables via XMLRPC. Index: RemoteXPathQueryService.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmldb/RemoteXPathQueryService.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** RemoteXPathQueryService.java 25 Mar 2004 13:25:56 -0000 1.14 --- RemoteXPathQueryService.java 30 Mar 2004 16:56:32 -0000 1.15 *************** *** 21,24 **** --- 21,25 ---- protected RemoteCollection collection; protected Hashtable namespaceMappings = new Hashtable(5); + protected Hashtable variableDecls = new Hashtable(); protected Properties outputProperties = null; *************** *** 39,42 **** --- 40,45 ---- if(namespaceMappings.size() > 0) optParams.put(RpcAPI.NAMESPACES, namespaceMappings); + if(variableDecls.size() > 0) + optParams.put(RpcAPI.VARIABLES, variableDecls); optParams.put(RpcAPI.BASE_URI, collection.getPath()); Vector params = new Vector(); *************** *** 66,70 **** try { Hashtable optParams = new Hashtable(); ! optParams.put(RpcAPI.NAMESPACES, namespaceMappings); if(sortExpr != null) optParams.put(RpcAPI.SORT_EXPR, sortExpr); --- 69,76 ---- try { Hashtable optParams = new Hashtable(); ! if(namespaceMappings.size() > 0) ! optParams.put(RpcAPI.NAMESPACES, namespaceMappings); ! if(variableDecls.size() > 0) ! optParams.put(RpcAPI.VARIABLES, variableDecls); if(sortExpr != null) optParams.put(RpcAPI.SORT_EXPR, sortExpr); *************** *** 135,141 **** */ public void declareVariable(String qname, Object initialValue) throws XMLDBException { ! // TODO Not implemented ! //throw new XMLDBException(ErrorCodes.NOT_IMPLEMENTED, ! // "method not implemented"); } --- 141,145 ---- */ public void declareVariable(String qname, Object initialValue) throws XMLDBException { ! variableDecls.put(qname, initialValue); } |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 17:08:11
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7528/src/org/exist/xquery/functions/text Modified Files: TextModule.java Log Message: It is now possible to pass user declared variables via XMLRPC. Index: TextModule.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xquery/functions/text/TextModule.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TextModule.java 1 Mar 2004 13:20:35 -0000 1.1 --- TextModule.java 30 Mar 2004 16:56:31 -0000 1.2 *************** *** 39,43 **** new FunctionDef(FuzzyMatchAll.signature, FuzzyMatchAll.class), new FunctionDef(FuzzyMatchAny.signature, FuzzyMatchAny.class), ! new FunctionDef(FuzzyIndexTerms.signature, FuzzyIndexTerms.class) }; --- 39,44 ---- new FunctionDef(FuzzyMatchAll.signature, FuzzyMatchAll.class), new FunctionDef(FuzzyMatchAny.signature, FuzzyMatchAny.class), ! new FunctionDef(FuzzyIndexTerms.signature, FuzzyIndexTerms.class), ! new FunctionDef(TextRank.signature, TextRank.class) }; |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 17:08:10
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7528/src/org/exist/storage/serializers Modified Files: Serializer.java Log Message: It is now possible to pass user declared variables via XMLRPC. Index: Serializer.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/serializers/Serializer.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Serializer.java 25 Feb 2004 15:31:57 -0000 1.20 --- Serializer.java 30 Mar 2004 16:56:31 -0000 1.21 *************** *** 170,174 **** for (Iterator i = properties.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); ! setProperty((String)entry.getKey(), (String)entry.getValue()); } } --- 170,174 ---- for (Iterator i = properties.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); ! setProperty((String)entry.getKey(), entry.getValue().toString()); } } *************** *** 180,184 **** for(Iterator i = table.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); ! setProperty((String)entry.getKey(), (String)entry.getValue()); } } --- 180,184 ---- for(Iterator i = table.entrySet().iterator(); i.hasNext(); ) { Map.Entry entry = (Map.Entry) i.next(); ! setProperty((String)entry.getKey(), entry.getValue().toString()); } } |
From: Wolfgang M. M. <wol...@us...> - 2004-03-30 10:48:02
|
Update of /cvsroot/exist/exist_php In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30166 Modified Files: exist_class.php Log Message: Updated for eXist-1.0beta1 Index: exist_class.php =================================================================== RCS file: /cvsroot/exist/exist_php/exist_class.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** exist_class.php 9 Aug 2002 08:01:43 -0000 1.1.1.1 --- exist_class.php 30 Mar 2004 10:36:24 -0000 1.2 *************** *** 1,125 **** ! <?php ! // ############################################################################################################### ! // Title : exist_class.php ! // Version : 0.5 ! // Author : Andrew Jenks (aje...@ya...) ! // Last modification date : 07-08-2002 ! // Description : This class allows you to use an eXist native database from PHP using the XML-RPC API. ! // License : This code is released as is GNU General Public License (GPL) ! // ############################################################################################################### ! // History: ! // 07-08-2002 (first rev. to get the functionality that I need) ! // This class is an inspiration based on the same class written by Luis Argerich for the Xindice xml ! // native database. ! // ############################################################################################################### ! // Function Info: ! //function-->getCollectionDesc(); ! //returns a hashtable that has three fields: "name", "collections", "documents". "name" is the collection's //name,"documents" contains an array listing the names of all documents contained in this collection, //"collections"is an array listing the names of available sub-collections in this collection. ! // ! // function--> queryCollection(); ! //Execute the XPath query and return a reference to the generated result set. This method may later be used to ! //retrieve results or get a result-summary. ! // ! // function--> getSummary(); ! //Get a summary of query results for the result-set referenced by resultId. Returns a struct with the following ! //fields: "queryTime", "hits", "documents", "doctype". ! //"queryTime" and "hits" are integers, describing the time in milliseconds consumed by query execution and the ! //number of hits in the result-set. Field "documents" is an array of array (Object[][3]), representing a table ! //where every row identifies one document. The first field in each row contains the document-id as integer. The ! //second has the document's name as string. The third contains the number of hits found in this document (int). ! //The "doctype" field is an array of array (Object[][2]) in each row containing the doctype's public identifier ! //and the number of hits found for this doctype. ! // ! // function--> queryCollectionXML(); ! //Execute XPath query and return results. This method will directly return a part of the result-set, starting at ! //start, as a new XML document. The number of results returned is determined by parameter howmany. The ! //result-set will be deleted on the server, so later calls to this method will again execute the query. ! // ################################################################################################################ ! // How to use it: ! // To make a query to the database and return XML; ! // $xmlstring=$xi->queryCollectionXML("document(*)//HEADER[AUTHOR&='GEORGE']","ISO-8859-1",10,1,1); ! // ! // $xh = xslt_create(); ! // ! // $args = array ( '/_xml' => $xmlstring ); ! // $params = array ( 'somevariable' => 'somecontent' ); ! // ! // $result = xslt_process($xh, 'arg:/_xml', 'your_transform_file.xsl', NULL, $args, $params); ! // ! // echo $result; ! // ! // xslt_free($xh); ! // ################################################################################################################ ! ! include_once("xmlrpc/xmlrpc.inc"); ! ! class eXist { ! var $client; ! var $error; ! ! function getError() { ! return $this->error; ! } ! ! function setXmlRpcDebug($debug) { ! $this->client->setDebug($debug); ! } ! ! function eXist($server_host,$server_port) { ! $this->client=new xmlrpc_client("/",$server_host,$server_port); ! } ! ! // General collection functions ! ! function getCollectionDesc($collection) { ! $method="getCollectionDesc"; ! $msg=new xmlrpcmsg($method,array(new xmlrpcval($collection,"string"))); ! return $this->sendMsg($msg); ! } ! ! // Query functions ! ! function queryCollection($query) { ! $method="executeQuery"; ! $msg=new xmlrpcmsg($method,array(new xmlrpcval($query,"string"))); ! return $this->sendMsg($msg); ! } ! ! ! function getSummary($queryint) { ! $method="querySummary"; ! $msg=new xmlrpcmsg($method, array(new xmlrpcval($queryint,"int"))); ! return $this->sendMsg($msg); ! } ! ! function queryCollectionXML($xpath, $encoding, $howmany, $start, $prettyPrint ) { ! $method="query"; ! $msg=new xmlrpcmsg($method, array(new xmlrpcval($xpath,"string"),new xmlrpcval($encoding,"string"), new xmlrpcval($howmany,"int"), new xmlrpcval($start,"int"), new xmlrpcval($prettyPrint, "int"))); ! return $this->sendMsg($msg); ! } ! ! ! // PRIVATE METHODS ! function getBase($collection) { ! $paths=split('/',$collection); ! return $paths[0]; ! } ! ! function sendMsg($msg) { ! $result=$this->client->send($msg); ! if(!$result) { ! $this->error='Cannot send xmlrpc message to the server'; ! return 0; ! } ! if($result->faultCode()) { ! $this->error=$result->faultString(); ! return 0; ! } ! $ret=xmlrpc_decode($result->value()); ! return $ret; ! } ! ! ! } ! ! ?> \ No newline at end of file --- 1,129 ---- ! <?php ! // ############################################################################################################### ! // Title : exist_class.php ! // Version : 0.6 ! // Author : Andrew Jenks (aje...@ya...) ! // Last modification date : 03-30-2004 ! // Description : This class allows you to use an eXist native database from PHP using the XML-RPC API. ! // License : This code is released as is GNU General Public License (GPL) ! // $Id$ ! // ############################################################################################################### ! // History: ! // 07-08-2002 (first rev. to get the functionality that I need) ! // This class is an inspiration based on the same class written by Luis Argerich for the Xindice xml ! // native database. ! // ############################################################################################################### ! // Function Info: ! //function-->getCollectionDesc(); ! //returns a hashtable that has three fields: "name", "collections", "documents". "name" is the collection's //name,"documents" contains an array listing the names of all documents contained in this collection, //"collections"is an array listing the names of available sub-collections in this collection. ! // ! // function--> queryCollection(); ! //Execute the XPath query and return a reference to the generated result set. This method may later be used to ! //retrieve results or get a result-summary. ! // ! // function--> getSummary(); ! //Get a summary of query results for the result-set referenced by resultId. Returns a struct with the following ! //fields: "queryTime", "hits", "documents", "doctype". ! //"queryTime" and "hits" are integers, describing the time in milliseconds consumed by query execution and the ! //number of hits in the result-set. Field "documents" is an array of array (Object[][3]), representing a table ! //where every row identifies one document. The first field in each row contains the document-id as integer. The ! //second has the document's name as string. The third contains the number of hits found in this document (int). ! //The "doctype" field is an array of array (Object[][2]) in each row containing the doctype's public identifier ! //and the number of hits found for this doctype. ! // ! // function--> queryCollectionXML(); ! //Execute XPath query and return results. This method will directly return a part of the result-set, starting at ! //start, as a new XML document. The number of results returned is determined by parameter howmany. The ! //result-set will be deleted on the server, so later calls to this method will again execute the query. ! // ################################################################################################################ ! // How to use it: ! // To make a query to the database and return XML; ! // $xmlstring=$xi->queryCollectionXML("document(*)//HEADER[AUTHOR&='GEORGE']","ISO-8859-1",10,1,1); ! // ! // $xh = xslt_create(); ! // ! // $args = array ( '/_xml' => $xmlstring ); ! // $params = array ( 'somevariable' => 'somecontent' ); ! // ! // $result = xslt_process($xh, 'arg:/_xml', 'your_transform_file.xsl', NULL, $args, $params); ! // ! // echo $result; ! // ! // xslt_free($xh); ! // ################################################################################################################ ! ! include_once("/usr/local/xmlrpc-1.0.99.2/xmlrpc.inc"); ! ! class eXist { ! var $client; ! var $error; ! ! function getError() { ! return $this->error; ! } ! ! function setXmlRpcDebug($debug) { ! $this->client->setDebug($debug); ! } ! ! function eXist($server_host,$server_port) { ! $this->client=new xmlrpc_client("/",$server_host,$server_port); ! } ! ! // General collection functions ! ! function getCollectionDesc($collection) { ! $method="getCollectionDesc"; ! $msg=new xmlrpcmsg($method,array(new xmlrpcval($collection,"string"))); ! return $this->sendMsg($msg); ! } ! ! // Query functions ! ! function queryCollection($query) { ! $method="executeQuery"; ! $msg=new xmlrpcmsg($method,array(new xmlrpcval($query,"string"))); ! return $this->sendMsg($msg); ! } ! ! ! function getSummary($queryint) { ! $method="querySummary"; ! $msg=new xmlrpcmsg($method, array(new xmlrpcval($queryint,"int"))); ! return $this->sendMsg($msg); ! } ! ! function queryCollectionXML($xpath, $encoding, $howmany, $start) { //method signature changed , $prettyPrint ) { ! $method="query"; ! // a fake hash for now ! $myStruct=new xmlrpcval(array("geek" => new xmlrpcval("hacker","arashb")), "struct"); ! ! $msg=new xmlrpcmsg($method, array(new xmlrpcval($xpath,"string"),/*new xmlrpcval($encoding,"string"),*/ new xmlrpcval($howmany,"int"), new xmlrpcval($start,"int"), $myStruct)); ! return $this->sendMsg($msg); ! } ! ! ! // PRIVATE METHODS ! function getBase($collection) { ! $paths=split('/',$collection); ! return $paths[0]; ! } ! ! function sendMsg($msg) { ! $result=$this->client->send($msg); ! if(!$result) { ! $this->error='Cannot send xmlrpc message to the server'; ! return 0; ! } ! if($result->faultCode()) { ! $this->error=$result->faultString(); ! return 0; ! } ! $ret=xmlrpc_decode($result->value()); ! return $ret; ! } ! ! ! } ! ! ?> |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:27:16
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage/cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/src/org/exist/storage/cache Modified Files: ClockCache.java GClockCache.java Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. Index: GClockCache.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/cache/GClockCache.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GClockCache.java 29 Jan 2004 15:06:45 -0000 1.8 --- GClockCache.java 29 Mar 2004 14:15:12 -0000 1.9 *************** *** 48,52 **** protected int hits = 0, fails = 0; ! protected long syncPeriod = 30000; protected long lastSync = System.currentTimeMillis(); --- 48,52 ---- protected int hits = 0, fails = 0; ! protected long syncPeriod = 20000; protected long lastSync = System.currentTimeMillis(); *************** *** 55,59 **** this.items = new Cacheable[size]; this.map = new Long2ObjectHashMap(size); - //this.map = new Long2ObjectOpenHashMap(size); } --- 55,58 ---- Index: ClockCache.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/cache/ClockCache.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ClockCache.java 2 Feb 2004 15:30:35 -0000 1.10 --- ClockCache.java 29 Mar 2004 14:15:12 -0000 1.11 *************** *** 46,50 **** private long lastSync = System.currentTimeMillis(); ! private long syncPeriod = 15000; public ClockCache(int size) { --- 46,50 ---- private long lastSync = System.currentTimeMillis(); ! private long syncPeriod = 30000; public ClockCache(int size) { |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:27:16
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/src/org/exist/collections Modified Files: Collection.java Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. Index: Collection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/collections/Collection.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Collection.java 3 Feb 2004 09:10:11 -0000 1.18 --- Collection.java 29 Mar 2004 14:15:11 -0000 1.19 *************** *** 65,69 **** import org.exist.util.VariableByteInputStream; import org.exist.util.VariableByteOutputStream; ! import org.exist.util.hashtable.Object2LongHashMap; import org.w3c.dom.Node; import org.xml.sax.EntityResolver; --- 65,69 ---- import org.exist.util.VariableByteInputStream; import org.exist.util.VariableByteOutputStream; ! import org.exist.util.hashtable.ObjectHashSet; import org.w3c.dom.Node; import org.xml.sax.EntityResolver; *************** *** 108,112 **** // stores child-collections with their storage address ! private Object2LongHashMap subcollections = new Object2LongHashMap(19); // temporary field for the storage address --- 108,112 ---- // stores child-collections with their storage address ! private ObjectHashSet subcollections = new ObjectHashSet(19); // temporary field for the storage address *************** *** 142,147 **** final int p = child.name.lastIndexOf('/') + 1; final String childName = child.name.substring(p); ! if (!subcollections.containsKey(childName)) ! subcollections.put(childName, child.address); } --- 142,147 ---- final int p = child.name.lastIndexOf('/') + 1; final String childName = child.name.substring(p); ! if (!subcollections.contains(childName)) ! subcollections.add(childName); } *************** *** 155,159 **** final String childName = child.name.substring(p); subcollections.remove(childName); ! subcollections.put(childName, child.address); } --- 155,159 ---- final String childName = child.name.substring(p); subcollections.remove(childName); ! subcollections.add(childName); } *************** *** 247,256 **** for (Iterator i = subcollections.iterator(); i.hasNext(); ) { childName = (String) i.next(); ! addr = subcollections.get(childName); ! if (addr < 0) ! child = broker.getCollection(name + '/' + childName); ! else ! child = broker.getCollection(name + '/' + childName, addr); ! if (permissions.validate(broker.getUser(), Permission.READ)) { child.getDocuments(docs); if (child.getChildCollectionCount() > 0) --- 247,254 ---- for (Iterator i = subcollections.iterator(); i.hasNext(); ) { childName = (String) i.next(); ! child = broker.getCollection(name + '/' + childName); ! if(child == null) { ! LOG.warn("child collection " + childName + " not found. Skipping ..."); ! } else if (permissions.validate(broker.getUser(), Permission.READ)) { child.getDocuments(docs); if (child.getChildCollectionCount() > 0) *************** *** 444,451 **** try { lock.acquire(Lock.READ_LOCK); ! return subcollections.containsKey(name); } catch (LockException e) { LOG.warn(e.getMessage(), e); ! return subcollections.containsKey(name); } finally { lock.release(); --- 442,449 ---- try { lock.acquire(Lock.READ_LOCK); ! return subcollections.contains(name); } catch (LockException e) { LOG.warn(e.getMessage(), e); ! return subcollections.contains(name); } finally { lock.release(); *************** *** 474,480 **** final int collLen = istream.readInt(); String sub; ! subcollections = new Object2LongHashMap(collLen); for (int i = 0; i < collLen; i++) ! subcollections.put(istream.readUTF(), istream.readLong()); final SecurityManager secman = broker.getBrokerPool() --- 472,478 ---- final int collLen = istream.readInt(); String sub; ! subcollections = new ObjectHashSet(collLen); for (int i = 0; i < collLen; i++) ! subcollections.add(istream.readUTF()); final SecurityManager secman = broker.getBrokerPool() *************** *** 1230,1234 **** childColl = (String) i.next(); ostream.writeUTF(childColl); - ostream.writeLong(subcollections.get(childColl)); } org.exist.security.SecurityManager secman = broker.getBrokerPool() --- 1228,1231 ---- *************** *** 1283,1286 **** --- 1280,1287 ---- } + public long getAddress() { + return this.address; + } + public void setCreationTime(long ms) { created = ms; |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:26:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/storage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/src/org/exist/storage Modified Files: NativeBroker.java Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. Index: NativeBroker.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/storage/NativeBroker.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** NativeBroker.java 25 Mar 2004 12:50:50 -0000 1.60 --- NativeBroker.java 29 Mar 2004 14:15:14 -0000 1.61 *************** *** 243,249 **** user = new User("admin", null, "dba"); getOrCreateCollection(ROOT_COLLECTION); ! } catch (Exception e) { ! LOG.debug(e); ! e.printStackTrace(); } } --- 243,252 ---- user = new User("admin", null, "dba"); getOrCreateCollection(ROOT_COLLECTION); ! } catch (DBException e) { ! LOG.debug("failed to initialize database: " + e.getMessage(), e); ! throw new EXistException(e); ! } catch (PermissionDeniedException e) { ! LOG.debug("failed to initialize database: " + e.getMessage(), e); ! throw new EXistException(e); } } *************** *** 1679,1687 **** } collection.setAddress(address); ! if (!name.equals(ROOT_COLLECTION)) { ! Collection parent = collection.getParent(this); ! parent.update(collection); ! saveCollection(parent); ! } ostream.close(); } catch (IOException ioe) { --- 1682,1690 ---- } collection.setAddress(address); ! // if (!name.equals(ROOT_COLLECTION)) { ! // Collection parent = collection.getParent(this); ! // parent.update(collection); ! // saveCollection(parent); ! // } ostream.close(); } catch (IOException ioe) { *************** *** 1724,1732 **** } collection.setAddress(addr); ! if (!name.equals(ROOT_COLLECTION)) { ! Collection parent = collection.getParent(this); ! parent.update(collection); ! saveCollection(parent); ! } collectionsDb.getCollectionCache().add(collection); ostream.close(); --- 1727,1735 ---- } collection.setAddress(addr); ! // if (!name.equals(ROOT_COLLECTION)) { ! // Collection parent = collection.getParent(this); ! // parent.update(collection); ! // saveCollection(parent); ! // } collectionsDb.getCollectionCache().add(collection); ostream.close(); |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:26:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/util/hashtable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/src/org/exist/util/hashtable Added Files: ObjectHashSet.java Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. --- NEW FILE: ObjectHashSet.java --- /* * eXist Open Source Native XML Database * Copyright (C) 2001-03 Wolfgang M. Meier * wol...@ex... * http://exist.sourceforge.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * $Id: ObjectHashSet.java,v 1.1 2004/03/29 14:15:13 wolfgang_m Exp $ */ package org.exist.util.hashtable; import java.util.Iterator; /** * A hash set on objects. Objects are compared for equality by * calling Object.equals(). * * @author Wolfgang Meier (wol...@ex...) */ public class ObjectHashSet extends AbstractHashtable { protected Object[] keys; /** * */ public ObjectHashSet() { super(); keys = new Object[tabSize]; } /** * @param iSize */ public ObjectHashSet(int iSize) { super(iSize); keys = new Object[tabSize]; } public void add(Object key) { try { insert(key); } catch (HashtableOverflowException e) { Object[] copyKeys = keys; // enlarge the table with a prime value tabSize = (int) nextPrime(tabSize + tabSize / 2); keys = new Object[tabSize]; items = 0; for (int k = 0; k < copyKeys.length; k++) { if (copyKeys[k] != null && copyKeys[k] != REMOVED) add(copyKeys[k]); } add(key); } } protected void insert(Object key) throws HashtableOverflowException { if (key == null) throw new IllegalArgumentException("Illegal value: null"); int idx = hash(key) % tabSize; if (idx < 0) idx *= -1; int bucket = -1; // look for an empty bucket if (keys[idx] == null) { keys[idx] = key; ++items; return; } else if (keys[idx] == REMOVED) { // remember the bucket, but continue to check // for duplicate keys bucket = idx; } else if (keys[idx].equals(key)) { // duplicate value return; } int rehashVal = rehash(idx); int rehashCnt = 1; for (int i = 0; i < tabSize; i++) { idx = (idx + rehashVal) % tabSize; if (keys[idx] == REMOVED) { bucket = idx; } else if (keys[idx] == null) { if (bucket > -1) { // store key into the empty bucket first found idx = bucket; } keys[idx] = key; ++items; return; } else if (keys[idx].equals(key)) { // duplicate value return; } ++rehashCnt; } // should never happen, but just to be sure: // if the key has not been inserted yet, do it now if (bucket > -1) { keys[bucket] = key; ++items; return; } throw new HashtableOverflowException(); } public boolean contains(Object key) { int idx = hash(key) % tabSize; if (idx < 0) idx *= -1; if (keys[idx] == null) return false; // key does not exist else if (keys[idx].equals(key)) { return true; } int rehashVal = rehash(idx); for (int i = 0; i < tabSize; i++) { idx = (idx + rehashVal) % tabSize; if (keys[idx] == null) { return false; // key not found } else if (keys[idx].equals(key)) { return true; } } return false; } public Object remove(Object key) { int idx = hash(key) % tabSize; if (idx < 0) idx *= -1; if (keys[idx] == null) { return null; // key does not exist } else if (keys[idx].equals(key)) { key = keys[idx]; keys[idx] = REMOVED; --items; return key; } int rehashVal = rehash(idx); for (int i = 0; i < tabSize; i++) { idx = (idx + rehashVal) % tabSize; if (keys[idx] == null) { return null; // key not found } else if (keys[idx].equals(key)) { key = keys[idx]; keys[idx] = REMOVED; --items; return key; } } return null; } protected int rehash(int iVal) { int retVal = (iVal + iVal / 2) % tabSize; if (retVal == 0) retVal = 1; return retVal; } protected final static int hash(Object o) { return o.hashCode(); } /* (non-Javadoc) * @see org.exist.util.hashtable.AbstractHashtable#iterator() */ public Iterator iterator() { return new ObjectHashSetIterator(); } public Iterator stableIterator() { return new ObjectHashSetStableIterator(); } /* (non-Javadoc) * @see org.exist.util.hashtable.AbstractHashtable#valueIterator() */ public Iterator valueIterator() { return null; } protected class ObjectHashSetIterator implements Iterator { int idx = 0; public ObjectHashSetIterator() { } /* (non-Javadoc) * @see java.util.Iterator#hasNext() */ public boolean hasNext() { if (idx == tabSize) return false; while (keys[idx] == null || keys[idx] == REMOVED) { ++idx; if (idx == tabSize) return false; } return true; } /* (non-Javadoc) * @see java.util.Iterator#next() */ public Object next() { if (idx == tabSize) return null; while (keys[idx] == null || keys[idx] == REMOVED) { ++idx; if (idx == tabSize) return null; } return keys[idx++]; } /* (non-Javadoc) * @see java.util.Iterator#remove() */ public void remove() { } } protected class ObjectHashSetStableIterator implements Iterator { int idx = 0; Object mKeys[]; public ObjectHashSetStableIterator() { mKeys = new Object[tabSize]; System.arraycopy(keys, 0, mKeys, 0, tabSize); } /* (non-Javadoc) * @see java.util.Iterator#hasNext() */ public boolean hasNext() { if (idx == tabSize) return false; while (mKeys[idx] == null || mKeys[idx] == REMOVED) { ++idx; if (idx == tabSize) return false; } return true; } /* (non-Javadoc) * @see java.util.Iterator#next() */ public Object next() { if (idx == tabSize) return null; while (mKeys[idx] == null || mKeys[idx] == REMOVED) { ++idx; if (idx == tabSize) return null; } return mKeys[idx++]; } /* (non-Javadoc) * @see java.util.Iterator#remove() */ public void remove() { } } } |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:26:43
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/src/org/exist/client Modified Files: QueryDialog.java Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. Index: QueryDialog.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/client/QueryDialog.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** QueryDialog.java 3 Feb 2004 13:14:53 -0000 1.10 --- QueryDialog.java 29 Mar 2004 14:15:13 -0000 1.11 *************** *** 29,34 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - import java.awt.event.WindowAdapter; - import java.awt.event.WindowEvent; import java.io.BufferedReader; import java.io.File; --- 29,32 ---- |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:26:42
|
Update of /cvsroot/exist/eXist-1.0/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/bin Modified Files: client.sh Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. Index: client.sh =================================================================== RCS file: /cvsroot/exist/eXist-1.0/bin/client.sh,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** client.sh 17 Feb 2004 15:04:59 -0000 1.33 --- client.sh 29 Mar 2004 14:15:13 -0000 1.34 *************** *** 32,36 **** # set java options if [ -z "$JAVA_OPTIONS" ]; then ! export JAVA_OPTIONS="-Xms16m -Xmx256m -Dfile.encoding=UTF-8" fi --- 32,36 ---- # set java options if [ -z "$JAVA_OPTIONS" ]; then ! export JAVA_OPTIONS="-Xms64m -Xmx256m -Dfile.encoding=UTF-8" fi |
From: Wolfgang M. M. <wol...@us...> - 2004-03-29 14:26:42
|
Update of /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31676/src/org/dbxml/core/filer Modified Files: BTree.java Paged.java Log Message: * Fixed stability issues: collection pointers got corrupted occasionally, resulting in ArrayIndexOutOfBoundsExceptions. * Added check for file format versions: the database will throw an exception if the database files are incompatible with the current eXist version. Index: Paged.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/Paged.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Paged.java 29 Jan 2004 15:06:48 -0000 1.19 --- Paged.java 29 Mar 2004 14:15:13 -0000 1.20 *************** *** 100,103 **** --- 100,107 ---- } + public short getFileVersion() { + return 0; + } + public final static void setPageSize(int pageSize) { PAGE_SIZE = pageSize; *************** *** 191,194 **** --- 195,203 ---- public boolean close() throws DBException { + try { + raf.close(); + } catch (IOException e) { + throw new DBException("an error occurred while closing database file: " + e.getMessage()); + } return true; } *************** *** 347,360 **** } ! /** ! * Description of the Method ! * ! *@return Description of the Return Value ! *@exception DBException Description of the Exception ! */ ! public boolean open() throws DBException { try { if (exists()) { fileHeader.read(); return true; } else --- 356,367 ---- } ! public boolean open(short expectedVersion) throws DBException { try { if (exists()) { fileHeader.read(); + if(fileHeader.getVersion() != expectedVersion) + throw new DBException("Database file " + + getFile().getName() + " has a storage format incompatible with this " + + "version of eXist. Please do a backup/restore of your data first."); return true; } else *************** *** 472,484 **** writeValue(getPage(page), value); } ! /** * FileHeader * *@author Wolfgang Meier <me...@if...> - *@created 26. Mai 2002 */ public abstract class FileHeader { private boolean dirty = false; private long firstFreePage = -1; --- 479,493 ---- writeValue(getPage(page), value); } ! /** * FileHeader * *@author Wolfgang Meier <me...@if...> */ public abstract class FileHeader { + + private short versionId; + private boolean dirty = false; private long firstFreePage = -1; *************** *** 508,542 **** } - /** - * Constructor for the FileHeader object - * - *@param pageCount Description of the Parameter - *@param pageSize Description of the Parameter - */ public FileHeader(long pageCount, int pageSize) { this(pageCount, pageSize, (byte) 4); } - /** - * Constructor for the FileHeader object - * - *@param pageCount Description of the Parameter - *@param pageSize Description of the Parameter - *@param blockSize Description of the Parameter - */ public FileHeader(long pageCount, int pageSize, byte blockSize) { this.pageSize = pageSize; this.pageCount = pageCount; ! totalCount = pageCount; ! headerSize = (short) pageSize; calculateWorkSize(); } - /** - * Constructor for the FileHeader object - * - *@param read Description of the Parameter - *@exception IOException Description of the Exception - */ public FileHeader(boolean read) throws IOException { if (read) --- 517,533 ---- } public FileHeader(long pageCount, int pageSize) { this(pageCount, pageSize, (byte) 4); } public FileHeader(long pageCount, int pageSize, byte blockSize) { this.pageSize = pageSize; this.pageCount = pageCount; ! this.totalCount = pageCount; ! this.headerSize = (short) pageSize; ! this.versionId = getFileVersion(); calculateWorkSize(); } public FileHeader(boolean read) throws IOException { if (read) *************** *** 644,647 **** --- 635,642 ---- } + public final short getVersion() { + return versionId; + } + /** Increment the number of records being managed by the file */ public final synchronized void incRecordCount() { *************** *** 659,667 **** } - /** - * Description of the Method - * - *@exception IOException Description of the Exception - */ public final synchronized void read() throws IOException { raf.seek(0); --- 654,657 ---- *************** *** 671,681 **** } - /** - * Description of the Method - * - *@param raf Description of the Parameter - *@exception IOException Description of the Exception - */ public void read(RandomAccessFile raf) throws IOException { headerSize = raf.readShort(); pageSize = raf.readInt(); --- 661,666 ---- } public void read(RandomAccessFile raf) throws IOException { + versionId = raf.readShort(); headerSize = raf.readShort(); pageSize = raf.readInt(); *************** *** 790,798 **** } - /** - * Description of the Method - * - *@exception IOException Description of the Exception - */ public final synchronized void write() throws IOException { raf.seek(0); --- 775,778 ---- *************** *** 801,811 **** } - /** - * Description of the Method - * - *@param raf Description of the Parameter - *@exception IOException Description of the Exception - */ public void write(RandomAccessFile raf) throws IOException { raf.writeShort(headerSize); raf.writeInt(pageSize); --- 781,786 ---- } public void write(RandomAccessFile raf) throws IOException { + raf.writeShort(versionId); raf.writeShort(headerSize); raf.writeInt(pageSize); Index: BTree.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/dbxml/core/filer/BTree.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** BTree.java 2 Feb 2004 15:30:38 -0000 1.20 --- BTree.java 29 Mar 2004 14:15:13 -0000 1.21 *************** *** 133,138 **** } ! public boolean open() throws DBException { ! if (super.open()) { cache = new LRDCache(buffers); cache.setFileName(getFile().getName()); --- 133,138 ---- } ! public boolean open(short expectedVersion) throws DBException { ! if (super.open(expectedVersion)) { cache = new LRDCache(buffers); cache.setFileName(getFile().getName()); *************** *** 431,436 **** private int calcDataLen() { int length = ptrs == null ? 0 : ptrs.length << 3; ! final int keyLen = fileHeader.getFixedKeyLen() < 0 ? 2 : 0; ! length += keyLen * values.length; for (int i = 0; i < values.length; i++) length += values[i].getLength(); --- 431,436 ---- private int calcDataLen() { int length = ptrs == null ? 0 : ptrs.length << 3; ! if(fileHeader.getFixedKeyLen() < 0) ! length += 2 * values.length; for (int i = 0; i < values.length; i++) length += values[i].getLength(); *************** *** 667,672 **** idx = - (idx + 1); - // Check to see if we've exhausted the block - //boolean split = ph.getDataLen() + 6 + value.getLength() > fileHeader.getWorkSize(); setValues(insertArrayValue(values, value.trim(), //new Value(value.getData()), --- 667,670 ---- *************** *** 688,693 **** public void promoteValue(Value value, long rightPointer) throws IOException, BTreeException { - // Check to see if we've exhausted the block - //boolean split = ph.getDataLen() + 6 + value.getLength() > fileHeader.getWorkSize(); int idx = Arrays.binarySearch(values, value); if (idx < 0) --- 686,689 ---- *************** *** 701,705 **** if (split) split(); - //write(); } --- 697,700 ---- |