Forum OpenACS Development: Naviserver - ns_share migration

Collapse
Posted by Avni Khatri on
Hi:

I need to port a filter defined like this:
ns_share -init {set ll_filters_installed 0} ll_filters_installed

so that it works with naviserver.

This link provides an example of how to migrate ns_share but not with the -init param and not in this manner: http://naviserver.sourceforge.net/n/naviserver/files/nsv.html#section3

Any help would be greatly appreciated.

Thanks much,
Avni

Collapse
Posted by Gustaf Neumann on
Hi Avni, i think the migration rule says simply "use nsv instead of ns_share". I would assume you can replace
    ns_share -init {set ll_filters_installed 0} ll_filters_installed
by something like the following:
  • The "ns_share -init" command (the line above) can be dropped.
  • Somewhere in the code there will be test to check, if the filters are already installed. Use there something like:
    if {![nsv_exists myshare ll_filters_installed]} {
       ...
    }
    
  • Somewhere else will an assignment to indicate that the filters are installed. use there something like
       nsv_set myshare ll_filters_installed 1
    
There is not much magic involved. all the best
-g
Collapse
Posted by Avni Khatri on
Thanks, Gustaf. Super easy!