Index: openacs-4/packages/acs-kernel/acs-kernel.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v diff -u -r1.17.2.12 -r1.17.2.13 --- openacs-4/packages/acs-kernel/acs-kernel.info 6 Jun 2003 08:39:29 -0000 1.17.2.12 +++ openacs-4/packages/acs-kernel/acs-kernel.info 4 Jul 2003 12:22:36 -0000 1.17.2.13 @@ -7,13 +7,13 @@ t t - + Don Baccus Routines and data models providing the foundation for OpenACS-based Web services. 2002-10-27 OpenACS - + Index: openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql,v diff -u -r1.3.2.3 -r1.3.2.4 --- openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql 3 May 2003 23:51:44 -0000 1.3.2.3 +++ openacs-4/packages/acs-kernel/sql/oracle/acs-create.sql 4 Jul 2003 12:22:36 -0000 1.3.2.4 @@ -237,11 +237,12 @@ -- Make the "Unregistered Visitor" be object 0, which corresponds -- with the user_id assigned throughout the toolkit Tcl code + -- LARS: Make object_id 0 be a user, not a person insert into acs_objects (object_id, object_type) values - (0, 'person'); + (0, 'user'); insert into parties (party_id) @@ -253,6 +254,11 @@ values (0, 'Unregistered', 'Visitor'); + insert into users + (user_id) + values + (0); + insert into acs_magic_objects (name, object_id) values Index: openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql,v diff -u -r1.3.4.4 -r1.3.4.5 --- openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql 24 Mar 2003 20:30:57 -0000 1.3.4.4 +++ openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql 4 Jul 2003 12:22:36 -0000 1.3.4.5 @@ -677,6 +677,53 @@ +create or replace package body admin_rel +as + + function new ( + rel_id in admin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'admin_rel', + object_id_one in acs_rels.object_id_one%TYPE, + object_id_two in acs_rels.object_id_two%TYPE, + member_state in membership_rels.member_state%TYPE default 'approved', + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return admin_rels.rel_id%TYPE + is + v_rel_id integer; + begin + v_rel_id := membership_rel.new ( + rel_id => rel_id, + rel_type => rel_type, + object_id_one => object_id_one, + object_id_two => object_id_two, + member_state => member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert into admin_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in admin_rels.rel_id%TYPE + ) + is + begin + membership_rel.delete(rel_id); + end; + +end admin_rel; +/ +show errors + + + create or replace package body acs_group is function new ( Index: openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql 16 Sep 2002 21:52:41 -0000 1.4 +++ openacs-4/packages/acs-kernel/sql/oracle/groups-create.sql 4 Jul 2003 12:22:36 -0000 1.4.2.1 @@ -34,6 +34,14 @@ 'banned', 'rejected', 'deleted')) ); +create table admin_rels ( + rel_id integer constraint admin_rel_rel_id_fk + references membership_rels (rel_id) + constraint admin_rel_rel_id_pk + primary key +); + + create index member_rels_member_state_idx on membership_rels (member_state); declare @@ -101,6 +109,22 @@ min_n_rels_two => 0, max_n_rels_two => null ); + acs_rel_type.create_role ('admin', 'Administrator', 'Administrators'); + + acs_rel_type.create_type ( + rel_type => 'admin_rel', + pretty_name => 'Administrator Relation', + pretty_plural => 'Administrator Relationships', + supertype => 'membership_rel', + table_name => 'admin_rels', + id_column => 'rel_id', + package_name => 'admin_rel', + object_type_one => 'group', + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'person', role_two => 'admin', + min_n_rels_two => 0, max_n_rels_two => null + ); + commit; end; / @@ -446,6 +470,28 @@ show errors +create or replace package admin_rel +as + + function new ( + rel_id in admin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'admin_rel', + object_id_one in acs_rels.object_id_one%TYPE, + object_id_two in acs_rels.object_id_two%TYPE, + member_state in membership_rels.member_state%TYPE default 'approved', + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return admin_rels.rel_id%TYPE; + + procedure delete ( + rel_id in admin_rels.rel_id%TYPE + ); + +end admin_rel; +/ +show errors + + create or replace package acs_group is function new ( Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.6.5-4.6.6.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql,v diff -u -r1.6.4.5 -r1.6.4.6 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 3 May 2003 23:52:05 -0000 1.6.4.5 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-create.sql 4 Jul 2003 12:22:36 -0000 1.6.4.6 @@ -207,7 +207,7 @@ insert into acs_objects (object_id, object_type) values - (0, ''person''); + (0, ''user''); insert into parties (party_id) @@ -219,6 +219,11 @@ values (0, ''Unregistered'', ''Visitor''); + insert into users + (user_id) + values + (0); + insert into acs_magic_objects (name, object_id) values Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql,v diff -u -r1.16.2.8 -r1.16.2.9 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 24 Mar 2003 20:32:10 -0000 1.16.2.8 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 4 Jul 2003 12:22:36 -0000 1.16.2.9 @@ -995,3 +995,70 @@ -- show errors + + +-- create or replace package body admin_rel +-- function new +select define_function_args('admin_rel__new','rel_id,rel_type;admin_rel,object_id_one,object_id_two,member_state;approved,creation_user,creation_ip'); + +create or replace function admin_rel__new (integer,varchar,integer,integer,varchar,integer,varchar) +returns integer as ' +declare + p_rel_id alias for $1; -- default null + p_rel_type alias for $2; -- default ''admin_rel'' + p_object_id_one alias for $3; + p_object_id_two alias for $4; + p_member_state alias for $5; -- default ''approved'' + p_creation_user alias for $6; -- default null + p_creation_ip alias for $7; -- default null + v_rel_id integer; +begin + v_rel_id := membership_rel__new ( + p_rel_id, -- rel_id + p_rel_type, -- rel_type + p_object_id_one, -- object_id_one + p_object_id_two, -- object_id_two + p_member_state, -- member_state + p_creation_user, -- creation_usre + p_creation_ip -- creation_ip + ); + + insert into admin_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + +end;' language 'plpgsql'; + +-- function new +create or replace function admin_rel__new (integer,integer) +returns integer as ' +declare + object_id_one alias for $1; + object_id_two alias for $2; +begin + return membership_rel__new( + null, -- rel_id + ''admin_rel'', -- rel_type + object_id_one, -- object_id_one + object_id_two, -- object_id_two + ''approved'', -- member_state + null, -- creation_user + null -- creation_ip + ); +end;' language 'plpgsql'; + +-- procedure delete +create or replace function admin_rel__delete (integer) +returns integer as ' +declare + rel_id alias for $1; +begin + PERFORM membership_rel__delete(rel_id); + + return 0; +end;' language 'plpgsql'; + + Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql,v diff -u -r1.11.2.2 -r1.11.2.3 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql 13 Mar 2003 16:02:43 -0000 1.11.2.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-create.sql 4 Jul 2003 12:22:36 -0000 1.11.2.3 @@ -34,6 +34,13 @@ 'banned', 'rejected', 'deleted')) ); +create table admin_rels ( + rel_id integer constraint admin_rel_rel_id_fk + references membership_rels (rel_id) + constraint admin_rel_rel_id_pk + primary key +); + create function inline_0 () returns integer as ' declare @@ -102,23 +109,46 @@ attr_id := acs_rel_type__create_role (''member'', ''Member'', ''Members''); attr_id := acs_rel_type__create_type ( - ''membership_rel'', - ''Membership Relation'', - ''Membership Relationships'', - ''relationship'', - ''membership_rels'', - ''rel_id'', - ''membership_rel'', - ''group'', - null, - 0, - null, - ''person'', - ''member'', - 0, - null + ''membership_rel'', -- rel_type + ''Membership Relation'', -- pretty_name + ''Membership Relationships'', -- pretty_plural + ''relationship'', -- supertype + ''membership_rels'', -- table_name + ''rel_id'', -- id_column + ''membership_rel'', -- package_name + ''group'', -- object_type_one + null, -- role_one + 0, -- min_n_rels_one + null, -- max_n_rels_one + ''person'', -- object_type_two + ''member'', -- role_two + 0, -- min_n_rels_two + null -- max_n_rels_two ); + -- + -- Administrator Relationship + -- + attr_id := acs_rel_type__create_role (''admin'', ''Administrator'', ''Administrators''); + + attr_id := acs_rel_type__create_type ( + ''admin_rel'', -- rel_type + ''Administrator Relation'', -- pretty_name + ''Administrator Relationships'', -- pretty_plural + ''membership_rel'', -- supertype + ''admin_rels'', -- table_name + ''rel_id'', -- id_column + ''admin_rel'', -- package_name + ''group'', -- object_type_one + null, -- role_one + 0, -- min_n_rels_one + null, -- max_n_rels_one + ''person'', -- object_type_two + ''admin'', -- role_two + 0, -- min_n_rels_two + null -- max_n_rels_two + ); + return 0; end;' language 'plpgsql'; Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-4.6.5-4.6.6.sql'. Fisheye: No comparison available. Pass `N' to diff?