Class ::xowiki::includelet::get

::xowiki::includelet::get[i] create ... \
           [ -__decoration (default "none") ] \
           [ -parameter_declaration (default " {-variable} {-form_variable} {-source ""} ") ]

Get an instance variable from the current or from a different page.
Defined in packages/xowiki/tcl/includelet-procs.tcl

Class Relations

  • class: ::xowiki::IncludeletClass[i]
  • superclass: ::xowiki::Includelet[i]
::xowiki::IncludeletClass create ::xowiki::includelet::get \
     -superclass ::xowiki::Includelet

Methods (to be applied on instances)

  • __decoration (setter)

  • parameter_declaration (setter)

  • render (scripted)

    :get_parameters
    if {![info exists variable] && ![info exists form_variable]} {
      return "either -variable or -form_variable must be specified"
    }
    set page [:resolve_page_name $source]
    
    if {[info exists variable] && [$page exists $variable]} {
      return [$page set $variable]
    }
    if {[info exists form_variable] && [$page exists instance_attributes]} {
      set __ia [$page set instance_attributes]
      if {[dict exists $__ia $form_variable]} {
        return [dict get $__ia $form_variable]
      }
    }
    if {[info exists variable]} {
      return "no such variable $variable defined in page [$page set name]"
    }
    return "no such form_variable $form_variable defined in page [$page set name]"