Index: openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql 30 Sep 2006 16:14:25 -0000 1.5 +++ openacs-4/packages/acs-subsite/sql/oracle/application-groups-create.sql 30 Jan 2009 02:36:56 -0000 1.6 @@ -54,6 +54,7 @@ url in parties.url%TYPE default null, group_name in groups.group_name%TYPE, package_id in application_groups.package_id%TYPE, + join_policy in groups.join_policy%TYPE default null, context_id in acs_objects.context_id%TYPE default null ) return application_groups.group_id%TYPE; @@ -87,6 +88,7 @@ url in parties.url%TYPE default null, group_name in groups.group_name%TYPE, package_id in application_groups.package_id%TYPE, + join_policy in groups.join_policy%TYPE default null, context_id in acs_objects.context_id%TYPE default null ) return application_groups.group_id%TYPE @@ -102,7 +104,8 @@ email => email, url => url, group_name => group_name, - context_id => context_id + context_id => context_id, + join_policy => join_policy ); insert into application_groups (group_id, package_id) Index: openacs-4/packages/acs-subsite/sql/oracle/upgrade/upgrade-5.5.0d5-5.5.0d6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/oracle/upgrade/upgrade-5.5.0d5-5.5.0d6.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/sql/oracle/upgrade/upgrade-5.5.0d5-5.5.0d6.sql 30 Jan 2009 02:36:56 -0000 1.1 @@ -0,0 +1,117 @@ +create or replace package application_group +is + + function new ( + group_id in application_groups.group_id%TYPE default null, + object_type in acs_objects.object_type%TYPE + default 'application_group', + creation_date in acs_objects.creation_date%TYPE + default sysdate, + creation_user in acs_objects.creation_user%TYPE + default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + email in parties.email%TYPE default null, + url in parties.url%TYPE default null, + group_name in groups.group_name%TYPE, + package_id in application_groups.package_id%TYPE, + join_policy in groups.join_policy%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return application_groups.group_id%TYPE; + + procedure del ( + group_id in application_groups.group_id%TYPE + ); + + function group_id_from_package_id ( + package_id in application_groups.group_id%TYPE, + no_complain_p in char default 'f' + ) return char; + +end application_group; +/ +show errors + + +create or replace package body application_group +is + + function new ( + group_id in application_groups.group_id%TYPE default null, + object_type in acs_objects.object_type%TYPE + default 'application_group', + creation_date in acs_objects.creation_date%TYPE + default sysdate, + creation_user in acs_objects.creation_user%TYPE + default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + email in parties.email%TYPE default null, + url in parties.url%TYPE default null, + group_name in groups.group_name%TYPE, + package_id in application_groups.package_id%TYPE, + join_policy in groups.join_policy%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) + return application_groups.group_id%TYPE + is + v_group_id application_groups.group_id%TYPE; + begin + v_group_id := acs_group.new ( + group_id => group_id, + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + email => email, + url => url, + group_name => group_name, + context_id => context_id, + join_policy => join_policy + ); + + insert into application_groups (group_id, package_id) + values (v_group_id, package_id); + + return v_group_id; + end new; + + + procedure del ( + group_id in application_groups.group_id%TYPE + ) + is + begin + + acs_group.del(group_id); + + end del; + + function group_id_from_package_id ( + package_id in application_groups.group_id%TYPE, + no_complain_p in char default 'f' + ) return char + is + v_group_id application_groups.group_id%TYPE; + begin + + select group_id + into v_group_id + from application_groups + where package_id = group_id_from_package_id.package_id; + + return v_group_id; + + exception when no_data_found then + + if no_complain_p != 't' then + raise_application_error(-20000, 'No group_id found for package ' || + package_id || ' (' || acs_object.name(package_id) || ').' ); + end if; + + return null; + + end group_id_from_package_id; + +end application_group; +/ +show errors + Index: openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql 25 Sep 2006 21:16:34 -0000 1.10 +++ openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql 30 Jan 2009 02:36:56 -0000 1.11 @@ -36,9 +36,9 @@ unique (package_id) ); -select define_function_args('application_group__new','group_id,object_type;application_group,creation_date;now(),creation_user,creation_ip,email,url,group_name,package_id,context_id'); +select define_function_args('application_group__new','group_id,object_type;application_group,creation_date;now(),creation_user,creation_ip,email,url,group_name,package_id,join_policy,context_id'); -create function application_group__new(integer,varchar,timestamptz,integer,varchar,varchar,varchar,varchar,integer,integer) +create function application_group__new(integer,varchar,timestamptz,integer,varchar,varchar,varchar,varchar,integer,varchar,integer) returns integer as ' declare new__group_id alias for $1; @@ -50,7 +50,8 @@ new__url alias for $7; -- default null, new__group_name alias for $8; new__package_id alias for $9; - new__context_id alias for $10; -- default null + new__join_policy alias for $10; + new__context_id alias for $11; -- default null v_group_id application_groups.group_id%TYPE; begin v_group_id := acs_group__new ( @@ -62,7 +63,7 @@ new__email, new__url, new__group_name, - null, + new__join_policy, new__context_id ); Index: openacs-4/packages/acs-subsite/sql/postgresql/upgrade/upgrade-5.5.0d5-5.5.0d6.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/upgrade/upgrade-5.5.0d5-5.5.0d6.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/sql/postgresql/upgrade/upgrade-5.5.0d5-5.5.0d6.sql 30 Jan 2009 02:36:56 -0000 1.1 @@ -0,0 +1,38 @@ +select define_function_args('application_group__new','group_id,object_type;application_group,creation_date;now(),creation_user,creation_ip,email,url,group_name,package_id,join_policy,context_id'); + +create function application_group__new(integer,varchar,timestamptz,integer,varchar,varchar,varchar,varchar,integer,varchar,integer) +returns integer as ' +declare + new__group_id alias for $1; + new__object_type alias for $2; -- default ''application_group'', + new__creation_date alias for $3; -- default sysdate, + new__creation_user alias for $4; -- default null, + new__creation_ip alias for $5; -- default null, + new__email alias for $6; -- default null, + new__url alias for $7; -- default null, + new__group_name alias for $8; + new__package_id alias for $9; + new__join_policy alias for $10; + new__context_id alias for $11; -- default null + v_group_id application_groups.group_id%TYPE; +begin + v_group_id := acs_group__new ( + new__group_id, + new__object_type, + new__creation_date, + new__creation_user, + new__creation_ip, + new__email, + new__url, + new__group_name, + new__join_policy, + new__context_id + ); + + insert into application_groups (group_id, package_id) + values (v_group_id, new__package_id); + + return v_group_id; + +end;' language 'plpgsql'; +