cr_create_content_file_path (public)

 cr_create_content_file_path item_id revision_id

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

Creates a unique file in the content repository filesystem based on the item_id and revision_id of the content item.

Parameters:
item_id (required)
revision_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 cr_create_content_file cr_create_content_file (public) cr_create_content_file_path cr_create_content_file_path cr_create_content_file->cr_create_content_file_path cr_create_content_file_from_string cr_create_content_file_from_string (public) cr_create_content_file_from_string->cr_create_content_file_path cr_fs_path cr_fs_path (private) cr_create_content_file_path->cr_fs_path

Testcases:
No testcase defined.
Source code:

    # Split out the version_id by groups of 2.
    set item_id_length [string length $item_id]
    set path "/"

    for {set i 0} {$i < $item_id_length} {incr i} {
        append path [string range $item_id $i $i]
        if {($i % 2) == 1} {
            if {$i < $item_id_length} {
                # Check that the directory exists
                if {![file exists [cr_fs_path]$path]} {
                    file mkdir [cr_fs_path]$path
                }

                append path "/"
            }
        }
    }

    # Check that the directory exists
    if {![file exists [cr_fs_path]$path]} {
        file mkdir [cr_fs_path]$path
    }

    if {[string index $path end] ne "/" } {
        append path "/"
    }

    return "${path}${revision_id}"
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: