Index: openacs-4/packages/acs-content-repository/tcl/content-extlink-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-extlink-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-extlink-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,56 @@ +# packages/acs-content-repository/tcl/content-extlink-procs.tcl + +ad_library { + + Procedures for content_extlink + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-09 + @arch-tag: f8f62c6c-bf3b-46d9-8e1e-fa5e60ba1c05 + @cvs-id $Id: content-extlink-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::extlink {} + +ad_proc -public content::extlink::copy { + -extlink_id:required + -target_folder_id:required + -creation_user:required + {-creation_ip ""} +} { + @param extlink_id extlink to copy + @param target_folder_id folder to copy extlink into + @param creation_user + @param creation_ip +} { + return [package_exec_plsql -var_list [list \ + extlink_id $extlink_id \ + target_folder_id $target_folder_id \ + creation_user $creation_user \ + creation_ip $creation_ip \ + ] content_extlink copy] +} + + +ad_proc -public content::extlink::del { + -extlink_id:required +} { + @param extlink_id item_id of extlink to delete +} { + return [package_exec_plsql -var_list [list \ + extlink_id $extlink_id \ + ] content_extlink del] +} + + +ad_proc -public content::extlink::is_extlink { + -item_id:required +} { + @param item_id item_id to check + + @return 1 if extlink, otherwise 0 +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_extlink is_extlink] +} Index: openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-folder-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,318 @@ +# + +ad_library { + + Tcl API for content_folders + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + @cvs-id $Id: content-folder-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ + +} + +namespace eval ::content::folder {} + +ad_proc -public ::content::folder::new { + -name:required + {-folder_id ""} + {-parent_id ""} + {-content_type "content_folder"} + {-label ""} + {-description ""} + {-creation_user ""} + {-creation_ip ""} + {-creation_date ""} + {-context_id ""} + {-package_id ""} +} { + + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + @param folder_id + + @param name + + @param parent_id + + @param content_type + + @param label + + @param description + + @param creation_user + + @param creation_ip + + @param creation_date + + @param context_id + + @param package_id + + @return + + @error +} { + # FIXME or should this use package instantiate object which is a + # little smarter + set var_list [list] + foreach var [list folder_id name label description parent_id context_id package_id creation_date] { + lappend var_list [list $var [set $var]] + } + set folder_id [package_instantiate_object \ + -creation_user $creation_user \ + -creation_ip $creation_ip \ + -var_list $var_list \ + $content_type] + return $folder_id +} + +ad_proc -public ::content::folder::delete { + -folder_id:required + {-cascade_p "f"} +} { + Delete a content folder + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + @param folder_id item_id of the content_folder + @param cascade_p if true delete all children, if false, return error if folder is non-empty + + @return + + @error +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + cascape_p $cascade_p + ] \ + "content_folder" "delete" \ + ] +} + +ad_proc -public ::content::folder::register_content_type { + -folder_id:required + -content_type:required + {-include_subtypes "f"} +} { + Register an allowed content type for folder_id + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-29 + + @param folder_id folder to register type to + + @param content_type content_revision or subtype of content_revision + + @param include_subtypes t or f + + @return + + @error +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + content_type $content_type \ + include_subtypes $include_subtypes ] \ + content_folder register_content_type] +} + + +ad_proc -public ::content::folder::unregister_content_type { + -folder_id:required + -content_type:required + {-include_subtypes "f"} +} { + Unregister an allowed content type for folder_id + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-04 + + @param folder_id folder to unregister type from + + @param content_type content_revision or subtype of content_revision + + @param include_subtypes t or f + + @return + + @error +} { + + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + content_type $content_type \ + include_subtypes $include_subtypes] \ + "content_folder" "unregister_content_type" + ] + +} + +ad_proc -public ::content::folder::update { + folder_id:required + attributes:required +} { + Update standard cr_folder attributes, including the attributes for + the folder cr_item + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-04 + + @param folder_id folder to update + + @param attributes A list of pairs of additional attributes and their values to get. Each pair is a list of two elements: key => value + + @return + + @error +} { + set valid_attributes [list label description package_id] + + set item_attributes $attributes + set i 0 + foreach {attribute value} $attributes { + if {[lsearch $valid_attributes $attribute] > -1} { + + # create local variable to use for binding + + set $attribute $value + if {![string equal "" $update_text]} { + append update_text "," + } + append update_text " ${attribute} = :${attribute} " + # remove this attribute from the list passed to item::set + set item_attributes [lreplace $item_attributes $i $i] + } + incr i + } + if {![string equal "" $update_text]} { + + # we have valid attributes, update them + + set query_text "update cr_folders set ${update_text}" + db_dml item_update $query_text + } + + # pass the rest of the attributes to content::item::set + # we can just send the folder attributes because they don't overlap + content::item::set \ + -item_id $folder_id \ + -attributes $attributes +} + + +ad_proc -public content::folder::get_index_page { + -folder_id:required +} { + @param folder_id + + @return item_id of content item named "index" in folder_id +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + ] \ + content_folder get_index_page] +} + + +ad_proc -public content::folder::get_label { + -folder_id:required +} { + @param folder_id + + @return label of cr_folder suitable for display +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + ] \ + content_folder get_label] +} + + +ad_proc -public content::folder::is_empty { + -folder_id:required +} { + @param folder_id + + @return t or f +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + ] \ + content_folder is_empty] +} + + +ad_proc -public content::folder::is_folder { + -item_id:required +} { + @param item_id + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_folder is_folder] +} + + +ad_proc -public content::folder::is_registered { + -folder_id:required + -content_type:required + {-include_subtypes ""} +} { + @param folder_id + @param content_type + @param include_subtypes + + @return t or f +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + content_type $content_type \ + include_subtypes $include_subtypes \ + ] \ + content_folder is_registered] +} + + +ad_proc -public content::folder::is_root { + -folder_id:required +} { + @param folder_id + + @return t or f +} { + return [package_exec_plsql -var_list [list \ + folder_id $folder_id \ + ] content_folder is_root] +} + + +ad_proc -public content::folder::is_sub_folder { + -folder_id:required + -target_folder_id:required +} { + @param folder_id + @param target_folder_id + + @return t of f +} { + return [package_exec_plsql \ + -var_list [list \ + folder_id $folder_id \ + target_folder_id $target_folder_id \ + ] \ + content_folder is_sub_folder] +} Index: openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-item-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,639 @@ + +ad_library { + + Tcl API for cr_items in the content repository + + @author Dave Bauer (dave@thedesignexperience.org) + @author Jun Yamog + @creation-date 2004-05-28 + @cvs-id $Id: content-item-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::item {} + +ad_proc -public ::content::item::new { + -name:required + {-parent_id ""} + {-item_id ""} + {-locale ""} + {-creation_date ""} + {-creation_user ""} + {-context_id ""} + {-creation_ip ""} + {-item_subtype ""} + {-content_type "content_revision"} + {-object_type "content_item"} + {-title ""} + {-description ""} + {-mime_type ""} + {-nls_language ""} + {-text ""} + {-data ""} + {-relation_tag ""} + {-is_live ""} + {-storage_type ""} + {-attributes ""} +} { + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + Create a new content item This proc creates versioned content + items where content_type iscontent_revision or subtypes of content + revision. There are procedures for each other base content + item. This procdedure uses package_instantiate object. Under + PostgreSQL the object_type new function must be registered with + define_function_args. + + @param name + @param item_id - item_id of this content_item. If this is not + specified an item_id will be generated automatically + @param parent_id - parent object of this content_item + @param object_type - content_item or subtype of content_item + @param content_type - content_revision or subtype of content_revision + @param context_id - + @param creation_user - + @param creation_ip - + @param creation_date - defaults to current date and time + @param storage_type - file, lob, or text (postgresql only) + @param locale - + + @param attributes - A list of pairs of additional attributes and their values to pass to the constructor. Each pair is a list of two elements: key => value + + @return item_id of the new content item + + @see content::symlink::new content::extlink::new content::folder::new +} { + if {![string equal "" $attributes]} { + set var_list $attributes + } else { + set var_list [list] + } + + lappend var_list \ + name $name \ + parent_id $parent_id \ + item_id $item_id \ + locale $locale \ + creation_date $creation_date \ + creation_user $creation_user \ + context_id $context_id \ + creation_ip $creation_ip \ + item_subtype $item_subtype \ + content_type $content_type \ + title $title \ + description $description \ + mime_type $mime_type \ + nls_language $nls_language \ + text $text \ + data $data \ + relation_tag $relation_tag \ + is_live $is_live \ + storage_type $storage_type + + foreach var [list item_id name parent_id content_type context_id creation_date] { + lappend var_list [list $var [set $var]] + } + + # the content type is not the object type of the cr_item so we pass in + # the cr_item subtype here and content_type as part of var_list + + set item_id [package_instantiate_object \ + -creation_user $creation_user \ + -creation_ip $creation_ip \ + -var_list $var_list \ + $object_type] + return $item_id +} + +ad_proc -public ::content::item::delete { + -item_id:required +} { + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + Delete a content item + @param item_id +} { + set var_list [list [list item_id $item_id]] + package_exec_plsql \ + -var_list $var_list \ + "content_item" "delete" +} + +ad_proc -public ::content::item::rename { + -item_id:required + -name:required +} { + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + Rename a content item. + @param item_id + @param name +} { + set var_list [list [list item_id $item_id] \ + [list name $name] + ] + package_exec_plsql \ + -var_list $var_list \ + "content_item" "rename" +} + +ad_proc -public ::content::item::move { + -item_id:required + -target_folder_id:required + {-name} +} { + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + @param item_id item to move + @param new_parent_id new parent item + @param name new name, allows move with rename +} { + set var_list [list item_id $item_id target_folder_id $target_folder_id] + if {[exists_and_not_null name]} { + lappend var_list name $name + } + package_exec_plsql \ + -var_list [list item_id $item_id] \ + "content_item" "move" +} + +ad_proc -public ::content::item::get { + -item_id:required + {-revision "live"} + {-attributes ""} +} { + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-05-28 + + @param item_id + @param revision live, latest, or best (live if it exists, otherwise latest) + @param attributes A list of pairs of additional attributes and their values to get. Each pair is a list of two elements: key => value + + @return + + @error +} { + + # get attributes of the content_item use the content_typex view +} + +ad_proc -public ::content::item::update { + -item_id:required + -attributes:required +} { + Update standard non-versioned content item attributes (cr_items) + Valid attributes: name parent_id latest_revision live_revision locale publish_status + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-04 + + @param item_id item to update + + @param attributes A list of pairs of additional attributes and their values to get. Each pair is a list of two elements: key => value + + @return + + @error +} { + + # do not allow update of item_id, storage_location, storage_type, + # content_type, or tree_sortkey + + set valid_attributes [list name parent_id latest_revision live_revision locale publish_status] + + set update_text "" + + foreach {attribute value} $attributes { + if {[lsearch $valid_attributes $attribute] > -1} { + + # create local variable to use for binding + + set $attribute $value + if {![string equal "" $update_text]} { + append update_text "," + } + append update_text " ${attribute} = :${attribute} " + } + } + if {![string equal "" $update_text]} { + + # we have valid attributes, update them + + set query_text "update cr_items set ${update_text}" + db_dml item_update $query_text + } +} + +ad_proc -public ::content::item::content_type { + -item_id:required +} { + @public get_content_type + + Retrieves the content type of the item. If the item does not exist, + returns an empty string. + + @param item_id The item id + + @return The content type of the item, or an empty string if no such + item exists +} { + return [package_exec_plsql \ + -var_list [list [list item_id $item_id]] \ + "content_item" "get_content_type"] +} + + +ad_proc -public content::item::get_best_revision { + -item_id:required +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_best_revision] +} + + +ad_proc -public content::item::get_content_type { + -item_id:required +} { + @param item_id + + @return VARCHAR2(100) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_content_type] +} + + +ad_proc -public content::item::get_context { + -item_id:required +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_context] +} + + +ad_proc -public content::item::get_id { + -item_path:required + {-root_folder_id ""} + {-resolve_index ""} +} { + @param item_path + @param root_folder_id + @param resolve_index + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_path $item_path \ + root_folder_id $root_folder_id \ + resolve_index $resolve_index \ + ] content_item get_id] +} + + +ad_proc -public content::item::get_latest_revision { + -item_id:required +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_latest_revision] +} + + +ad_proc -public content::item::get_live_revision { + -item_id:required +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_live_revision] +} + + +ad_proc -public content::item::get_parent_folder { + -item_id:required +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_parent_folder] +} + + +ad_proc -public content::item::get_path { + -item_id:required + {-root_folder_id ""} +} { + @param item_id + @param root_folder_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + root_folder_id $root_folder_id \ + ] content_item get_path] +} + + +ad_proc -public content::item::get_publish_date { + -item_id:required + {-is_live ""} +} { + @param item_id + @param is_live + + @return DATE +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + is_live $is_live \ + ] content_item get_publish_date] +} + + +ad_proc -public content::item::get_revision_count { + -item_id:required +} { + @param item_id + + @return NUMBER +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_revision_count] +} + + +ad_proc -public content::item::get_root_folder { + {-item_id ""} +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item get_root_folder] +} + + +ad_proc -public content::item::get_template { + -item_id:required + -use_context:required +} { + @param item_id + @param use_context + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + use_context $use_context \ + ] content_item get_template] +} + + +ad_proc -public content::item::get_title { + -item_id:required + {-is_live ""} +} { + @param item_id + @param is_live + + @return VARCHAR2(1000) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + is_live $is_live \ + ] content_item get_title] +} + + +ad_proc -public content::item::get_virtual_path { + -item_id:required + {-root_folder_id ""} +} { + @param item_id + @param root_folder_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + root_folder_id $root_folder_id \ + ] content_item get_virtual_path] +} + + +ad_proc -public content::item::is_index_page { + -item_id:required + -folder_id:required +} { + @param item_id + @param folder_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + folder_id $folder_id \ + ] content_item is_index_page] +} + + +ad_proc -public content::item::is_publishable { + -item_id:required +} { + @param item_id + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item is_publishable] +} + + +ad_proc -public content::item::is_published { + -item_id:required +} { + @param item_id + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item is_published] +} + + +ad_proc -public content::item::is_subclass { + -object_type:required + -supertype:required +} { + @param object_type + @param supertype + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + object_type $object_type \ + supertype $supertype \ + ] content_item is_subclass] +} + + +ad_proc -public content::item::is_valid_child { + -item_id:required + -content_type:required + {-relation_tag ""} +} { + @param item_id + @param content_type + @param relation_tag + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + content_type $content_type \ + relation_tag $relation_tag \ + ] content_item is_valid_child] +} + + +ad_proc -public content::item::register_template { + -item_id:required + -template_id:required + -use_context:required +} { + @param item_id + @param template_id + @param use_context +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + template_id $template_id \ + use_context $use_context \ + ] content_item register_template] +} + + +ad_proc -public content::item::relate { + -item_id:required + -object_id:required + {-relation_tag ""} + {-order_n ""} + {-relation_type ""} +} { + @param item_id + @param object_id + @param relation_tag + @param order_n + @param relation_type + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + object_id $object_id \ + relation_tag $relation_tag \ + order_n $order_n \ + relation_type $relation_type \ + ] content_item relate] +} + + +ad_proc -public content::item::set_live_revision { + -revision_id:required + {-publish_status ""} +} { + @param revision_id + @param publish_status +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + publish_status $publish_status \ + ] content_item set_live_revision] +} + + +ad_proc -public content::item::set_release_period { + -item_id:required + {-start_when ""} + {-end_when ""} +} { + @param item_id + @param start_when + @param end_when +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + start_when $start_when \ + end_when $end_when \ + ] content_item set_release_period] +} + + +ad_proc -public content::item::unregister_template { + -item_id:required + {-template_id ""} + {-use_context ""} +} { + @param item_id + @param template_id + @param use_context +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + template_id $template_id \ + use_context $use_context \ + ] content_item unregister_template] +} + + +ad_proc -public content::item::unrelate { + -rel_id:required +} { + @param rel_id +} { + return [package_exec_plsql -var_list [list \ + rel_id $rel_id \ + ] content_item unrelate] +} + + +ad_proc -public content::item::unset_live_revision { + -item_id:required +} { + @param item_id +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_item unset_live_revision] +} + Index: openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-keyword-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,207 @@ +# + +ad_library { + + Procedures for content_keywords + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-09 + @arch-tag: dc56be97-e611-4f34-a5b6-264b46a6ad7b + @cvs-id $Id: content-keyword-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::keyword {} + +ad_proc -public content::keyword::write_to_file { + -item_id:required + -root_path:required +} { + @param item_id + @param root_path +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + root_path $root_path \ + ] content_keyword write_to_file] +} + + +ad_proc -public content::keyword::del { + -keyword_id:required +} { + @param keyword_id +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + ] content_keyword del] +} + + +ad_proc -public content::keyword::get_description { + -keyword_id:required +} { + @param keyword_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + ] content_keyword get_description] +} + + +ad_proc -public content::keyword::get_heading { + -keyword_id:required +} { + @param keyword_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + ] content_keyword get_heading] +} + + +ad_proc -public content::keyword::get_path { + -keyword_id:required +} { + @param keyword_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + ] content_keyword get_path] +} + + +ad_proc -public content::keyword::is_assigned { + -item_id:required + -keyword_id:required + {-recurse ""} +} { + @param item_id + @param keyword_id + @param recurse + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + keyword_id $keyword_id \ + recurse $recurse \ + ] content_keyword is_assigned] +} + + +ad_proc -public content::keyword::is_leaf { + -keyword_id:required +} { + @param keyword_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + ] content_keyword is_leaf] +} + + +ad_proc -public content::keyword::item_assign { + -item_id:required + -keyword_id:required + {-context_id ""} + {-creation_user ""} + {-creation_ip ""} +} { + @param item_id + @param keyword_id + @param context_id + @param creation_user + @param creation_ip +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + keyword_id $keyword_id \ + context_id $context_id \ + creation_user $creation_user \ + creation_ip $creation_ip \ + ] content_keyword item_assign] +} + + +ad_proc -public content::keyword::item_unassign { + -item_id:required + -keyword_id:required +} { + @param item_id + @param keyword_id +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + keyword_id $keyword_id \ + ] content_keyword item_unassign] +} + + +ad_proc -public content::keyword::new { + -heading:required + {-description ""} + {-parent_id ""} + {-keyword_id ""} + {-creation_date ""} + {-creation_user ""} + {-creation_ip ""} + {-object_type ""} +} { + @param heading + @param description + @param parent_id + @param keyword_id + @param creation_date + @param creation_user + @param creation_ip + @param object_type + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + heading $heading \ + description $description \ + parent_id $parent_id \ + keyword_id $keyword_id \ + creation_date $creation_date \ + creation_user $creation_user \ + creation_ip $creation_ip \ + object_type $object_type \ + ] content_keyword new] +} + + +ad_proc -public content::keyword::set_description { + -keyword_id:required + -description:required +} { + @param keyword_id + @param description +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + description $description \ + ] content_keyword set_description] +} + + +ad_proc -public content::keyword::set_heading { + -keyword_id:required + -heading:required +} { + @param keyword_id + @param heading +} { + return [package_exec_plsql -var_list [list \ + keyword_id $keyword_id \ + heading $heading \ + ] content_permission set_heading] +} Index: openacs-4/packages/acs-content-repository/tcl/content-permission-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/content-permission-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-permission-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,186 @@ +# + +ad_library { + + These should probably just use the regular old + permission procedures + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-09 + @arch-tag: da21d1e8-0729-4f3b-8bef-3b847a979fec + @cvs-id $Id: content-permission-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::permission {} + +ad_proc -public content::permission::cm_admin_exists { +} { + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + ] content_permission cm_admin_exists] +} + + +ad_proc -public content::permission::grant_permission { + -object_id:required + -holder_id:required + -privilege:required + -recepient_id:required + {-is_recursive ""} + {-object_type ""} +} { + @param object_id + @param holder_id + @param privilege + @param recepient_id + @param is_recursive + @param object_type +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + holder_id $holder_id \ + privilege $privilege \ + recepient_id $recepient_id \ + is_recursive $is_recursive \ + object_type $object_type \ + ] content_permission grant_permission] +} + + +ad_proc -public content::permission::grant_permission_h { + -object_id:required + -grantee_id:required + -privilege:required +} { + @param object_id + @param grantee_id + @param privilege +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + grantee_id $grantee_id \ + privilege $privilege \ + ] content_permission grant_permission_h] +} + + +ad_proc -public content::permission::has_grant_authority { + -object_id:required + -holder_id:required + -privilege:required +} { + @param object_id + @param holder_id + @param privilege + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + holder_id $holder_id \ + privilege $privilege \ + ] content_permission has_grant_authority] +} + + +ad_proc -public content::permission::has_revoke_authority { + -object_id:required + -holder_id:required + -privilege:required + -revokee_id:required +} { + @param object_id + @param holder_id + @param privilege + @param revokee_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + holder_id $holder_id \ + privilege $privilege \ + revokee_id $revokee_id \ + ] content_permission has_revoke_authority] +} + + +ad_proc -public content::permission::inherit_permissions { + -parent_object_id:required + -child_object_id:required + {-child_creator_id ""} +} { + @param parent_object_id + @param child_object_id + @param child_creator_id +} { + return [package_exec_plsql -var_list [list \ + parent_object_id $parent_object_id \ + child_object_id $child_object_id \ + child_creator_id $child_creator_id \ + ] content_permission inherit_permissions] +} + + +ad_proc -public content::permission::permission_p { + -object_id:required + -holder_id:required + -privilege:required +} { + @param object_id + @param holder_id + @param privilege + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + holder_id $holder_id \ + privilege $privilege \ + ] content_permission permission_p] +} + + +ad_proc -public content::permission::revoke_permission { + -object_id:required + -holder_id:required + -privilege:required + -revokee_id:required + {-is_recursive ""} + {-object_type ""} +} { + @param object_id + @param holder_id + @param privilege + @param revokee_id + @param is_recursive + @param object_type +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + holder_id $holder_id \ + privilege $privilege \ + revokee_id $revokee_id \ + is_recursive $is_recursive \ + object_type $object_type \ + ] content_permission revoke_permission] +} + + +ad_proc -public content::revision::revoke_permission_h { + -object_id:required + -revokee_id:required + -privilege:required +} { + @param object_id + @param revokee_id + @param privilege +} { + return [package_exec_plsql -var_list [list \ + object_id $object_id \ + revokee_id $revokee_id \ + privilege $privilege \ + ] content_premission revoke_permission_h] +} Index: openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-revision-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,348 @@ +# + +ad_library { + + Procedures to manipulate content revisions + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-04 + @arch-tag: ddc736fb-cb5f-41fe-a854-703df26e8e03 + @cvs-id $Id: content-revision-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::revision {} + +ad_proc -public ::content::revision::new { + {-revision_id ""} + {-item_id ""} + {-title ""} + {-description ""} + {-content ""} + {-mime_type ""} + {-publish_date ""} + {-nls_language ""} + {-creation_date ""} + {-content_type} + {-creation_user} + {-creation_ip} + {-attributes} +} { + Adds a new revision of a content item. If content_type is not + passed in, we determine it from the content item. This is needed + to find the attributes for the content type. + + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-04 + + @param revision_id + + @param item_id + + @param content_type + + @param title + + @param description + + @param content + + @param mime_type + + @param publish_date + + @param nls_language + + @param creation_date + + @param creation_user + + @param creation_ip + + @param attributes + + @return + + @error +} { + + if {![info exists creation_user]} { + set creation_user [ad_conn user_id] + } + + if {![info exists creation_ip]} { + set creation_ip [ad_conn peeraddr] + } + + if {![exists_and_not_null content_type]} { + set content_type [item::get_content_type $item_id] + } + set attribute_names "" + set attribute_values "" + + if { [exists_and_not_null attributes] } { + set type_attributes [package_object_attribute_list $object_type] + set valid_attributes [list] + # add in extended attributes for this type, ingore + # content_revision as those are already captured as named + # parameters to this procedure + + foreach e $type_attributes { + if {![string equal "cr_revisions" [lindex $e 1]]} { + lappend $valid_attributes [lindex $e 2] + } + } + + if {[lsearch $valid_attributes $attribute] > -1} { + + # create local variable to use for binding + + set $attribute $value + append attribute_names ", ${attribute}" + append attribute_values ", :${attribute}" + } + } + + set table_name [db_string get_table_name "select table_name from acs_object_types where object_type=:content_type"] + set table_name "${table_name}i" + + set query_text "insert into ${table_name} + (revision_id, object_type, creation_user, creation_date, creation_ip, title, description, item_id, text, mime_type $attribute_names) + values (:revision_id, :content_type, :creation_user, :creation_date, :creation_ip, :title, :description, :item_id, :content, :mime_type $attribute_values)" + db_transaction { + if {[string equal "" $revision_id]} { + set revision_id [db_nextval "acs_object_id_seq"] + } + db_dml insert_revision $query_text + } + + return $revision_id +} + + +ad_proc -public content::revision::content_copy { + -revision_id:required + {-revision_id_dest ""} +} { + @param revision_id + @param revision_id_dest +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + revision_id_dest $revision_id_dest \ + ] content_revision content_copy] +} + + +ad_proc -public content::revision::copy { + -revision_id:required + {-copy_id ""} + {-target_item_id ""} + {-creation_user ""} + {-creation_ip ""} +} { + @param revision_id + @param copy_id + @param target_item_id + @param creation_user + @param creation_ip + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + copy_id $copy_id \ + target_item_id $target_item_id \ + creation_user $creation_user \ + creation_ip $creation_ip \ + ] content_revision copy] +} + + +ad_proc -public content::revision::del { + -revision_id:required +} { + @param revision_id +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision del] +} + + +ad_proc -public content::revision::export_xml { + -revision_id:required +} { + @param revision_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision export_xml] +} + + +ad_proc -public content::revision::get_number { + -revision_id:required +} { + @param revision_id + + @return NUMBER +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision get_number] +} + + +ad_proc -public content::revision::import_xml { + -item_id:required + -revision_id:required + -doc_id:required +} { + @param item_id + @param revision_id + @param doc_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + revision_id $revision_id \ + doc_id $doc_id \ + ] content_revision import_xml] +} + + +ad_proc -public content::revision::index_attributes { + -revision_id:required +} { + @param revision_id +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision index_attributes] +} + + +ad_proc -public content::revision::is_latest { + -revision_id:required +} { + @param revision_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision is_latest] +} + + +ad_proc -public content::revision::is_live { + -revision_id:required +} { + @param revision_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision is_live] +} + + +ad_proc -public content::revision::read_xml { + -item_id:required + -revision_id:required + -clob_loc:required +} { + @param item_id + @param revision_id + @param clob_loc + + @return NUMBER +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + revision_id $revision_id \ + clob_loc $clob_loc \ + ] content_revision read_xml] +} + + +ad_proc -public content::revision::replace { + -revision_id:required + -search:required + -replace:required +} { + @param revision_id + @param search + @param replace +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + search $search \ + replace $replace \ + ] content_revision replace] +} + + +ad_proc -public content::revision::revision_name { + -revision_id:required +} { + @param revision_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision revision_name] +} + + +ad_proc -public content::revision::to_html { + -revision_id:required +} { + @param revision_id +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision to_html] +} + + +ad_proc -public content::revision::to_temporary_clob { + -revision_id:required +} { + @param revision_id +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + ] content_revision to_temporary_clob] +} + + +ad_proc -public content::revision::write_xml { + -revision_id:required + -clob_loc:required +} { + @param revision_id + @param clob_loc + + @return NUMBER +} { + return [package_exec_plsql -var_list [list \ + revision_id $revision_id \ + clob_loc $clob_loc \ + ] content_revision write_xml] +} + + +ad_proc -public content::revision::update_attribute_index { +} { +} { + return [package_exec_plsql -var_list [list \ + ] content_revision update_attribute_index] +} + Index: openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-symlink-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,116 @@ +# + +ad_library { + + Procedures for content symlink + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-09 + @arch-tag: 31c66882-e912-4db4-84fe-8a2b0890ffb0 + @cvs-id $Id: content-symlink-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::symlink {} + +ad_proc -public content::symlink::copy { + -symlink_id:required + -target_folder_id:required + -creation_user:required + {-creation_ip ""} +} { + @param symlink_id + @param target_folder_id + @param creation_user + @param creation_ip +} { + return [package_exec_plsql -var_list [list \ + symlink_id $symlink_id \ + target_folder_id $target_folder_id \ + creation_user $creation_user \ + creation_ip $creation_ip \ + ] content_symlink copy] +} + + +ad_proc -public content::symlink::del { + -symlink_id:required +} { + @param symlink_id +} { + return [package_exec_plsql -var_list [list \ + symlink_id $symlink_id \ + ] content_symlink del] +} + + +ad_proc -public content::symlink::is_symlink { + -item_id:required +} { + @param item_id + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_symlink is_symlink] +} + + +ad_proc -public content::symlink::new { + {-name ""} + {-label ""} + -target_id:required + -parent_id:required + {-symlink_id ""} + {-creation_date ""} + {-creation_user ""} + {-creation_ip ""} +} { + @param name + @param label + @param target_id + @param parent_id + @param symlink_id + @param creation_date + @param creation_user + @param creation_ip + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + name $name \ + label $label \ + target_id $target_id \ + parent_id $parent_id \ + symlink_id $symlink_id \ + creation_date $creation_date \ + creation_user $creation_user \ + creation_ip $creation_ip \ + ] content_symlink new] +} + + +ad_proc -public content::symlink::resolve { + -item_id:required +} { + @param item_id + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_symlink resolve] +} + + +ad_proc -public content::symlink::resolve_content_type { + -item_id:required +} { + @param item_id + + @return VARCHAR2(100) +} { + return [package_exec_plsql -var_list [list \ + item_id $item_id \ + ] content_symlink resolve_content_type] +} Index: openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-template-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,97 @@ +# + +ad_library { + + Procudures for content template + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-09 + @arch-tag: a2fad1c8-17eb-412c-a62e-9704d346b27b + @cvs-id $Id: content-template-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::template {} + + +ad_proc -public content::template::del { + -template_id:required +} { + @param template_id +} { + return [package_exec_plsql -var_list [list \ + template_id $template_id \ + ] content_template del] +} + + +ad_proc -public content::template::get_path { + -template_id:required + {-root_folder_id ""} +} { + @param template_id + @param root_folder_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + template_id $template_id \ + root_folder_id $root_folder_id \ + ] content_template get_path] +} + + +ad_proc -public content::template::get_root_folder { +} { + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + ] content_template get_root_folder] +} + + +ad_proc -public content::template::is_template { + -template_id:required +} { + @param template_id + + @return VARCHAR2 +} { + return [package_exec_plsql -var_list [list \ + template_id $template_id \ + ] content_template is_template] +} + + +ad_proc -public content::template::new { + -name:required + {-text ""} + {-parent_id ""} + {-is_live ""} + {-template_id ""} + {-creation_date ""} + {-creation_user ""} + {-creation_ip ""} +} { + @param name + @param text + @param parent_id + @param is_live + @param template_id + @param creation_date + @param creation_user + @param creation_ip + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + name $name \ + text $text \ + parent_id $parent_id \ + is_live $is_live \ + template_id $template_id \ + creation_date $creation_date \ + creation_user $creation_user \ + creation_ip $creation_ip \ + ] content_template new] +} Index: openacs-4/packages/acs-content-repository/tcl/content-type-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/content-type-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-content-repository/tcl/content-type-procs.tcl 10 Jun 2004 01:13:57 -0000 1.1 @@ -0,0 +1,330 @@ +# + +ad_library { + + Procedures for content types + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2004-06-09 + @arch-tag: 4a8a3652-fd5d-49aa-86fc-fade683f06ce + @cvs-id $Id: content-type-procs.tcl,v 1.1 2004/06/10 01:13:57 daveb Exp $ +} + +namespace eval ::content::type {} + +ad_proc -public content::type::create_attribute { + -content_type:required + -attribute_name:required + -datatype:required + -pretty_name:required + {-pretty_plural ""} + {-sort_order ""} + {-default_value ""} + {-column_spec ""} +} { + @param content_type + @param attribute_name + @param datatype + @param pretty_name + @param pretty_plural + @param sort_order + @param default_value + @param column_spec + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + attribute_name $attribute_name \ + datatype $datatype \ + pretty_name $pretty_name \ + pretty_plural $pretty_plural \ + sort_order $sort_order \ + default_value $default_value \ + column_spec $column_spec \ + ] content_type create_attribute] +} + + +ad_proc -public content::type::create_type { + -content_type:required + {-supertype ""} + -pretty_name:required + -pretty_plural:required + {-table_name ""} + {-id_column ""} + {-name_method ""} +} { + @param content_type + @param supertype + @param pretty_name + @param pretty_plural + @param table_name + @param id_column + @param name_method +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + supertype $supertype \ + pretty_name $pretty_name \ + pretty_plural $pretty_plural \ + table_name $table_name \ + id_column $id_column \ + name_method $name_method \ + ] content_type create_type] +} + + +ad_proc -public content::type::drop_attribute { + -content_type:required + -attribute_name:required + {-drop_column ""} +} { + @param content_type + @param attribute_name + @param drop_column +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + attribute_name $attribute_name \ + drop_column $drop_column \ + ] content_type drop_attribute] +} + + +ad_proc -public content::type::drop_type { + -content_type:required + {-drop_children_p ""} + {-drop_table_p ""} +} { + @param content_type + @param drop_children_p + @param drop_table_p +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + drop_children_p $drop_children_p \ + drop_table_p $drop_table_p \ + ] content_type drop_type] +} + + +ad_proc -public content::type::get_template { + -content_type:required + -use_context:required +} { + @param content_type + @param use_context + + @return NUMBER(38) +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + use_context $use_context \ + ] content_type get_template] +} + + +ad_proc -public content::type::is_content_type { + -object_type:required +} { + @param object_type + + @return CHAR +} { + return [package_exec_plsql -var_list [list \ + object_type $object_type \ + ] content_type is_content_type] +} + + +ad_proc -public content::type::refresh_view { + -content_type:required +} { + @param content_type +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + ] content_type refresh_view] +} + + +ad_proc -public content::type::register_child_type { + -parent_type:required + -child_type:required + {-relation_tag ""} + {-min_n ""} + {-max_n ""} +} { + @param parent_type + @param child_type + @param relation_tag + @param min_n + @param max_n +} { + return [package_exec_plsql -var_list [list \ + parent_type $parent_type \ + child_type $child_type \ + relation_tag $relation_tag \ + min_n $min_n \ + max_n $max_n \ + ] content_type register_child_type] +} + + +ad_proc -public content::type::register_mime_type { + -content_type:required + -mime_type:required +} { + @param content_type + @param mime_type +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + mime_type $mime_type \ + ] content_type register_mime_type] +} + + +ad_proc -public content::type::register_relation_type { + -content_type:required + -target_type:required + {-relation_tag ""} + {-min_n ""} + {-max_n ""} +} { + @param content_type + @param target_type + @param relation_tag + @param min_n + @param max_n +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + target_type $target_type \ + relation_tag $relation_tag \ + min_n $min_n \ + max_n $max_n \ + ] content_type register_relation_type] +} + + +ad_proc -public content::type::register_template { + -content_type:required + -template_id:required + -use_context:required + {-is_default ""} +} { + @param content_type + @param template_id + @param use_context + @param is_default +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + template_id $template_id \ + use_context $use_context \ + is_default $is_default \ + ] content_type register_template] +} + + +ad_proc -public content::type::rotate_template { + -template_id:required + -v_content_type:required + -use_context:required +} { + @param template_id + @param v_content_type + @param use_context +} { + return [package_exec_plsql -var_list [list \ + template_id $template_id \ + v_content_type $v_content_type \ + use_context $use_context \ + ] content_type rotate_template] +} + + +ad_proc -public content::type::set_default_template { + -content_type:required + -template_id:required + -use_context:required +} { + @param content_type + @param template_id + @param use_context +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + template_id $template_id \ + use_context $use_context \ + ] content_type set_default_template] +} + + +ad_proc -public content::type::unregister_child_type { + -parent_type:required + -child_type:required + {-relation_tag ""} +} { + @param parent_type + @param child_type + @param relation_tag +} { + return [package_exec_plsql -var_list [list \ + parent_type $parent_type \ + child_type $child_type \ + relation_tag $relation_tag \ + ] content_type unregister_child_type] +} + + +ad_proc -public content::type::unregister_mime_type { + -content_type:required + -mime_type:required +} { + @param content_type + @param mime_type +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + mime_type $mime_type \ + ] content_type unregister_mime_type] +} + + +ad_proc -public content::type::unregister_relation_type { + -content_type:required + -target_type:required + {-relation_tag ""} +} { + @param content_type + @param target_type + @param relation_tag +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + target_type $target_type \ + relation_tag $relation_tag \ + ] content_type unregister_relation_type] +} + + +ad_proc -public content::type::unregister_template { + {-content_type ""} + -template_id:required + {-use_context ""} +} { + @param content_type + @param template_id + @param use_context +} { + return [package_exec_plsql -var_list [list \ + content_type $content_type \ + template_id $template_id \ + use_context $use_context \ + ] content_type unregister_template] +} + +