Index: openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql 14 Oct 2003 14:58:31 -0000 1.7 +++ openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql 31 Oct 2003 09:01:42 -0000 1.8 @@ -6,22 +6,23 @@ select content_item__new ( - :item_name, -- name - integer :parent_id, -- parent_id for some reason PG gets confused on this param, explicit typecasting was needed - null, -- item_id - null, -- locale - now(), -- creation_date - :creation_user_id, -- creation_user - :parent_id, -- context_id - :creation_ip, -- creation_ip - 'content_revision', -- item_subtype - :content_type, -- content_type - null, -- title - null, -- description - null, -- mime_type - null, -- nls_language - null, -- data - :storage_type -- storage_type + :item_name, -- name + integer :parent_id, -- parent_id + -- for some reason PG gets confused on this param, explicit typecasting was needed + :item_id, -- item_id + null, -- locale + now(), -- creation_date + :creation_user_id, -- creation_user + :parent_id, -- context_id + :creation_ip, -- creation_ip + 'content_revision', -- item_subtype + :content_type, -- content_type + null, -- title + null, -- description + null, -- mime_type + null, -- nls_language + null, -- data + :storage_type -- storage_type ) @@ -148,8 +149,8 @@ :item_id, -- item_id :related_object_id, -- related_object_id :relation_type, -- relation_tag - null, -- order_n - 'cr_item_rel' -- relation_type + :order_n, -- order_n + :relation_type -- relation_type ) Index: openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl 30 Oct 2003 15:08:11 -0000 1.10 +++ openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl 31 Oct 2003 09:01:42 -0000 1.11 @@ -26,6 +26,7 @@ ad_proc -private bcms::item::create_item { + {-item_id ""} {-item_name:required} {-parent_id:required} {-content_type "content_revision"} @@ -37,6 +38,7 @@ Normally you would like couple this with create_revision or your own custom create_revision. + @param item_id Optionally supply an item_id. @param item_name the name or url that will be used for the content item @param parent_id the parent_id which the page will be under, normally this is a folder @param content_type content type of the item to be created @@ -49,7 +51,7 @@ if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } - set item_id [db_exec_plsql create_item "SQL"] + set item_id [db_exec_plsql create_item {}] ns_log Debug "bcms::item::create_item created new item $item_id" return $item_id } @@ -555,12 +557,13 @@ {-relation_type:required} {-item_id:required} {-related_object_id:required} + {-order_n ""} + {-relation_type "cr_item_rel"} } { relate item_id to related_object_id with relation_type } { - return [db_exec_plsql relate_item "SQL"] - + return [db_exec_plsql relate_item {}] } ad_proc -public bcms::item::unrelate_item {