You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gunnar Brand <g....@interface-projects.de> on 2005/09/15 20:49:06 UTC
CopletModule always returning String instead of real Object
Hi.
I was using the coplet input module to get some value stored in an
attribute of a coplet.
But not inside the sitemap (because there you can only work with strings)
but in normal java code.
Unfortunately (for me) I had to notice that the coplet module always calls
".toString()" on the value it returns via getAttribute.
I think this is a bug or design mistake because it prevents any non String
from being looked up this way.
And the sitemap does the string conversion anyway.
IMHO input modules can and should return objects and not convert them to
strings.
If I am right, can somebody fix this? I checked the SVN archive I could
find on the website and it seems all versions of
CopletModule.java have this return value.toString();
gunnar
--
G. Brand - interface projects GmbH
Tolkewitzer Strasse 49
D-01277 Dresden
mail: g.brand@interface-projects.de
tel: ++49-351-3 18 09 - 41
Ein Unternehmen der interface:business-Gruppe
Re: CopletModule always returning String instead of real Object
Posted by Carsten Ziegeler <cz...@apache.org>.
Yes, I think this is a bug - I just fixed it.
Thanks
Carsten
Gunnar Brand wrote:
> Hi.
>
> I was using the coplet input module to get some value stored in an
> attribute of a coplet.
> But not inside the sitemap (because there you can only work with strings)
> but in normal java code.
> Unfortunately (for me) I had to notice that the coplet module always calls
> ".toString()" on the value it returns via getAttribute.
> I think this is a bug or design mistake because it prevents any non String
> from being looked up this way.
> And the sitemap does the string conversion anyway.
> IMHO input modules can and should return objects and not convert them to
> strings.
>
> If I am right, can somebody fix this? I checked the SVN archive I could
> find on the website and it seems all versions of
> CopletModule.java have this return value.toString();
>
> gunnar
>
>
>
--
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/