Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.89 -r1.90 --- openacs-4/packages/dotlrn/dotlrn.info 29 May 2002 03:48:21 -0000 1.89 +++ openacs-4/packages/dotlrn/dotlrn.info 30 May 2002 22:04:58 -0000 1.90 @@ -41,15 +41,27 @@ + + + + + + + + + + + + @@ -60,6 +72,8 @@ + + @@ -69,6 +83,7 @@ + @@ -78,6 +93,7 @@ + @@ -284,6 +300,8 @@ + + Index: openacs-4/packages/dotlrn/sql/oracle/applet-sc-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/applet-sc-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/applet-sc-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,189 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN applet service contract +-- +-- started October 1st, 2001 +-- we remember September 11th +-- + +declare +begin + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'GetPrettyName' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.GetPrettyName.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.GetPrettyName.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'AddApplet' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddApplet.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddApplet.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'RemoveApplet' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveApplet.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveApplet.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'AddAppletToCommunity' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddAppletToCommunity.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddAppletToCommunity.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'RemoveAppletFromCommunity' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveAppletFromCommunity.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveAppletFromCommunity.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'AddUser' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddUser.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddUser.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'RemoveUser' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveUser.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveUser.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'AddUserToCommunity' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddUserToCommunity.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddUserToCommunity.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'RemoveUserFromCommunity' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveUserFromCommunity.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemoveUserFromCommunity.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'AddPortlet' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddPortlet.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.AddPortlet.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'RemovePortlet' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemovePortlet.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.RemovePortlet.OutputType' + ); + + acs_sc_operation.delete( + contract_name => 'dotlrn_applet', + operation_name => 'Clone' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.Clone.InputType' + ); + + acs_sc_msg_type.delete( + msg_type_name => 'dotlrn_applet.Clone.OutputType' + ); + + acs_sc_contract.delete( + contract_name => 'dotlrn_applet' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/class-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/class-memberships-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/class-memberships-create.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,196 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- create the dotLRN class membership model +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date 2001-08-18 +-- @version $Id: class-memberships-create.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +create table dotlrn_student_rels ( + rel_id constraint dotlrn_student_rels_rel_id_fk + references dotlrn_member_rels (rel_id) + constraint dotlrn_student_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_student_rels_full +as + select dotlrn_member_rels_full.rel_id, + dotlrn_member_rels_full.community_id, + dotlrn_member_rels_full.user_id, + dotlrn_member_rels_full.rel_type, + dotlrn_member_rels_full.role, + dotlrn_member_rels_full.member_state + from dotlrn_member_rels_full, + dotlrn_student_rels + where dotlrn_member_rels_full.rel_id = dotlrn_student_rels.rel_id; + +create table dotlrn_ta_rels ( + rel_id constraint dotlrn_ta_rels_rel_id_fk + references dotlrn_admin_rels (rel_id) + constraint dotlrn_ta_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_ta_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_ta_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_ta_rels.rel_id; + +create table dotlrn_ca_rels ( + rel_id constraint dotlrn_ca_rels_rel_id_fk + references dotlrn_admin_rels (rel_id) + constraint dotlrn_ca_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_ca_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_ca_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_ca_rels.rel_id; + +create table dotlrn_cadmin_rels ( + rel_id constraint dotlrn_cadmin_rels_rel_id_fk + references dotlrn_admin_rels (rel_id) + constraint dotlrn_cadmin_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_cadmin_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_cadmin_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_cadmin_rels.rel_id; + +create table dotlrn_instructor_rels ( + rel_id constraint dotlrn_instructor_rels_rel_fk + references dotlrn_admin_rels(rel_id) + constraint dotlrn_instructor_rels_rel_pk + primary key +); + +create or replace view dotlrn_instructor_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_instructor_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_instructor_rels.rel_id; + + + +declare +begin + acs_rel_type.create_type ( + rel_type => 'dotlrn_student_rel', + supertype => 'dotlrn_member_rel', + pretty_name => 'dotLRN Student Community Membership', + pretty_plural => 'dotLRN Student Community Memberships', + package_name => 'dotlrn_student_rel', + table_name => 'dotlrn_student_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'student', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_ta_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Teaching Assistant Community Membership', + pretty_plural => 'dotLRN Teaching Assistant Community Memberships', + package_name => 'dotlrn_ta_rel', + table_name => 'dotlrn_ta_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'teaching_assistant', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_ca_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Course Assitant Community Membership', + pretty_plural => 'dotLRN Course Assitant Community Memberships', + package_name => 'dotlrn_ca_rel', + table_name => 'dotlrn_ca_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'course_assistant', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_cadmin_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Course Administrator Community Membership', + pretty_plural => 'dotLRN Course Administrator Community Memberships', + package_name => 'dotlrn_cadmin_rel', + table_name => 'dotlrn_cadmin_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'course_admin', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_instructor_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Instructor Community Membership', + pretty_plural => 'dotLRN Instructor Community Memberships', + package_name => 'dotlrn_instructor_rel', + table_name => 'dotlrn_instructor_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'instructor', + min_n_rels_two => 0, max_n_rels_two => null + ); +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/class-memberships-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/class-memberships-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/class-memberships-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,67 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN class membership model +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date 2001-08-18 +-- @version $Id: class-memberships-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +declare +begin + + acs_rel_type.drop_type ( + rel_type => 'dotlrn_student_rel', + cascade_p => 't' + ); + + acs_rel_type.drop_type ( + rel_type => 'dotlrn_ta_rel', + cascade_p => 't' + ); + + acs_rel_type.drop_type ( + rel_type => 'dotlrn_ca_rel', + cascade_p => 't' + ); + + acs_rel_type.drop_type ( + rel_type => 'dotlrn_cadmin_rel', + cascade_p => 't' + ); + + acs_rel_type.drop_type ( + rel_type => 'dotlrn_instructor_rel', + cascade_p => 't' + ); + +end; +/ +show errors + +drop view dotlrn_instructor_rels_full; +drop table dotlrn_instructor_rels; +drop view dotlrn_cadmin_rels_full; +drop table dotlrn_cadmin_rels; +drop view dotlrn_ca_rels_full; +drop table dotlrn_ca_rels; +drop view dotlrn_ta_rels_full; +drop table dotlrn_ta_rels; +drop view dotlrn_student_rels_full; +drop table dotlrn_student_rels; Index: openacs-4/packages/dotlrn/sql/oracle/classes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/classes-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/classes-create.sql 13 May 2002 19:46:18 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/classes-create.sql 30 May 2002 22:04:58 -0000 1.3 @@ -15,12 +15,8 @@ -- -- --- The DotLRN basic system --- copyright 2001, OpenForce, inc. --- distributed under the GNU GPL v2 +-- create the dotLRN classes model -- --- for Oracle 8/8i. (We're guessing 9i works, too). --- -- @author Ben Adida (ben@openforce.net) -- @author yon (yon@openforce.net) -- @creation-date 2001-08-18 @@ -120,15 +116,7 @@ dotlrn_terms.term_year, dotlrn_terms.start_date, dotlrn_terms.end_date, - dotlrn_communities.community_type, - dotlrn_communities.community_key, - dotlrn_communities.pretty_name, - dotlrn_communities.description, - dotlrn_communities.active_start_date, - dotlrn_communities.active_end_date, - dotlrn_communities.portal_id, - dotlrn_communities.non_member_portal_id, - dotlrn_communities.package_id, + dotlrn_communities.*, dotlrn_community.url(dotlrn_communities.community_id) as url, dotlrn_classes_full.pretty_name as class_name, dotlrn_classes_full.url as class_url, Index: openacs-4/packages/dotlrn/sql/oracle/classes-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/classes-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/classes-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,40 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN classes model +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date 2001-08-18 +-- @version $Id: classes-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +drop package body dotlrn_class_instance; +drop package dotlrn_class_instance; +drop package body dotlrn_class; +drop package dotlrn_class; +drop package body dotlrn_department; +drop package dotlrn_department; +drop view dotlrn_class_instances_not_old; +drop view dotlrn_class_instances_current; +drop view dotlrn_class_instances_full; +drop table dotlrn_class_instances; +drop view dotlrn_classes_full; +drop table dotlrn_classes; +drop table dotlrn_terms; +drop view dotlrn_departments_full; +drop table dotlrn_departments; Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/classes-memberships-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/sql/oracle/clubs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/clubs-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/clubs-create.sql 13 May 2002 19:46:18 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/clubs-create.sql 30 May 2002 22:04:58 -0000 1.3 @@ -16,13 +16,8 @@ -- --- The DotLRN basic system --- copyright 2001, OpenForce, Inc. --- distributed under the GNU GPL v2 +-- create dotLRN clubs model -- --- for Oracle 8/8i. (We're guessing 9i works, too). --- --- @author Ben Adida (ben@openforce.net) -- @author yon (yon@openforce.net) -- @creation-date August 18th, 2001 -- @version $Id$ @@ -38,15 +33,7 @@ create or replace view dotlrn_clubs_full as select dotlrn_clubs.club_id, - dotlrn_communities.community_type, - dotlrn_communities.community_key, - dotlrn_communities.pretty_name, - dotlrn_communities.description, - dotlrn_communities.active_start_date, - dotlrn_communities.active_end_date, - dotlrn_communities.portal_id, - dotlrn_communities.non_member_portal_id, - dotlrn_communities.package_id, + dotlrn_communities.*, dotlrn_community.url(dotlrn_communities.community_id) as url, groups.join_policy from dotlrn_communities, Index: openacs-4/packages/dotlrn/sql/oracle/clubs-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/clubs-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/clubs-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,29 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop dotLRN clubs model +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date August 18th, 2001 +-- @version $Id: clubs-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +drop package body dotlrn_club; +drop package dotlrn_club; +drop view dotlrn_clubs_full; +drop table dotlrn_clubs; Index: openacs-4/packages/dotlrn/sql/oracle/communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-create.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/oracle/communities-create.sql 24 May 2002 01:58:45 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/oracle/communities-create.sql 30 May 2002 22:04:58 -0000 1.5 @@ -15,10 +15,8 @@ -- -- --- The DotLRN communities construct +-- create the dotLRN communities model -- --- for Oracle 8/8i. (We're guessing 9i works, too). --- -- @author Ben Adida (ben@openforce.net) -- @author yon (yon@openforce.net -- @author arjun (arjun@openforce.net) @@ -31,16 +29,19 @@ references group_types (group_type) constraint dotlrn_community_types_pk primary key, + supertype constraint dotlrn_ct_supertype_fk + references dotlrn_community_types (community_type), + constraint dotlrn_ct_type_supertype_un unique (community_type, supertype), pretty_name varchar2(100) constraint dotlrn_ct_pretty_name_nn not null, description varchar2(4000), package_id constraint dotlrn_ct_package_id_fk references apm_packages (package_id), - supertype constraint dotlrn_ct_supertype_fk - references dotlrn_community_types (community_type), portal_id constraint dotlrn_ct_portal_id_fk - references portals (portal_id) + references portals (portal_id), + tree_sortkey raw(240), + max_child_sortkey raw(3) ); create table dotlrn_communities_all ( @@ -50,6 +51,7 @@ primary key, parent_community_id constraint dotlrn_c_parent_comm_id_fk references dotlrn_communities_all (community_id), + constraint dotlrn_c_community_key_un unique (community_key, parent_community_id), community_type constraint dotlrn_c_community_type_nn not null constraint dotlrn_c_community_type_fk @@ -83,8 +85,8 @@ default 0, header_img varchar2(100) default '', - constraint dotlrn_c_community_key_un - unique (community_key, parent_community_id) + tree_sortkey raw(240), + max_child_sortkey raw(3) ); create or replace view dotlrn_communities @@ -120,7 +122,7 @@ create table dotlrn_applets ( applet_id integer - constraint dotlrn_applets_applet_pk + constraint dotlrn_applets_applet_pk primary key, applet_key varchar(100) constraint dotlrn_applets_applet_key_nn Index: openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,34 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN communities model +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net +-- @author arjun (arjun@openforce.net) +-- @creation-date September 20th, 2001 (redone) +-- @version $Id: communities-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +drop table dotlrn_community_applets; +drop table dotlrn_applets; +drop view dotlrn_active_comms_not_closed; +drop view dotlrn_active_communities; +drop view dotlrn_communities_not_closed; +drop view dotlrn_communities; +drop table dotlrn_communities_all; +drop table dotlrn_community_types; Index: openacs-4/packages/dotlrn/sql/oracle/communities-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/communities-package-create.sql 13 May 2002 19:46:18 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/communities-package-create.sql 30 May 2002 22:04:58 -0000 1.3 @@ -111,6 +111,10 @@ from dotlrn_community_types where community_type = dotlrn_community_type.delete.community_type; + delete + from group_types + where group_types.group_type = dotlrn_community_type.delete.community_type; + acs_object_type.drop_type(dotlrn_community_type.delete.community_type); end; Index: openacs-4/packages/dotlrn/sql/oracle/communities-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/communities-package-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,21 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +drop view dotlrn_communities_full; +drop package body dotlrn_community; +drop package dotlrn_community; +drop package body dotlrn_community_type; +drop package dotlrn_community_type; Index: openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/communities-tree-create.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,366 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +create or replace package dotlrn_community_type +is + function new ( + community_type in dotlrn_community_types.community_type%TYPE, + parent_type in dotlrn_community_types.supertype%TYPE default 'dotlrn_community', + pretty_name in dotlrn_community_types.pretty_name%TYPE, + pretty_plural in dotlrn_community_types.pretty_name%TYPE default null, + description in dotlrn_community_types.description%TYPE, + package_id in dotlrn_community_types.package_id%TYPE default null, + 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, + context_id in acs_objects.context_id%TYPE default null + ) return dotlrn_community_types.community_type%TYPE; + + procedure delete ( + community_type in dotlrn_community_types.community_type%TYPE + ); + + function name ( + community_type in dotlrn_community_types.community_type%TYPE + ) return varchar; +end; +/ +show errors + +create or replace package body dotlrn_community_type +is + function new ( + community_type in dotlrn_community_types.community_type%TYPE, + parent_type in dotlrn_community_types.supertype%TYPE default 'dotlrn_community', + pretty_name in dotlrn_community_types.pretty_name%TYPE, + pretty_plural in dotlrn_community_types.pretty_name%TYPE default null, + description in dotlrn_community_types.description%TYPE, + package_id in dotlrn_community_types.package_id%TYPE default null, + 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, + context_id in acs_objects.context_id%TYPE default null + ) return dotlrn_community_types.community_type%TYPE + is + v_parent_object_type acs_object_types.object_type%TYPE; + v_unique_name acs_objects.object_id%TYPE; + begin + if parent_type is null then + v_parent_object_type:= 'group'; + else + v_parent_object_type:= parent_type; + end if; + + select acs_object_id_seq.nextval + into v_unique_name + from dual; + + acs_object_type.create_type ( + supertype => v_parent_object_type, + object_type => dotlrn_community_type.new.community_type, + pretty_name => dotlrn_community_type.new.community_type, + pretty_plural => dotlrn_community_type.new.community_type, + table_name => v_unique_name, + id_column => v_unique_name, + package_name => v_unique_name, + name_method => 'acs_group.name' + ); + + insert + into group_types + (group_type, default_join_policy) + values + (dotlrn_community_type.new.community_type, 'closed'); + + insert + into dotlrn_community_types + (community_type, + pretty_name, + description, + package_id, + supertype) + values + (dotlrn_community_type.new.community_type, + dotlrn_community_type.new.pretty_name, + dotlrn_community_type.new.description, + dotlrn_community_type.new.package_id, + dotlrn_community_type.new.parent_type); + + return community_type; + end; + + procedure delete ( + community_type in dotlrn_community_types.community_type%TYPE + ) + is + begin + delete + from dotlrn_community_types + where community_type = dotlrn_community_type.delete.community_type; + + acs_object_type.drop_type(dotlrn_community_type.delete.community_type); + end; + + function name ( + community_type in dotlrn_community_types.community_type%TYPE + ) return varchar + is + v_name dotlrn_community_types.pretty_name%TYPE; + begin + select dotlrn_community_types.pretty_name + into v_name + from dotlrn_community_types + where dotlrn_community_types.community_type = dotlrn_community_type.name.community_type; + + return v_name; + end; +end; +/ +show errors + +create or replace package dotlrn_community +is + + function new ( + community_id in dotlrn_communities_all.community_id%TYPE default null, + parent_community_id in dotlrn_communities_all.parent_community_id%TYPE default null, + community_type in dotlrn_communities_all.community_type%TYPE, + community_key in dotlrn_communities_all.community_key%TYPE, + pretty_name in dotlrn_communities_all.pretty_name%TYPE, + description in dotlrn_communities_all.description%TYPE, + archived_p in dotlrn_communities_all.archived_p%TYPE default 'f', + portal_id in dotlrn_communities_all.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities_all.non_member_portal_id%TYPE default null, + package_id in dotlrn_communities_all.package_id%TYPE default null, + join_policy in groups.join_policy%TYPE default null, + 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, + context_id in acs_objects.context_id%TYPE default null + ) return dotlrn_communities_all.community_id%TYPE; + + procedure set_active_dates ( + community_id in dotlrn_communities_all.community_id%TYPE, + start_date in dotlrn_communities_all.active_start_date%TYPE, + end_date in dotlrn_communities_all.active_end_date%TYPE + ); + + procedure delete ( + community_id in dotlrn_communities_all.community_id%TYPE + ); + + function name ( + community_id in dotlrn_communities_all.community_id%TYPE + ) return varchar; + + function member_p ( + community_id in dotlrn_communities_all.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char; + + function admin_p ( + community_id in dotlrn_communities_all.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char; + + function url ( + community_id in dotlrn_communities_all.community_id%TYPE + ) return varchar2; + + function has_subcomm_p ( + community_id in dotlrn_communities_all.community_id%TYPE + ) return char; + +end dotlrn_community; +/ +show errors + +create or replace package body dotlrn_community +as + + function new ( + community_id in dotlrn_communities_all.community_id%TYPE default null, + parent_community_id in dotlrn_communities_all.parent_community_id%TYPE default null, + community_type in dotlrn_communities_all.community_type%TYPE, + community_key in dotlrn_communities_all.community_key%TYPE, + pretty_name in dotlrn_communities_all.pretty_name%TYPE, + description in dotlrn_communities_all.description%TYPE, + archived_p in dotlrn_communities_all.archived_p%TYPE default 'f', + portal_id in dotlrn_communities_all.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities_all.non_member_portal_id%TYPE default null, + package_id in dotlrn_communities_all.package_id%TYPE default null, + join_policy in groups.join_policy%TYPE default null, + 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, + context_id in acs_objects.context_id%TYPE default null + ) return dotlrn_communities_all.community_id%TYPE + is + c_id integer; + begin + c_id := acs_group.new ( + context_id => dotlrn_community.new.context_id, + group_id => dotlrn_community.new.community_id, + object_type => dotlrn_community.new.community_type, + creation_date => dotlrn_community.new.creation_date, + creation_user => dotlrn_community.new.creation_user, + creation_ip => dotlrn_community.new.creation_ip, + group_name => dotlrn_community.new.community_key, + join_policy => dotlrn_community.new.join_policy + ); + + insert into dotlrn_communities_all + (community_id, + parent_community_id, + community_type, + community_key, + pretty_name, + description, + package_id, + archived_p, + portal_id, + non_member_portal_id) + values + (c_id, + dotlrn_community.new.parent_community_id, + dotlrn_community.new.community_type, + dotlrn_community.new.community_key, + dotlrn_community.new.pretty_name, + dotlrn_community.new.description, + dotlrn_community.new.package_id, + dotlrn_community.new.archived_p, + dotlrn_community.new.portal_id, + dotlrn_community.new.non_member_portal_id); + + return c_id; + end; + + procedure set_active_dates ( + community_id in dotlrn_communities_all.community_id%TYPE, + start_date in dotlrn_communities_all.active_start_date%TYPE, + end_date in dotlrn_communities_all.active_end_date%TYPE + ) + is + begin + update dotlrn_communities_all + set active_start_date = dotlrn_community.set_active_dates.start_date, + active_end_date = dotlrn_community.set_active_dates.end_date + where dotlrn_communities_all.community_id = dotlrn_community.set_active_dates.community_id; + end; + + procedure delete ( + community_id in dotlrn_communities_all.community_id%TYPE + ) + is + begin + delete + from dotlrn_communities_all + where dotlrn_communities_all.community_id = dotlrn_community.delete.community_id; + + acs_group.delete(dotlrn_community.delete.community_id); + end; + + function name ( + community_id in dotlrn_communities_all.community_id%TYPE + ) return varchar + is + begin + return acs_group.name(dotlrn_community.name.community_id); + end; + + function member_p ( + community_id in dotlrn_communities_all.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char + is + v_member_p char(1); + begin + select decode(count(*), 0, 'f', 't') + into v_member_p + from dual + where exists (select 1 + from dotlrn_member_rels_approved + where dotlrn_member_rels_approved.user_id = dotlrn_community.member_p.party_id + and dotlrn_member_rels_approved.community_id = dotlrn_community.member_p.community_id); + + return v_member_p; + end; + + function admin_p ( + community_id in dotlrn_communities_all.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char + is + v_rv char(1); + begin + select decode( + acs_permission.permission_p(dotlrn_community.admin_p.community_id, dotlrn_community.admin_p.party_id, 'dotlrn_admin_community'), + 'f', + acs_permission.permission_p(dotlrn_community.admin_p.community_id, dotlrn_community.admin_p.party_id, 'admin'), + 't' + ) into v_rv + from dual; + + return v_rv; + end; + + function url ( + community_id in dotlrn_communities_all.community_id%TYPE + ) return varchar2 + is + v_node_id site_nodes.node_id%TYPE; + begin + select site_nodes.node_id into v_node_id + from dotlrn_communities_all, + site_nodes + where dotlrn_communities_all.community_id = dotlrn_community.url.community_id + and site_nodes.object_id = dotlrn_communities_all.package_id; + + return site_node.url(v_node_id); + + exception + when no_data_found then + return ''; + end; + + function has_subcomm_p ( + community_id in dotlrn_communities_all.community_id%TYPE + ) return char + is + v_rv char(1); + begin + select decode(count(*), 0, 'f', 't') + into v_rv + from dual + where exists (select 1 + from dotlrn_communities_all + where dotlrn_communities_all.parent_community_id = dotlrn_community.has_subcomm_p.community_id); + return v_rv; + end; + +end; +/ +show errors + +create or replace view dotlrn_communities_full +as + select dotlrn_communities.*, + dotlrn_community.url(dotlrn_communities.community_id) as url, + groups.group_name, + groups.join_policy + from dotlrn_communities, + groups + where dotlrn_communities.community_id = groups.group_id; Index: openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql 21 May 2002 07:46:02 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql 30 May 2002 22:04:58 -0000 1.3 @@ -14,9 +14,8 @@ -- details. -- - -- --- The DotLRN communities membership constructs +-- create the dotLRN communities membership model -- -- for Oracle 8/8i. (We're guessing 9i works, too). -- Index: openacs-4/packages/dotlrn/sql/oracle/community-memberships-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/community-memberships-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,30 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN communities membership model +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date November 6th, 2001 +-- @version $Id: community-memberships-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +drop view dotlrn_admin_rels_full; +drop table dotlrn_admin_rels; +drop view dotlrn_member_rels_approved; +drop view dotlrn_member_rels_full; +drop table dotlrn_member_rels; Index: openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-create.sql 13 May 2002 19:46:18 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-create.sql 30 May 2002 22:04:58 -0000 1.3 @@ -14,20 +14,14 @@ -- details. -- - -- --- The DotLRN memberships packages +-- create the dotLRN memberships packages -- --- for Oracle 8/8i. (We're guessing 9i works, too). +-- @author Ben Adida (ben@openforce.net) +-- @creation-daate 2001-11-06 +-- @version $Id$ -- --- ben@openforce.net --- started November 6th, 2001 --- --- --- Basic dotLRN membership rel --- - create or replace package dotlrn_member_rel is Index: openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,38 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN memberships packages +-- +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-11-06 +-- @version $Id: community-memberships-packages-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +drop package body dotlrn_cadmin_rel; +drop package dotlrn_cadmin_rel; +drop package body dotlrn_ca_rel; +drop package dotlrn_ca_rel; +drop package body dotlrn_ta_rel; +drop package dotlrn_ta_rel; +drop package body dotlrn_instructor_rel; +drop package dotlrn_instructor_rel; +drop package body dotlrn_student_rel; +drop package dotlrn_student_rel; +drop package body dotlrn_admin_rel; +drop package dotlrn_admin_rel; +drop package body dotlrn_member_rel; +drop package dotlrn_member_rel; Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql,v diff -u -r1.15 -r1.16 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 24 May 2002 01:58:45 -0000 1.15 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 30 May 2002 22:04:58 -0000 1.16 @@ -15,15 +15,12 @@ -- -- --- The DotLRN basic system --- copyright 2001, OpenForce, Inc. --- distributed under the GNU GPL v2 +-- create the dotLRN model -- --- for Oracle 8/8i. (We're guessing 9i works, too). +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-08-18 +-- @version $Id$ -- --- ben@openforce.net --- started August 18th, 2001 --- @@ users-create.sql @@ portal-types-create.sql @@ -33,7 +30,7 @@ @@ dotlrn-init.sql @@ clubs-create.sql @@ classes-create.sql -@@ classes-memberships-create.sql +@@ class-memberships-create.sql @@ applet-sc-create.sql @@ community-memberships-packages-create.sql @@ main-portlet-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,38 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop the dotLRN model +-- +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-08-18 +-- @version $Id: dotlrn-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +@@ user-extension-drop.sql +@@ security-drop.sql +@@ main-portlet-drop.sql +@@ community-memberships-packages-drop.sql +@@ applet-sc-drop.sql +@@ class-memberships-drop.sql +@@ classes-drop.sql +@@ clubs-drop.sql +@@ dotlrn-sanitize.sql +@@ communities-package-drop.sql +@@ community-memberships-drop.sql +@@ communities-drop.sql +@@ portal-types-drop.sql +@@ users-drop.sql Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql,v diff -u -r1.25 -r1.26 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 24 May 2002 01:58:45 -0000 1.25 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 30 May 2002 22:04:58 -0000 1.26 @@ -15,7 +15,7 @@ -- -- --- The DotLRN basic system +-- bootstrap dotLRN -- -- @author Ben Adida (ben@openforce.net) -- @creation-date 2001-09-25 @@ -38,11 +38,6 @@ description => 'Communities - the base community type' ); - update acs_object_types - set table_name = 'dotlrn_community', - package_name = 'dotlrn_community' - where object_type = 'dotlrn_community'; - -- these are the possible attributes of a community bar := acs_attribute.create_attribute( object_type => 'dotlrn_community', @@ -97,11 +92,6 @@ description => 'e.g. 6.001' ); - update acs_object_types - set table_name = 'dotlrn_class_instance', - package_name = 'dotlrn_class_instance' - where object_type = 'dotlrn_class_instance'; - -- create the dotlrn_club community type foo := dotlrn_community_type.new( community_type => 'dotlrn_club', Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-sanitize.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,179 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- sanitize dotLRN +-- +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-09-25 +-- @version $Id: dotlrn-sanitize.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- +-- @note We remember September 11th, 2001 +-- + +declare +begin + + acs_rel_type.drop_type( + rel_type => 'dotlrn_admin_rel', + cascade_p => 't' + ); + + -- all rels to communities must have a portal_id + acs_attribute.drop_attribute( + object_type => 'dotlrn_member_rel', + attribute_name => 'portal_id' + ); + + -- drop basic rel_types + acs_rel_type.drop_type( + rel_type => 'dotlrn_member_rel', + cascade_p => 't' + ); + + -- drop roles + acs_rel_type.drop_role( + role => 'student' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'student_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'student_pretty_plural' + ); + + acs_rel_type.drop_role( + role => 'course_assistant' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'course_assistant_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'course_assistant_pretty_plural' + ); + + acs_rel_type.drop_role( + role => 'teaching_assistant' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'teaching_assistant_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'teaching_assistant_pretty_plural' + ); + + acs_rel_type.drop_role( + role => 'instructor' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'instructor_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'instructor_pretty_plural' + ); + + acs_rel_type.drop_role( + role => 'course_admin' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'course_admin_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'course_admin_pretty_plural' + ); + + acs_rel_type.drop_role( + role => 'admin' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'admin_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'admin_pretty_plural' + ); + + -- drop the dotlrn_club community type + dotlrn_community_type.delete( + community_type => 'dotlrn_club' + ); + + -- drop the dotlrn_class community type + dotlrn_community_type.delete( + community_type => 'dotlrn_class_instance' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'header_font' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'header_font_size' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'header_font_color' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'header_logo_item_id' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'member_pretty_name' + ); + + acs_attribute.drop_attribute( + object_type => 'dotlrn_community', + attribute_name => 'member_pretty_plural' + ); + + -- drop the base community type + dotlrn_community_type.delete( + community_type => 'dotlrn_community' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 9 May 2002 23:59:51 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 30 May 2002 22:04:58 -0000 1.3 @@ -31,137 +31,130 @@ -- from the GNU Project: http://www.fsf.org/copyleft/gpl.html declare - ds_id portal_datasources.datasource_id%TYPE; + ds_id portal_datasources.datasource_id%TYPE; + foo integer; begin - ds_id := portal_datasource.new( - name => 'dotlrn_main_portlet', - description => 'Displays the list of communities a user belongs to' - ); - -- the standard 4 params + ds_id := portal_datasource.new( + name => 'dotlrn_main_portlet', + description => 'Displays the list of communities a user belongs to' + ); - -- shadeable_p - portal_datasource.set_def_param ( - datasource_id => ds_id, - config_required_p => 't', - configured_p => 't', - key => 'shadeable_p', - value => 'f' -); + -- shadeable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 'f' + ); + -- hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 'f' + ); - -- hideable_p - portal_datasource.set_def_param ( - datasource_id => ds_id, - config_required_p => 't', - configured_p => 't', - key => 'hideable_p', - value => 'f' -); + -- user_editable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' + ); - -- user_editable_p - portal_datasource.set_def_param ( - datasource_id => ds_id, - config_required_p => 't', - configured_p => 't', - key => 'user_editable_p', - value => 'f' -); + -- shaded_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' + ); - -- shaded_p - portal_datasource.set_def_param ( - datasource_id => ds_id, - config_required_p => 't', - configured_p => 't', - key => 'shaded_p', - value => 'f' -); + -- link_hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' + ); - -- link_hideable_p - portal_datasource.set_def_param ( - datasource_id => ds_id, - config_required_p => 't', - configured_p => 't', - key => 'link_hideable_p', - value => 't' -); -end; -/ -show errors + -- create the implementation + foo := acs_sc_impl.new ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_owner_name => 'dotlrn_main_portlet' + ); -declare - foo integer; -begin - -- create the implementation - foo := acs_sc_impl.new ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'dotlrn_main_portlet' - ); + -- add all the hooks + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'GetMyName', + impl_alias => 'dotlrn_main_portlet::get_my_name', + impl_pl => 'TCL' + ); - -- add all the hooks - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'GetMyName', - 'dotlrn_main_portlet::get_my_name', - 'TCL' - ); + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'GetPrettyName', + impl_alias => 'dotlrn_main_portlet::get_pretty_name', + impl_pl => 'TCL' + ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'GetPrettyName', - 'dotlrn_main_portlet::get_pretty_name', - 'TCL' - ); + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'Link', + impl_alias => 'dotlrn_main_portlet::link', + impl_pl => 'TCL' + ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'Link', - 'dotlrn_main_portlet::link', - 'TCL' - ); + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'AddSelfToPage', + impl_alias => 'dotlrn_main_portlet::add_self_to_page', + impl_pl => 'TCL' + ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'AddSelfToPage', - 'dotlrn_main_portlet::add_self_to_page', - 'TCL' - ); + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'RemoveSelfFromPage', + impl_alias => 'dotlrn_main_portlet::remove_self_from_page', + impl_pl => 'TCL' + ); + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'Show', + impl_alias => 'dotlrn_main_portlet::show', + impl_pl => 'TCL' + ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'RemoveSelfFromPage', - 'dotlrn_main_portlet::remove_self_from_page', - 'TCL' - ); + foo := acs_sc_impl.new_alias ( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'Edit', + impl_alias => 'dotlrn_main_portlet::edit', + impl_pl => 'TCL' + ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'Show', - 'dotlrn_main_portlet::show', - 'TCL' - ); + -- Add the binding + acs_sc_binding.new ( + contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet' + ); - foo := acs_sc_impl.new_alias ( - 'portal_datasource', - 'dotlrn_main_portlet', - 'Edit', - 'dotlrn_main_portlet::edit', - 'TCL' - ); - - -- Add the binding - acs_sc_binding.new ( - contract_name => 'portal_datasource', - impl_name => 'dotlrn_main_portlet' - ); end; / show errors Index: openacs-4/packages/dotlrn/sql/oracle/main-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/main-portlet-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/main-portlet-drop.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/main-portlet-drop.sql 30 May 2002 22:04:58 -0000 1.2 @@ -28,21 +28,74 @@ -- from the GNU Project: http://www.fsf.org/copyleft/gpl.html declare - ds_id portal_datasources.datasource_id%TYPE; + ds_id portal_datasources.datasource_id%TYPE; + foo integer; begin - begin - select datasource_id into ds_id - from portal_datasources - where name = 'dotlrn-main-portlet'; - exception when no_data_found then - ds_id := null; - end; + acs_sc_binding.delete( + contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet' + ); - if ds_id is not null then - portal_datasource.delete(ds_id); - end if; + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'GetMyName' + ); + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'GetPrettyName' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'Link' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'AddSelfToPage' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'RemoveSelfFromPage' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'Show' + ); + + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet', + impl_operation_name => 'Edit' + ); + + acs_sc_impl.delete( + impl_contract_name => 'portal_datasource', + impl_name => 'dotlrn_main_portlet' + ); + + begin + select datasource_id into ds_id + from portal_datasources + where name = 'dotlrn-main-portlet'; + exception when no_data_found then + ds_id := null; + end; + + if ds_id is not null then + portal_datasource.delete(ds_id); + end if; + end; / show errors; Index: openacs-4/packages/dotlrn/sql/oracle/security-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/security-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/security-create.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/security-create.sql 30 May 2002 22:04:58 -0000 1.2 @@ -14,65 +14,57 @@ -- details. -- - -- --- dotLRN Project +-- create dotLRN permissions -- --- copyright 2001, OpenForce --- released under the GPL, v2.0 +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-11-28 +-- @version $Id$ -- --- ben@openforce --- --- 11/28/2001 --- --- Security Setup for dotLRN --- privileges, privilege inheritance --- -DECLARE -BEGIN - -- the ability to browse dotLRN in general - acs_privilege.create_privilege('dotlrn_browse'); +declare +begin - -- the ability to even view that a community exists - acs_privilege.create_privilege('dotlrn_view_community'); + -- the ability to browse dotLRN in general + acs_privilege.create_privilege('dotlrn_browse'); - -- the ability to participate in a community - acs_privilege.create_privilege('dotlrn_edit_community'); + -- the ability to even view that a community exists + acs_privilege.create_privilege('dotlrn_view_community'); - -- the ability to admin a community - acs_privilege.create_privilege('dotlrn_admin_community'); + -- the ability to participate in a community + acs_privilege.create_privilege('dotlrn_edit_community'); - -- the ability to create a community - acs_privilege.create_privilege('dotlrn_create_community'); + -- the ability to admin a community + acs_privilege.create_privilege('dotlrn_admin_community'); - -- the ability to even view a community type - acs_privilege.create_privilege('dotlrn_view_community_type'); + -- the ability to create a community + acs_privilege.create_privilege('dotlrn_create_community'); - -- the ability to admin a community type - acs_privilege.create_privilege('dotlrn_admin_community_type'); - - -- the ability to create a community type - acs_privilege.create_privilege('dotlrn_create_community_type'); + -- the ability to even view a community type + acs_privilege.create_privilege('dotlrn_view_community_type'); - -- Consistent permissions - acs_privilege.add_child('dotlrn_edit_community', 'dotlrn_view_community'); - acs_privilege.add_child('dotlrn_admin_community', 'dotlrn_edit_community'); + -- the ability to admin a community type + acs_privilege.create_privilege('dotlrn_admin_community_type'); - -- inheritance - acs_privilege.add_child('create', 'dotlrn_create_community_type'); - acs_privilege.add_child('create', 'dotlrn_create_community'); - acs_privilege.add_child('write', 'dotlrn_edit_community'); - acs_privilege.add_child('read', 'dotlrn_view_community'); - acs_privilege.add_child('read', 'dotlrn_view_community_type'); - acs_privilege.add_child('admin', 'dotlrn_admin_community'); - acs_privilege.add_child('admin', 'dotlrn_admin_community_type'); + -- the ability to create a community type + acs_privilege.create_privilege('dotlrn_create_community_type'); - -- for now, we only want admins to be able to browse by default - acs_privilege.add_child('admin', 'dotlrn_browse'); + -- consistent permissions + acs_privilege.add_child('dotlrn_edit_community', 'dotlrn_view_community'); + acs_privilege.add_child('dotlrn_admin_community', 'dotlrn_edit_community'); - -- no default permissions + -- inheritance + acs_privilege.add_child('create', 'dotlrn_create_community_type'); + acs_privilege.add_child('create', 'dotlrn_create_community'); + acs_privilege.add_child('write', 'dotlrn_edit_community'); + acs_privilege.add_child('read', 'dotlrn_view_community'); + acs_privilege.add_child('read', 'dotlrn_view_community_type'); + acs_privilege.add_child('admin', 'dotlrn_admin_community'); + acs_privilege.add_child('admin', 'dotlrn_admin_community_type'); + -- for now, we only want admins to be able to browse by default + acs_privilege.add_child('admin', 'dotlrn_browse'); + end; / show errors Index: openacs-4/packages/dotlrn/sql/oracle/security-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/security-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/security-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,62 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- drop dotLRN permissions +-- +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-11-28 +-- @version $Id: security-drop.sql,v 1.1 2002/05/30 22:04:58 yon Exp $ +-- + +declare +begin + + acs_privilege.remove_child('admin', 'dotlrn_admin_community'); + acs_privilege.remove_child('admin', 'dotlrn_admin_community_type'); + acs_privilege.remove_child('admin', 'dotlrn_browse'); + acs_privilege.remove_child('create', 'dotlrn_create_community'); + acs_privilege.remove_child('create', 'dotlrn_create_community_type'); + acs_privilege.remove_child('read', 'dotlrn_view_community'); + acs_privilege.remove_child('read', 'dotlrn_view_community_type'); + acs_privilege.remove_child('write', 'dotlrn_edit_community'); + + acs_privilege.remove_child('dotlrn_edit_community', 'dotlrn_view_community'); + acs_privilege.remove_child('dotlrn_admin_community', 'dotlrn_edit_community'); + + delete + from acs_permissions + where privilege in ('dotlrn_admin_community', + 'dotlrn_admin_community_type', + 'dotlrn_browse', + 'dotlrn_create_community', + 'dotlrn_create_community_type', + 'dotlrn_edit_community', + 'dotlrn_view_community', + 'dotlrn_view_community_type'); + + acs_privilege.drop_privilege('dotlrn_admin_community'); + acs_privilege.drop_privilege('dotlrn_admin_community_type'); + acs_privilege.drop_privilege('dotlrn_browse'); + acs_privilege.drop_privilege('dotlrn_create_community'); + acs_privilege.drop_privilege('dotlrn_create_community_type'); + acs_privilege.drop_privilege('dotlrn_edit_community'); + acs_privilege.drop_privilege('dotlrn_view_community'); + acs_privilege.drop_privilege('dotlrn_view_community_type'); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/user-extension-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/user-extension-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/user-extension-create.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/user-extension-create.sql 30 May 2002 22:04:58 -0000 1.2 @@ -28,67 +28,67 @@ declare - foo integer; + foo integer; begin - -- create the implementation - foo := acs_sc_impl.new ( - 'UserData', - 'dotlrn_user_extension', - 'dotlrn_user_extension' - ); - -- add all the hooks + -- create the implementation + foo := acs_sc_impl.new ( + 'UserData', + 'dotlrn_user_extension', + 'dotlrn_user_extension' + ); - -- UserNew - foo := acs_sc_impl.new_alias ( - 'UserData', - 'dotlrn_user_extension', - 'UserNew', - 'dotlrn_user_extension::user_new', - 'TCL' - ); + -- UserNew + foo := acs_sc_impl.new_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserNew', + 'dotlrn_user_extension::user_new', + 'TCL' + ); - -- UserNew - foo := acs_sc_impl.new_alias ( - 'UserData', - 'dotlrn_user_extension', - 'UserApprove', - 'dotlrn_user_extension::user_approve', - 'TCL' - ); + -- UserNew + foo := acs_sc_impl.new_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserApprove', + 'dotlrn_user_extension::user_approve', + 'TCL' + ); - -- UserNew - foo := acs_sc_impl.new_alias ( - 'UserData', - 'dotlrn_user_extension', - 'UserDeapprove', - 'dotlrn_user_extension::user_deapprove', - 'TCL' - ); + -- UserNew + foo := acs_sc_impl.new_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserDeapprove', + 'dotlrn_user_extension::user_deapprove', + 'TCL' + ); - -- UserNew - foo := acs_sc_impl.new_alias ( - 'UserData', - 'dotlrn_user_extension', - 'UserModify', - 'dotlrn_user_extension::user_modify', - 'TCL' - ); + -- UserNew + foo := acs_sc_impl.new_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserModify', + 'dotlrn_user_extension::user_modify', + 'TCL' + ); - -- UserNew - foo := acs_sc_impl.new_alias ( - 'UserData', - 'dotlrn_user_extension', - 'UserDelete', - 'dotlrn_user_extension::user_delete', - 'TCL' - ); + -- UserNew + foo := acs_sc_impl.new_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserDelete', + 'dotlrn_user_extension::user_delete', + 'TCL' + ); - -- Add the binding - acs_sc_binding.new ( - contract_name => 'UserData', - impl_name => 'dotlrn_user_extension' - ); + -- Add the binding + acs_sc_binding.new ( + contract_name => 'UserData', + impl_name => 'dotlrn_user_extension' + ); + end; / show errors Index: openacs-4/packages/dotlrn/sql/oracle/user-extension-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/user-extension-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/user-extension-drop.sql 30 May 2002 22:04:58 -0000 1.1 @@ -0,0 +1,77 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + + +-- +-- The dotLRN extension to user data notifications +-- copyright 2002, OpenForce +-- distributed under GPL v2.0 +-- +-- +-- ben@openforce.net +-- +-- 01/22/2002 +-- + + +declare + foo integer; +begin + + acs_sc_binding.delete ( + contract_name => 'UserData', + impl_name => 'dotlrn_user_extension' + ); + + foo := acs_sc_impl.delete_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserNew' + ); + + foo := acs_sc_impl.delete_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserApprove' + ); + + foo := acs_sc_impl.delete_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserDeapprove' + ); + + foo := acs_sc_impl.delete_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserModify' + ); + + foo := acs_sc_impl.delete_alias ( + 'UserData', + 'dotlrn_user_extension', + 'UserDelete' + ); + + -- create the implementation + acs_sc_impl.delete( + 'UserData', + 'dotlrn_user_extension' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-drop.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-drop.sql 30 May 2002 22:04:58 -0000 1.2 @@ -34,26 +34,26 @@ -- drop the bindings to the method implementations - -- name method - foo := acs_sc_impl.delete_alias( - impl_contract_name => 'profile_provider', - impl_name => 'dotlrn_user_profile_provider', - impl_operation_name => 'name' - ); + -- name method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_operation_name => 'name' + ); - -- prettyName method - foo := acs_sc_impl.delete_alias( - impl_contract_name => 'profile_provider', - impl_name => 'dotlrn_user_profile_provider', - impl_operation_name => 'prettyName' - ); + -- prettyName method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_operation_name => 'prettyName' + ); - -- render method - foo := acs_sc_impl.delete_alias( - impl_contract_name => 'profile_provider', - impl_name => 'dotlrn_user_profile_provider', - impl_operation_name => 'render' - ); + -- render method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_operation_name => 'render' + ); -- drop the implementation acs_sc_impl.delete( Index: openacs-4/packages/dotlrn/sql/oracle/users-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/users-sanitize.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/users-sanitize.sql 6 May 2002 23:55:01 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/users-sanitize.sql 30 May 2002 22:04:58 -0000 1.2 @@ -22,27 +22,29 @@ -- declare - foo integer; + v_segment_id integer; + v_group_id integer; begin - select min(segment_id) - into foo + select segment_id, group_id + into v_segment_id, v_group_id from rel_segments - where segment_name = 'dotLRN Users'; + where rel_type = 'dotlrn_user_profile_rel'; + delete + from acs_permissions + where grantee_id = v_segment_id; + rel_segment.delete( - segment_id => foo + segment_id => v_segment_id ); - select min(group_id) - into foo - from profiled_groups - where profile_provider = (select min(impl_id) - from acs_sc_impls - where impl_name = 'dotlrn_user_profile_provider'); + delete + from acs_permissions + where grantee_id = v_group_id; profiled_group.delete( - group_id => foo + group_id => v_group_id ); acs_rel_type.drop_type( Index: openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl 24 May 2002 01:58:45 -0000 1.23 +++ openacs-4/packages/dotlrn/tcl/dotlrn-init.tcl 30 May 2002 22:04:59 -0000 1.24 @@ -14,94 +14,82 @@ # details. # -# -# Procs for initializing DOTLRN basic system -# Copyright 2001 OpenForce, inc. -# Distributed under the GNU GPL v2 -# -# August 20th, 2001 -# - ad_library { - Procs for initializing basic dotLRN + initialize dotLRN @author ben@openforce.net @creation-date 2001-08-18 + @version $Id$ } -# We check to see if dotLRN has been installed, and if so, if permissions -# have been granted - ns_log notice "dotlrn-init: starting..." # if installed if {[dotlrn::is_instantiated]} { set portal_package_key [portal::package_key] set portal_mount_point [portal::automount_point] - - # we now mount new-portal at the automount point if it's not already mounted, of course + + # we now mount new-portal at the automount point if it's not already mounted, of course if {[site_nodes::mount_count -package_key $portal_package_key] == 0} { - + ns_log notice "dotlrn-init: $portal_package_key being automounted at /$portal_mount_point" - + dotlrn::mount_package \ -parent_node_id [site_node_id "/"] \ -package_key $portal_package_key \ -url $portal_mount_point \ -directory_p "t" } - db_transaction { - + ns_log notice "dotlrn-init: dotlrn is instantiated, about to call dotlrn_applet::init" # this may seems strange, but init the applets first # initialize the applets subsystem (ooh, I'm using big words - ben) if {![dotlrn_applet::is_initalized]} { dotlrn_applet::init } - + # We go through all Applets and make sure they are added. - + # The applet_add proc in the dotlrn_applet contract is for one-time # init of each applet NOTE: this applet_add proc _must_ be able to be # called repeatedly since this script is eval'd at every server startup foreach applet [dotlrn_community::list_applets] { # Callback on all applets dotlrn_community::applet_call $applet "AddApplet" [list] } - + ns_log notice "dotlrn-init: dotlrn is instantiated, about to call dotlrn::init" - + if {![dotlrn::is_initialized]} { dotlrn::init } - + ns_log notice "dotlrn-init: about to call dotlrn_class:init" - + if {![dotlrn_class::is_initialized]} { dotlrn_class::init } - + ns_log notice "dotlrn-init: about to call dotlrn_club::init" - + if {![dotlrn_club::is_initialized]} { dotlrn_club::init } - + ns_log notice "dotlrn-init: done with dotlrn_club::init" - + # Grantee set grantee_id [dotlrn::get_users_rel_segment_id] set package_id [dotlrn::get_package_id] - + # Grant the permission permission::grant -party_id $grantee_id -object_id $package_id -privilege "dotlrn_browse" - + # check read permission on dotLRN for all users set grantee_id [dotlrn::get_users_rel_segment_id] permission::grant -party_id $grantee_id -object_id $package_id -privilege "read" } } - # Make sure that privacy is turned on acs_privacy::privacy_control_set 1