xowiki::test::require_page (private)

 xowiki::test::require_page [ -text text ] [ -page_order page_order ] \
    name parent_id package_id [ file_content ]

Defined in packages/xowiki/tcl/test/test-procs.tcl

Switches:
-text (optional)
-page_order (optional)
Parameters:
name (required)
parent_id (required)
package_id (required)
file_content (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_link_tests link_tests (test xowiki) xowiki::test::require_page xowiki::test::require_page test_link_tests->xowiki::test::require_page test_path_resolve path_resolve (test xowiki) test_path_resolve->xowiki::test::require_page test_slot_interactions slot_interactions (test xowiki) test_slot_interactions->xowiki::test::require_page test_xowiki_test_cases xowiki_test_cases (test xowiki) test_xowiki_test_cases->xowiki::test::require_page aa_log aa_log (public) xowiki::test::require_page->aa_log base64::decode base64::decode xowiki::test::require_page->base64::decode xo::write_tmp_file xo::write_tmp_file xowiki::test::require_page->xo::write_tmp_file xowiki::guesstype xowiki::guesstype xowiki::test::require_page->xowiki::guesstype

Testcases:
xowiki_test_cases, link_tests, slot_interactions, path_resolve
Source code:
        set item_id [::xo::db::CrClass lookup -name $name -parent_id $parent_id]
        if {$item_id == 0} {
            if {$file_content eq ""} {
                ::$package_id get_lang_and_name -name $name lang stripped_name
                set nls_language [::xowiki::Package get_nls_language_from_lang $lang]
                if {![info exists text]} {
                    set text [list "Content of $name" text/html]
                }
                set f [::xowiki::Page new  -name $name  -description ""  -parent_id $parent_id  -package_id $package_id  -nls_language $nls_language  -page_order $page_order  -text $text]
            } else {
                set mime_type [::xowiki::guesstype $name]
                set f [::xowiki::File new  -name $name  -description ""  -parent_id $parent_id  -package_id $package_id  -page_order $page_order  -mime_type $mime_type]

                ::xo::write_tmp_file import_file [::base64::decode $file_content]
                $f set import_file $import_file
            }
            $f publish_status ready
            $f save_new
            set item_id [$f item_id]
            $f destroy_on_cleanup
        }
        ns_log notice "Page  $name => $item_id"
        aa_log "  $name => $item_id"

        return $item_id
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: