Index: openacs-4/packages/acs-core-docs/www/tutorial-notifications.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-notifications.adp,v diff -u -r1.4.2.5 -r1.4.2.6 --- openacs-4/packages/acs-core-docs/www/tutorial-notifications.adp 27 Apr 2022 16:52:20 -0000 1.4.2.5 +++ openacs-4/packages/acs-core-docs/www/tutorial-notifications.adp 13 Jul 2023 12:43:23 -0000 1.4.2.6 @@ -1,11 +1,11 @@ -{/doc/acs-core-docs {ACS Core Documentation}} {Notifications} +{/doc/acs-core-docs/ {ACS Core Documentation}} {Notifications} Notifications

@@ -18,7 +18,7 @@ through any defined communications medium (e.g. email, sms) upon some event occurring within the system.

This tutorial steps through the process of integrating the notifications package with your package.

First step is to create the notification types. To do this a -script similar to the one below needs to be loaded into Postgresql. +script similar to the one below needs to be loaded into PostgreSQL. I create this script in a package-name/sql/postgresql/package-name-notifications-init.sql file. I then load this file from my create SQL file. The following @@ -86,7 +86,8 @@ select inline_0(); drop function inline_0(); -

You also need a drop script. This is untested for compatibility + +

You also need a drop script. This is untested for compatibility with the above script.

       -- \@author gwong\@orchardlabs.com,ben\@openforce.biz
       -- \@creation-date 2002-05-16
@@ -176,7 +177,8 @@
 
 select inline_0();
 drop function inline_0();
-    

The next step is to setup our notification creation. A new + +

The next step is to setup our notification creation. A new notification must be added to the notification table for each blog entry added. We do this using the notification::new procedure

         notification::new \
@@ -186,7 +188,8 @@
             -response_id $blog(entry_id) \
             -notif_subject $blog(title) \
             -notif_text $new_content
-    

This code is placed in the Tcl procedure that creates blog + +

This code is placed in the Tcl procedure that creates blog entries, right after the entry gets created in the code. The $blog(package_id) is the OpenACS object_id of the Weblogger instance to which the entry has @@ -208,8 +211,10 @@ -pretty_name [lars_blog_name] \ -url [lars_blog_public_package_url] \ ] -

which will return something like

-    You may <a href="/notifications/request-new?...">request notification</a> for Weblogger.

which can be readily put on the blog index page. The + +

which will return something like

+    You may <a href="/notifications/request-new?...">request notification</a> for Weblogger.
+

which can be readily put on the blog index page. The pretty_name parameter is what appears at the end of the text returned (i.e. "... request notification</a> for pretty_name"), The url parameter should be set to the address