xotcl.wu-wien.ac.at
Begin main content
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xowiki::IncludeletClass[i] ::xowiki::includelet::wf-todo

Class Hierarchy of ::xowiki::includelet::wf-todo

  • ::xotcl::Object[i]
    Meta-class:
    ::xotcl::Class[i]
    Methods for instances:
    __api_make_doc, __api_make_forward_doc, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, check, classC, cleanupC, configureC, containsC, copyC, db_0or1rowC, db_1rowC, debug, defaultmethodC, destroyC, destroy_on_cleanup, ds, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearch, forward, hasclass, incrC, infoC, init, instvarC, invarC, isclass, ismetaclass, ismixin, isobject, istype, lappendC, log, method, mixinC, mixinguardC, moveC, msg, noinitC, objectparameter, parametercmdC, proc, procsearch, qn, requireNamespaceC, residualargsC, self, serialize, setC, set_instance_vars_defaults, show-object, substC, traceC, unknown, unsetC, uplevelC, upvarC, volatileC, vwait
    Methods to be applied on the class (in addition to the methods provided by the meta-class):
    getExitHandler, setExitHandler, unsetExitHandler
    • ::xo::Context[i]
      Meta-class:
      ::xotcl::Class[i]
      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[i]
        Meta-class:
        ::xotcl::Class[i]
        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, glob_clause, html_encode, html_id, html_to_text, js_encode, js_name, listing, locale_clause, parent_id_clause, publish_status_clause, require_YUI_CSS, require_YUI_JS
        • ::xowiki::includelet::wf-todo[i]
          Meta-class:
          ::xowiki::IncludeletClass[i]
          Parameter for instances:
          __decoration (default "plain"), parameter_declaration (default " {-workflow ""} {-user_id} {-ical 0} {-max_entries} ")
          Methods for instances:
          initialize, render, render_ical
          Methods to be applied on the class:
          Methods provided by the meta-class

Class Relations

  • superclass: ::xowiki::Includelet[i]
::xowiki::IncludeletClass create ::xowiki::includelet::wf-todo \
     -superclass ::xowiki::Includelet \
     -parameter {{__decoration plain} {parameter_declaration {
          {-workflow ""}
          {-user_id}
          {-ical 0}
          {-max_entries}
        }}}

Methods

  • instproc initialize

    ::481079 instproc initialize {} {
        my get_parameters
        if {![info exists user_id]} {set user_id [::xo::cc user_id]}
    
        set sql {
          select assignee,xowiki_form_page_id,state,i.publish_status,page_template,
              p.creation_date, p.last_modified, p,description,
              i2.name as wf_name,p.title,i.name,i.parent_id,o.package_id as pid
          from xowiki_form_pagei p,cr_items i, cr_items i2, acs_objects o 
          where (assignee = :user_id or acs_group__member_p(:user_id,assignee, 'f'))
          and i.live_revision = xowiki_form_page_id 
          and p.page_template = i2.item_id 
          and o.object_id = xowiki_form_page_id
        }
        if {$workflow ne ""} {
          # The workflow might be of one of the following forms:
          #   name
          #   <language prefix>:name
          #   /path-in-package/<language prefix>:name
          #   //package/<language prefix>:name
          #   //package/path-in-package/<language prefix>:name
          #
          # To address all workflow of a package instance, use
          #   //package/
          #
          if {[regexp {^/(/.*)/$} $workflow _ package]} {
    	# all workflows from this package
            ::xowf::Package initialize -url $package
            #my msg "using package_id=$package_id"
            append sql " and o.package_id = :package_id"
          } else {
    	if {[regexp {^/(/[^/]+)(/.+)$} $workflow _ package path]} {
    	  ::xowf::Package initialize -url $package
    	  #my msg "using package_id=$package_id"
    	} else {
    	  set path $workflow
    	}
    	set parent_id [[my set __including_page] parent_id]
    	set wf_page [$package_id get_page_from_item_ref -parent_id $parent_id $path]
            if {$wf_page eq ""} {
    	  my msg "cannot resolve page $workflow"
              set package_id -1; set page_template -1
            } else {
              set page_template [$wf_page item_id]
              set package_id [$wf_page package_id]
            }
            #my msg "page_template=$page_template pkg=$package_id"
            append sql " and o.package_id = :package_id and p.page_template = :page_template"
          }
        }
    
        append sql " order by p.last_modified desc"
    
        my set items [::xowiki::FormPage instantiate_objects -sql $sql]
      }
    
  • instproc render

    ::481079 instproc render {} {
        my get_parameters
        if {$ical} {return [my render_ical]}
    
        my instvar items
        set t [TableWidget new -volatile  -columns {
                     Field package -label Package
                     AnchorField wf -label Workflow
                     AnchorField title -label "Todo"
                     Field state -label [::xowiki::FormPage::slot::state set pretty_name]
                   }]
        foreach i [$items children] {
          $i instvar wf_name name title state xowiki_form_page_id pid parent_id
          ::xowf::Package initialize -package_id $pid
          $t add  -wf $wf_name  -wf.href [$pid pretty_link -parent_id $parent_id $wf_name]  -title $title  -title.href [$pid pretty_link -parent_id $parent_id $name]  -state $state  -package [$pid package_url]
        }
        return [$t asHTML]
      }
    
  • instproc render_ical

    ::481079 instproc render_ical {} {
        my instvar items
        foreach i [$items children] {
          $i instvar wf_name name title state xowiki_form_page_id pid description parent_id
          ::xowf::Package initialize -package_id $pid
    
          $i class ::xo::ical::VTODO
          $i configure -uid $pid-$xowiki_form_page_id  -url [$pid pretty_link -absolute true $parent_id $name]  -summary "$title ($state)"  -description "Workflow instance of workflow $wf_name $description"
        }
        $items mixin ::xo::ical::VCALENDAR
        $items configure -prodid "-//WU Wien//NONSGML XoWiki Content Flow//EN" 
        set text [$items as_ical]
        #my log "--ical sending $text"
        #ns_return 200 text/calendar $text
        ns_return 200 text/plain $text
      }
    

Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]