fs::new_folder (public)

 fs::new_folder -name name -pretty_name pretty_name \
    -parent_id parent_id [ -creation_user creation_user ] \
    [ -creation_ip creation_ip ] [ -description description ] \
    [ -package_id package_id ] [ -no_callback ]

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

Create a new folder.

Switches:
-name (required)
Internal name of the folder, must be unique under a given parent_id
-pretty_name (required)
What we show to users of the system
-parent_id (required)
Where we create this folder
-creation_user (optional)
Who created this folder
-creation_ip (optional)
What is the IP address of the creation_user
-description (optional)
of the folder. Not used in the current FS UI but might be used elsewhere.
-package_id (optional)
Package_id of the package for which to create the new folder. Preferably a file storage package_id
-no_callback (optional, boolean)
defines if the callback should be called. Defaults to yes
Returns:
folder_id of the newly created folder

Partial Call Graph (max 5 caller/called nodes):
%3 test_fs_add_delete_copy fs_add_delete_copy (test file-storage) fs::new_folder fs::new_folder test_fs_add_delete_copy->fs::new_folder test_fs_add_file_to_folder fs_add_file_to_folder (test file-storage) test_fs_add_file_to_folder->fs::new_folder test_fs_create_folder_using_api fs_create_folder_using_api (test file-storage) test_fs_create_folder_using_api->fs::new_folder test_fs_publish_file fs_publish_file (test file-storage) test_fs_publish_file->fs::new_folder acs_object::package_id acs_object::package_id (public) fs::new_folder->acs_object::package_id ad_conn ad_conn (public) fs::new_folder->ad_conn apm_package_key_from_id apm_package_key_from_id (public) fs::new_folder->apm_package_key_from_id callback callback (public) fs::new_folder->callback content::folder::new content::folder::new (public) fs::new_folder->content::folder::new callback::pm::project_new::impl::file_storage callback::pm::project_new::impl::file_storage (private) callback::pm::project_new::impl::file_storage->fs::new_folder fs::impl::fs_object::mkcol fs::impl::fs_object::mkcol (private) fs::impl::fs_object::mkcol->fs::new_folder install::xml::action::file-storage-folder install::xml::action::file-storage-folder (private) install::xml::action::file-storage-folder->fs::new_folder packages/file-storage/www/folder-create.tcl packages/file-storage/ www/folder-create.tcl packages/file-storage/www/folder-create.tcl->fs::new_folder

Testcases:
fs_publish_file, fs_add_delete_copy, fs_create_folder_using_api, fs_add_file_to_folder
Source code:
    if {$creation_user eq ""} {
        set creation_user [ad_conn user_id]
    }

    if {$creation_ip eq ""} {
        set creation_ip [ns_conn peeraddr]
    }

    # If the package_id is empty, try the package_id from the parent_object
    if {$package_id eq ""} {
        set package_id [acs_object::package_id -object_id $parent_id]

        # If the package_id from the parent_id exists, make sure it is a file-storage package_id
        if {$package_id ne ""} {
            if {[apm_package_key_from_id $package_id] ne "file-storage"} {
                set package_id ""
            }
        }
    }

    set folder_id [content::folder::new  -name $name  -label $pretty_name  -parent_id $parent_id  -creation_user $creation_user  -creation_ip $creation_ip  -description $description  -package_id $package_id]
    permission::grant -party_id $creation_user -object_id $folder_id -privilege "admin"

    if {!$no_callback_p} {
        callback fs::folder_new -package_id $package_id -folder_id $folder_id
    }

    return $folder_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: