Methods: | Source: | Variables: |
---|---|---|
[All Methods | Documented Methods | Hide Methods] | [Display Source | Hide Source] | [Show Variables | Hide Variables] |
::xotcl::Class
::xo::db::CrClass
Class Hierarchy of ::xo::db::CrClass
- ::xotcl::Object
![]()
- Meta-class:
- ::xotcl::Class
- Methods for instances:
- __api_make_doc, __api_make_forward_doc, __timediff, abstract, ad_doc, ad_forward, ad_proc, appendC, arrayC, asHTML, autonameC, check, classC, cleanupC, configureC, containsC, copyC, db_0or1rowC, db_1rowC, debug, defaultmethodC, destroyC, destroy_on_cleanup, ds, evalC, existsC, extractConfigureArg, filterC, filterguardC, filtersearch, forward, hasclass, incrC, infoC, init, instvarC, invarC, isclass, ismetaclass, ismixin, isobject, istype, lappendC, log, method, mixinC, mixinguardC, moveC, msg, noinitC, objectparameter, parametercmdC, proc, procsearch, qn, requireNamespaceC, residualargsC, self, serialize, setC, set_instance_vars_defaults, show-object, substC, traceC, unknown, unsetC, uplevelC, upvarC, volatileC, vwait
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- getExitHandler, setExitHandler, unsetExitHandler
- ::xotcl::Class
![]()
- Meta-class:
- ::xotcl::Class
- Parameter for instances:
- __default_metaclass (default "::xotcl::Class"), __default_superclass (default "::xotcl::Object")
- Methods for instances:
- ad_instproc, allinstances, allocC, createC, deallocC, extend_slot, infoC, instfilterC, instfilterguardC, instforward, instinvarC, instmixinC, instmixinguardC, instparametercmdC, instproc, method, newC, parameter, recreateC, slots, superclassC, unknown, uses
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- __unknown
- ::xo::db::Class
![]()
- Meta-class:
- ::xotcl::Class
- Parameter for instances:
- abstract_p (default "f"), auto_save (default "false"), id_column, name_method (default ""), object_type (default "[self]"), pretty_name, pretty_plural, security_inherit_p (default "t"), sql_package_name, supertype (default "acs_object"), table_name, with_table (default "true")
- Methods for instances:
- check_default_values, check_table_atts, create_object_type, db_slots, dbproc_nonposargs, drop_object_type, fetch_query, fix_function_args, generate_proc_body, generate_psql, get_context, get_function_args, get_instances_from_db, init, init_type_hierarchy, initialize_acs_object, instance_select_query, instantiate_objects, mk_insert_method, mk_save_method, new_acs_object, new_persistent_object, object_types, object_types_query, sql-arguments, table_definition, unknown
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- class_to_object_type, create_all_functions, delete, delete_all_acs_objects, drop_type, exists_in_db, get_all_package_functions, get_class_from_db, get_instance_from_db, get_object_type, get_table_name, object_type_exists_in_db, object_type_to_class
- ::xo::db::CrClass
![]()
- Meta-class:
- ::xotcl::Class
- Parameter for instances:
- edit_form, folder_id (default "-100"), form, mime_type (default "text/plain"), storage_type (default "text"), supertype (default "content_revision")
- Methods for instances:
- 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
- Methods to be applied on the class (in addition to the methods provided by the meta-class):
- delete, get_child_item_ids, get_instance_from_db, get_name, get_object_type, get_parent_id, lookup, require_folder_object
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.
Defined in packages/xotcl-core/tcl/cr-procs.tcl
Class Relations
Methods
proc delete (public)
::xo::db::CrClass
delete [ -item_id item_id ]
Delete a CrItem in the database
- Switches:
- -item_id (optional)
proc get_child_item_ids (public)
::xo::db::CrClass
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
proc get_instance_from_db (public)
::xo::db::CrClass
get_instance_from_db [ -item_id item_id ] \ [ -revision_id revision_id ]
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)
- -item_id (defaults to
- Returns:
- fully qualified object containing the attributes of the CrItem
proc get_name (public)
::xo::db::CrClass
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
proc get_object_type (public)
::xo::db::CrClass
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
proc get_parent_id (public)
::xo::db::CrClass
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
proc lookup (public)
::xo::db::CrClass
lookup -name name [ -parent_id parent_id ]
Check, whether an content item with the given name exists. If the item exists, return its item_id, otherwise 0.
- Switches:
- -name (required)
- -parent_id (defaults to
"-100"
) (optional)
- Returns:
- item_id
proc require_folder_object (public)
::xo::db::CrClass
require_folder_object [ -folder_id folder_id ] \ [ -package_id package_id ]
Dummy stub; let specializations define it
- Switches:
- -folder_id (optional)
- -package_id (optional)
instproc create_object_type (public)
<instance of ::xo::db::CrClass
> create_object_type
Create an oacs object_type and a table for keeping the additional attributes.
instproc delete (public)
<instance of ::xo::db::CrClass
> delete -item_id item_id
Delete a content item from the content repository.
- Switches:
- -item_id (required)
- id of the item to be deleted
instproc drop_object_type (public)
<instance of ::xo::db::CrClass
> 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.
instproc edit_atts
instproc fetch_object (public)
<instance of ::xo::db::CrClass
> fetch_object -item_id item_id \ [ -revision_id revision_id ] -object object \ [ -initialize initialize ]
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 (defaults to
"true"
) (optional)
- Returns:
- cr item object
instproc folder_type (public)
<instance of ::xo::db::CrClass
> 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)
- -include_subtypes (defaults to
- Parameters:
-
operation
instproc folder_type_unregister_all (public)
<instance of ::xo::db::CrClass
> 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
- -include_subtypes (defaults to
instproc getFormClass
instproc get_instance_from_db (public)
<instance of ::xo::db::CrClass
> get_instance_from_db \ [ -item_id item_id ] [ -revision_id revision_id ]
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 strored 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.
- -item_id (defaults to
- Returns:
- fully qualified object
instproc get_instances_from_db (public)
<instance of ::xo::db::CrClass
> 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 ]
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)
instproc init
instproc insert_statement
instproc instance_select_query (public)
<instance of ::xo::db::CrClass
> 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)
- -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
instproc lock
instproc mk_insert_method
instproc mk_save_method
instproc new_persistent_object (public)
<instance of ::xo::db::CrClass
> 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
instproc remember_long_text_slots
instproc type_selection_clause
instproc unknown
Instances
::xo::db::CrFolder, ::xo::db::CrItem
, ::xo::db::image
, ::xowiki::File
, ::xowiki::Form
, ::xowiki::FormPage
, ::xowiki::Object
, ::xowiki::Page
, ::xowiki::PageInstance
, ::xowiki::PageTemplate
, ::xowiki::PlainPage
, ::xowiki::PodcastItem
Methods: | Source: | Variables: |
---|---|---|
[All Methods | Documented Methods | Hide Methods] | [Display Source | Hide Source] | [Show Variables | Hide Variables] |