content-revision-procs.tcl

CRUD procedures for content revisions

Location:
packages/acs-content-repository/tcl/content-revision-procs.tcl
Created:
2004-06-04
Author:
Dave Bauer <dave@thedesignexperience.org>
CVS Identification:
$Id: content-revision-procs.tcl,v 1.36.2.9 2022/09/12 15:30:42 antoniop Exp $

Procedures in this file

Detailed information

content::revision::check_dirs (private)

 content::revision::check_dirs [ -max_results max_results ] \
    [ -max_checks max_checks ] [ -returnlist ] [ -prune ]

Figure out, how many directories in the CR are empty, report them optionally or delete them optionally.

Switches:
-max_results
(defaults to "5000") (optional)
stop after having found so many empty directories
-max_checks
(defaults to "10000") (optional)
stop after having checked so many directories
-returnlist
(boolean) (optional)
return the directories as part of the result
-prune
(boolean) (optional)
delete the found empty directories
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 cr_fs_path cr_fs_path (private) content::revision::check_dirs content::revision::check_dirs content::revision::check_dirs->cr_fs_path

Testcases:
No testcase defined.

content::revision::check_files (private)

 content::revision::check_files [ -max_results max_results ] \
    [ -max_checks max_checks ] [ -returnlist ]

Figure out, how many files in the CR are not linked to the revisions in the content repository, and report them optionally.

Switches:
-max_results
(defaults to "5000") (optional)
stop after having found so many non-referenced files
-max_checks
(defaults to "10000") (optional)
stop after having checked so many non-referenced files
-returnlist
(boolean) (optional)
return the non-referenced files as part of the result
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 cr_count_file_entries cr_count_file_entries (private) cr_fs_path cr_fs_path (private) content::revision::check_files content::revision::check_files content::revision::check_files->cr_count_file_entries content::revision::check_files->cr_fs_path

Testcases:
No testcase defined.

content::revision::cleanup (private)

 content::revision::cleanup -storage_type storage_type \
    -storage_area_key storage_area_key -data data
Switches:
-storage_type
(required)
-storage_area_key
(required)
-data
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 content::item::delete content::item::delete (public) content::revision::cleanup content::revision::cleanup content::item::delete->content::revision::cleanup

Testcases:
No testcase defined.

content::revision::cleanup-file (private)

 content::revision::cleanup-file -storage_area_key storage_area_key \
    -data data

This function cleans-up files AFTER the DB-entry was deleted. If the transaction is aborted, the file will not be executed and the file will survive. Thus function should make cr_check_orphaned_files obsolete, which does not scale.

Switches:
-storage_area_key
(required)
-data
(required)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 cr_fs_path cr_fs_path (private) content::revision::cleanup-file content::revision::cleanup-file content::revision::cleanup-file->cr_fs_path

Testcases:
No testcase defined.

content::revision::cleanup-lob (private)

 content::revision::cleanup-lob -storage_area_key storage_area_key \
    -data data
Switches:
-storage_area_key
(required)
-data
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

content::revision::cleanup-text (private)

 content::revision::cleanup-text -storage_area_key storage_area_key \
    -data data
Switches:
-storage_area_key
(required)
-data
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

content::revision::collect_cleanup_data (private)

 content::revision::collect_cleanup_data -item_id item_id \
    -storage_type storage_type
Switches:
-item_id
(required)
-storage_type
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 content::item::delete content::item::delete (public) content::revision::collect_cleanup_data content::revision::collect_cleanup_data content::item::delete->content::revision::collect_cleanup_data

Testcases:
No testcase defined.

content::revision::collect_cleanup_data-file (private)

 content::revision::collect_cleanup_data-file -item_id item_id
Switches:
-item_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 db_list db_list (public) content::revision::collect_cleanup_data-file content::revision::collect_cleanup_data-file content::revision::collect_cleanup_data-file->db_list

Testcases:
No testcase defined.

content::revision::collect_cleanup_data-lob (private)

 content::revision::collect_cleanup_data-lob -item_id item_id
Switches:
-item_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

content::revision::collect_cleanup_data-text (private)

 content::revision::collect_cleanup_data-text -item_id item_id
Switches:
-item_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

content::revision::content_copy (public)

 content::revision::content_copy -revision_id revision_id \
    [ -revision_id_dest revision_id_dest ]
Switches:
-revision_id
(required)
-revision_id_dest
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::content_copy content::revision::content_copy content::revision::content_copy->package_exec_plsql

Testcases:
No testcase defined.

content::revision::copy (public)

 content::revision::copy -revision_id revision_id [ -copy_id copy_id ] \
    [ -target_item_id target_item_id ] \
    [ -creation_user creation_user ] [ -creation_ip creation_ip ]
Switches:
-revision_id
(required)
-copy_id
(optional)
-target_item_id
(optional)
-creation_user
(optional)
-creation_ip
(optional)
Returns:
NUMBER(38)

Partial Call Graph (max 5 caller/called nodes):
%3 fs::file_copy fs::file_copy (public) content::revision::copy content::revision::copy fs::file_copy->content::revision::copy package_exec_plsql package_exec_plsql (public) content::revision::copy->package_exec_plsql

Testcases:
No testcase defined.

content::revision::delete (public)

 content::revision::delete -revision_id revision_id
Switches:
-revision_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::delete content::revision::delete content::revision::delete->package_exec_plsql

Testcases:
No testcase defined.

content::revision::export_to_filesystem (public)

 content::revision::export_to_filesystem -revision_id revision_id \
    -storage_type storage_type -filename filename

Export the content of the provided revision to the named file in the filesystem.

Switches:
-revision_id
(required)
-storage_type
(required)
-filename
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 fs::publish_versioned_object_to_file_system fs::publish_versioned_object_to_file_system (public) content::revision::export_to_filesystem content::revision::export_to_filesystem fs::publish_versioned_object_to_file_system->content::revision::export_to_filesystem

Testcases:
No testcase defined.

content::revision::export_to_filesystem-file (private)

 content::revision::export_to_filesystem-file -revision_id revision_id \
    -filename filename

Export the content of the provided revision to the named file in the filesystem.

Switches:
-revision_id
(required)
-filename
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 ad_file ad_file (public) ad_log ad_log (public) content::revision::get_cr_file_path content::revision::get_cr_file_path (public) content::revision::export_to_filesystem-file content::revision::export_to_filesystem-file content::revision::export_to_filesystem-file->ad_file content::revision::export_to_filesystem-file->ad_log content::revision::export_to_filesystem-file->content::revision::get_cr_file_path

Testcases:
No testcase defined.

content::revision::export_to_filesystem-lob (private)

 content::revision::export_to_filesystem-lob -revision_id revision_id \
    -filename filename

Export the content of the provided revision to the named file in the filesystem.

Switches:
-revision_id
(required)
-filename
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 db_blob_get_file db_blob_get_file (public) content::revision::export_to_filesystem-lob content::revision::export_to_filesystem-lob content::revision::export_to_filesystem-lob->db_blob_get_file

Testcases:
No testcase defined.

content::revision::export_to_filesystem-text (private)

 content::revision::export_to_filesystem-text -revision_id revision_id \
    -filename filename

Export the content of the provided revision to the named file in the filesystem.

Switches:
-revision_id
(required)
-filename
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 db_string db_string (public) content::revision::export_to_filesystem-text content::revision::export_to_filesystem-text content::revision::export_to_filesystem-text->db_string

Testcases:
No testcase defined.

content::revision::export_xml (public)

 content::revision::export_xml -revision_id revision_id
Switches:
-revision_id
(required)
Returns:
NUMBER(38)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::export_xml content::revision::export_xml content::revision::export_xml->package_exec_plsql

Testcases:
No testcase defined.

content::revision::file_stats (private)

 content::revision::file_stats [ -max max ]

Determine some basic statistics about files in the CR based on a sample. This is useful for large installations with several million of files, where a detailed analysis would take very long.

Switches:
-max
(defaults to "10000") (optional)
number of revisions with storage-type "file" to check
Author:
Gustaf Neumann

Partial Call Graph (max 5 caller/called nodes):
%3 content::revision::item_id content::revision::item_id (public) db_list_of_lists db_list_of_lists (public) content::revision::file_stats content::revision::file_stats content::revision::file_stats->content::revision::item_id content::revision::file_stats->db_list_of_lists

Testcases:
No testcase defined.

content::revision::get_cr_file_path (public)

 content::revision::get_cr_file_path [ -revision_id revision_id ]

Get the path to content in the filesystem

Switches:
-revision_id
(optional)
Returns:
path to filesystem stored revision content
Author:
Dave Bauer <dave@solutiongrove.com>
Created:
2006-08-27

Partial Call Graph (max 5 caller/called nodes):
%3 test_apm_tarballs apm_tarballs (test acs-tcl) content::revision::get_cr_file_path content::revision::get_cr_file_path test_apm_tarballs->content::revision::get_cr_file_path test_fs_upload_a_notmpfile fs_upload_a_notmpfile (test file-storage) test_fs_upload_a_notmpfile->content::revision::get_cr_file_path test_oacs_dav_put oacs_dav_put (test oacs-dav) test_oacs_dav_put->content::revision::get_cr_file_path cr_fs_path cr_fs_path (private) content::revision::get_cr_file_path->cr_fs_path db_1row db_1row (public) content::revision::get_cr_file_path->db_1row acs_mail_lite::send_immediately acs_mail_lite::send_immediately (private) acs_mail_lite::send_immediately->content::revision::get_cr_file_path content::revision::export_to_filesystem-file content::revision::export_to_filesystem-file (private) content::revision::export_to_filesystem-file->content::revision::get_cr_file_path fs::file_copy fs::file_copy (public) fs::file_copy->content::revision::get_cr_file_path fs::get_object_info fs::get_object_info (public) fs::get_object_info->content::revision::get_cr_file_path fs__datasource fs__datasource (private) fs__datasource->content::revision::get_cr_file_path

Testcases:
apm_tarballs, fs_upload_a_notmpfile, oacs_dav_put

content::revision::get_number (public)

 content::revision::get_number -revision_id revision_id
Switches:
-revision_id
(required)
Returns:
NUMBER

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::get_number content::revision::get_number content::revision::get_number->package_exec_plsql

Testcases:
No testcase defined.

content::revision::get_title (public)

 content::revision::get_title -revision_id revision_id

Returns the title of a particular 'content_revision'.

Switches:
-revision_id
(required)
The 'revision_id' of the object
Returns:
The title of the object (text), or empty if not found.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_name_api attachments_name_api (test attachments) content::revision::get_title content::revision::get_title test_attachments_name_api->content::revision::get_title test_content_revision content_revision (test acs-content-repository) test_content_revision->content::revision::get_title db_string db_string (public) content::revision::get_title->db_string attachments::get_title attachments::get_title (public) attachments::get_title->content::revision::get_title

Testcases:
content_revision, attachments_name_api

content::revision::import_xml (public)

 content::revision::import_xml -item_id item_id \
    -revision_id revision_id -doc_id doc_id
Switches:
-item_id
(required)
-revision_id
(required)
-doc_id
(required)
Returns:
NUMBER(38)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::import_xml content::revision::import_xml content::revision::import_xml->package_exec_plsql

Testcases:
No testcase defined.

content::revision::index_attributes (public)

 content::revision::index_attributes -revision_id revision_id
Switches:
-revision_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::index_attributes content::revision::index_attributes content::revision::index_attributes->package_exec_plsql

Testcases:
No testcase defined.

content::revision::is_latest (public)

 content::revision::is_latest -revision_id revision_id
Switches:
-revision_id
(required)
Returns:
t or f

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_item content_item (test acs-content-repository) content::revision::is_latest content::revision::is_latest test_content_item->content::revision::is_latest test_content_revision content_revision (test acs-content-repository) test_content_revision->content::revision::is_latest package_exec_plsql package_exec_plsql (public) content::revision::is_latest->package_exec_plsql

Testcases:
content_item, content_revision

content::revision::is_live (public)

 content::revision::is_live -revision_id revision_id
Switches:
-revision_id
(required)
Returns:
t or f

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_item content_item (test acs-content-repository) content::revision::is_live content::revision::is_live test_content_item->content::revision::is_live test_content_revision content_revision (test acs-content-repository) test_content_revision->content::revision::is_live package_exec_plsql package_exec_plsql (public) content::revision::is_live->package_exec_plsql packages/acs-developer-support/www/css-edit.tcl packages/acs-developer-support/ www/css-edit.tcl packages/acs-developer-support/www/css-edit.tcl->content::revision::is_live

Testcases:
content_item, content_revision

content::revision::item_id (public)

 content::revision::item_id -revision_id revision_id

Gets the item_id of the item to which the revision belongs.

Switches:
-revision_id
(required)
The revision id
Returns:
The item_id of the item to which this revision belongs

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_revision content_revision (test acs-content-repository) content::revision::item_id content::revision::item_id test_content_revision->content::revision::item_id db_string db_string (public) content::revision::item_id->db_string acs_mail_lite::send_immediately acs_mail_lite::send_immediately (private) acs_mail_lite::send_immediately->content::revision::item_id callback::search::url::impl::file_storage_object callback::search::url::impl::file_storage_object (private) callback::search::url::impl::file_storage_object->content::revision::item_id content::item::get_content content::item::get_content (public) content::item::get_content->content::revision::item_id content::item::get_revision_content content::item::get_revision_content (public) content::item::get_revision_content->content::revision::item_id content::revision::file_stats content::revision::file_stats (private) content::revision::file_stats->content::revision::item_id

Testcases:
content_revision

content::revision::new (public)

 content::revision::new [ -revision_id revision_id ] -item_id item_id \
    [ -title title ] [ -description description ] [ -content content ] \
    [ -mime_type mime_type ] [ -publish_date publish_date ] \
    [ -nls_language nls_language ] [ -creation_date creation_date ] \
    [ -content_type content_type ] [ -creation_user creation_user ] \
    [ -creation_ip creation_ip ] [ -package_id package_id ] \
    [ -attributes attributes ] [ -is_live is_live ] \
    [ -tmp_filename tmp_filename ] [ -storage_type storage_type ]

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.

Switches:
-revision_id
(optional)
-item_id
(required)
-title
(optional)
-description
(optional)
-content
(optional)
-mime_type
(optional)
-publish_date
(optional)
-nls_language
(optional)
-creation_date
(optional)
-content_type
(optional)
-creation_user
(optional)
-creation_ip
(optional)
-package_id
(optional)
Package_id content belongs to
-attributes
(optional)
A list of lists of pairs of additional attributes and their values to pass to the constructor. Each pair is a list of two elements: key => value such as [list [list attribute value] [list attribute value]]
-is_live
(defaults to "f") (optional)
True is revision should be set live
-tmp_filename
(optional)
file containing content to be added to revision. The caller is responsible for cleaning up the temporary file.
-storage_type
(optional)
Returns:
Error:
Author:
Dave Bauer <dave@thedesignexperience.org>
Created:
2004-06-04

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_image content_image (test acs-content-repository) content::revision::new content::revision::new test_content_image->content::revision::new test_content_revision content_revision (test acs-content-repository) test_content_revision->content::revision::new acs_object_type::get_table_name acs_object_type::get_table_name (public) content::revision::new->acs_object_type::get_table_name ad_conn ad_conn (public) content::revision::new->ad_conn content::item::get_content_type content::item::get_content_type (public) content::revision::new->content::item::get_content_type content::item::set_live_revision content::item::set_live_revision (public) content::revision::new->content::item::set_live_revision content::revision::update_content content::revision::update_content (private) content::revision::new->content::revision::update_content apm_generate_tarball apm_generate_tarball (public) apm_generate_tarball->content::revision::new content::item::new content::item::new (public) content::item::new->content::revision::new email_image::edit_email_image email_image::edit_email_image (public) email_image::edit_email_image->content::revision::new email_image::new_item email_image::new_item (public) email_image::new_item->content::revision::new fs::add_created_version fs::add_created_version (public, deprecated) fs::add_created_version->content::revision::new

Testcases:
content_image, content_revision

content::revision::read_xml (public)

 content::revision::read_xml -item_id item_id -revision_id revision_id \
    -clob_loc clob_loc
Switches:
-item_id
(required)
-revision_id
(required)
-clob_loc
(required)
Returns:
NUMBER

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::read_xml content::revision::read_xml content::revision::read_xml->package_exec_plsql

Testcases:
No testcase defined.

content::revision::replace (public)

 content::revision::replace -revision_id revision_id -search search \
    -replace replace
Switches:
-revision_id
(required)
-search
(required)
-replace
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::replace content::revision::replace content::revision::replace->package_exec_plsql

Testcases:
No testcase defined.

content::revision::revision_name (public)

 content::revision::revision_name -revision_id revision_id
Switches:
-revision_id
(required)
Returns:
VARCHAR2

Partial Call Graph (max 5 caller/called nodes):
%3 test_content_revision content_revision (test acs-content-repository) content::revision::revision_name content::revision::revision_name test_content_revision->content::revision::revision_name package_exec_plsql package_exec_plsql (public) content::revision::revision_name->package_exec_plsql

Testcases:
content_revision

content::revision::to_html (public)

 content::revision::to_html -revision_id revision_id
Switches:
-revision_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::to_html content::revision::to_html content::revision::to_html->package_exec_plsql

Testcases:
No testcase defined.

content::revision::to_temporary_clob (public)

 content::revision::to_temporary_clob -revision_id revision_id
Switches:
-revision_id
(required)

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::to_temporary_clob content::revision::to_temporary_clob content::revision::to_temporary_clob->package_exec_plsql

Testcases:
No testcase defined.

content::revision::update_attribute_index (public, deprecated)

 content::revision::update_attribute_index
Deprecated. Invoking this procedure generates a warning.

DEPRECATED: the db api for this proc was deleted in 2005

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) package_exec_plsql package_exec_plsql (public) content::revision::update_attribute_index content::revision::update_attribute_index content::revision::update_attribute_index->ad_log_deprecated content::revision::update_attribute_index->package_exec_plsql

Testcases:
No testcase defined.

content::revision::update_content (private)

 content::revision::update_content -item_id item_id \
    -revision_id revision_id -content content \
    -storage_type storage_type -mime_type mime_type \
    [ -tmp_filename tmp_filename ]

Update content column separately. Oracle does not allow insert into a BLOB. This assumes that if storage type is lob and no file is specified that the content is really text and store it in the text column in PostgreSQL

Switches:
-item_id
(required)
-revision_id
(required)
Content revision to update
-content
(required)
Content to add to resivsion
-storage_type
(required)
text, file, or lob
-mime_type
(required)
mime type of the content
-tmp_filename
(optional)
For storage types except 'text' a filename can be specified instead of 'content'. The caller is responsible for cleaning up the temporary file
Author:
Dave Bauer <dave@thedesignexperience.org>
Created:
2005-02-09

Partial Call Graph (max 5 caller/called nodes):
%3 content::revision::new content::revision::new (public) content::revision::update_content content::revision::update_content content::revision::new->content::revision::update_content cr_import_content cr_import_content (public) cr_import_content->content::revision::update_content

Testcases:
No testcase defined.

content::revision::update_content-file (private)

 content::revision::update_content-file -item_id item_id \
    -revision_id revision_id -content content -mime_type mime_type \
    [ -tmp_filename tmp_filename ]
Switches:
-item_id
(required)
-revision_id
(required)
-content
(required)
-mime_type
(required)
-tmp_filename
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 cr_create_content_file cr_create_content_file (public) cr_create_content_file_from_string cr_create_content_file_from_string (public) cr_fs_path cr_fs_path (private) db_dml db_dml (public) content::revision::update_content-file content::revision::update_content-file content::revision::update_content-file->cr_create_content_file content::revision::update_content-file->cr_create_content_file_from_string content::revision::update_content-file->cr_fs_path content::revision::update_content-file->db_dml

Testcases:
No testcase defined.

content::revision::update_content-lob (private)

 content::revision::update_content-lob -item_id item_id \
    -revision_id revision_id -content content -mime_type mime_type \
    [ -tmp_filename tmp_filename ]
Switches:
-item_id
(required)
-revision_id
(required)
-content
(required)
-mime_type
(required)
-tmp_filename
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 cr_create_content_file cr_create_content_file (public) db_dml db_dml (public) content::revision::update_content-lob content::revision::update_content-lob content::revision::update_content-lob->cr_create_content_file content::revision::update_content-lob->db_dml

Testcases:
No testcase defined.

content::revision::update_content-text (private)

 content::revision::update_content-text -item_id item_id \
    -revision_id revision_id -content content -mime_type mime_type \
    [ -tmp_filename tmp_filename ]
Switches:
-item_id
(required)
-revision_id
(required)
-content
(required)
-mime_type
(required)
-tmp_filename
(optional)

Partial Call Graph (max 5 caller/called nodes):
%3 db_dml db_dml (public) content::revision::update_content-text content::revision::update_content-text content::revision::update_content-text->db_dml

Testcases:
No testcase defined.

content::revision::write_xml (public)

 content::revision::write_xml -revision_id revision_id \
    -clob_loc clob_loc
Switches:
-revision_id
(required)
-clob_loc
(required)
Returns:
NUMBER

Partial Call Graph (max 5 caller/called nodes):
%3 package_exec_plsql package_exec_plsql (public) content::revision::write_xml content::revision::write_xml content::revision::write_xml->package_exec_plsql

Testcases:
No testcase defined.
[ show source ]