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]

::xo::db::Class[i] ::xo::db::Object

Class Hierarchy of ::xo::db::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
    • ::xo::db::Object[i]
      Meta-class:
      ::xo::db::Class[i]
      Methods for instances:
      db_1row, delete, initialize_loaded_object, insert, object_idC, object_titleC, save, save_new
      Methods to be applied on the class:
      Methods provided by the meta-class

Class Relations

  • superclass: ::xotcl::Object[i]
  • subclass: ::xo::Package[i], ::xo::db::CrItem[i], ::xo::db::apm_parameter[i]
::xo::db::Class create ::xo::db::Object \
     -superclass ::xotcl::Object

Methods

  • instproc db_1row

    ::xowiki::policy5 instproc db_1row {qn sql} {
          set answers [uplevel [list ::xo::db::pg_0or1row $sql]]
          if {$answers ne ""} {
    	foreach {att val} [ns_set array $answers] { my set $att $val }
    	ns_set free $answers
    	return 1
          }
          error "query $sql did not return an answer"
        }
    
  • instproc delete (public)

    <instance of ::xo::db::Object[i]> delete
    Delete the object from the database and from memory

    ::xowiki::policy5 instproc delete {} {
        ::xo::db::sql::acs_object delete -object_id [my set object_id]
        my destroy
      }
    
  • instproc initialize_loaded_object

    ::xowiki::policy5 instproc initialize_loaded_object {} {
        #
        # This method is to be called, after an existing
        # object is fetched from the database.
        #
        # empty body, to be refined
      }
    
  • instproc insert

    ::xowiki::policy5 instproc insert {} {my log no-insert;}
    
  • instproc save (public)

    <instance of ::xo::db::Object[i]> save [ -package_id package_id ] \
        [ -modifying_user modifying_user ]
    Save the current object in the database

    Switches:
    -package_id (optional)
    -modifying_user (optional)
    ::xowiki::policy5 instproc save {-package_id -modifying_user} {
        my instvar object_id
        if {![info exists package_id] && [my exists package_id]} {
          set package_id [my package_id]
        }
        [my info class] get_context package_id modifying_user modifying_ip
        db_dml dbqd..update_object {update acs_objects 
          set modifying_user = :modifying_user, modifying_ip = :modifying_ip
          where object_id = :object_id}
      }
    
  • instproc save_new (public)

    <instance of ::xo::db::Object[i]> save_new \
        [ -package_id package_id ] [ -creation_user creation_user ] \
        [ -creation_ip creation_ip ]
    Save the XOTcl Object with a fresh acs_object in the database.

    Switches:
    -package_id (optional)
    -creation_user (optional)
    -creation_ip (optional)
    Returns:
    new object id
    ::xowiki::policy5 instproc save_new {-package_id -creation_user -creation_ip} {
        if {![info exists package_id] && [my exists package_id]} {
          set package_id [my package_id]
        }
        [my info class] get_context package_id creation_user creation_ip
        db_transaction {
          set id [[my info class] new_acs_object  -package_id $package_id  -creation_user $creation_user  -creation_ip $creation_ip  ""]
          [my info class] initialize_acs_object [self] $id
          my insert
        }
        return $id
      }
    

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