Forum OpenACS Development: Naviserver - ns_share migration

Posted by Avni Khatri on

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:

Any help would be greatly appreciated.

Thanks much,

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
Posted by Avni Khatri on
Thanks, Gustaf. Super easy!