Forum OpenACS Development: Re: Re: Re: Re: Re: xotcl object cache behavior?

Posted by Gustaf Neumann on
sorry, i thought the question was to obtain the folder id, i misread your posting. There is not a big need for an api, since once a package is instantiated, the folder_object is as well. you just need the package_id to get all you want. here is, how you get the interesting ids:

set P [::xowiki::Package create ::$package_id]
set folder ::[$P folder_id]
set folder_id [$folder set folder_id]
set folder_item_id [$folder set item_id]
set folder_revision_id [$folder set revision_id]

btw, in the next release, you can do

$folder serialize

instead of the Serializer::...

The new code is stabilizing, and has some cool features. For example, i added some code to instantiate values from an sql query into an object. normally you get the return variables into the current scope of a function. In order to implement this, only one line was needed

::xotcl::Object instforward db_1row -objscope

db_1row is a forwarder applicable to all objects that makes the instance variables of an object to appear as local variables (the flag -objscope). So, if you do a

$obj db_1row query_name "select some_atts from ..."

the return variables are set as instance variables of the object. This is quite important for dynamic sql queries, where there is no control over the output variables, where it is quite easy to overwrite local variables. the standard set of db-commands allows already array output, but for oo style of code, the above variant is much more convenient and saves copying of values...

Posted by Stan Kaufman on
Gustaf, this is *brilliant*! Thanks again!