Show last authors
1 {{velocity}}
2 #set($page = $request.page)
3 #if($request.durationfield)
4 #set($durationfield = $request.durationfield)
5 #else
6 #set($durationfield = "duration")
7 #end
8 #if($request.startfield)
9 #set($startfield = $request.startfield)
10 #else
11 #set($startfield = "datetime")
12 #end
13 #if($request.classname)
14 #set($classname = $request.classname)
15 #else
16 #set($classname = "")
17 #end
18 #set($success = false)
19 #if($page&&$page!="")
20 #set($pagedoc = $xwiki.getDocument($page))
21 #if(!$pagedoc.isNew())
22 #set($ok = $pagedoc.use($classname))
23 #if("$!{request.isResize}"=="1")
24 #set($cduration = $pagedoc.getValue($durationfield))
25 #if(!$cduration)
26 #set($cduration = "30")
27 #end
28 #set($nduration = $util.parseInt($cduration))
29 #set($dayDelta = $util.parseInt($request.dayDelta))
30 #set($minuteDelta = $util.parseInt($request.minuteDelta))
31 #set($nduration = $nduration + $dayDelta * 24 + $minuteDelta)
32 #set($ok = $pagedoc.set($durationfield, "$!{nduration}"))
33 #set($success = true)
34 #else
35 #set($datetime = $pagedoc.getValue($startfield))
36 #if(!$datetime)
37 #set($datetime = $xwiki.jodatime.getDateTime(2012, 7, 22, 8, 0, 0, 0).toDate())
38 #end
39 #set($jdatetime = $xwiki.jodatime.getDateTime($datetime.getTime()))
40 #set($jdatetime = $jdatetime.plusDays($util.parseInt($request.dayDelta)))
41 #set($jdatetime = $jdatetime.plusMinutes($util.parseInt($request.minuteDelta)))
42 #set($ok = $pagedoc.set($startfield, $jdatetime.toDate()))
43 #set($success = true)
44 #end
45 #if($success)
46 #set($ok = $pagedoc.save("Update session time"))
47 OK $pagedoc.getValue($durationfield) $pagedoc.getValue($startfield)
48 #else
49 FAIL $message ($pagedoc.fullName $pagedoc.getValue($durationfield) $pagedoc.getValue($startfield))
50 #end
51 #else
52 FAIL No Document
53 #end
54 #else
55 FAIL No Document
56 #end
57 {{/velocity}}