Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-applet-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql 3 Oct 2001 01:56:53 -0000 1.1 @@ -0,0 +1,113 @@ + +-- +-- The DotLRN communities construct +-- copyright 2001, OpenForce, Inc. +-- distributed under the GNU GPL v2 +-- +-- for Oracle 8/8i. (We're guessing 9i works, too). +-- +-- ben@openforce.net +-- started October 1st, 2001 +-- we remember September 11th +-- + +-- This is the service contract for dotLRN components + +declare + sc_dotlrn_contract integer; + foo integer; +begin + sc_dotlrn_contract := acs_sc_contract.new( + contract_name => 'dotLRN_Applet', + contract_desc => 'dotLRN Applet implement a specific interface' + ); + + -- Add the applet to a community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.AddApplet.InputType', + msg_type_spec => 'community_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.AddApplet.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotLRN_Applet', + 'AddApplet', + 'Add the Applet to a community', + 'f', -- not cacheable + 1, -- n_args + 'dotLRN_Applet.AddApplet.InputType', + 'dotLRN_Applet.AddApplet.OutputType' + ); + + -- add a user to the community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.AddUser.InputType', + msg_type_spec => 'community_id:integer,user_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.AddUser.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotLRN_Applet', + 'AddUser', + 'Add a user to a community, and set up appropriate things for that applet', + 'f', -- not cacheable + 2, -- n_args + 'dotLRN_Applet.AddUser.InputType', + 'dotLRN_Applet.AddUser.OutputType' + ); + + + -- remove a user from the community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.RemoveUser.InputType', + msg_type_spec => 'community_id:integer,user_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.RemoveUser.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotLRN_Applet', + 'RemoveUser', + 'Remove a user from a community, and set up appropriate things for that applet', + 'f', -- not cacheable + 2, -- n_args + 'dotLRN_Applet.RemoveUser.InputType', + 'dotLRN_Applet.RemoveUser.OutputType' + ); + + -- remove the applet from a community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.RemoveApplet.InputType', + msg_type_spec => 'community_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotLRN_Applet.RemoveApplet.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotLRN_Applet', + 'RemoveApplet', + 'Remove a user from a community, and set up appropriate things for that applet', + 'f', -- not cacheable + 1, -- n_args + 'dotLRN_Applet.RemoveApplet.InputType', + 'dotLRN_Applet.RemoveApplet.OutputType' + ); + + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 20 Sep 2001 18:54:51 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 3 Oct 2001 01:56:53 -0000 1.2 @@ -39,3 +39,26 @@ node_id constraint dlrn_comm_node_id_fk references site_nodes(node_id) ); + + +create table dotlrn_community_memberships ( + rel_id integer not null + constraint dlrn_comm_mem_fk references acs_rels(rel_id) + constraint dlrn_comm_mem_pk primary key, + community_id integer not null + constraint dlrn_comm_mem_comm_id_fk references dotlrn_communities(community_id), + user_id integer not null + constraint dlrn_comm_mem_user_id_fk references users(user_id), + page_id integer not null + -- constraint pointing to NPP +); + + +create table dotlrn_community_applets ( + community_id integer not null + constraint dlrn_comm_appl_comm_id_fk references dotlrn_communities(community_id), + applet_key varchar(100) not null, + constraint dlrn_comm_appl_pk primary key (community_id, applet_key), + active_p char(1) default 't' not null + constraint dlrn_comm_appl_act_p_ch check (active_p in ('t','f')) +);