Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v diff -u -N -r1.57.2.7 -r1.57.2.8 --- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 17 Sep 2019 11:36:38 -0000 1.57.2.7 +++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 5 Nov 2019 17:22:54 -0000 1.57.2.8 @@ -113,6 +113,42 @@ return [join $keys ,] } + ad_proc ::xowiki::hstore::update_hstore {package_id} { + update all instance attributes in hstore + } { + if {![::xo::dc has_hstore] && [::$package_id get_parameter use_hstore 0] } { + return 0 + } + # + # This proc can be used from ds/shell as follows + # + # ::xo::Package initialize -url /xowiki + # ::xowiki::hstore::update_hstore $package_id + # + # Check the result + # + # select hkey from xowiki_page_instance where hkey is not null; + # + ::xowf::Package initialize -package_id $package_id + # + # We get all revisions, so use the lower level interface + # + set items [::xowiki::FormPage instantiate_objects \ + -sql "select * from xowiki_form_pagei bt,cr_items i \ + where bt.object_package_id = $package_id and bt.item_id = i.item_id" \ + -object_class ::xowiki::FormPage] + set count 0 + foreach i [$items children] { + #$i msg "working on [$i set xowiki_form_page_id]" + $i save_in_hstore + incr count + } + $items msg "fetched $count objects from parent_id [::$package_id folder_id]" + return 1 + } + + + ad_proc ::xowiki::hstore::update_form_instance_item_index { {-package_id} {-object_class ::xowiki::FormPage}