xowiki::FormPage instproc update_item_index (public)

 <instance of xowiki::FormPage[i]> update_item_index

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

Tailored version of CrItem.update_item_index to keep insert_xowiki_form_instance_item_index in sync after updates.

Partial Call Graph (max 5 caller/called nodes):
%3 test_link_tests link_tests (test xowiki) xowiki::FormPage instproc update_item_index xowiki::FormPage instproc update_item_index test_link_tests->xowiki::FormPage instproc update_item_index xowiki::hstore::dict_as_hkey xowiki::hstore::dict_as_hkey (public) xowiki::FormPage instproc update_item_index->xowiki::hstore::dict_as_hkey

Testcases:
link_tests
Source code:
:instvar name item_id package_id parent_id publish_status  page_template instance_attributes assignee state

set useHstore [::$package_id get_parameter use_hstore:boolean 0]
set updateVars {name = :name, package_id = :package_id,
  parent_id = :parent_id, publish_status = :publish_status,
  page_template = :page_template, assignee = :assignee,
  state = :state}

if {$useHstore} {
  set hkey [::xowiki::hstore::dict_as_hkey [:hstore_attributes]]
  append updateVars ", hkey = '$hkey'"
}

set rows [xo::dc dml update_xowiki_form_instance_item_index [subst {
  update xowiki_form_instance_item_index
  set $updateVars
  where item_id = :item_id
}]]

if {$rows ne "" && $rows < 1} {
  set insertVars {item_id, name, package_id, parent_id, publish_status,
    page_template, assignee, state
  }
  set insertValues {:item_id, :name, :package_id, :parent_id, :publish_status,
    :page_template, :assignee, :state
  }
  if {$useHstore} {
    append insertVars {, hkey}
    append insertValues ", '$hkey'"
  }

  ::xo::dc dml insert_xowiki_form_instance_item_index [subst {
    insert into xowiki_form_instance_item_index
    ($insertVars) values ($insertValues)
  }]
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: