Thanks!

Caleb James DeLisle wrote:
> #set($species = '%' 
> "$doc.getObject('Species.SpeciesClass').getProperty('GalicianName').getValue()"
> + '%')
>   

It does! My cents...
#set($species = '%' + 
"$doc.getObject('Species.SpeciesClass').getProperty('GalicianName').getValue()" 
+ '%')

> if not try this:
> #set($species = 
> "%${doc.getObject('Species.SpeciesClass').getProperty('GalicianName').getValue()}%")
>
>   
It works as well.

> Hint about velocity, "this" gets interpreted as syntax, then pasted as a 
> string 'this' is just non
> parsed content.

Oooooh! Thanks! This was making me nuts. Page 21 of *Velocity Users 
Guide *reads: "when the string literal is enclosed in single quote 
characters, it will not be parsed"... :-( I must read more, and ask 
less... but without asking the meaning of what I read is poorer! Thanks 
for answering!

As a "pure" Velocity concatenation example...

#set($species = 
"${doc.getObject('Species.SpeciesClass').getProperty('GalicianName').getValue()}")
#set($wc = "%")
#set($speciesq = "$wc$species$wc")

#set($query = ", BaseObject as obj, LargeStringProperty as prop where 
doc.fullName = obj.name and obj.className='Users.PdrUserClass' and 
obj.id=prop.id.id and prop.id.name='Species' and prop.value like ? order 
by doc.fullName asc")

#set($results = $xwiki.searchDocuments($query, [$speciesq]))

But what I don't understand yet is where $species, or "$speciesq" in 
this last example get quoted. ? in $query needs '%whatever%', and not 
%whatever% that is what I get if I read $speciesq.

Thanks for your help!

Ricardo

-- 
Ricardo Rodríguez
CTO
eBioTIC.
Life Sciences, Data Modeling and Information Management Systems

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to