Saltar al contenido principal
Inicio del contenido principal
Methods: Source: Variables:
[All Methods | Documented Methods | Hide Methods] [Display Source | Hide Source] [Show Variables | Hide Variables]

::xotcl::Class[i] ::xowiki::Link

Class Hierarchy of ::xowiki::Link

  • ::xotcl::Object[i]
    Meta-class:
    ::xotcl::Class[i]
    Methods for instances:
    __api_make_doc, __api_make_forward_doc, __nextC, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, checkC, classC, cleanupC, configureC, contains, copy, db_1rowC, debug, defaultmethod, destroyC, destroy_on_cleanup, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearchC, forwardC, hasclass, incrC, infoC, init, instvarC, invarC, isclassC, ismetaclassC, ismixinC, isobjectC, istypeC, lappendC, log, method, mixinC, mixinguardC, move, msg, noinitC, parametercmdC, procC, procsearchC, qn, requireNamespaceC, self, serialize, setC, substC, traceC, unsetC, uplevelC, upvarC, volatileC, vwaitC
    Methods to be applied on the class (in addition to the methods provided by the meta-class):
    __exitHandler, getExitHandler, setExitHandler, unsetExitHandler
    • ::xowiki::BaseLink[i]
      Meta-class:
      ::xotcl::Class[i]
      Parameter for instances:
      anchor (default ""), cssclass, extra_query_parameter, href, label, target, title
      Methods for instances:
      mk_css_class
      Methods to be applied on the class:
      Methods provided by the meta-class
      • ::xowiki::Link[i]
        Meta-class:
        ::xotcl::Class[i]
        Parameter for instances:
        lang, name, package_id, page, parent_id, stripped_name, type
        Methods for instances:
        atts, folder_id, init, lookup_xowiki_package_by_name, render, render_found, render_not_found, resolve
        Methods to be applied on the class:
        Methods provided by the meta-class

Class Relations

  • superclass: ::xowiki::BaseLink[i]
  • instmixin: ::xowiki::LinkCache[i]
  • subclass: ::xowiki::Link::glossary[i], ::xowiki::Link::image[i], ::xowiki::Link::language[i]
::xotcl::Class create ::xowiki::Link \
     -superclass ::xowiki::BaseLink \
     -parameter {lang name package_id page parent_id stripped_name type} \
     -instmixin ::xowiki::LinkCache

Methods

  • instproc atts

    ::xowiki::Link instproc atts {} {
        set atts ""
        if {[my exists title]}  {append atts " title='[string map [list ' {'}] [my title]]'"}
        if {[my exists target]} {append atts " target='[my target]'"}
      }
  • instproc folder_id

    ::xowiki::Link instproc folder_id args {
        # This method is deprecated
        # just for backward compatibility
        my log "--deprecated [self proc] [self args], called from [self callingobject] [self callingproc]"
        eval my parent_id $args
      }
  • instproc init

    ::xowiki::Link instproc init {} {
        my instvar page name
        set class [self class]::[my type]
        if {[my isclass $class]} {my class $class}
        if {![my exists stripped_name]} {
          # set stripped name and lang from provided name or to the default
          my instvar stripped_name lang
          if {![regexp {^(..):(.*)$} $name _ lang stripped_name]} {
            set stripped_name $name; set lang ""
          }
        }
        if {![my exists label]}      {my label $name}
        if {![my exists parent_id]}  {my parent_id [$page parent_id]}
        if {![my exists package_id]} {my package_id [$page package_id]}
    
        #my log "--L link has class [my info class] // $class"
      }
  • instproc lookup_xowiki_package_by_name

    ::xowiki::Link instproc lookup_xowiki_package_by_name {name start_package_id} {
        set ancestors [site_node::get_ancestors  -node_id $start_package_id  -element node_id]
        foreach a $ancestors {
          set package_id [site_node::get_children -node_id $a -package_key xowiki  -filters [list name $name] -element package_id]
          if {$package_id ne ""} {
            #my log "--LINK found package_id=$package_id [my isobject ::$package_id]"
            ::xowiki::Package require $package_id
            return $package_id
          }
        }
        return 0
      }
  • instproc render

    ::xowiki::Link instproc render {} {
        my instvar package_id
        set page [my page]
        set item_id [my resolve]
        #my msg "--u resolve returns $item_id"
        if {$item_id} {
          $page lappend references [list $item_id [my type]]
          ::xowiki::Package require $package_id
          set href [::$package_id pretty_link -lang [my lang] -anchor [my anchor] [my name]]
          my render_found $href [my label]
        } else {
          $page incr unresolved_references
          if {[$page exists __unresolved_object_type]} {
    	# get the desired object_type for unresoved entries
    	set object_type [$page set __unresolved_object_type]
          } else {
    	set object_type [[$page info class] set object_type]
    	if {$object_type ne "::xowiki::Page" && $object_type ne "::xowiki::PlainPage"} {
    	  # TODO: this is a temporary solution. we should find a way to
    	  # pass similar to file or image entries the type of this
    	  # entry. Maybe we can get the type as well from a kind of
    	  # blackboard, where the type of the "edit" wiki-menu-entry is
    	  # stored as well.
    	  set object_type ::xowiki::Page
    	}
          }
          set name [my name]
          set title [my label]
          set new_link  [$package_id make_link $package_id edit-new object_type name title] 
          #set href [export_vars -base [$package_id package_url]  #              {{edit-new 1} object_type name title}]
    
          set html [my render_not_found $new_link [my label]]
          $page lappend __unresolved_references $html
          return $html
        }
      }
  • instproc render_found

    ::xowiki::Link instproc render_found {href label} {
        return "<a [my atts] [my mk_css_class] href='$href'>$label</a>"
      }
  • instproc render_not_found

    ::xowiki::Link instproc render_not_found {href label} {
        if {$href eq ""} {
          return \[$label\]
        } else {
          return "<a [my mk_css_class] href='$href'> \[ </a>$label <a [my mk_css_class] href='$href'> \] </a>"
        }
      }
  • instproc resolve

    ::xowiki::Link instproc resolve {} {
        #my msg "--lookup of [my name] -page [my page]"
        return [::xo::db::CrClass lookup -name [my name] -parent_id [my parent_id]]
      }

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