%3 ::xotcl::Class ::xotcl::Class → __unknown __class_configureparameter ad_instforward ad_instproc allinstances extend_slot extend_slot_default instfilter instforward instinvar instmixin instparametercmd instproc method parameter slots superclass unknown uses ::xotcl::Object ::xotcl::Object ::xotcl::Class->::xotcl::Object ::xo::db::Class ::xo::db::Class → class_to_object_type → create_all_functions → delete → delete_all_acs_objects → drop_type → exists_in_db → get_class_from_db → get_instance_from_db → get_object_type → get_table_name → object_type_exists_in_db → object_type_to_class check_default_values check_table_atts collect_constraints create_object_type db_slots dbproc_nonposargs drop_object_type fetch_query get_context get_instances_from_db init init_type_hierarchy initialize_acs_object instance_select_query instantiate_objects mk_insert_method mk_update_method new_acs_object new_persistent_object object_types object_types_query require_constraints table_definition unknown ::xo::db::Class->::xotcl::Class ::xo::db::CrClass ::xo::db::CrClass → delete → ensure_item_ids_instantiated → get_child_item_ids → get_instance_from_db → get_name → get_object_type → get_parent_id → id_belongs_to_package → lookup create_object_type delete drop_object_type edit_atts fetch_object folder_type folder_type_unregister_all getFormClass get_instance_from_db get_instances_from_db init insert_statement instance_select_query lock mk_insert_method mk_save_method new_persistent_object remember_long_text_slots type_selection_clause unknown ::xo::db::CrClass->::xo::db::Class ::xo::db::CrCache::Class ::xo::db::CrCache::Class ::xo::db::CrClass->::xo::db::CrCache::Class ::xo::db::CrCache ::xo::db::CrCache ::xo::db::CrClass->::xo::db::CrCache instmixin ::xo::PackageMgr ::xo::PackageMgr → get_package_class_from_package_key configure_fresh_instance first_instance fix_site_wide_package_ids form_unify form_usages get_nls_language_from_lang get_site_wide_page import_prototype_page initialize instances lookup_side_wide_page prototype_page_file_name require require_site_wide_info require_site_wide_pages ::xo::PackageMgr->::xo::db::Class

Class ::xo::db::Class

::xo::db::Class[i] create ... \
           [ -abstract_p (default "f") ] \
           [ -auto_save (default "false") ] \
           [ -id_column id_column ] \
           [ -name_method (default "") ] \
           [ -object_type (default "[self]") ] \
           [ -pretty_name pretty_name ] \
           [ -pretty_plural pretty_plural ] \
           [ -security_inherit_p (default "t") ] \
           [ -sql_package_name sql_package_name ] \
           [ -supertype (default "acs_object") ] \
           [ -table_name table_name ] \
           [ -with_table (default "true") ]

Defined in

Class Relations

  • class: ::xotcl::Class[i]
  • superclass: ::xotcl::Class[i]
  • subclass: ::xo::db::CrClass[i], ::xo::PackageMgr[i]

Methods (to be applied on the object)

Methods (to be applied on instances)

  • abstract_p (setter)

  • auto_save (setter)

  • check_default_values (scripted)

  • check_table_atts (scripted, public)

     <instance of xo::db::Class[i]> check_table_atts

    Check table_name and id_column and set meaningful defaults, if these attributes are not provided.

    Testcases:
    xotcl_core_tutorial_2, xotcl_core_tutorial_3, xotcl_core_tutorial_4
  • collect_constraints (scripted)

  • create_object_type (scripted, public)

     <instance of xo::db::Class[i]> create_object_type

    Create an acs object_type for the current XOTcl class

    Testcases:
    xotcl_core_tutorial_2
  • db_slots (scripted)

  • dbproc_nonposargs (scripted)

  • drop_object_type (scripted, public)

     <instance of xo::db::Class[i]> drop_object_type \
        [ -cascade cascade ]

    Drop an acs object_type; cascde true means that the attributes are dropped as well.

    Switches:
    -cascade (optional, defaults to "true")

    Testcases:
    No testcase defined.
  • fetch_query (scripted)

  • get_context (scripted)

  • get_instances_from_db (scripted, public)

     <instance of xo::db::Class[i]> get_instances_from_db \
        [ -select_attributes select_attributes ] \
        [ -from_clause from_clause ] [ -where_clause where_clause ] \
        [ -orderby orderby ] [ -page_size page_size ] \
        [ -page_number page_number ] [ -initialize initialize ]

    Returns a set (ordered composite) of the answer tuples of an 'instance_select_query' with the same attributes. Note that the returned objects might by partially instantiated.

    Switches:
    -select_attributes (optional)
    -from_clause (optional)
    -where_clause (optional)
    -orderby (optional)
    -page_size (optional, defaults to "20")
    -page_number (optional)
    -initialize (optional, defaults to "true")
    Returns:
    ordered composite

    Testcases:
    No testcase defined.
  • id_column (setter)

  • init (scripted)

  • init_type_hierarchy (scripted)

  • initialize_acs_object (scripted)

  • instance_select_query (scripted, public)

     <instance of xo::db::Class[i]> instance_select_query \
        [ -select_attributes select_attributes ] [ -orderby orderby ] \
        [ -where_clause where_clause ] [ -from_clause from_clause ] \
        [ -count on|off ] [ -page_size page_size ] \
        [ -page_number page_number ]

    Returns the SQL-query to select ACS Objects of the object_type of the class.

    Switches:
    -select_attributes (optional)
    attributes for the SQL query to be retrieved. if no attributes are specified, all attributes are retrieved.
    -orderby (optional)
    for ordering the solution set
    -where_clause (optional)
    clause for restricting the answer set
    -from_clause (optional)
    -count (optional, boolean, defaults to "false")
    return the query for counting the solutions
    -page_size (optional, defaults to "20")
    -page_number (optional)
    Returns:
    SQL query

    Testcases:
    No testcase defined.
  • instantiate_objects (scripted, public)

     <instance of xo::db::Class[i]> instantiate_objects [ -dbn dbn ] \
        [ -sql sql ] [ -full_statement_name full_statement_name ] \
        [ -as_ordered_composite on|off ] [ -object_class object_class ] \
        [ -named_objects on|off ] \
        [ -object_named_after object_named_after ] \
        [ -destroy_on_cleanup on|off ] [ -keep_existing_objects on|off ] \
        [ -ignore_missing_package_ids on|off ] [ -initialize initialize ]

    Retrieve multiple objects from the database using the given SQL query and create XOTcl objects from the tuples.

    Switches:
    -dbn (optional)
    -sql (optional)
    The SQL query to retrieve tuples. Note that if the SQL query only returns a restricted set of attributes, the objects will be only partially instantiated.
    -full_statement_name (optional)
    -as_ordered_composite (optional, boolean, defaults to "true")
    return an ordered composite object preserving the order. If the flag is false, one has to use "info instances" to access the resulted objects.
    -object_class (optional, defaults to "::xotcl::Object")
    specifies the XOTcl class, for which instances are created.
    -named_objects (optional, boolean, defaults to "false")
    If this flag is true, the value of the id_column is used for the name of the created objects (object will be named e.g. ::13738). Otherwise, objects are created with the XOTcl "new" method to avoid object name clashes.
    -object_named_after (optional)
    -destroy_on_cleanup (optional, boolean, defaults to "true")
    If this flag is true, the objects (and ordered composite) will be automatically destroyed on cleanup (typically after the request was processed).
    -keep_existing_objects (optional, boolean, defaults to "false")
    -ignore_missing_package_ids (optional, boolean, defaults to "false")
    -initialize (optional, defaults to "true")
    can be used to avoid full initialization, when a large series of objects is loaded. Per default, these objects are initialized via initialize_loaded_object, when the are of type ::xo::db::Object

    Testcases:
    xowiki_test_cases
  • mk_insert_method (scripted)

  • mk_update_method (scripted)

  • name_method (setter)

  • new_acs_object (scripted)

  • new_persistent_object (scripted, public)

     <instance of xo::db::Class[i]> new_persistent_object \
        [ -package_id package_id ] [ -creation_user creation_user ] \
        [ -creation_ip creation_ip ] args [ args... ]

    Create a new instance of the given class, configure it with the given arguments and insert it into the database. The XOTcl object is destroyed automatically on cleanup (end of a connection request).

    Switches:
    -package_id (optional)
    -creation_user (optional)
    -creation_ip (optional)
    Parameters:
    args (required)
    Returns:
    fully qualified object

    Testcases:
    xotcl_core_tutorial_1, xotcl_core_tutorial_2
  • object_type (setter)

  • object_types (scripted, public)

     <instance of xo::db::Class[i]> object_types \
        [ -subtypes_first on|off ]

    Return the type and subtypes of the class, on which the method is called. If subtypes_first is specified, the subtypes are returned first.

    Switches:
    -subtypes_first (optional, boolean, defaults to "false")
    Returns:
    list of object_types

    Testcases:
    xotcl_core_tutorial_2, xotcl_core_tutorial_4
  • object_types_query (scripted)

  • pretty_name (setter)

  • pretty_plural (setter)

  • require_constraints (scripted)

  • security_inherit_p (setter)

  • sql_package_name (setter)

  • supertype (setter)

  • table_definition (scripted)

  • table_name (setter)

  • unknown (scripted)

  • with_table (setter)