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):
- Testcases:
- fs_add_delete_copy, fs_add_file_to_folder, oacs_dav_put