Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 35272 invoked from network); 13 Sep 2005 09:10:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Sep 2005 09:10:30 -0000 Received: (qmail 51337 invoked by uid 500); 13 Sep 2005 09:10:24 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 51160 invoked by uid 500); 13 Sep 2005 09:10:20 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 51139 invoked by uid 99); 13 Sep 2005 09:10:19 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2005 02:10:19 -0700 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.79.216.190] (HELO rly20e.srv.mailcontrol.com) (217.79.216.190) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2005 02:10:27 -0700 Received: from c1-ex002.groupinfra.com ([213.86.115.109]) by rly20e.srv.mailcontrol.com (MailControl) with ESMTP id j8D986Tb029495 for ; Tue, 13 Sep 2005 10:10:13 +0100 Received: from uk-ex003.groupinfra.com ([158.234.38.247]) by c1-ex002.groupinfra.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 13 Sep 2005 10:05:28 +0100 Received: from uk-ex001.groupinfra.com ([158.234.68.229]) by uk-ex003.groupinfra.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 13 Sep 2005 10:05:21 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: New toSAX method in SourceUtil should have different name Date: Tue, 13 Sep 2005 10:05:21 +0100 Message-ID: <75CFC296F70A08409390004F30EF9B850103300D@uk-ex001.groupinfra.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: New toSAX method in SourceUtil should have different name Thread-Index: AcW4QkVw+RcxULlLQL2L4SJEOTOJ3w== From: "Wicksteed, Charles" To: X-OriginalArrivalTime: 13 Sep 2005 09:05:21.0568 (UTC) FILETIME=[450BCA00:01C5B842] X-Scanned-By: MailControl A-05-01-05 (www.mailcontrol.com) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, A new toSAX() method was introduced in org/apache/cocoon/components/source/SourceUtil.java in version 165317, when some refactoring was done to clean up the exception handling. This causes a problem when you try to call toSAX() from Flowscript with certain arguments, because the Flowscript interpreter can't work out which of the toSAX() methods to call. I think the new method needs to have a different name and/or be made private. It is not actually on the same level as the existing toSAX() methods, but is called from them. I have not put this in Bugzilla, because it is the first bug I have reported and I wanted to bounce it off you first. If Bugzilla is the way to go, let me know and I will enter it into Bugzilla. Patch below. I chose "xmlizableToSAX" as the new name. I am running the version of Cocoon (some time later than 2.1.7) which comes with Lenya 1.2.4 for Windows. This bit of work is independent of Lenya, but I'm using its Cocoon installation, augmented a bit, to develop some Forms. The problem arises when trying to load data into a "Cocoon Forms" Form using loadXML() where the source is a pipeline. sitemap.xmap: Flowscript: var form =3D new Form("mg_demo_users_def.xml"); // This version uses no binding definition file. // Instead we use the XMLAdapter as an alternative. // We get the data from a Cocoon pipeline which emits the data // in elements whose names are the same as the fields in which the data lives. // For the repeater, we use a special "item" element. // See the JavaDoc in cocoon-2.1.7\src\blocks\forms\java\org\apache\cocoon\forms\util\XMLAdapt er.java // mg_get_data in the local sitemap runs a fixed SQL query through the SQL transformer // and formats the results into elements with the same names as the form fields // using mg-demo_users_formatdata.xsl form.loadXML("cocoon:/mg_get_data"); Error message: org.mozilla.javascript.EvaluatorException: "resource://org/apache/cocoon/forms/flow/javascript/Form.js", line 226: The choice of Java method org.apache.cocoon.components.source.SourceUtil.toSAX matching JavaScript argument types (org.apache.cocoon.components.source.impl.SitemapSource,org.apache.cocoo n.forms.util.XMLAdapter) is ambiguous; candidate methods are: void toSAX(org.apache.excalibur.xml.sax.XMLizable,org.xml.sax.ContentHandler) , void toSAX(org.apache.excalibur.source.Source,org.xml.sax.ContentHandler)=20 which enabled me to track it down pretty quickly. I think line 226 must be: =20 Packages.org.apache.cocoon.components.source.SourceUtil.toSAX(source, this.getXML()); in the loadXML function (that's line 217 in plain Cocoon version 2.1.7). Thanks, Charles Wicksteed LogicaCMG London, UK ------------------------------------------------------------------------ - --- SourceUtil-178777.java Tue Aug 30 12:47:49 2005 +++ SourceUtil.java Tue Sep 13 08:54:03 2005 @@ -93,7 +93,7 @@ * * @param source the data */ - static public void toSAX(XMLizable source, + static public void xmlizableToSAX(XMLizable source, ContentHandler handler) throws SAXException, IOException, ProcessingException { try { @@ -177,7 +177,7 @@ ContentHandler handler) throws SAXException, IOException, ProcessingException { if (source instanceof XMLizable) { - toSAX((XMLizable) source, handler); + xmlizableToSAX((XMLizable) source, handler); } else { String mimeType =3D source.getMimeType(); if (null =3D=3D mimeType) { @@ -217,7 +217,7 @@ ContentHandler handler) throws SAXException, IOException, ProcessingException { if (source instanceof XMLizable) { - toSAX((XMLizable) source, handler); + xmlizableToSAX((XMLizable) source, handler); } else { String mimeType =3D source.getMimeType(); if (null =3D=3D mimeType) { @@ -257,7 +257,7 @@ ContentHandler handler) throws SAXException, IOException, ProcessingException { if (source instanceof XMLizable) { - toSAX((XMLizable) source, handler); + xmlizableToSAX((XMLizable) source, handler); } else { SAXParser parser =3D null; try { @@ -317,7 +317,7 @@ ContentHandler handler) throws SAXException, IOException, ProcessingException { if (source instanceof XMLizable) { - toSAX((XMLizable) source, handler); + xmlizableToSAX((XMLizable) source, handler); } else { SAXParser parser =3D null; try { ------------------------------------------------------------------------ - -- This e-mail and any attachment is for authorised use by the intended recipi= ent(s) only. It may contain proprietary material, confidential information = and/or be subject to legal privilege. It should not be copied, disclosed to= , retained or used by, any other party. If you are not an intended recipien= t then please promptly delete this e-mail and any attachment and all copies= and inform the sender. Thank you.