xowiki::transform_root_folder
xowiki::transform_root_folder
Defined in
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
-
No testcase defined.
Source code:
::xo::Package require $package_id
set item_id [::$package_id folder_id]
if {$item_id == 0} {
set name "xowiki: $package_id"
set item_id [xo::dc get_value refetch_item_id {
select item_id from cr_items where name = :name and parent_id = -100
}]
}
xo::xotcl_object_type_cache flush -partition_key $item_id $item_id
set form_id [::$package_id instantiate_forms -forms en:folder.form]
if {[::xo::dc 0or1row check {
select 1 from cr_items where content_type = '::xowiki::FormPage' and item_id = :item_id
}]} {
ns_log notice "folder $item_id is already converted"
set f [FormPage get_instance_from_db -item_id $item_id]
if {[$f page_template] != $form_id} {
ns_log notice "... must change form_id from [$f page_template] to $form_id"
set revision_id [$f revision_id]
::xo::dc dml chg0 {
update xowiki_page_instance set page_template = :form_id
where page_instance_id = :revision_id
}
}
return
}
set revision_id [::xo::db::sql::content_revision new -title [::$package_id instance_name] -text "" -item_id $item_id -package_id $package_id]
::xo::dc dml chg1 "insert into xowiki_page (page_id) values (:revision_id)"
::xo::dc dml chg2 "insert into xowiki_page_instance (page_instance_id, page_template) values (:revision_id, :form_id)"
::xo::dc dml chg3 "insert into xowiki_form_page (xowiki_form_page_id) values (:revision_id)"
::xo::dc dml chg4 "update acs_objects set object_type = 'content_item' where object_id = :item_id"
::xo::dc dml chg5 "update acs_objects set object_type = '::xowiki::FormPage' where object_id = :revision_id"
::xo::dc dml chg6 "update cr_items set content_type = '::xowiki::FormPage', publish_status = 'ready', live_revision = :revision_id, latest_revision = :revision_id where item_id = :item_id"
::xo::xotcl_object_cache flush $package_id
::xo::xotcl_object_cache flush $item_id
::xo::xotcl_object_cache flush $revision_id
::xo::xotcl_object_type_cache flush
::xo::xotcl_package_cache flush root-folder-$package_id
::xo::xotcl_object_type_cache flush -partition_key $item_id $item_id
::xo::xotcl_object_type_cache flush -partition_key $revision_id $revision_id
XQL Not present:Generic, PostgreSQL, Oracle
[
hide source ]
| [
make this the default ]