I agree we need to provide this capability.
Right now I think the only example of a Phrase that does (something
like) this is ${attributeNode}, which takes a "key=value" expression.
Originally I had thought (hoped I guess) that context -- attributes on
the stack -- could provide any additional info we needed.
Have you thought about a format for passing additional arguments? I
know ${phrase-name(arg1, ar2)} probably feels the most
natural/familiar. Is there any precedent for
${phrase-name(arg1)(ar2)}?
drew
> --
> You received this message because you are subscribed to the Google Groups "Cernunnos Discussion" group.
> To post to this group, send email to cernunnos-...@googlegroups.com.
> To unsubscribe from this group, send email to cernunnos-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cernunnos-discussion?hl=en.
>
>
Right, but that's really only 1 value as it is emitted as "key=value"
in a Document Node.
> Originally I had thought (hoped I guess) that context -- attributes on
> the stack -- could provide any additional info we needed.
>
That's how I'm implementing it now for some of our custom phrases. It
works and it's sometimes the right thing to do. But I have come
across a use case where you really need to express it as 2 arguments.
That said, the context is great in the cases that are already in
Cernunnos--it feels like an environment variable or a System property
and it feels right such as in <append-node>, ${parseXml()}, etc..
> Have you thought about a format for passing additional arguments? I
> know ${phrase-name(arg1, ar2)} probably feels the most
> natural/familiar. Is there any precedent for
> ${phrase-name(arg1)(ar2)}?
>
I've not seen any function call or markup like
${phrase-name(arg1)(arg2)}, but maybe someone on the list has.
Perhaps the implementation of Phrase should be reviewed and reworked
so that it knows how to deal with multiple arguments (such as reading
a portlet preference value using a Phrase) vs. single arguments (such
as reading SQL). It's tricky for sure. I'm happy to help contribute
ideas/implementations for this. But I've come to a point where it'd
be great to have that.
--
Andy Gherna
argh...@gmail.com
I'm game for this.
The code that parses XML attributes that contain phrases is due for an
overhaul anyway. It could be improved for speed and also accuracy.
drew