• Publicity: Public Only All

cr-procs.tcl

XOTcl for the Content Repository

This file defines the following Objects and Classes: ::xo::db::CrClass[i], ::xo::db::CrFolder[i]

Location:
packages/xotcl-core/tcl/cr-procs.tcl
Created:
2007-08-13
Author:
Gustaf Neumann
CVS Identification:
$Id: cr-procs.tcl,v 1.76.2.63 2023/02/15 16:35:42 gustafn Exp $

Procedures in this file

Detailed information

Class ::xo::db::CrClass (public)

 ::xotcl::Class ::xo::db::CrClass[i]

The meta class CrClass serves for a class of applications that mostly store information in the content repository and that use a few attributes adjoining this information. The class handles the open acs object_type creation and the automatic creation of the necessary tables based on instances of this meta-class.

The definition of new types is handled in the constructor of CrType through the method create_object_type, the removal of the object type is handled through the method drop_object_type (requires that all instances of this type are deleted).

Each content item can be retrieved either through the general method CrClass get_instance_from_db or through the "get_instance_from_db" method of every subclass of CrItem.

This Class is a meta-class providing methods for Classes managing CrItems.

Partial Call Graph (max 5 caller/called nodes):
%3 _ _ (public) ad_log ad_log (public) ad_try ad_try (public) db_1row db_1row (public) nsf::is nsf::is Class ::xo::db::CrClass Class ::xo::db::CrClass Class ::xo::db::CrClass->_ Class ::xo::db::CrClass->ad_log Class ::xo::db::CrClass->ad_try Class ::xo::db::CrClass->db_1row Class ::xo::db::CrClass->nsf::is

Testcases:
No testcase defined.

Class ::xo::db::CrFolder (public)

 ::xo::db::CrClass ::xo::db::CrFolder[i]

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

Partial Call Graph (max 5 caller/called nodes):
%3 ad_return_error ad_return_error (public) content::folder::update content::folder::update (public) db_1row db_1row (public) nsf::object::alloc nsf::object::alloc nsf::relation::set nsf::relation::set Class ::xo::db::CrFolder Class ::xo::db::CrFolder Class ::xo::db::CrFolder->ad_return_error Class ::xo::db::CrFolder->content::folder::update Class ::xo::db::CrFolder->db_1row Class ::xo::db::CrFolder->nsf::object::alloc Class ::xo::db::CrFolder->nsf::relation::set

Testcases:
No testcase defined.

xo::db::CrClass instproc create_object_type (public)

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

Create an oacs object_type and a table for keeping the additional attributes.

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc create_object_type xo::db::CrClass instproc create_object_type test_xotcl_core_tutorial_4->xo::db::CrClass instproc create_object_type

Testcases:
xotcl_core_tutorial_4

xo::db::CrClass instproc delete (public)

 <instance of xo::db::CrClass[i]> delete -item_id item_id 

Delete a content item from the content repository.

Switches:
-item_id
(required)
id of the item to be deleted

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc delete xo::db::CrClass instproc delete test_xotcl_core_tutorial_4->xo::db::CrClass instproc delete test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::CrClass instproc delete

Testcases:
xotcl_core_tutorial_4, xowiki_test_cases

xo::db::CrClass instproc drop_object_type (public)

 <instance of xo::db::CrClass[i]> drop_object_type

Delete the object type and remove the table for the attributes. This method should be called when all instances are deleted. It undoes everying what create_object_type has produced.

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc drop_object_type xo::db::CrClass instproc drop_object_type test_xotcl_core_tutorial_4->xo::db::CrClass instproc drop_object_type

Testcases:
xotcl_core_tutorial_4

xo::db::CrClass instproc fetch_object (public)

 <instance of xo::db::CrClass[i]> fetch_object -item_id item_id  \
    [ -revision_id revision_id ] -object object  \
    [ -initialize on|off ]

Load a content item into the specified object. If revision_id is provided, the specified revision is returned, otherwise the live revision of the item_id. If the object does not exist, we create it.

Switches:
-item_id
(required)
-revision_id
(defaults to "0") (optional)
-object
(required)
-initialize
(boolean) (defaults to "true") (optional)
Returns:
cr item object

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc fetch_object xo::db::CrClass instproc fetch_object test_xotcl_core_tutorial_4->xo::db::CrClass instproc fetch_object test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::CrClass instproc fetch_object db_1row db_1row (public) xo::db::CrClass instproc fetch_object->db_1row

Testcases:
xotcl_core_tutorial_4, xowiki_test_cases

xo::db::CrClass instproc folder_type (public)

 <instance of xo::db::CrClass[i]> folder_type \
    [ -include_subtypes include_subtypes ] [ -folder_id folder_id ] \
    operation

register the current object type for folder_id. If folder_id is not specified, use the instvar of the class instead.

Switches:
-include_subtypes
(defaults to "t") (optional)
Boolean value (t/f) to flag whether the operation should be applied on subtypes as well
-folder_id
(optional)
Parameters:
operation

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc folder_type xo::db::CrClass instproc folder_type test_xotcl_core_tutorial_4->xo::db::CrClass instproc folder_type

Testcases:
xotcl_core_tutorial_4

xo::db::CrClass instproc folder_type_unregister_all (public)

 <instance of xo::db::CrClass[i]> folder_type_unregister_all \
    [ -include_subtypes include_subtypes ]

Unregister the object type from all folders on the system

Switches:
-include_subtypes
(defaults to "t") (optional)
Boolean value (t/f) to flag whether the operation should be applied on subtypes as well

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

Testcases:
No testcase defined.

xo::db::CrClass instproc get_instance_from_db (public)

 <instance of xo::db::CrClass[i]> get_instance_from_db \
    [ -item_id item_id ] [ -revision_id revision_id ] \
    [ -initialize on|off ]

Retrieve either the live revision or a specified revision of a content item with all attributes into a newly created object. The retrieved attributes are stored in the instance variables in class representing the object_type. The XOTcl object is destroyed automatically on cleanup (end of a connection request)

Switches:
-item_id
(defaults to "0") (optional)
id of the item to be retrieved.
-revision_id
(defaults to "0") (optional)
revision-id of the item to be retrieved.
-initialize
(boolean) (defaults to "true") (optional)
Returns:
fully qualified object

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_folder_with_page create_folder_with_page (test xowf) xo::db::CrClass instproc get_instance_from_db xo::db::CrClass instproc get_instance_from_db test_create_folder_with_page->xo::db::CrClass instproc get_instance_from_db test_create_form_with_form_instance create_form_with_form_instance (test xowiki) test_create_form_with_form_instance->xo::db::CrClass instproc get_instance_from_db test_test_cr_items test_cr_items (test xotcl-core) test_test_cr_items->xo::db::CrClass instproc get_instance_from_db test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) test_xotcl_core_tutorial_4->xo::db::CrClass instproc get_instance_from_db test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::CrClass instproc get_instance_from_db

Testcases:
xotcl_core_tutorial_4, test_cr_items, create_folder_with_page, xowiki_test_cases, create_form_with_form_instance

xo::db::CrClass instproc get_instances_from_db (public)

 <instance of xo::db::CrClass[i]> get_instances_from_db \
    [ -select_attributes select_attributes ] \
    [ -from_clause from_clause ] [ -where_clause where_clause ] \
    [ -orderby orderby ] [ -with_subtypes on|off ] \
    [ -folder_id folder_id ] [ -page_size page_size ] \
    [ -page_number page_number ] [ -base_table base_table ] \
    [ -initialize initialize ]

Returns a set (ordered composite) of the answer tuples of an 'instance_select_query' with the same attributes. The tuples are instances of the class, on which the method was called.

Switches:
-select_attributes
(optional)
-from_clause
(optional)
-where_clause
(optional)
-orderby
(optional)
-with_subtypes
(boolean) (defaults to "true") (optional)
-folder_id
(optional)
-page_size
(defaults to "20") (optional)
-page_number
(optional)
-base_table
(defaults to "cr_revisions") (optional)
-initialize
(defaults to "true") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xo::db::CrClass instproc get_instances_from_db xo::db::CrClass instproc get_instances_from_db test_create_form_with_form_instance->xo::db::CrClass instproc get_instances_from_db test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) test_xotcl_core_tutorial_4->xo::db::CrClass instproc get_instances_from_db

Testcases:
xotcl_core_tutorial_4, create_form_with_form_instance

xo::db::CrClass instproc instance_select_query (public)

 <instance of xo::db::CrClass[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, and package_id 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 "false") (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_revisions") (optional)
typically automatic view, must contain title and revision_id
Returns:
SQL query

Partial Call Graph (max 5 caller/called nodes):
%3 test_xowiki_test_cases xowiki_test_cases (test xowiki) xo::db::CrClass instproc instance_select_query xo::db::CrClass instproc instance_select_query test_xowiki_test_cases->xo::db::CrClass instproc instance_select_query

Testcases:
xowiki_test_cases

xo::db::CrClass instproc new_persistent_object (public)

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

Create a new content item of the actual 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
Returns:
fully qualified object

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass instproc new_persistent_object xo::db::CrClass instproc new_persistent_object test_xotcl_core_tutorial_4->xo::db::CrClass instproc new_persistent_object ad_log ad_log (public) xo::db::CrClass instproc new_persistent_object->ad_log ad_try ad_try (public) xo::db::CrClass instproc new_persistent_object->ad_try

Testcases:
xotcl_core_tutorial_4

xo::db::CrClass proc delete (public)

 xo::db::CrClass[i] delete [ -item_id item_id ]

Delete a CrItem in the database

Switches:
-item_id
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrClass proc delete xo::db::CrClass proc delete test_xotcl_core_tutorial_4->xo::db::CrClass proc delete

Testcases:
xotcl_core_tutorial_4

xo::db::CrClass proc ensure_item_ids_instantiated (public)

 xo::db::CrClass[i] ensure_item_ids_instantiated [ -initialize on|off ] \
    -item_ids item_ids 

Make sure, the objects all of the provided items_ids are instantiated (i.e. the same-named objects do exist as executable commands in the current thread).

Switches:
-initialize
(boolean) (defaults to "true") (optional)
-item_ids
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_link_tests link_tests (test xowiki) xo::db::CrClass proc ensure_item_ids_instantiated xo::db::CrClass proc ensure_item_ids_instantiated test_link_tests->xo::db::CrClass proc ensure_item_ids_instantiated

Testcases:
link_tests

xo::db::CrClass proc get_child_item_ids (public)

 xo::db::CrClass[i] get_child_item_ids -item_id item_id 

Return a list of content items having the provided item_id as direct or indirect parent. The method returns recursively all item_ids.

Switches:
-item_id
(required)
Returns:
list of item_ids

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

Testcases:
xowiki_test_cases

xo::db::CrClass proc get_instance_from_db (public)

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

Instantiate the live revision or the specified revision of an CrItem. The XOTcl object is destroyed automatically on cleanup (end of a connection request).

Switches:
-item_id
(defaults to "0") (optional)
-revision_id
(defaults to "0") (optional)
-initialize
(boolean) (defaults to "true") (optional)
Returns:
fully qualified object containing the attributes of the CrItem

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_workflow_with_instance create_workflow_with_instance (test xowf) xo::db::CrClass proc get_instance_from_db xo::db::CrClass proc get_instance_from_db test_create_workflow_with_instance->xo::db::CrClass proc get_instance_from_db test_link_tests link_tests (test xowiki) test_link_tests->xo::db::CrClass proc get_instance_from_db test_path_resolve path_resolve (test xowiki) test_path_resolve->xo::db::CrClass proc get_instance_from_db test_slot_interactions slot_interactions (test xowiki) test_slot_interactions->xo::db::CrClass proc get_instance_from_db test_test_cr_items test_cr_items (test xotcl-core) test_test_cr_items->xo::db::CrClass proc get_instance_from_db ad_log ad_log (public) xo::db::CrClass proc get_instance_from_db->ad_log nsf::is nsf::is xo::db::CrClass proc get_instance_from_db->nsf::is

Testcases:
test_cr_items, create_workflow_with_instance, xowiki_test_cases, link_tests, slot_interactions, path_resolve

xo::db::CrClass proc get_name (public)

 xo::db::CrClass[i] get_name -item_id item_id 

Get the name of a content item either from an already instantiated object or from the database without instantiating it. If item_id is not a valid item_id, we throw an error.

Switches:
-item_id
(required)
Returns:
parent_id

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

Testcases:
xowiki_test_cases

xo::db::CrClass proc get_object_type (public)

 xo::db::CrClass[i] get_object_type [ -item_id item_id ] \
    [ -revision_id revision_id ]

Return the object type for an item_id or revision_id.

Switches:
-item_id
(optional)
-revision_id
(defaults to "0") (optional)
Returns:
object_type typically an XOTcl class

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::CrClass proc get_object_type xo::db::CrClass proc get_object_type test_test_cr_items->xo::db::CrClass proc get_object_type test_test_xo_db_object test_xo_db_object (test xotcl-core) test_test_xo_db_object->xo::db::CrClass proc get_object_type

Testcases:
test_xo_db_object, test_cr_items

xo::db::CrClass proc get_parent_id (public)

 xo::db::CrClass[i] get_parent_id -item_id item_id 

Get the parent_id of a content item either from an already instantiated object or from the database without instantiating it. If item_id is not a valid item_id, we throw an error.

Switches:
-item_id
(required)
Returns:
parent_id

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

Testcases:
xowiki_test_cases

xo::db::CrClass proc id_belongs_to_package (public)

 xo::db::CrClass[i] id_belongs_to_package [ -item_id item_id ] \
    [ -revision_id revision_id ] [ -package_id package_id ]

Check if the provided item_id or revision_id belongs to the provided package.

Switches:
-item_id
(defaults to "0") (optional)
-revision_id
(defaults to "0") (optional)
-package_id
(optional)
Returns:
boolean success

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

Testcases:
No testcase defined.

xo::db::CrClass proc lookup (public)

 xo::db::CrClass[i] lookup -name name  [ -parent_id parent_id ] \
    [ -content_type content_type ]

Check, whether a content item with the given name exists. When content_type is provided (e.g. -content_type "::%") then a like operation is applied on the value.

Switches:
-name
(required)
-parent_id
(defaults to "-100") (optional)
-content_type
(optional)
Returns:
item_id If the item exists, return its item_id, otherwise 0.

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_folder_with_page create_folder_with_page (test xowf) xo::db::CrClass proc lookup xo::db::CrClass proc lookup test_create_folder_with_page->xo::db::CrClass proc lookup test_path_resolve path_resolve (test xowiki) test_path_resolve->xo::db::CrClass proc lookup test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) test_xotcl_core_tutorial_4->xo::db::CrClass proc lookup test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::CrClass proc lookup

Testcases:
xotcl_core_tutorial_4, create_folder_with_page, xowiki_test_cases, path_resolve

xo::db::CrFolder instproc delete (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.

xo::db::CrFolder instproc save (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.

xo::db::CrFolder instproc save_new (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.

xo::db::CrFolder proc fetch_object (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.

xo::db::CrFolder proc get_instance_from_db (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.

xo::db::CrFolder proc instance_select_query (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.

xo::db::CrFolder proc register_content_types (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

xo::db::CrItem instproc delete (public)

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

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

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::CrItem instproc delete xo::db::CrItem instproc delete test_test_cr_items->xo::db::CrItem instproc delete

Testcases:
test_cr_items

xo::db::CrItem instproc is_package_root_folder (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.

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_folder_with_page create_folder_with_page (test xowf) xo::db::CrItem instproc is_package_root_folder xo::db::CrItem instproc is_package_root_folder test_create_folder_with_page->xo::db::CrItem instproc is_package_root_folder test_create_workflow_with_instance create_workflow_with_instance (test xowf) test_create_workflow_with_instance->xo::db::CrItem instproc is_package_root_folder

Testcases:
create_folder_with_page, create_workflow_with_instance

xo::db::CrItem instproc privilege=creator (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
(defaults to "true") (optional)
Parameters:
user_id
package_id
method

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

Testcases:
No testcase defined.

xo::db::CrItem instproc rename (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)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_form_with_form_instance create_form_with_form_instance (test xowiki) xo::db::CrItem instproc rename xo::db::CrItem instproc rename test_create_form_with_form_instance->xo::db::CrItem instproc rename

Testcases:
create_form_with_form_instance

xo::db::CrItem instproc save (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
(boolean) (defaults to "true") (optional)
make this revision the live revision
-use_given_publish_date
(boolean) (defaults to "false") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::CrItem instproc save xo::db::CrItem instproc save test_test_cr_items->xo::db::CrItem instproc save test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) test_xotcl_core_tutorial_4->xo::db::CrItem instproc save _ _ (public) xo::db::CrItem instproc save->_ ad_conn ad_conn (public) xo::db::CrItem instproc save->ad_conn cr_check_mime_type cr_check_mime_type (public) xo::db::CrItem instproc save->cr_check_mime_type cr_create_content_file cr_create_content_file (public) xo::db::CrItem instproc save->cr_create_content_file

Testcases:
xotcl_core_tutorial_4, test_cr_items

xo::db::CrItem instproc save_new (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
(boolean) (defaults to "true") (optional)
make this revision the live revision
-use_given_publish_date
(boolean) (defaults to "false") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_test_cr_items test_cr_items (test xotcl-core) xo::db::CrItem instproc save_new xo::db::CrItem instproc save_new test_test_cr_items->xo::db::CrItem instproc save_new test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) test_xotcl_core_tutorial_4->xo::db::CrItem instproc save_new _ _ (public) xo::db::CrItem instproc save_new->_ cr_check_mime_type cr_check_mime_type (public) xo::db::CrItem instproc save_new->cr_check_mime_type cr_create_content_file cr_create_content_file (public) xo::db::CrItem instproc save_new->cr_create_content_file

Testcases:
xotcl_core_tutorial_4, test_cr_items

xo::db::CrItem instproc set_live_revision (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
(defaults to "ready") (optional)
one of 'live', 'ready' or 'production'
-is_latest
(boolean) (defaults to "false") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_folder_with_page create_folder_with_page (test xowf) xo::db::CrItem instproc set_live_revision xo::db::CrItem instproc set_live_revision test_create_folder_with_page->xo::db::CrItem instproc set_live_revision test_create_workflow_with_instance create_workflow_with_instance (test xowf) test_create_workflow_with_instance->xo::db::CrItem instproc set_live_revision

Testcases:
create_folder_with_page, create_workflow_with_instance

xo::db::CrItem instproc update_item_index (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.

Partial Call Graph (max 5 caller/called nodes):
%3 test_xotcl_core_tutorial_4 xotcl_core_tutorial_4 (test xotcl-core) xo::db::CrItem instproc update_item_index xo::db::CrItem instproc update_item_index test_xotcl_core_tutorial_4->xo::db::CrItem instproc update_item_index test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xo::db::CrItem instproc update_item_index

Testcases:
xotcl_core_tutorial_4, xowiki_test_cases
[ show source ]