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.48
edited by bougault
on 2022/03/18 13:21
Change comment: There is no comment for this version
To version 3.27
edited by bougault
on 2022/03/18 09:05
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,18 +1,22 @@
1 -{{velocity output="no"}}
2 -$xwiki.ssx.use('Collaboratory.Apps.HighlightedCollabs.Code.HighlightedCollabsMacro')
3 -#set($query = $services.query.xwql("from doc.object(Collaboratory.Apps.Membership.MembershipRequest.Code.MembershipRequestClass) as req"))
4 -#set($reqs = $query.execute())
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 5  {{/velocity}}
6 -
7 7  {{velocity wiki="false"}}
8 -## If AJAX call
9 -$response.setContentType('application/json')
10 -{rows:[
11 -#foreach($req of $reqs)
12 - #set($highlight = $xwiki.getDocument($req))
13 - {
14 - "title": "$req.getTitle()",
15 - }#if( $foreach.hasNext ), #end
16 -#end
17 -]}
7 +{
8 +"row": [
9 + ##foreach($membershipDoc of $memberships)
10 + ##set($m = $xwiki.getDocument($membershipDoc))
11 + ##{
12 + ##hello: "world"
13 + ##"title": "$m.title",
14 + ##"target": "$m.target",
15 + ##username: '$m.username',
16 + ##"status": "$m.status",
17 + ##"date": "$m.date"
18 + ##}#if( $foreach.hasNext ), #end
19 + ##end
20 +]
21 +}
18 18  {{/velocity}}