cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Man <Martin....@seznam.cz>
Subject Re: substituting sitemap parameters from FormValidatorAction
Date Fri, 11 May 2001 08:57:16 GMT
On Wed, May 09, 2001 at 05:08:51PM -0400, Peter Royal wrote:
> I've got the following in my sitemap:
> 
<snip/>
> 
> The id attribute gets properly validated as a Long, and then is available 
> as a sitemap parameter. Thing is, FormValidatorAction casts its parameters 
> to whatever datatype they were validated as. In the substitute method of 
> AbstractSiteMap it would attempt to cast all sitemap parameters as strings, 
> and failing on the Long from FormValidatorAction. Below is a patch to 
> remove that cast. The StringBuffer has a version of the append method that 
> accepts Object, so that should still work. If this patch is on the wrong 
> end (ie FormValidatorAction should only return  a map of Strings, let me 
> know). Thanks!
> -peter
> 
As the author of those validators I'd like to hear the opinion of others also, 

what's the policy here, should the action return only strings (presumming it
did the validation using whatever type it wanted) or this issue should be
handld as propossed bellow.... ???


martin




> Index: AbstractSitemap.java
> ===================================================================
> RCS file: 
> /home/cvspublic/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/AbstractSitemap.java,v
> retrieving revision 1.1.2.39
> diff -r1.1.2.39 AbstractSitemap.java
> 220c220
> <                     result.append((String)((Map)list.get(k)).get(s));
> ---
>  >                     result.append(((Map)list.get(k)).get(s));
> 222c222
> < 
> result.append((String)((Map)list.get(k)).get(s.substring(m+1)));
> ---
>  >                     result.append(((Map)list.get(k)).get(s.substring(m+1)));
> 225c225
> <                        + " as " + (String)((Map)list.get(k)).get(m == -1 
> ? s : s.substring(m+1)));
> ---
>  >                        + " as " + ((Map)list.get(k)).get(m == -1 ? s : 
> s.substring(m+1)));
> 
> 
> -- 
> peter royal -> proyal@managingpartners.com
> managing partners, inc. -> http://www.managingpartners.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

-- 
-------------------------------------------------------------------------------
"Only dead fish swims with a stream"
gpg_key_available: http://globales.cz/~mman/martin.man.gpg
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message