scripting the resolver with Velocity "Template" attribute defintion
Peter Schober
peter.schober at univie.ac.at
Wed Feb 15 15:31:33 EST 2017
* Peter Schober <peter.schober at univie.ac.at> [2017-02-14 21:57]:
> <Template>#if($StaffEmail)$StaffEmail#else$StudentEmail#end</Template>
Note that while this technically works it wasn't suitable for the
use-cases I originally envisioned using Velocity for, which was simple
conditionals (if/elseif some attributes are [not] available populate
the attribute with some value), due to the documented requirement of
the Template attribute definition that:
"All source attributes used in TemplateAttributeDefinition must have
the same number of values"
While this makes sense for uses of the Template type as illustrated in
the wiki (and in Scott's contributed example from this thread) where
all sourced attributes' values are combined/concatented into a single
string, but limits the more general use of Velocity as a scripting
language.
Given that writing Velocity within AttributeDefinitions causes
readability issues due to whitespace that's probably all OK.
I did consider opening an RFE to make the restriction of "same number
of values" at least optional/configurable. Does that make sense to
others as well?
Best,
-peter
More information about the users
mailing list