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):
- 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_idXQL Not present: Generic, PostgreSQL, Oracle