- Publicity: Public Only All
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.10 2024/08/27 13:54:27 gustafn Exp $
Procedures in this file
- content::revision::check_dirs (private)
- content::revision::check_files (private)
- content::revision::cleanup (private)
- content::revision::cleanup-file (private)
- content::revision::cleanup-lob (private)
- content::revision::cleanup-text (private)
- content::revision::collect_cleanup_data (private)
- content::revision::collect_cleanup_data-file (private)
- content::revision::collect_cleanup_data-lob (private)
- content::revision::collect_cleanup_data-text (private)
- content::revision::content_copy (public)
- content::revision::copy (public)
- content::revision::delete (public)
- content::revision::export_to_filesystem (public)
- content::revision::export_to_filesystem-file (private)
- content::revision::export_to_filesystem-lob (private)
- content::revision::export_to_filesystem-text (private)
- content::revision::export_xml (public)
- content::revision::file_stats (private)
- content::revision::get_cr_file_path (public)
- content::revision::get_number (public)
- content::revision::get_title (public)
- content::revision::import_xml (public)
- content::revision::index_attributes (public)
- content::revision::is_latest (public)
- content::revision::is_live (public)
- content::revision::item_id (public)
- content::revision::new (public)
- content::revision::read_xml (public)
- content::revision::replace (public)
- content::revision::revision_name (public)
- content::revision::to_html (public)
- content::revision::to_temporary_clob (public)
- content::revision::update_attribute_index (public, deprecated)
- content::revision::update_content (private)
- content::revision::update_content-file (private)
- content::revision::update_content-lob (private)
- content::revision::update_content-text (private)
- content::revision::write_xml (public)
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 (optional, defaults to
"5000"
)- stop after having found so many empty directories
- -max_checks (optional, defaults to
"10000"
)- stop after having checked so many directories
- -returnlist (optional, boolean)
- return the directories as part of the result
- -prune (optional, boolean)
- delete the found empty directories
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- 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 (optional, defaults to
"5000"
)- stop after having found so many non-referenced files
- -max_checks (optional, defaults to
"10000"
)- stop after having checked so many non-referenced files
- -returnlist (optional, boolean)
- return the non-referenced files as part of the result
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- Testcases:
- content_revision
content::revision::delete (public)
content::revision::delete -revision_id revision_id
- Switches:
- -revision_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- content_revision
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):
- 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):
- 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):
- 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):
- 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):
- 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 (optional, defaults to
"10000"
)- number of revisions with storage-type "file" to check
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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 (optional, defaults to
"f"
)- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- 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):
- Testcases:
- No testcase defined.