Rico Jansen <[EMAIL PROTECTED]> wrote:
 > As far as I can see this resolves the problem in a far more elegant manner.
> I will revoke my call. And if nobody has objected tomorrow I (or maybee Michiel)
> can make a Call.


So, since nothing happened, I do the call myself.

I have changed the proposal a little. My original proposal did take
the last entry of a list always if not explicitily request a list. I
think this is too much.

It is for example possible to make function on nodes which return a
list. We see this in the media-project:

<mm:field name="urls()" />

Which would now require to be:

<mm:field name="urls()" vartype="list" />

This is of course mainly used for debugging (depending toString of
list) because in actual use the followwing will be common anyway:

<mm:field name="urls()" vartype="list" jspvar="list">
  <% bla bla %>
</mm:field>

But also this stays possible (in contradiction to the orignal proposal):
<mm:field name="urls()"  jspvar="list">
  <% List a = (List) list; 
      bla bla %>
</mm:field>
(but who likes to do the cast, if 'vartype' would do it more elegantly)

So, I decided that it is nicer to make it optional in WriterHelper.
The diffs are attached.

For more information about this hack, I refer to this thread.

I think the impact will now be so little that a vote is hardly required, but anyway.


START OF CALL: 2003-02-16

END OF CALL:   2003-02-19

[_] +1 (YEA)

[_] +0 (ABSTAIN )

[_] -1 (NAY), because :

[_] VETO, because:


Michiel
-- 
mihxil'  Michiel Meeuwissen 
Mediapark C101 Hilversum  
+31 (0)35 6772979
[]() 
Index: WriterHelper.java
===================================================================
RCS file: /usr/local/cvs/mmbase/bridge/jsp/taglib/WriterHelper.java,v
retrieving revision 1.14
diff -r1.14 WriterHelper.java
32a33,34
>     public static boolean NOIMPLICITLIST = true;
>     public static boolean IMPLICITLIST   = false;
138a141,143
>         setValue(v, IMPLICITLIST);        
>     }
>     public void setValue(Object v, boolean noImplicitList) throws JspTagException {
177a183,196
>         if (noImplicitList) {
>             // Take last of list if vartype defined not to be a list:
>             if (v instanceof java.util.List) {
>                 if (vartype != TYPE_LIST && vartype != TYPE_VECTOR) {
>                     java.util.List l = (java.util.List) v;
>                     if (l.size() > 0) { 
>                         v = l.get(l.size() - 1);
>                     } else {
>                         v = null;
>                     }
>                 }
>             }
>         }
> 
212c231
<                 throw new JspTagException("Variable is not of type Node. Conversion 
is not yet supported by this Tag");
---
>                 throw new JspTagException("Variable is not of type Node, but of type 
>" + v.getClass().getName() + ". Conversion is not yet supported by this Tag");
Index: ImportTag.java
===================================================================
RCS file: /usr/local/cvs/mmbase/bridge/jsp/taglib/ImportTag.java,v
retrieving revision 1.22
diff -r1.22 ImportTag.java
124c124
<             helper.setValue(value);
---
>             helper.setValue(value, helper.NOIMPLICITLIST); 

Reply via email to