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::categories-recent

Class Hierarchy of ::xowiki::includelet::categories-recent

  • ::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::categories-recent[i]
          Meta-class:
          ::xowiki::IncludeletClass[i]
          Parameter for instances:
          parameter_declaration (default " {-max_entries:integer 10} {-tree_name ""} {-locale ""} {-pretty_age "off"} "), title (default "Recently Changed Pages (by categories)")
          Methods for instances:
          include_head_entries, initialize, render
          Methods to be applied on the class:
          Methods provided by the meta-class

Class Relations

  • superclass: ::xowiki::Includelet[i]
::xowiki::IncludeletClass create ::xowiki::includelet::categories-recent \
     -superclass ::xowiki::Includelet \
     -parameter {{parameter_declaration {
          {-max_entries:integer 10}
          {-tree_name ""}
          {-locale ""}
          {-pretty_age "off"}
        }} {title "Recently Changed Pages (by categories)"}}

Methods

  • instproc include_head_entries

    ::xowiki::policy5 instproc include_head_entries {} {
        ::xowiki::Tree include_head_entries -renderer [my set style]
      }
    
  • instproc initialize

    ::xowiki::policy5 instproc initialize {} {
        my set style sections
        # When pretty age is activated, this includedlet is not suited for
        # caching (it could make sense e.g. when the age granularity is 1
        # minute or more). This measure here (turing off caching
        # completely) is a little bit too much, but it is safe.
        my get_parameters
        if {[[my info class] cacheable] && $pretty_age ne "off"} {
          [my info class] cacheable false
        }
      }
    
  • instproc render

    ::xowiki::policy5 instproc render {} {
        my get_parameters
      
        if {![my exists id]} {my set id [::xowiki::Includelet html_id [self]]}
        set cattree [::xowiki::Tree new -volatile -id [my id]]
    
        foreach {locale locale_clause}  [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] break
    
        set tree_ids [::xowiki::Category get_mapped_trees -object_id $package_id -locale $locale  -names $tree_name -output tree_id]
        
        if {$tree_ids ne ""} {
          set tree_select_clause "and c.tree_id in ([join $tree_ids ,])"
        } else {
          set tree_select_clause ""
        }
        set sql [::xo::db::sql select  -vars "c.category_id, ci.name, ci.parent_id, r.title, r.publish_date,  to_char(r.publish_date,'YYYY-MM-DD HH24:MI:SS') as formatted_date"  -from "category_object_map_tree c, cr_items ci, cr_revisions r, xowiki_page p"  -where "c.object_id = ci.item_id and ci.parent_id = [$package_id folder_id]  and r.revision_id = ci.live_revision  and p.page_id = r.revision_id $tree_select_clause $locale_clause  and ci.publish_status <> 'production'"  -orderby "publish_date desc"  -limit $max_entries]
        db_foreach [my qn get_pages] $sql {
          if {$title eq ""} {set title $name}
          set itemobj [Object new]
          set prefix ""
          set suffix ""
          switch -- $pretty_age {
    	1 {set suffix " ([::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [my locale]])"}
    	2 {set suffix "([::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [my locale] -levels 2])"}
    	default {set prefix "$formatted_date "}
          }
          if {$prefix ne ""} {set prefix "<span class='date'>$prefix</span>";$itemobj set encoded(prefix) 1}
          if {$suffix ne ""} {set suffix "<span class='date'>$suffix</span>";$itemobj set encoded(suffix) 1}
          foreach var {name title prefix suffix} {$itemobj set $var [set $var]}
          $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name]        
    
          if {![info exists categories($category_id)]} {
            set categories($category_id) [::xowiki::TreeNode new  -label [category::get_name $category_id $locale]  -level 1]
            $cattree add  $categories($category_id)
          }
          $cattree add_item -category $categories($category_id) -itemobj $itemobj
        }
        return [$cattree render -style [my set style]]
      }
    

Variables

::xowiki::includelet::categories-recent set __default_metaclass ::xotcl::Class
::xowiki::includelet::categories-recent set __default_superclass ::xotcl::Object
::xowiki::includelet::categories-recent set aggregating true
::xowiki::includelet::categories-recent set cacheable true
::xowiki::includelet::categories-recent set localized true
::xowiki::includelet::categories-recent set personalized false

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