Class ::xowiki::includelet::page_fragment_cache

::xowiki::includelet::page_fragment_cache[i] create ...

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Object[i]
::xotcl::Class create ::xowiki::includelet::page_fragment_cache \
     -superclass ::xotcl::Object

Methods (to be applied on instances)

  • cache_includelet_data (scripted)

    #:msg "data=[next]"
    set data [next]
    if {$data ne ""} {
      ::xowiki::cache set -partition_key ${:package_id} $key $data
    }
  • render (scripted)

    set c [:info class]
    #
    # Construct a key based on the class parameters and the
    # actual parameters
    #
    set key "PF-${:package_id}-"
    append key [expr {[$c aggregating] ? "agg" : "ind"}]
    append key "-$c ${:__caller_parameters}"
    if {[$c localized]}    {append key -[:locale]}
    if {[$c personalized]} {append key -[::xo::cc user_id]}
    #
    # Get the HTML from the rendered includelet by calling "next"
    #
    set HTML [::xowiki::cache eval -partition_key ${:package_id} $key next]
    #
    # Some side-effects might be necessary, even when the HTML output
    # of the includelet is cached (e.g. some associative arrays,
    # etc.).  For this purpose, we provide here a means to cache
    # additional some "includelet data", if the includelet provides
    # it.
    #
    if {[catch {set data [::xowiki::cache get -partition_key ${:package_id} $key-data]}]} {
      :cache_includelet_data $key-data
    } else {
      #:msg "eval $data"
      {*}$data
    }
    return $HTML