xowiki::Package instproc get_parameter_from_parameter_page (public)

 <instance of xowiki::Package[i]> get_parameter_from_parameter_page \
    [ -parameter_page_name parameter_page_name ] parameter [ default ]

Defined in packages/xowiki/tcl/package-procs.tcl

Try to get the parameter from the named parameter_page.

Switches:
-parameter_page_name
(optional)
Parameters:
parameter
default (optional)
Returns:
parameter value or empty

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xowiki::Package instproc get_parameter_from_parameter_page xowiki::Package instproc get_parameter_from_parameter_page test_xowiki_test_cases->xowiki::Package instproc get_parameter_from_parameter_page ad_log ad_log (public) xowiki::Package instproc get_parameter_from_parameter_page->ad_log nsf::is nsf::is xowiki::Package instproc get_parameter_from_parameter_page->nsf::is

Testcases:
xowiki_test_cases
Source code:
set value $default
if {$parameter_page_name ne ""} {
  if {![regexp {/?..:} $parameter_page_name]} {
    ad_log error "Name of parameter page '$parameter_page_name'"  "of FormPage [self] must contain a language prefix"
  } else {
    set page [::xo::cc cache  [list ::${:id} get_page_from_item_ref $parameter_page_name]]
    if {$page eq ""} {
      ad_log error "Could not resolve parameter page '$parameter_page_name'"  "for package ${:id}."
    }
    #
    # The following block should not be necessary
    #
    if {![::nsf::is object $page]} {
      ad_log warning "We have to refetch parameter page"
      ::xo::db::CrClass get_instance_from_db -item_id [string trimleft $page :]
    }

    if {$page ne "" && [$page exists instance_attributes]} {
      set __ia [$page set instance_attributes]
      if {[dict exists $__ia $parameter]} {
        set value [dict get $__ia $parameter]
      }
    }
  }
}
return $value
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: