::xowiki::IncludeletClass
::xowiki::includelet::activity-graph
Class Hierarchy of ::xowiki::includelet::activity-graph
- ::xotcl::Object
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Methods for instances:
- __api_make_doc, __api_make_forward_doc, __nextC, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, checkC, classC, cleanupC, configureC, contains, copy, db_1rowC, debug, defaultmethod, destroyC, destroy_on_cleanup, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearchC, forwardC, hasclass, incrC, infoC, init, instvarC, invarC, isclassC, ismetaclassC, ismixinC, isobjectC, istypeC, lappendC, log, method, mixinC, mixinguardC, move, msg, noinitC, parametercmdC, procC, procsearchC, qn, requireNamespaceC, self, serialize, setC, substC, traceC, unsetC, uplevelC, upvarC, volatileC, vwaitC
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- __exitHandler, getExitHandler, setExitHandler, unsetExitHandler
- ::xo::Context
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- actual_query (default " "), locale, package_id (default "0"), parameter_declaration (default "")
- Methods for instances:
- exists_query_parameter, export_vars, get_all_query_parameter, get_parameters, initialize, original_url_and_query, process_query_parameter, query_parameter
- Methods to be applied on the class:
- Methods provided by the meta-class
- ::xowiki::Includelet
- Meta-class:
- ::xotcl::Class
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- __decoration (default "portlet"), id, name (default ""), parameter_declaration (default ""), title (default "")
- Methods for instances:
- category_clause, get_page_order, include_head_entries, initialize, js_name, resolve_page_name, screen_name
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- available_includelets, describe_includelets, detail_link, html_id, html_to_text, incr_page_order, js_name, locale_clause, publish_status_clause, require_YUI_CSS, require_YUI_JS
- ::xowiki::includelet::graph
- Meta-class:
- ::xowiki::IncludeletClass
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- __decoration (default "plain")
- Methods for instances:
- graphHTML
- Methods to be applied on the class:
- Methods provided by the meta-class
- ::xowiki::includelet::activity-graph
- Meta-class:
- ::xowiki::IncludeletClass
![[i]](/resources/acs-subsite/ZoomIn16.gif)
- Parameter for instances:
- parameter_declaration (default "
{-max_edges 70}
{-cutoff 0.1}
{-max_activities:integer 100}
{-show_anonymous "message"}
")
- Methods for instances:
- render
- Methods to be applied on the class:
- Methods provided by the meta-class
Class Relations
- superclass: ::xowiki::includelet::graph
![[i]](/resources/acs-subsite/ZoomIn16.gif)
::xowiki::IncludeletClass create ::xowiki::includelet::activity-graph \
-superclass ::xowiki::includelet::graph \
-parameter {{parameter_declaration {
{-max_edges 70}
{-cutoff 0.1}
{-max_activities:integer 100}
{-show_anonymous "message"}
}}}
Methods
instproc render
::xowiki::includelet::activity-graph instproc render {} {
my get_parameters
if {$show_anonymous ne "all" && [::xo::cc user_id] eq 0} {
return "You must login to see the [namespace tail [self class]]"
}
set tmp_table_name XOWIKI_TMP_ACTIVITY
#my msg "tmp exists [::xo::db::require exists_table $tmp_table_name]"
set tt [::xo::db::temp_table new -name $tmp_table_name -query [::xo::db::sql select -vars "i.item_id, revision_id, creation_user" -from "cr_revisions cr, cr_items i, acs_objects o" -where "cr.item_id = i.item_id and i.parent_id = [$package_id folder_id] and o.object_id = revision_id" -orderby "revision_id desc" -limit $max_activities] -vars "item_id, revision_id, creation_user"]
set total 0
db_foreach [my qn get_activities] "
select count(revision_id) as count, item_id, creation_user
from $tmp_table_name
where creation_user is not null
group by item_id, creation_user
" {
lappend i($item_id) $creation_user $count
incr total $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])"
}
$tt destroy
if {[array size i] == 0} {
append result "<p>No activities found</p>"
} elseif {[array size user] == 1} {
set user_id [lindex [array names user] 0]
append result "<p>Last $total activities were done by user " "<a href='collab?$user_id'>[::xo::get_user_name $user_id]</a>."
} else {
append result "<p>Collaborations in last $total activities by [array size user] Users in this wiki</p>"
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 0
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 [my graphHTML -nodes [array get user] -edges $edges -max_edges $max_edges -cutoff $cutoff -base collab -attrib user_id]
}
return $result
}