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]

::xotcl::Class[i] ::xotcl::Object

Class Hierarchy of ::xotcl::Object

  • ::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

Class Relations

  • subclass: ::Generic::Form[i], ::Hypermail2xowiki[i], ::OpenID[i], ::RR[i], ::Test[i], ::xo::AsyncHttpRequest::SimpleListener[i], ::xo::Cluster[i], ::xo::Context[i], ::xo::DS[i], ::xo::HttpCore[i], ::xo::HttpRequestTrace[i], ::xo::InstanceManager[i], ::xo::Localizer[i], ::xo::Message[i], ::xo::Module[i], ::xo::OrderedComposite[i], ::xo::OrderedComposite::Child[i], ::xo::OrderedComposite::ChildManager[i], ::xo::OrderedComposite::IndexCompare[i], ::xo::OrderedComposite::MethodCompare[i], ::xo::Page[i], ::xo::Policy[i], ::xo::ProtocolHandler[i], ::xo::SiteNode[i], ::xo::SiteNodeCache[i], ::xo::TRN-Mode[i], ::xo::Table::TABLE::HiddenField[i], ::xo::Timestamp[i], ::xo::Tls[i], ::xo::db::CrCache[i], ::xo::db::CrCache::Class[i], ::xo::db::CrCache::Item[i], ::xo::db::Object[i], ::xo::db::sql::acs[i], ::xo::db::sql::acs_activity[i], ::xo::db::sql::acs_attribute[i], ::xo::db::sql::acs_event[i], ::xo::db::sql::acs_group[i], ::xo::db::sql::acs_log[i], ::xo::db::sql::acs_message[i], ::xo::db::sql::acs_object[i], ::xo::db::sql::acs_object_type[i], ::xo::db::sql::acs_object_util[i], ::xo::db::sql::acs_permission[i], ::xo::db::sql::acs_privilege[i], ::xo::db::sql::acs_reference[i], ::xo::db::sql::acs_rel[i], ::xo::db::sql::acs_rel_type[i], ::xo::db::sql::acs_sc_binding[i], ::xo::db::sql::acs_sc_contract[i], ::xo::db::sql::acs_sc_impl[i], ::xo::db::sql::acs_sc_impl_alias[i], ::xo::db::sql::acs_sc_implementation[i], ::xo::db::sql::acs_sc_msg_type[i], ::xo::db::sql::acs_sc_operation[i], ::xo::db::sql::acs_user[i], ::xo::db::sql::admin_rel[i], ::xo::db::sql::apm[i], ::xo::db::sql::apm_application[i], ::xo::db::sql::apm_package[i], ::xo::db::sql::apm_package_type[i], ::xo::db::sql::apm_package_version[i], ::xo::db::sql::apm_parameter_value[i], ::xo::db::sql::apm_service[i], ::xo::db::sql::application_group[i], ::xo::db::sql::authority[i], ::xo::db::sql::category[i], ::xo::db::sql::category_link[i], ::xo::db::sql::category_synonym[i], ::xo::db::sql::category_tree[i], ::xo::db::sql::composition_rel[i], ::xo::db::sql::content_extlink[i], ::xo::db::sql::content_folder[i], ::xo::db::sql::content_item[i], ::xo::db::sql::content_item_search[i], ::xo::db::sql::content_keyword[i], ::xo::db::sql::content_revision[i], ::xo::db::sql::content_search[i], ::xo::db::sql::content_symlink[i], ::xo::db::sql::content_template[i], ::xo::db::sql::content_type[i], ::xo::db::sql::doc[i], ::xo::db::sql::file_storage[i], ::xo::db::sql::image[i], ::xo::db::sql::journal_entry[i], ::xo::db::sql::membership_rel[i], ::xo::db::sql::notification[i], ::xo::db::sql::notification_delivery_method[i], ::xo::db::sql::notification_interval[i], ::xo::db::sql::notification_reply[i], ::xo::db::sql::notification_request[i], ::xo::db::sql::notification_type[i], ::xo::db::sql::party[i], ::xo::db::sql::party_approved_member[i], ::xo::db::sql::person[i], ::xo::db::sql::recurrence[i], ::xo::db::sql::rel_constraint[i], ::xo::db::sql::rel_segment[i], ::xo::db::sql::rss_gen_subscr[i], ::xo::db::sql::search_observer[i], ::xo::db::sql::site_node[i], ::xo::db::sql::site_node_object_map[i], ::xo::db::sql::subsite_callback[i], ::xo::db::sql::template_demo_note[i], ::xo::db::sql::time_interval[i], ::xo::db::sql::timespan[i], ::xo::db::sql::timezone[i], ::xo::db::sql::util[i], ::xo::db::sql::xorb_servicecontract[i], ::xo::db::sql::xorb_serviceimplementation[i], ::xo::db::temp_table[i], ::xo::ical::VCALENDAR[i], ::xo::ical::VCALITEM[i], ::xo::parameter[i], ::xo::role::Role[i], ::xo::tdom::AttributeManager[i], ::xotcl::Class[i], ::xotcl::THREAD[i], ::xotcl::THREAD::Client[i], ::xowf::Context[i], ::xowf::WorkflowConstruct[i], ::xowf::WorkflowPage[i], ::xowf::atjob[i], ::xowiki::ADP_Generator[i], ::xowiki::ArchiveFile[i], ::xowiki::BaseLink[i], ::xowiki::Category[i], ::xowiki::Importer[i], ::xowiki::MenuBar[i], ::xowiki::ParameterCache[i], ::xowiki::RSS-client[i], ::xowiki::RSS-client::channel[i], ::xowiki::RSS-client::item[i], ::xowiki::TreeRenderer=list[i], ::xowiki::WebDav-stm-xowiki[i], ::xowiki::Weblog[i], ::xowiki::Weblog::EntryRenderer[i], ::xowiki::Weblog::WeblogRenderer[i], ::xowiki::XMLSyndication[i], ::xowiki::includelet::PageReorderSupport[i], ::xowiki::includelet::decoration=edit[i], ::xowiki::includelet::decoration=plain[i], ::xowiki::includelet::decoration=portlet[i], ::xowiki::includelet::decoration=rightbox[i], ::xowiki::includelet::form-menu-button[i], ::xowiki::includelet::highcharts[i], ::xowiki::includelet::page_fragment_cache[i], ::xowiki::policy1::CrFolder[i], ::xowiki::policy1::File[i], ::xowiki::policy1::Form[i], ::xowiki::policy1::Object[i], ::xowiki::policy1::Package[i], ::xowiki::policy1::Page[i], ::xowiki::policy2::File[i], ::xowiki::policy2::Form[i], ::xowiki::policy2::Object[i], ::xowiki::policy2::Package[i], ::xowiki::policy2::Page[i], ::xowiki::policy3::File[i], ::xowiki::policy3::Form[i], ::xowiki::policy3::Object[i], ::xowiki::policy3::Package[i], ::xowiki::policy3::Page[i], ::xowiki::policy5::File[i], ::xowiki::policy5::Form[i], ::xowiki::policy5::FormPage[i], ::xowiki::policy5::Object[i], ::xowiki::policy5::Package[i], ::xowiki::policy5::Page[i]
::xotcl::Class create ::xotcl::Object

Methods

  • proc getExitHandler

    ::202158 proc getExitHandler {} {::nsf::exithandler get}
    
  • proc setExitHandler

    ::202158 proc setExitHandler newbody {::nsf::exithandler set $newbody}
    
  • proc unsetExitHandler

    ::202158 proc unsetExitHandler {} {::nsf::exithandler unset}
    
  • instproc __api_make_doc

    ::202158 instproc __api_make_doc {inst proc_name} {
      upvar doc doc private private public public deprecated deprecated
      if {$doc eq ""} {
        set doc_elements(main) ""
      } else {
        ad_parse_documentation_string $doc doc_elements
      }
      set defaults [list]
      foreach a [my info ${inst}args $proc_name] {
        if {[my info ${inst}default $proc_name $a d]} {lappend defaults $a $d}
      }
      set public [expr {$private ? false : true}]
      set doc_elements(public_p) $public
      set doc_elements(private_p) $private
      set doc_elements(deprecated_p) $deprecated
      set doc_elements(warn_p) $deprecated
      set doc_elements(varargs_p) [expr {[lsearch args [my info ${inst}args $proc_name]]>-1}] 
      set doc_elements(flags) [list]
      set doc_elements(switches) [list]
      foreach f [my info ${inst}nonposargs $proc_name] {
        set pair [split [lindex $f 0 0] :]
        set sw [string range [lindex $pair 0] 1 end]
        lappend doc_elements(switches) $sw
        lappend doc_elements(flags) $sw [lindex $pair 1]
        #my log "default_value $proc_name: $sw -> '[lindex $f 1]' <$pair/$f>"
        if {[lindex $pair 1] eq "switch" && [lindex $f 1] eq ""} {
          set default "false"
        } else {
          set default [lindex $f 1]
        }
        #my log "default_value $proc_name: $sw -> 'default' <$pair/$f>"
        lappend defaults $sw $default
      }
      set doc_elements(default_values) $defaults
      set doc_elements(positionals) [my info ${inst}args $proc_name] 
      # argument documentation finished
      set scope [::xotcl::api scope]
      set doc_elements(script) [::xotcl::api script_name $scope]
      set proc_index [::xotcl::api proc_index $scope [self] ${inst}proc $proc_name]
      if {![nsv_exists api_proc_doc $proc_index]} {
        nsv_lappend api_proc_doc_scripts $doc_elements(script) $proc_index
      }
      #my log "doc_elements=[array get doc_elements]"
      #my log "SETTING api_proc_doc '$proc_index'"
      nsv_set api_proc_doc $proc_index [array get doc_elements]
    }
    
  • instproc __api_make_forward_doc

    ::202158 instproc __api_make_forward_doc {inst method_name} {
      upvar doc doc private private public public deprecated deprecated
      if {$doc eq ""} {
        set doc_elements(main) ""
      } else {
        ad_parse_documentation_string $doc doc_elements
        #my log "doc_elements=[array get doc_elements]"
      }
      set defaults [list]
      set public [expr {$private ? false : true}]
      set doc_elements(public_p) $public
      set doc_elements(private_p) $private
      set doc_elements(deprecated_p) $deprecated
      set doc_elements(warn_p) $deprecated
      set doc_elements(varargs_p) false
      set doc_elements(flags) [list]
      set doc_elements(switches) [list]
      set doc_elements(default_values) [list]
      set doc_elements(positionals) [list] 
      # argument documentation finished
      set scope [::xotcl::api scope]
      set doc_elements(script) [::xotcl::api script_name $scope]
      set proc_index [::xotcl::api proc_index $scope [self] ${inst}forward $method_name]
      if {![nsv_exists api_proc_doc $proc_index]} {
        nsv_lappend api_proc_doc_scripts $doc_elements(script) $proc_index
      }
      #my log "doc_elements=[array get doc_elements]"
      #my log "SETTING api_proc_doc '$proc_index'"
      nsv_set api_proc_doc $proc_index [array get doc_elements]
    }
    
  • instproc __timediff

    ::202158 instproc __timediff {} {
      set now [ns_time get]
      if {[ns_conn isconnected]} {
        set start_time [ns_conn start]
      } else {
        if {![info exists ::__start_time]} {set ::__start_timestamp $now}
        set start_time $::__start_timestamp
      }
      set t [ns_time diff $now $start_time]
      set ms [expr {[ns_time seconds $t]*1000 + [ns_time microseconds $t]/1000}]
      if {[info exists ::__last_timestamp]} {
        set t [ns_time diff $now $::__last_timestamp]
        set dms [expr {[ns_time seconds $t]*1000 + [ns_time microseconds $t]/1000}]
        set diff ", ${dms}ms"
      } else {
        set diff ""
      }
      set ::__last_timestamp $now
      return "${ms}ms$diff"
    }
    
  • instproc abstract

    ::202158 instproc abstract {methtype methname arglist} {
        if {$methtype ne "proc" && $methtype ne "instproc" && $methtype ne "method"} {
          error "invalid method type '$methtype',  must be either 'proc', 'instproc' or 'method'."
        }
        :$methtype $methname $arglist "
          if {!\[::xotcl::self isnextcall\]} {
            error \"Abstract method $methname $arglist called\"
          } else {::xotcl::next}
        "
      }
    
  • instproc ad_doc

    ::202158 instproc ad_doc doc_string {
      ad_parse_documentation_string $doc_string doc_elements
      set scope [::xotcl::api scope]
      set doc_elements(script) [::xotcl::api script_name $scope]
      set proc_index [::xotcl::api object_index $scope [self]]
    
      #if {![nsv_exists api_proc_doc $proc_index]} {
      #  nsv_lappend api_proc_doc_scripts $doc_elements(script) $proc_index
      #}
      set doc_elements(public_p) true
      set doc_elements(private_p) false
      set doc_elements(varargs_p) false
      set doc_elements(deprecated_p) false
      set doc_elements(warn_p) false
      set doc_elements(default_values) ""
      set doc_elements(switches) ""
      set doc_elements(positionals) ""
      set doc_elements(flags) ""
      nsv_set api_proc_doc $proc_index [array get doc_elements]
      nsv_set api_library_doc  $proc_index  [array get doc_elements]
    
      set file_index $doc_elements(script)
    
      if {[nsv_exists api_library_doc $file_index]} {
        array set elements [nsv_get api_library_doc $file_index]
      }
      set oldDoc [expr {[info exists elements(main)] ?  [lindex $elements(main) 0] : ""}]
      set prefix "This file defines the following Objects and Classes"
      set entry [::xotcl::api object_link $scope [self]]
      if {![string match *$prefix* $oldDoc]} {
        append oldDoc "<p>$prefix: $entry"
      } else {
        append oldDoc ", $entry"
      }
      set elements(main) [list $oldDoc]
      #my log "elements = [array get elements]"
      nsv_set api_library_doc $file_index [array get elements]
    }
    
  • instproc ad_forward

    ::202158 instproc ad_forward {{-private:switch false} {-deprecated:switch false} {-warn:switch false} {-debug:switch false} method_name doc args} {
        uplevel [self] forward $method_name $args
        my __api_make_forward_doc "" $method_name
      }
    
  • instproc ad_proc

    ::202158 instproc ad_proc {{-private:switch false} {-deprecated:switch false} {-warn:switch false} {-debug:switch false} proc_name arguments doc body} {
        uplevel [list [self] proc $proc_name $arguments $body]
        my __api_make_doc "" $proc_name
      }
    
  • instproc asHTML

    ::202158 instproc asHTML {{-master defaultMaster} -page:switch} {
      require_html_procs
      dom createDocument html doc
      set root [$doc documentElement]
      if {!$page} {
        $root appendFromScript {my render}
        set n [$root childNode]
        if {$n eq ""} {
          return ""
        }
        return [$n asHTML]
      } else {
        set slave [$master decorate $root]
        $slave appendFromScript {my render}
        ns_return 200 text/html [$root asHTML]
      }
    }
    
  • instproc check

    ::202158 instproc check checkoptions {
        ::nsf::method::assertion [self] check [::xotcl::checkoption_xotcl1_to_internal $checkoptions]
      }
    
  • instproc debug

    ::202158 instproc debug msg {
      ns_log debug "[self] [self callingclass]->[self callingproc]: $msg"
    }
    
  • instproc destroy_on_cleanup

    ::202158 instproc destroy_on_cleanup {} {
        #my log "--cleanup adding ::xo::cleanup([self]) [list [self] destroy]"
        set ::xo::cleanup([self]) [list [self] destroy]
      }
    
  • instproc ds

    ::202158 instproc ds msg {
      ds_comment "[self]: $msg, ([self callingclass]->[self callingproc] [my __timediff])"
    }
    
  • instproc extractConfigureArg

    ::202158 instproc extractConfigureArg {al name {cutTheArg 0}} {
        set value ""
        upvar $al argList
        set largs [llength $argList]
        for {set i 0} {$i < $largs} {incr i} {
          if {[lindex $argList $i] == $name && $i + 1 < $largs} {
            set startIndex $i
            set endIndex [expr {$i + 1}]
            while {$endIndex < $largs &&
                   [string first - [lindex $argList $endIndex]] != 0} {
              lappend value [lindex $argList $endIndex]
              incr endIndex
            }
          }
        }
        if {[info exists startIndex] && $cutTheArg != 0} {
          set argList [lreplace $argList $startIndex [expr {$endIndex - 1}]]
        }
        return $value
      }
    
  • instproc filtersearch

    ::202158 instproc filtersearch filter {
        set handle [::nsf::directdispatch [::nsf::current object]  ::nsf::methods::object::info::lookupfilter $filter]
        return [method_handle_to_xotcl $handle]
      }
    
  • instproc forward

    ::202158 instproc forward {-default -earlybinding:switch -methodprefix -objscope:switch -onerror -verbose:switch method target args} {
        set arglist [list]
        if {[info exists default]} {lappend arglist -default $default}
        if {$earlybinding} {lappend arglist "-earlybinding"}
        if {[info exists methodprefix]} {lappend arglist -methodprefix $methodprefix}
        if {$objscope} {lappend arglist "-objframe"}
        if {[info exists onerror]} {lappend arglist -onerror $onerror}
        if {$verbose} {lappend arglist -verbose}
        if {[info exists target]} {lappend arglist $target}
        if {[llength $args] > 0} {lappend arglist {*}$args}
        set r [::nsf::method::forward [self] -per-object $method {*}$arglist]
        return $r
      }
    
  • instproc hasclass

    ::202158 instproc hasclass cl {
        if {![::nsf::is class $cl]} {return 0}
        if {[::nsf::directdispatch [self] ::nsf::methods::object::info::hasmixin $cl]} {return 1}
        ::nsf::directdispatch [self] ::nsf::methods::object::info::hastype $cl
      }
    
  • instproc init

    ::202158 instproc init args {
        if {![::nsf::current isnextcall] && [llength $args] > 0 && [::nsf::configure debug] > 0} {
          ::nsf::log Warning "Arguments '$args' to constructor of object [self] are most likely not processed"
        }
      }
    
  • instproc isclass

    ::202158 instproc isclass {{class {[self]}}} {::nsf::is class $class}
    
  • instproc ismetaclass

    ::202158 instproc ismetaclass {{class {[self]}}} {::nsf::is metaclass $class}
    
  • instproc ismixin

    ::202158 instproc ismixin class {
        return [expr {[::nsf::is class $class] &&
    		  [my ::nsf::methods::object::info::hasmixin $class]}]
      }
    
  • instproc isobject

    ::202158 instproc isobject {{object {[self]}}} {::nsf::object::exists $object}
    
  • instproc istype

    ::202158 instproc istype class {
        return [expr {[::nsf::is class $class] &&
    		  [::nsf::directdispatch [self] ::nsf::methods::object::info::hastype $class]}]
      }
    
  • instproc log

    ::202158 instproc log msg {
      ns_log notice "$msg, [self] [self callingclass]->[self callingproc] ([my __timediff])"
    }
    
  • instproc method

    ::202158 instproc method {name arguments body} {
        :proc $name $arguments $body
      }
    
  • instproc msg

    ::202158 instproc msg {{-html false} msg} {
      if {[ns_conn isconnected]} {
        set msg "[self]: $msg  ([self callingclass]->[self callingproc])"
        if {$html} {
            util_user_message -html -message $msg
        } else {
          util_user_message -message $msg
        }
      }
    }
    
  • instproc objectparameter

    ::202158 instproc objectparameter {} {
        set parameterDefinitions [list]
        set class [nsf::directdispatch [self] ::nsf::methods::object::info::class]
        foreach slot [nsf::directdispatch $class ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] {
          lappend parameterDefinitions [$slot getParameterSpec]
        }
        lappend parameterDefinitions args:alias,method=residualargs,args
        return $parameterDefinitions
      }
    
  • instproc proc

    ::202158 instproc proc {name arguments body precondition postcondition} {
        set conditions [list]
        if {[info exists precondition]}  {lappend conditions -precondition  $precondition}
        if {[info exists postcondition]} {lappend conditions -postcondition $postcondition}
        ::nsf::method::create [self] -per-object $name $arguments $body {*}$conditions
      }
    
  • instproc procsearch

    ::202158 instproc procsearch name {
        set handle [::nsf::directdispatch [::nsf::current object]  ::nsf::methods::object::info::lookupmethod $name]
        return [method_handle_to_xotcl $handle]
      }
    
  • instproc qn

    ::202158 instproc qn query_name {
      set qn "dbqd.[my uplevel [list self class]]-[my uplevel [list self proc]].$query_name"
      return $qn
    }
    
  • instproc self

    ::202158 instproc self {} ::xotcl::self
    
  • instproc serialize

    ::202158 instproc serialize {} {
      ::Serializer deepSerialize [self]
    }
    
  • instproc set_instance_vars_defaults

    ::202158 instproc set_instance_vars_defaults {} :configure
    
  • instproc show-object

    ::202158 instproc show-object {} {
      #
      # Allow to show an arbitrary object via API-browser.  Per-default,
      # e.g. site-wide can use e.g. /xowiki/index?m=show-object
      #
      set form [rp_getform]
      ns_set update $form object [self]
      ns_set update $form show_source    [::xo::cc query_parameter "show_source" 1]
      ns_set update $form show_methods   [::xo::cc query_parameter "show_methods" 2]
      ns_set update $form show_variables [::xo::cc query_parameter "show_variables" 1]
      rp_internal_redirect /packages/xotcl-core/www/show-object
    }
    
  • instproc unknown

    ::202158 instproc unknown {m args} {
        if {![self isnext]} {
          error "[self]: unable to dispatch method '$m'"
        }
      }
    
  • instproc vwait

    ::202158 instproc vwait varName {
        if {[regexp {:[^:]*} $varName]} {
          error "invalid varName '$varName'; only plain or fully qualified variable names allowed"
        }
        if {[string match ::* $varName]} {
          ::vwait $varName
        } else {
          ::vwait :$varName
        }
      }
    

Instances

::YUI::loader[i], ::defaultMaster[i], ::ns_log[i], ::pageMaster[i], ::xo::broadcast[i], ::xo::db::require[i], ::xo::db::sql[i], ::xo::ical[i], ::xo::library[i], ::xo::ns_log_redirector_manager[i], ::xo::system_stats[i], ::xotcl::@[i], ::xotcl::api[i], ::xotcl::classInfo[i], ::xotcl::config[i], ::xotcl::objectInfo[i], ::xotcl::rcs[i], ::xowiki::autoname[i], ::xowiki::clipboard[i], ::xowiki::tidy[i], ::xowiki::virus[i]

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