-
Notifications
You must be signed in to change notification settings - Fork 0
/
count_status_backend.vm
38 lines (38 loc) · 1.02 KB
/
count_status_backend.vm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Macro title: My Macro
## Macro has a body: N
## Body processing: Selected body processing option
## Output: Selected output option
##
## Developed by: My Name
## Date created: dd/mm/yyyy
## Installed by: PF
## @noparams
#set ( $container = {} )
#set( $contentBody = $content.bodyAsString )
#foreach ( $part in $contentBody.split('(?=<ac:structured-macro)|(?<=\/ac:structured-macro>)') )
#if ( $part.contains('ac:name="status"') )
#set ( $status = $part.replaceAll(' ac:macro-id=".{36}"', '') )
#set ( $statusCount = false )
#set ( $statusCount = $container.get($status) )
#if ( $statusCount )
#set ( $statusCount = $statusCount + 1 )
#set ( $void = $container.put($status, $statusCount) )
#else
#set ( $void = $container.put($status, 1) )
#end
#end
#end
<table>
<tbody>
<tr>
<th>Status</th>
<th>Count</th>
</tr>
#foreach ( $status in $container.keySet() )
<tr>
<td>$status</td>
<td>$container.get($status)</td>
</tr>
#end
</tbody>
</table>