0 Votes

Wiki source code of TodoListsService

Last modified by Ryan C on 2025/04/24 09:30

Show last authors
1 {{velocity}}
2 #set($tododoc = $xwiki.getDocument($request.page))
3 #set($todog = $xwiki.parseGroovyFromPage("TodoLists.TodoListsGroovy"))
4 #set($ok = $todog.setContext($context,$xwiki))
5 #if($todog=="groovy_missingrights")
6 FAILED Missing programming rights on TodoListGroovy
7 #else
8 #if($request.save)
9 #set($result = $todog.updateDocument($tododoc, $request.content))
10 #if($result && $result!=0)
11 #set($ok = $tododoc.save("Todo List updated"))
12 SUCCESS
13 #else
14 FAILED
15 #end
16 #elseif($request.create)
17 #set($result = $todog.addToDocument($tododoc, $request.content))
18 #if($result && $result!=0)
19 #set($ok = $tododoc.save("Todo List item added"))
20 SUCCESS
21 #else
22 FAILED
23 #end
24 #else
25 {{{
26 $jsontool.serialize($todog.getTodos($tododoc))
27 }}}
28 #end
29 #end
30 {{/velocity}}

XWiki AI Chat