Class ::xo::db::CrFolder

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

Defined in

Class Relations

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

Methods (to be applied on the object)

  • delete (scripted)

  • 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 (optional, defaults to "0")
    -object (required)
    -initialize (optional, boolean, defaults to "true")
    See Also:
    • CrClass fetch_object

    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 (optional, defaults to "0")
    -revision_id (optional, defaults to "0")
    -initialize (optional, boolean, defaults to "true")

    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 (optional, boolean, defaults to "true")
    return subtypes as well
    -with_children (optional, boolean, defaults to "true")
    return immediate child objects of all objects as well
    -publish_status (optional)
    one of 'live', 'ready', or 'production'
    -count (optional, boolean, defaults to "false")
    return the query for counting the solutions
    -folder_id (optional)
    parent_id
    -parent_id (optional)
    -page_size (optional, defaults to "20")
    -page_number (optional)
    -base_table (optional, defaults to "cr_folders")
    typically automatic view, must contain title and revision_id
    Returns:
    SQL query

    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)

    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.

    Testcases:
    No testcase defined.
  • description (setter)

  • folder_id (setter)

  • label (setter)

  • mime_type (setter)

  • save (scripted, public)

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

    Save an existing CrFolder instance in the database.

    Parameters:
    args (required)

    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)

    Testcases:
    No testcase defined.
  • update (scripted)