fs::add_created_version (public, deprecated)

 fs::add_created_version -name name -content_body content_body \
    -mime_type mime_type -item_id item_id \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ] \
    [ -title title ] [ -description description ] \
    [ -suppress_notify_p suppress_notify_p ] \
    [ -storage_type storage_type ] [ -package_id package_id ] \
    [ -storage_type storage_type ]

Defined in packages/file-storage/tcl/file-storage-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Create a new version of a file storage item using the content passed in content_body DEPRECATED: this proc has been superseded by fs::add_version

Switches:
-name (required)
-content_body (required)
-mime_type (required)
-item_id (required)
-creation_user (optional)
-creation_ip (optional)
-title (optional)
-description (optional)
-suppress_notify_p (optional, defaults to "f")
-storage_type (optional)
-package_id (optional)
-storage_type (optional)
Returns:
revision_id
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 fs::add_created_file fs::add_created_file (public, deprecated) fs::add_created_version fs::add_created_version fs::add_created_file->fs::add_created_version ad_conn ad_conn (public) fs::add_created_version->ad_conn ad_log_deprecated ad_log_deprecated (public) fs::add_created_version->ad_log_deprecated content::revision::new content::revision::new (public) fs::add_created_version->content::revision::new db_string db_string (public) fs::add_created_version->db_string fs::do_notifications fs::do_notifications (public) fs::add_created_version->fs::do_notifications

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc fs::add_created_version
    if {$package_id eq ""} {
        set package_id [ad_conn package_id]
    }
    if {$storage_type eq ""} {
        set storage_type [db_string get_storage_type {
            select storage_type from cr_items where item_id = :item_id
        }]
    }
    if {$creation_user eq ""} {
        set creation_user [ad_conn user_id]
    }
    if {$creation_ip eq ""} {
        set creation_ip [ns_conn peeraddr]
    }

    set revision_id [content::revision::new  -item_id $item_id  -title $title  -description $description  -content $content_body  -mime_type $mime_type  -creation_user $creation_user  -creation_ip $creation_ip  -package_id $package_id  -is_live "t"  -storage_type $storage_type]

    set parent_id [fs::get_parent -item_id $item_id]

    if {[string is false $suppress_notify_p]} {
        fs::do_notifications  -folder_id $parent_id  -filename $title  -item_id $revision_id  -action "new_version"  -package_id $package_id
    }

    #
    # It is safe to rebuild RSS repeatedly, assuming it's not too
    # expensive.
    #
    set folder_info [fs::get_folder_package_and_root $parent_id]
    set db_package_id [lindex $folder_info 0]
    if { [parameter::get -package_id $db_package_id -parameter ExposeRssP -default 0] } {
        fs::rss::build_feeds $parent_id
    }

    return $revision_id
Generic XQL file:
packages/file-storage/tcl/file-storage-procs.xql

PostgreSQL XQL file:
packages/file-storage/tcl/file-storage-procs-postgresql.xql

Oracle XQL file:
packages/file-storage/tcl/file-storage-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: