Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

MembershipJson - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page MembershipJson

Last modified by bougault on 2022/03/18 14:34

From version 3.42
edited by bougault
on 2022/03/18 13:01
Change comment: There is no comment for this version
To version 3.33
edited by bougault
on 2022/03/18 12:54
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,2 +1,28 @@
1 -{{velocity filter="indent" wiki="false"}}$response.setContentType('application/json')#set($mylist = ['foo','bar'])#set($mymap= {"things": $mylist})$jsontool.serialize(${mymap}){{/velocity}}
1 +{{velocity output="false"}}
2 +$response.setContentType('application/json')
3 +#set($query = $services.query.xwql("from doc.object(Collaboratory.Apps.Membership.MembershipRequest.Code.MembershipRequestClass) as requests"))
4 +#set($memberships = $query.execute())
5 +#set($map = {})
6 +#set($rows = [])
7 +{{/velocity}}
8 +{{velocity wiki="false"}}
9 + #set($ok = $rows.add("toto")
10 +##{
11 + ## "row": [
12 + ##foreach($membershipDoc of $memberships)
13 + ##set($m = $xwiki.getDocument($membershipDoc))
14 + ##{
15 + ##hello: "world"
16 + ##"title": "$m.title",
17 + ##"target": "$m.target",
18 + ##username: '$m.username',
19 + ##"status": "$m.status",
20 + ##"date": "$m.date"
21 + ##}#if( $foreach.hasNext ), #end
22 + ##end
23 +## ]
24 +##}
25 +$map.rows = $rows
26 +$jsontool.serialize($map)
27 +{{/velocity}}
2 2