%3 ::xo::db::CrItem ::xo::db::CrItem delete is_package_root_folder privilege=creator rename save save_new set_live_revision update_attribute_from_slot update_item_index ::xo::db::Object ::xo::db::Object delete save save_new update ::xo::db::CrItem->::xo::db::Object ::xo::db::CrCache::Item ::xo::db::CrCache::Item ::xo::db::CrItem->::xo::db::CrCache::Item instmixin ::xotcl::Object ::xotcl::Object ::xo::db::Object->::xotcl::Object ::xo::db::CrFolder ::xo::db::CrFolder → fetch_object → get_instance_from_db → instance_select_query → register_content_types delete save save_new ::xo::db::CrFolder->::xo::db::CrItem

Class ::xo::db::CrFolder

::xo::db::CrFolder[i] create ...

This is a generic class that represents a "cr_folder" XoWiki specific methods are currently directly mixed into all instances of this class.
See Also:
xowiki::Folder
Defined in packages/xotcl-core/tcl/cr-procs.tcl

Class Relations

  • class: ::xo::db::CrClass[i]
  • superclass: ::xo::db::CrItem[i]

Methods (to be applied on the object)

  • fetch_object (scripted, public)

     xo::db::CrFolder[i] fetch_object -item_id item_id  \
        [ -revision_id revision_id ] -object object  \
        [ -initialize on|off ]

    We overwrite the default fetch_object method here. We join acs_objects, cr_items and cr_folders and fetch all attributes. The revision_id is completely ignored.

    Switches:
    -item_id
    (required)
    -revision_id
    (defaults to "0") (optional)
    -object
    (required)
    -initialize
    (boolean) (defaults to "true") (optional)
    See Also:
    • CrClass fetch_object

    Partial Call Graph (max 5 caller/called nodes):
    %3 db_1row db_1row (public) xo::db::CrFolder proc fetch_object xo::db::CrFolder proc fetch_object xo::db::CrFolder proc fetch_object->db_1row

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

     xo::db::CrFolder[i] get_instance_from_db [ -item_id item_id ] \
        [ -revision_id revision_id ] [ -initialize on|off ]

    The "standard" get_instance_from_db methods return objects following the naming convention "::<acs_object_id>", e.g. ::1234

    Usually, the id of the item that is fetched from the database is used. However, XoWiki's "folder objects" (i.e. an ::xowiki::Object instance that can be used to configure the respective instance) are created using the acs_object_id of the root folder of the xowiki instance, which is actually the id of another acs_object.

    Because of this, we cannot simply create the instances of CrFolder using the "standard naming convention". Instead we create them as ::cr_folder<acs_object_id>.

    Switches:
    -item_id
    (defaults to "0") (optional)
    -revision_id
    (defaults to "0") (optional)
    -initialize
    (boolean) (defaults to "true") (optional)

    Partial Call Graph (max 5 caller/called nodes):
    %3

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

     xo::db::CrFolder[i] instance_select_query \
        [ -select_attributes select_attributes ] [ -orderby orderby ] \
        [ -where_clause where_clause ] [ -from_clause from_clause ] \
        [ -with_subtypes on|off ] [ -with_children on|off ] \
        [ -publish_status publish_status ] [ -count on|off ] \
        [ -folder_id folder_id ] [ -parent_id parent_id ] \
        [ -page_size page_size ] [ -page_number page_number ] \
        [ -base_table base_table ]

    returns the SQL-query to select the CrItems of the specified object_type

    Switches:
    -select_attributes
    (optional)
    attributes for the SQL query to be retrieved, in addition to item_id, name, publish_status, object_type which are always returned
    -orderby
    (optional)
    for ordering the solution set
    -where_clause
    (optional)
    clause for restricting the answer set
    -from_clause
    (optional)
    -with_subtypes
    (boolean) (defaults to "true") (optional)
    return subtypes as well
    -with_children
    (boolean) (defaults to "true") (optional)
    return immediate child objects of all objects as well
    -publish_status
    (optional)
    one of 'live', 'ready', or 'production'
    -count
    (boolean) (defaults to "false") (optional)
    return the query for counting the solutions
    -folder_id
    (optional)
    parent_id
    -parent_id
    (optional)
    -page_size
    (defaults to "20") (optional)
    -page_number
    (optional)
    -base_table
    (defaults to "cr_folders") (optional)
    typically automatic view, must contain title and revision_id
    Returns:
    SQL query

    Partial Call Graph (max 5 caller/called nodes):
    %3

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

     xo::db::CrFolder[i] register_content_types -folder_id folder_id  \
        [ -content_types content_types ]

    Register the specified content types for the folder. If a content_type ends with a *, include its subtypes

    Switches:
    -folder_id
    (required)
    -content_types
    (optional)

    Partial Call Graph (max 5 caller/called nodes):
    %3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xo::db::CrFolder proc register_content_types xo::db::CrFolder proc register_content_types test_xowiki_test_cases->xo::db::CrFolder proc register_content_types

    Testcases:
    xowiki_test_cases

Methods (to be applied on instances)

  • delete (scripted, public)

     <instance of xo::db::CrFolder[i]> delete

    Delete the CrFolder instance. This method takes the folder_id of the current instance.

    Partial Call Graph (max 5 caller/called nodes):
    %3 ad_return_error ad_return_error (public) xo::db::CrFolder instproc delete xo::db::CrFolder instproc delete xo::db::CrFolder instproc delete->ad_return_error

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

     <instance of xo::db::CrFolder[i]> save args [ args... ]

    Save an existing CrFolder instance in the database.

    Parameters:
    args

    Partial Call Graph (max 5 caller/called nodes):
    %3 content::folder::update content::folder::update (public) xo::db::CrFolder instproc save xo::db::CrFolder instproc save xo::db::CrFolder instproc save->content::folder::update

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

     <instance of xo::db::CrFolder[i]> save_new \
        [ -creation_user creation_user ]

    Save a new CrFolder instance in the database.

    Switches:
    -creation_user
    (optional)

    Partial Call Graph (max 5 caller/called nodes):
    %3

    Testcases:
    No testcase defined.

Variables

::xo::db::CrFolder set __default_metaclass ::xotcl::Class
::xo::db::CrFolder set __default_superclass ::xotcl::Object
::xo::db::CrFolder set abstract_p f
::xo::db::CrFolder set auto_save false
::xo::db::CrFolder array set db_constraints {folder_id {{references {cr_items on delete cascade}} \
       {references {cr_items on delete cascade}}}}
::xo::db::CrFolder array set db_slot \
       {label ::xo::db::CrFolder::slot::label creation_date ::xo::db::Object::slot::creation_date \
       creation_user ::xo::db::Object::slot::creation_user object_id \
       ::xo::db::Object::slot::object_id description ::xo::db::CrFolder::slot::description \
       creation_ip ::xo::db::Object::slot::creation_ip text ::xo::db::CrItem::slot::text folder_id \
       ::xo::db::CrFolder::slot::folder_id nls_language ::xo::db::CrItem::slot::nls_language \
       object_title ::xo::db::Object::slot::object_title package_id \
       ::xo::db::Object::slot::package_id name ::xo::db::CrItem::slot::name mime_type \
       ::xo::db::CrItem::slot::mime_type context_id ::xo::db::Object::slot::context_id \
       security_inherit_p ::xo::db::Object::slot::security_inherit_p title \
       ::xo::db::CrItem::slot::title revision_id ::xo::db::CrItem::slot::revision_id item_id \
       ::xo::db::CrItem::slot::item_id last_modified ::xo::db::Object::slot::last_modified \
       publish_date ::xo::db::CrItem::slot::publish_date modifying_user \
       ::xo::db::Object::slot::modifying_user modifying_ip ::xo::db::Object::slot::modifying_ip}
::xo::db::CrFolder set edit_form CrFolderForm
::xo::db::CrFolder set folder_id -100
::xo::db::CrFolder set form CrFolderForm
::xo::db::CrFolder set id_column folder_id
::xo::db::CrFolder set mime_type text/plain
::xo::db::CrFolder set name_method {}
::xo::db::CrFolder set non_cached_instance_var_patterns __*
::xo::db::CrFolder set object_type content_folder
::xo::db::CrFolder set object_type_key 000000000000110100000000
::xo::db::CrFolder set pretty_name Folder
::xo::db::CrFolder set pretty_plural Folders
::xo::db::CrFolder set security_inherit_p t
::xo::db::CrFolder set sql_package_name ::xo::db::CrFolder
::xo::db::CrFolder set storage_type text
::xo::db::CrFolder set supertype content_revision
::xo::db::CrFolder set table_name cr_folders
::xo::db::CrFolder set with_table true