- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::includelet::collab-graph
::xowiki::includelet::collab-graph create ... \Include a collaboration graph
[ -parameter_declaration (default " {-max_edges 70} {-cutoff 0.1} {-show_anonymous "message"} -user_id ") ]
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
Class Relations
::xowiki::IncludeletClass create ::xowiki::includelet::collab-graph \ -superclass ::xowiki::includelet::graphMethods (to be applied on instances)
parameter_declaration (setter)
render (scripted)
:get_parameters if {$show_anonymous ne "all" && [::xo::cc user_id] eq "0"} { return "You must login to see the [namespace tail [self class]]" } if {![info exists user_id]} {set user_id [::xo::cc user_id]} set folder_id [::$package_id folder_id] ::xo::dc foreach get_collaborators { select count(revision_id), item_id, creation_user from cr_revisions r, acs_objects o where item_id in (select distinct i.item_id from acs_objects o, acs_objects o2, cr_revisions cr, cr_items i where o.object_id = i.item_id and o2.object_id = cr.revision_id and o2.creation_user = :user_id and i.item_id = cr.item_id and i.parent_id = :folder_id order by item_id ) and o.object_id = revision_id and creation_user is not null group by item_id, creation_user} { lappend i($item_id) $creation_user $count set count_var user_count($creation_user) if {![info exists $count_var]} {set $count_var 0} incr $count_var $count set user($creation_user) "[::xo::get_user_name $creation_user] ([set $count_var])" if {![info exists activities($creation_user)]} {set activities($creation_user) 0} incr activities($creation_user) $count } set result "<p>Collaboration Graph for <b>[::xo::get_user_name $user_id]</b> in this wiki" if {[array size i] < 1} { append result "</p><p>No collaborations found</p>" } else { foreach x [array names i] { foreach {u1 c1} $i($x) { foreach {u2 c2} $i($x) { if {$u1 < $u2} { set var collab($u1,$u2) if {![info exists $var]} {set $var 0} incr $var $c1 incr $var $c2 } } } } set max 50 foreach x [array names collab] { if {$collab($x) > $max} {set max $collab($x)} } set edges [list] foreach x [array names collab] { lappend edges [list $x $collab($x) [expr {$collab($x)*5.0/$max}]] } append result "($activities($user_id) contributions)</p>\n" append result [:graphHTML -nodes [array get user] -edges $edges -max_edges $max_edges -cutoff $cutoff -base collab -attrib user_id] } return $result
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables