cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: svn commit: r219856 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms: binding/MultiValueJXPathBinding.java flow/javascript/ScriptableWidget.java
Date Thu, 21 Jul 2005 09:20:33 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 20 Jul 2005, Antonio Gallardo wrote:

> Date: Wed, 20 Jul 2005 09:37:26 -0500
> From: Antonio Gallardo <agallardo@agssa.net>
> Reply-To: dev@cocoon.apache.org
> To: dev@cocoon.apache.org
> Subject: Re: svn commit: r219856 - in
>     /cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/form
>     s: binding/MultiValueJXPathBinding.java
>     flow/javascript/ScriptableWidget.java
> 
> Hi Giacomo,
>
> I guess it is related to commons-jxpath-1.2. Can you add the buggy version 
> number of the JXPath lib? This could help in the future to check if this bug 
> is already fixed on the released jars? If there is already a bug for this in 
> JXPath, will be fine to add the bug # in the comment.

I've tried to add a bug to bugzilla for commons-jxpath but connection 
here at ApacheCon has prevented me until now. But sure it's still on my 
todo list :-)

Thanks

Giacomo

>
> Best Regards,
>
> Antonio Gallardo
>
> giacomo@apache.org wrote:
>
>> Author: giacomo
>> Date: Wed Jul 20 01:19:35 2005
>> New Revision: 219856
>> 
>> URL: http://svn.apache.org/viewcvs?rev=219856&view=rev
>> Log:
>> added workaround for a bug in commons-jxpath's 
>> JXPathContext.removeAll(path) which isn't really removing all elements from 
>> a Collection type object
>> 
>> Modified:
>>     cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
>>     cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java
>> 
>> Modified: 
>> cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java
>> URL: 
>> http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java?rev=219856&r1=219855&r2=219856&view=diff
>> ==============================================================================
>> --- 
>> cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java

>> (original)
>> +++ 
>> cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/binding/MultiValueJXPathBinding.java

>> Wed Jul 20 01:19:35 2005
>> @@ -15,8 +15,11 @@
>>  */
>>  package org.apache.cocoon.forms.binding;
>> 
>> +import java.util.ArrayList;
>> +import java.util.Collections;
>>  import java.util.Iterator;
>>  import java.util.LinkedList;
>> +import java.util.List;
>>  import java.util.Locale;
>>
>>  import org.apache.avalon.framework.logger.Logger;
>> @@ -104,7 +107,23 @@
>>          JXPathContext multiValueContext =
>>          jctx.getRelativeContext(jctx.createPath(this.multiValuePath));
>>
>>          // Delete all that is already present
>> -        multiValueContext.removeAll(this.rowPath);
>> +        +        // Unfortunately the following statement doesn't work (it 
>> doesn't removes all elements from the +        // list because of a bug in 
>> JXPath) so I had to work out another immediate solution
>> +        //multiValueContext.removeAll(this.rowPath);
>> +        +        Iterator rowPointers = 
>> multiValueContext.iteratePointers(this.rowPath);
>> +        List l = new ArrayList();
>> +        while( rowPointers.hasNext() )
>> +        {
>> +            Pointer p = (Pointer)rowPointers.next();
>> +            l.add(p.asPath());
>> +        }
>> +        Collections.sort(l);
>> +        for( int i = l.size()-1; i >= 0; i-- )
>> +        {
>> +            multiValueContext.removePath((String)l.get(i));
>> +        }
>>
>>          boolean update = false;
>> 
>> 
>> Modified: 
>> cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java
>> URL: 
>> http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java?rev=219856&r1=219855&r2=219856&view=diff
>> ==============================================================================
>> --- 
>> cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java

>> (original)
>> +++ 
>> cocoon/branches/BRANCH_2_1_X/src/blocks/forms/java/org/apache/cocoon/forms/flow/javascript/ScriptableWidget.java

>> Wed Jul 20 01:19:35 2005
>> @@ -30,6 +30,8 @@
>>  import org.mozilla.javascript.Undefined;
>>  import org.mozilla.javascript.Wrapper;
>> 
>> +import java.util.Collection;
>> +
>>  /**
>>   * @version $Id$
>>   * 
>> @@ -256,6 +258,8 @@
>>                      }
>>                  } else if (value instanceof Object[]) {
>>                      values = (Object[])value;
>> +                } else if (value instanceof Collection ) {
>> +                    values = ((Collection)value).toArray();
>>                  }
>>                  field.setValues(values);
>>              } else {
>>
>> 
>> 
>
>

- -- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC32jhLNdJvZjjVZARAn24AJ4496e8QKhBIL5yM0pSNv65eSx3lgCfc1mE
9I+v2m/xbvP8DFj1UcmOZ7Q=
=wsmV
-----END PGP SIGNATURE-----

Mime
View raw message