Index: openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql 24 Jul 2004 08:34:43 -0000 1.14 +++ openacs-4/packages/notifications/sql/oracle/notifications-core-create.sql 28 Jun 2007 17:23:41 -0000 1.15 @@ -163,7 +163,8 @@ references users(user_id), notif_subject varchar(1000), notif_text clob, - notif_html clob + notif_html clob, + file_ids varchar(4000) ); -- RI indexes Index: openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql 29 Jun 2004 10:18:40 -0000 1.11 +++ openacs-4/packages/notifications/sql/oracle/notifications-package-create.sql 28 Jun 2007 17:23:41 -0000 1.12 @@ -382,6 +382,7 @@ notif_subject in notifications.notif_subject%TYPE default null, notif_text in varchar default null, notif_html in varchar default null, + file_ids in varchar default null, creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE, creation_ip in acs_objects.creation_ip%TYPE, @@ -400,9 +401,9 @@ ); insert into notifications - (notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html) + (notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html, file_ids) values - (v_notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html); + (v_notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html, file_ids); return v_notification_id; end new; Index: openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-5.4.0d2-5.4.0d3.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-5.4.0d2-5.4.0d3.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/notifications/sql/oracle/upgrade/upgrade-5.4.0d2-5.4.0d3.sql 28 Jun 2007 17:23:41 -0000 1.1 @@ -0,0 +1,56 @@ +-- Adding support for file attachments in notifications +alter table notifications add file_ids varchar(4000); + + +create or replace package body notification +as + + function new ( + notification_id in notifications.notification_id%TYPE default null, + type_id in notifications.type_id%TYPE, + object_id in notifications.object_id%TYPE, + notif_date in notifications.notif_date%TYPE default sysdate, + response_id in notifications.response_id%TYPE default null, + notif_user in notifications.notif_user%TYPE default null, + notif_subject in notifications.notif_subject%TYPE default null, + notif_text in varchar default null, + notif_html in varchar default null, + file_ids in varchar default null, + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE, + creation_ip in acs_objects.creation_ip%TYPE, + context_id in acs_objects.context_id%TYPE default null + ) return notifications.notification_id%TYPE + is + v_notification_id acs_objects.object_id%TYPE; + begin + v_notification_id := acs_object.new ( + object_id => notification_id, + object_type => 'notification', + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert into notifications + (notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html, file_ids) + values + (v_notification_id, type_id, object_id, notif_date, response_id, notif_user, notif_subject, notif_text, notif_html, file_ids); + + return v_notification_id; + end new; + + procedure del ( + notification_id in notifications.notification_id%TYPE default null + ) + is + begin + delete from notifications where notification_id = notification.del.notification_id; + + acs_object.del (notification_id); + end del; + +end notification; +/ +show errors