Forum OpenACS Development: Re: Getting package_id in an init.tcl script

Collapse
Posted by Janine Ohmer on
Ok, I'm trying to do this but I'm obviously missing something.

I put this in bulk-mail/tcl/apm-callback-procs.tcl:

ad_library {
    APM callback procedures in the bulk-mail::apm namespace.

    @creation-date October 31 2003
    @author Janine Sisk
    @cvs-id $Id$
}

namespace eval bulk-mail::apm {}

ad_proc -public bulk-mail::apm::after_mount {
  {-package_id:required}
  {-node_id:required}
} {
  This is a comment about what this proc does
} {
  ns_log Notice "J9: in bulk_mail::apm::after_mount"
}

Then I created an after_mount callback for bulk-mail in the APM, using bulk-mail::apm::after_mount as the proc name, and restarted the site.  There are no errors in the error log, but my ns_log is not being executed.

What else do I need to do?

Collapse
Posted by Randy O'Meara on
Janine,

You should have to do nothing in addition to what you've done. I've done it exactly like this without any problem. If I recall, with debug on, the APM logs the fact that it's calling a callback.

The package manager shows that your callback is defined, right?