Hide last authors
Alexandru Colesnicov 1.3 1 {{velocity}}
Alexandru Colesnicov 6.2 2
Alexandru Colesnicov 1.3 3 #set($class="Duncan1.Code.GDataClass")
4 #set($template="Duncan1.Code.GDataTemplate")
5 #set($xwlquery="from doc.object($class) as obj where doc.fullName <> '$template' order by doc.date desc")
6 #set($list=$services.query.xwql($xwlquery).execute())
7 #set($totalF=0)
Alexandru Colesnicov 3.1 8 #set($totalM=0)
9 #set($nPos=$list.size())
Alexandru Colesnicov 1.3 10 #foreach($item in $list)
11 #set($itemdoc = $xwiki.getDocument($item))
Alexandru Colesnicov 2.1 12 ###$itemdoc.getName()
Alexandru Colesnicov 3.1 13 ###$itemdoc.get('Profession')
Alexandru Colesnicov 4.1 14 #set($nFInPos = $itemdoc.getValue('QuaWoman'))
15 #set($nMInPos = $itemdoc.getValue('QuaMan'))
16 #set($totalF = $totalF+$nFInPos)
17 #set($totalM = $totalM+$nMInPos)
Alexandru Colesnicov 1.3 18 #end
Alexandru Colesnicov 4.1 19 #set($totalFM=$totalF+$totalM)
Alexandru Colesnicov 3.1 20 $nPos records processed
Alexandru Colesnicov 4.1 21 $totalFM pers. incl. woman: $totalF; man: $totalM
Alexandru Colesnicov 6.2 22
Alexandru Colesnicov 1.3 23 {{/velocity}}
Alexandru Colesnicov 6.2 24
Alexandru Colesnicov 5.1 25 {{python}}
Alexandru Colesnicov 6.2 26
Alexandru Colesnicov 6.1 27 iDunc = 0.0
Alexandru Colesnicov 9.13 28 print totalF totalM
Alexandru Colesnicov 9.5 29 for item in list:
Alexandru Colesnicov 5.1 30 itemdoc = xwiki.getDocument(item)
Alexandru Colesnicov 9.4 31 nFInPos = itemdoc.getValue("QuaWoman")
32 nMInPos = itemdoc.getValue("QuaMan")
Alexandru Colesnicov 5.1 33 iDunc += abs(nFInPos/totalF - nMInPos/totalM)
Alexandru Colesnicov 9.13 34 print nFInPos nMInPos iDunc
Alexandru Colesnicov 9.2 35 iDunc *= 0.5
Alexandru Colesnicov 6.2 36
Alexandru Colesnicov 5.1 37 {{/python}}
Alexandru Colesnicov 9.9 38
39 {{velocity}}
40 Duncan index = $iDunc
41 {{/velocity}}

Need help?

If you need help with XWiki you can contact: