cr_import_content (public)

 cr_import_content [ -storage_type storage_type ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ] \
    [ -image_only ] [ -image_type image_type ] \
    [ -other_type other_type ] [ -title title ] \
    [ -description description ] [ -package_id package_id ] \
    [ -item_id item_id ] parent_id tmp_filename tmp_size mime_type \
    object_name

Defined in packages/acs-content-repository/tcl/revision-procs.tcl

Import an uploaded file into the content repository.

Switches:
-storage_type (optional, defaults to "file")
Where to store the content (lob or file), defaults to "file" (later a system-wide parameter)
-creation_user (optional)
The creating user (defaults to current user)
-creation_ip (optional)
The creating ip (defaults to peeraddr)
-image_only (optional, boolean)
Only allow images
-image_type (optional, defaults to "image")
The type of content item to create if the file contains an image
-other_type (optional, defaults to "content_revision")
The type of content item to create for a non-image file
-title (optional)
The title given to the new revision
-description (optional)
The description of the new revision
-package_id (optional)
Package ID of the package that created the item
-item_id (optional)
If present, make a new revision of this item, otherwise, make a new item
Parameters:
parent_id (required)
The parent of the content item we create
tmp_filename (required)
The name of the temporary file holding the uploaded content
tmp_size (required)
The size of tmp_file
mime_type (required)
The uploaded file's mime type
object_name (required)
The name to give the result content item and revision This procedure handles all mime_type details, creating a new item of the appropriate type and stuffing the content into either the filesystem or the database depending on "storage_type". The new revision is set live, and its item_id is returned to the caller. image_type and other_type should be supplied when the client package has extended the image and content_revision types to hold package-specific information. Checking is done to ensure that image_type has been inherited from image, and that other_type has been inherited from content_revision. Is up to the caller to do any checking on size limitations, etc.

Partial Call Graph (max 5 caller/called nodes):
%3 test_fs_add_delete_copy fs_add_delete_copy (test file-storage) cr_import_content cr_import_content test_fs_add_delete_copy->cr_import_content test_fs_add_file_to_folder fs_add_file_to_folder (test file-storage) test_fs_add_file_to_folder->cr_import_content test_oacs_dav_put oacs_dav_put (test oacs-dav) test_oacs_dav_put->cr_import_content ad_conn ad_conn (public) cr_import_content->ad_conn content::revision::update_content content::revision::update_content (private) cr_import_content->content::revision::update_content db_0or1row db_0or1row (public) cr_import_content->db_0or1row db_dml db_dml (public) cr_import_content->db_dml db_exec_plsql db_exec_plsql (public) cr_import_content->db_exec_plsql content::item::upload_file content::item::upload_file (public) content::item::upload_file->cr_import_content fs::add_version fs::add_version (public) fs::add_version->cr_import_content oacs_dav::impl::content_revision::put oacs_dav::impl::content_revision::put (private) oacs_dav::impl::content_revision::put->cr_import_content text_templates::store_final_document text_templates::store_final_document (public) text_templates::store_final_document->cr_import_content

Testcases:
fs_add_delete_copy, fs_add_file_to_folder, oacs_dav_put
[ show source ]
Show another procedure: