Class ::xo::db::CrItem

::xo::db::CrItem[i] create ... \
           [ -package_id package_id ] \
           [ -parent_id (default "-100") ] \
           [ -publish_status (default "ready") ] \
           [ -storage_type (default "text") ]

Defined in

Class Relations

  • class: ::xo::db::CrClass[i]
  • superclass: ::xo::db::Object[i]
  • instmixin: ::xo::db::CrCache::Item[i]
  • subclass: ::xo::oauth::ClientMetadata[i], ::xo::oauth::ServerMetadata[i], ::xo::db::image[i], ::xo::db::CrFolder[i], ::xowiki::Page[i], ::xo::oauth::Credentials[i]

Methods (to be applied on instances)

  • changed_redirect_url (scripted)

  • current_user_id (scripted)

  • delete (scripted, public)

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

    Delete the item from the content repository with the item_id taken from the instance variable.

    Testcases:
    test_cr_items
  • description (setter)

  • fix_content (scripted)

  • initialize_loaded_object (scripted)

  • is_cached_object (scripted)

  • is_package_root_folder (scripted, public)

     <instance of xo::db::CrItem[i]> is_package_root_folder

    # In general, every cr_item may be in the role of a # "root-folder" of a package.

    Testcases:
    create_folder_with_page, create_workflow_with_instance
  • item_id (setter)

  • mime_type (setter)

  • name (setter)

  • nls_language (setter)

  • package_id (setter)

  • parent_id (setter)

  • privilege=creator (scripted, public)

     <instance of xo::db::CrItem[i]> privilege=creator [ -login login ] \
        user_id package_id method

    Define an object specific privilege to be used in the policies. Grant access to a content item for the creator (creation_user) of the item, and for the package admin.

    Switches:
    -login (optional, defaults to "true")
    Parameters:
    user_id (required)
    package_id (required)
    method (required)

    Testcases:
    No testcase defined.
  • publish_date (setter)

  • publish_status (setter)

  • rename (scripted, public)

     <instance of xo::db::CrItem[i]> rename -old_name old_name  \
        -new_name new_name 

    Rename a content item

    Switches:
    -old_name (required)
    -new_name (required)

    Testcases:
    create_form_with_form_instance
  • revision_id (setter)

  • save (scripted, public)

     <instance of xo::db::CrItem[i]> save \
        [ -modifying_user modifying_user ] [ -live_p on|off ] \
        [ -use_given_publish_date on|off ]

    Updates an item in the content repository. We insert a new revision instead of changing the current revision.

    Switches:
    -modifying_user (optional)
    -live_p (optional, boolean, defaults to "true")
    make this revision the live revision
    -use_given_publish_date (optional, boolean, defaults to "false")

    Testcases:
    xotcl_core_tutorial_4, test_cr_items
  • save_new (scripted, public)

     <instance of xo::db::CrItem[i]> save_new [ -package_id package_id ] \
        [ -creation_user creation_user ] [ -creation_ip creation_ip ] \
        [ -context_id context_id ] [ -live_p on|off ] \
        [ -use_given_publish_date on|off ]

    Insert a new item to the content repository.

    Switches:
    -package_id (optional)
    -creation_user (optional)
    user_id if the creating user
    -creation_ip (optional)
    -context_id (optional)
    -live_p (optional, boolean, defaults to "true")
    make this revision the live revision
    -use_given_publish_date (optional, boolean, defaults to "false")

    Testcases:
    xotcl_core_tutorial_4, test_cr_items
  • set_live_revision (scripted, public)

     <instance of xo::db::CrItem[i]> set_live_revision \
        -revision_id revision_id  [ -publish_status publish_status ] \
        [ -is_latest on|off ]
    Switches:
    -revision_id (required)
    -publish_status (optional, defaults to "ready")
    one of 'live', 'ready' or 'production'
    -is_latest (optional, boolean, defaults to "false")

    Testcases:
    create_folder_with_page, create_workflow_with_instance
  • storage_type (setter)

  • text (setter)

  • title (setter)

  • update (scripted)

  • update_attribute_from_slot (scripted)

     <instance of xo::db::CrItem[i]> update_attribute_from_slot

    Testcases:
    slot_interactions, xowiki
  • update_content (scripted)

  • update_item_index (scripted, public)

     <instance of xo::db::CrItem[i]> update_item_index

    Dummy stub to allow subclasses to produce a more efficient index for items based on live revisions.

    Testcases:
    xotcl_core_tutorial_4, xowiki_test_cases
  • update_revision (scripted)

  • www-revisions (scripted)