General Actions:
Log-in
Register
Wiki:
games
▼
:
Document Index
»
Space:
NameManager
▼
:
Document Index
»
Page:
quicktest
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
quicktest
Wiki source code of
quicktest
Last modified by
Adam Hattrell
on 2008/05/26 13:42
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Show line numbers
#set($groovyObject = $xwiki.parseGroovyFromPage("Groovy.Random")) #set ($dice = $groovyObject.getRandom()) #set ($sql = "select prop.value from BaseObject as obj, XWikiDocument as doc, StringProperty as prop where obj.name=doc.fullName and obj.id = prop.id.id and doc.web='NameManager' and obj.className='NameManager.NameClass' and obj.name<>'NameManager.NameClassTemplate' and prop.id.name='name'") #set ($names = $xwiki.search($sql)) #set ($pick = $dice.nextInt($names.size())) #set ($choice = $names.get($pick)) $choice