Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -r1.75 -r1.76 --- openacs-4/packages/dotlrn/dotlrn.info 28 Apr 2002 18:53:15 -0000 1.75 +++ openacs-4/packages/dotlrn/dotlrn.info 6 May 2002 23:55:00 -0000 1.76 @@ -31,60 +31,60 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -151,15 +151,12 @@ - - - @@ -302,10 +299,8 @@ - - @@ -353,6 +348,8 @@ + + @@ -384,6 +381,8 @@ + + @@ -410,7 +409,7 @@ - + Index: openacs-4/packages/dotlrn/sql/oracle/admin-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admin-profile-provider-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admin-profile-provider-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,72 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Admins. +-- +-- @author yon@openforce.net +-- @version $Id: admin-profile-provider-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_owner_name => 'dotlrn_admin_profile_provider' + ); + + -- add the bindings to the method implementations + + -- name method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_operation_name => 'name', + impl_alias => 'dotlrn_admin_profile_provider::name', + impl_pl => 'TCL' + ); + + -- prettyName method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_operation_name => 'prettyName', + impl_alias => 'dotlrn_admin_profile_provider::prettyName', + impl_pl => 'TCL' + ); + + -- render method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_operation_name => 'render', + impl_alias => 'dotlrn_admin_profile_provider::render', + impl_pl => 'TCL' + ); + + -- bind this implementation to the interface it implements + acs_sc_binding.new( + contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/admin-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admin-profile-provider-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admin-profile-provider-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,66 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Admins. +-- +-- @author yon@openforce.net +-- @version $Id: admin-profile-provider-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- drop the binding between this implementation and the interface it + -- implements. + acs_sc_binding.delete( + contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider' + ); + + -- drop the bindings to the method implementations + + -- name method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_operation_name => 'name' + ); + + -- prettyName method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_operation_name => 'prettyName' + ); + + -- render method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider', + impl_operation_name => 'render' + ); + + -- drop the implementation + acs_sc_impl.delete( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_admin_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/admins-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admins-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admins-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,33 @@ +-- +-- 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 Admins package +-- +-- @author yon@openforce.net +-- @version $Id: admins-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_admin_profile_rels ( + rel_id constraint dotlrn_admin_p_rels_rel_id_fk + references dotlrn_user_profile_rels (rel_id) + constraint dotlrn_admin_profile_rels_pk + primary key +); + +@@ admin-profile-provider-create.sql +@@ admins-init.sql +@@ admins-package-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/admins-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admins-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admins-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,28 @@ +-- +-- 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 Admins package +-- +-- @author yon@openforce.net +-- @version $Id: admins-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +@@ admins-package-drop.sql +@@ admins-sanitize.sql +@@ admin-profile-provider-drop.sql + +drop table dotlrn_admin_profile_rels; Index: openacs-4/packages/dotlrn/sql/oracle/admins-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admins-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admins-init.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,82 @@ +-- +-- 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. +-- + +-- +-- Initialize the dotLRN Admins package +-- +-- @author yon@openforce.net +-- @version $Id: admins-init.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; + group_id integer; + dotlrn_users_group_id integer; +begin + + acs_rel_type.create_type( + rel_type => 'dotlrn_admin_profile_rel', + supertype => 'dotlrn_user_profile_rel', + pretty_name => 'dotLRN Profile Admin', + pretty_plural => 'dotLRN Profile Admins', + package_name => 'dotlrn_admin_profile_rel', + table_name => 'dotlrn_admin_profile_rels', + id_column => 'rel_id', + object_type_one => 'profiled_group', + role_one => null, + min_n_rels_one => 0, + max_n_rels_one => null, + object_type_two => 'user', + role_two => null, + min_n_rels_two => 0, + max_n_rels_two => 1 + ); + + select min(impl_id) + into foo + from acs_sc_impls + where impl_name = 'dotlrn_admin_profile_provider'; + + group_id := profiled_group.new( + profile_provider => foo, + group_name => 'dotLRN Admins' + ); + + insert + into dotlrn_user_types + (type, pretty_name, group_id) + values + ('admin', 'Staff', group_id); + + foo := rel_segment.new( + segment_name => 'dotLRN Admins', + group_id => group_id, + rel_type => 'dotlrn_admin_profile_rel' + ); + + select group_id + into dotlrn_users_group_id + from groups + where group_name = 'dotLRN Users'; + + foo := composition_rel.new( + object_id_one => dotlrn_users_group_id, + object_id_two => group_id + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/admins-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admins-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admins-package-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,112 @@ +-- +-- 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 Admin package +-- +-- @author yon@openforce.net +-- @version $Id: admins-package-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create or replace package dotlrn_admin_profile_rel +as + function new ( + rel_id in dotlrn_admin_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_admin_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_admin_profile_rels.rel_id%TYPE + ); + +end; +/ +show errors + +create or replace package body dotlrn_admin_profile_rel +as + function new ( + rel_id in dotlrn_admin_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_admin_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE + is + v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; + v_group_id groups.group_id%TYPE; + begin + if group_id is null then + select min(group_id) + into v_group_id + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_admin_profile_provider'); + else + v_group_id := group_id; + end if; + + v_rel_id := dotlrn_user_profile_rel.new( + rel_id => rel_id, + user_id => user_id, + portal_id => portal_id, + access_level => access_level, + theme_id => theme_id, + id => id, + rel_type => rel_type, + group_id => v_group_id, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_admin_profile_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_admin_profile_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_admin_profile_rels + where rel_id = dotlrn_admin_profile_rel.delete.rel_id; + + dotlrn_user_profile_rel.delete(rel_id); + end; + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/admins-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admins-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admins-package-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,24 @@ +-- +-- 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 Admins package +-- +-- @author yon@openforce.net +-- @version $Id: admins-package-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +drop package dotlrn_admin_profile_rel; Index: openacs-4/packages/dotlrn/sql/oracle/admins-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/admins-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/admins-sanitize.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,59 @@ +-- +-- 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 the dotLRN Admin package +-- +-- @author yon@openforce.net +-- @version $Id: admins-sanitize.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + select min(segment_id) + into foo + from rel_segments + where segment_name = 'dotLRN Admins'; + + rel_segment.delete( + segment_id => foo + ); + + select min(group_id) + into foo + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_admin_profile_provider'); + + delete + from dotlrn_user_types + where group_id = foo; + + profiled_group.delete( + group_id => foo + ); + + acs_rel_type.drop_type( + rel_type => 'dotlrn_admin_profile_rel', + cascade_p => 't' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/applet-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/applet-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/applet-sc-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,238 @@ +-- +-- 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 applet service contract +-- +-- copyright 2001, OpenForce, Inc. +-- distributed under the GNU GPL v2 +-- +-- for Oracle 8/8i. (We're guessing 9i works, too). +-- +-- ben@openforce.net, arjun@openforce.net +-- +-- started October 1st, 2001 +-- we remember September 11th +-- + +-- This is the service contract for dotLRN applets. A dotlrn applet MUST +-- have AT LEAST the procs (with the proper arguments) defined below to work +-- as a dotlrn applet. + +declare + sc_dotlrn_contract integer; + foo integer; +begin + sc_dotlrn_contract := acs_sc_contract.new ( + contract_name => 'dotlrn_applet', + contract_desc => 'dotLRN Applet contract' + ); + + -- Get a pretty name + foo := acs_sc_msg_type.new ( + msg_type_name => 'dotlrn_applet.GetPrettyName.InputType', + msg_type_spec => '' + ); + + foo := acs_sc_msg_type.new ( + msg_type_name => 'dotlrn_applet.GetPrettyName.OutputType', + msg_type_spec => 'pretty_name:string' + ); + + foo := acs_sc_operation.new ( + 'dotlrn_applet', + 'GetPrettyName', + 'Get the pretty name of the applet', + 't', -- not cacheable + 0, -- n_args + 'dotlrn_applet.GetPrettyName.InputType', + 'dotlrn_applet.GetPrettyName.OutputType' + ); + + -- Add the applet to dotlrn (used for one-time initialization) + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.AddApplet.InputType', + msg_type_spec => '' + ); + + 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 dotlrn - used for one-time initialization', + 'f', -- not cacheable + 0, -- n_args + 'dotlrn_applet.AddApplet.InputType', + 'dotlrn_applet.AddApplet.OutputType' + ); + + -- Add the applet to a community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.AddAppletToCommunity.InputType', + msg_type_spec => 'community_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.AddAppletToCommunity.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotlrn_applet', + 'AddAppletToCommunity', + 'Add the Applet to a specific dotlrn community', + 'f', -- not cacheable + 1, -- n_args + 'dotlrn_applet.AddAppletToCommunity.InputType', + 'dotlrn_applet.AddAppletToCommunity.OutputType' + ); + + -- add a user to dotlrn (used for user-specific one time stuff) + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.AddUser.InputType', + msg_type_spec => '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 dotlrn, used for user-specific one-time init', + 'f', -- not cacheable + 1, -- n_args + 'dotlrn_applet.AddUser.InputType', + 'dotlrn_applet.AddUser.OutputType' + ); + + + -- add a user to the a specfic dotlrn community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.AddUserToCommunity.InputType', + msg_type_spec => 'community_id:integer,user_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.AddUserToCommunity.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotlrn_applet', + 'AddUserToCommunity', + 'Add a user to a community', + 'f', -- not cacheable + 2, -- n_args + 'dotlrn_applet.AddUserToCommunity.InputType', + 'dotlrn_applet.AddUserToCommunity.OutputType' + ); + + -- remove a user from dotlrn + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.RemoveUser.InputType', + msg_type_spec => '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 dotlrn', + 'f', -- not cacheable + 1, -- n_args + 'dotlrn_applet.RemoveUser.InputType', + 'dotlrn_applet.RemoveUser.OutputType' + ); + + -- remove a user from the community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.RemoveUserFromCommunity.InputType', + msg_type_spec => 'community_id:integer,user_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.RemoveUserFromCommunity.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotlrn_applet', + 'RemoveUserFromCommunity', + 'Remove a user from a community, applet does appropriate cleanup', + 'f', -- not cacheable + 2, -- n_args + 'dotlrn_applet.RemoveUserFromCommunity.InputType', + 'dotlrn_applet.RemoveUserFromCommunity.OutputType' + ); + + -- remove the applet from dotlrn + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.RemoveApplet.InputType', + msg_type_spec => '' + ); + + 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 the applet', + 'f', -- not cacheable + 0, -- n_args + 'dotlrn_applet.RemoveApplet.InputType', + 'dotlrn_applet.RemoveApplet.OutputType' + ); + + -- remove the applet from a community + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.RemoveAppletFromCommunity.InputType', + msg_type_spec => 'community_id:integer,package_id:integer' + ); + + foo := acs_sc_msg_type.new( + msg_type_name => 'dotlrn_applet.RemoveAppletFromCommunity.OutputType', + msg_type_spec => 'success_p:boolean,error_message:string' + ); + + foo := acs_sc_operation.new ( + 'dotlrn_applet', + 'RemoveAppletFromCommunity', + 'Remove the applet from a given community', + 'f', -- not cacheable + 2, -- n_args + 'dotlrn_applet.RemoveAppletFromCommunity.InputType', + 'dotlrn_applet.RemoveAppletFromCommunity.OutputType' + ); + + + +end; +/ +show errors 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/classes-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,395 @@ +-- +-- 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 basic system +-- copyright 2001, OpenForce, inc. +-- distributed under the GNU GPL v2 +-- +-- 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 +-- @version $Id: classes-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_departments ( + department_key constraint dotlrn_departments_dept_key_fk + references dotlrn_community_types (community_type) + constraint dotlrn_departments_pk + primary key, + external_url varchar2(4000) +); + +create or replace view dotlrn_departments_full +as + select dotlrn_departments.department_key, + dotlrn_community_types.pretty_name, + dotlrn_community_types.description, + dotlrn_community_types.package_id, + dotlrn_community_types.supertype, + (select site_node.url(site_nodes.node_id) + from site_nodes + where site_nodes.object_id = dotlrn_community_types.package_id) as url, + dotlrn_departments.external_url + from dotlrn_departments, + dotlrn_community_types + where dotlrn_departments.department_key = dotlrn_community_types.community_type; + +create table dotlrn_terms ( + term_id integer + constraint dotlrn_terms_pk + primary key, + term_name varchar2(20) + constraint dotlrn_t_term_name_nn + not null, + term_year varchar2(4) + constraint dotlrn_t_term_year_nn + not null, + start_date date + default sysdate + constraint dotlrn_t_start_date_nn + not null, + end_date date + default (sysdate + 180) + constraint dotlrn_t_end_date_nn + not null +); + +create table dotlrn_classes ( + class_key constraint dotlrn_classes_class_key_fk + references dotlrn_community_types (community_type) + constraint dotlrn_classes_pk + primary key, + department_key constraint dotlrn_classes_dept_key_fk + references dotlrn_departments (department_key) + constraint dotlrn_classes_dept_key_nn + not null +); + +create or replace view dotlrn_classes_full +as + select dotlrn_classes.class_key, + dotlrn_community_types.pretty_name, + dotlrn_community_types.description, + dotlrn_community_types.package_id, + dotlrn_community_types.supertype, + (select site_node.url(site_nodes.node_id) + from site_nodes + where site_nodes.object_id = dotlrn_community_types.package_id) as url, + dotlrn_classes.department_key + from dotlrn_classes, + dotlrn_community_types + where dotlrn_classes.class_key = dotlrn_community_types.community_type; + +create table dotlrn_class_instances ( + class_instance_id constraint dotlrn_ci_class_instance_id_fk + references dotlrn_communities (community_id) + constraint dotlrn_class_instances_pk + primary key, + class_key constraint dotlrn_ci_class_key_fk + references dotlrn_classes (class_key) + constraint dotlrn_ci_class_key_nn + not null, + term_id constraint dotlrn_ci_term_id_fk + references dotlrn_terms (term_id) + constraint dotlrn_ci_term_id_nn + not null +); + +create or replace view dotlrn_class_instances_full +as + select dotlrn_class_instances.class_instance_id, + dotlrn_class_instances.class_key, + dotlrn_class_instances.term_id, + dotlrn_terms.term_name, + 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_community.url(dotlrn_communities.community_id) as url, + dotlrn_classes_full.pretty_name as class_name, + dotlrn_classes_full.url as class_url, + dotlrn_classes_full.department_key, + dotlrn_departments_full.pretty_name as department_name, + dotlrn_departments_full.url as department_url, + groups.join_policy + from dotlrn_communities, + dotlrn_class_instances, + dotlrn_terms, + dotlrn_classes_full, + dotlrn_departments_full, + groups + where dotlrn_communities.community_id = dotlrn_class_instances.class_instance_id + and dotlrn_class_instances.term_id = dotlrn_terms.term_id + and dotlrn_communities.community_type = dotlrn_classes_full.class_key + and dotlrn_classes_full.department_key = dotlrn_departments_full.department_key + and dotlrn_communities.community_id = groups.group_id; + +create or replace view dotlrn_class_instances_current +as + select * + from dotlrn_class_instances_full + where active_end_date >= sysdate + and active_start_date <= sysdate; + +create or replace view dotlrn_class_instances_not_old +as + select * + from dotlrn_class_instances_full + where active_end_date >= sysdate; + +create or replace package dotlrn_department +is + function new ( + department_key in dotlrn_departments.department_key%TYPE, + pretty_name in dotlrn_community_types.pretty_name%TYPE, + pretty_plural in acs_object_types.pretty_plural%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_departments.department_key%TYPE; + + procedure delete ( + department_key in dotlrn_departments.department_key%TYPE + ); +end; +/ +show errors + +create or replace package body dotlrn_department +is + function new ( + department_key in dotlrn_departments.department_key%TYPE, + pretty_name in dotlrn_community_types.pretty_name%TYPE, + pretty_plural in acs_object_types.pretty_plural%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_departments.department_key%TYPE + is + v_department_key dotlrn_departments.department_key%TYPE; + begin + v_department_key := dotlrn_community_type.new ( + community_type => department_key, + parent_type => 'dotlrn_class_instance', + pretty_name => pretty_name, + pretty_plural => pretty_plural, + description => description, + package_id => package_id, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert + into dotlrn_departments + (department_key) values (v_department_key); + + return v_department_key; + end; + + procedure delete ( + department_key in dotlrn_departments.department_key%TYPE + ) + is + begin + delete + from dotlrn_departments + where department_key = department_key; + + dotlrn_community_type.delete(department_key); + end; +end; +/ +show errors + +create or replace package dotlrn_class +is + function new ( + class_key in dotlrn_classes.class_key%TYPE, + department_key in dotlrn_departments.department_key%TYPE, + pretty_name in dotlrn_community_types.pretty_name%TYPE, + pretty_plural in acs_object_types.pretty_plural%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_classes.class_key%TYPE; + + procedure delete ( + class_key in dotlrn_classes.class_key%TYPE + ); +end; +/ +show errors + +create or replace package body dotlrn_class +is + function new ( + class_key in dotlrn_classes.class_key%TYPE, + department_key in dotlrn_departments.department_key%TYPE, + pretty_name in dotlrn_community_types.pretty_name%TYPE, + pretty_plural in acs_object_types.pretty_plural%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_classes.class_key%TYPE + is + v_class_key dotlrn_classes.class_key%TYPE; + begin + v_class_key := dotlrn_community_type.new ( + community_type => class_key, + parent_type => department_key, + pretty_name => pretty_name, + pretty_plural => pretty_plural, + description => description, + package_id => package_id, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert + into dotlrn_classes + (class_key, department_key) values (v_class_key, department_key); + + return v_class_key; + end; + + procedure delete ( + class_key in dotlrn_classes.class_key%TYPE + ) + is + begin + delete + from dotlrn_classes + where class_key = class_key; + + dotlrn_community_type.delete(class_key); + end; +end; +/ +show errors + +create or replace package dotlrn_class_instance +is + function new ( + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE default null, + class_key in dotlrn_class_instances.class_key%TYPE, + term_id in dotlrn_class_instances.term_id%TYPE, + community_key in dotlrn_communities.community_key%TYPE, + pretty_name in dotlrn_communities.pretty_name%TYPE, + description in dotlrn_communities.description%TYPE, + package_id in dotlrn_communities.package_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities.non_member_portal_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_class_instances.class_instance_id%TYPE; + + procedure delete ( + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE + ); +end; +/ +show errors + +create or replace package body dotlrn_class_instance +is + function new ( + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE default null, + class_key in dotlrn_class_instances.class_key%TYPE, + term_id in dotlrn_class_instances.term_id%TYPE, + community_key in dotlrn_communities.community_key%TYPE, + pretty_name in dotlrn_communities.pretty_name%TYPE, + description in dotlrn_communities.description%TYPE, + package_id in dotlrn_communities.package_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities.non_member_portal_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_class_instances.class_instance_id%TYPE + is + v_class_instance_id dotlrn_class_instances.class_instance_id%TYPE; + begin + v_class_instance_id := dotlrn_community.new ( + community_id => class_instance_id, + community_type => class_key, + community_key => community_key, + pretty_name => pretty_name, + description => description, + package_id => package_id, + portal_id => portal_id, + non_member_portal_id => non_member_portal_id, + join_policy => join_policy, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert + into dotlrn_class_instances + (class_instance_id, class_key, term_id) + values + (v_class_instance_id, class_key, term_id); + + return v_class_instance_id; + end; + + procedure delete ( + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE + ) + is + begin + delete + from dotlrn_class_instances + where class_instance_id= class_instance_id; + + dotlrn_community.delete(community_id => class_instance_id); + end; +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/classes-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/classes-memberships-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/classes-memberships-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,195 @@ +-- +-- 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. +-- + +-- Membership stuff for classes +-- ben@openforce + +-- +-- For Classes +-- + +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 + foo integer; +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/clubs-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/clubs-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/clubs-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,137 @@ +-- +-- 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 basic system +-- copyright 2001, OpenForce, Inc. +-- distributed under the GNU GPL v2 +-- +-- 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: clubs-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_clubs ( + club_id constraint dotlrn_clubs_club_id_fk + references dotlrn_communities (community_id) + constraint dotlrn_clubs_pk + primary key +); + +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_community.url(dotlrn_communities.community_id) as url, + groups.join_policy + from dotlrn_communities, + dotlrn_clubs, + groups + where dotlrn_communities.community_id = dotlrn_clubs.club_id + and dotlrn_communities.community_id = groups.group_id; + +create or replace package dotlrn_club +is + function new ( + club_id in dotlrn_clubs.club_id%TYPE default null, + community_key in dotlrn_communities.community_key%TYPE, + pretty_name in dotlrn_communities.pretty_name%TYPE, + description in dotlrn_communities.description%TYPE, + package_id in dotlrn_communities.package_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities.non_member_portal_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_clubs.club_id%TYPE; + + procedure delete ( + club_id in dotlrn_clubs.club_id%TYPE + ); +end; +/ +show errors + +create or replace package body dotlrn_club +is + function new ( + club_id in dotlrn_clubs.club_id%TYPE default null, + community_key in dotlrn_communities.community_key%TYPE, + pretty_name in dotlrn_communities.pretty_name%TYPE, + description in dotlrn_communities.description%TYPE, + package_id in dotlrn_communities.package_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities.non_member_portal_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_clubs.club_id%TYPE + is + v_club_id integer; + begin + v_club_id := dotlrn_community.new( + community_id => club_id, + community_type => 'dotlrn_club', + community_key => community_key, + pretty_name => pretty_name, + description => description, + package_id => package_id, + portal_id => portal_id, + non_member_portal_id => non_member_portal_id, + join_policy => join_policy, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert + into dotlrn_clubs (club_id) + values (v_club_id); + + return v_club_id; + end; + + procedure delete ( + club_id in dotlrn_clubs.club_id%TYPE + ) + is + begin + delete + from dotlrn_clubs + where club_id = dotlrn_club.delete.club_id; + + dotlrn_community.delete(community_id => club_id); + end; +end; +/ +show errors 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/communities-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,142 @@ +-- +-- 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 communities construct +-- +-- 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) +-- @creation-date September 20th, 2001 (redone) +-- @version $Id: communities-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_community_types ( + community_type constraint dotlrn_ct_community_type_fk + references group_types (group_type) + constraint dotlrn_community_types_pk + primary key, + 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) +); + +create table dotlrn_communities ( + community_id constraint dotlrn_c_community_id_fk + references groups (group_id) + constraint dotlrn_communities_pk + primary key, + parent_community_id constraint dotlrn_c_parent_comm_id_fk + references dotlrn_communities (community_id), + community_type not null + constraint dotlrn_c_community_type_fk + references dotlrn_community_types (community_type), + community_key varchar2(100) + constraint dotlrn_c_community_key_nn + not null, + pretty_name varchar2(100) + constraint dotlrn_c_pretty_name_nn + not null, + description varchar2(4000), + active_start_date date, + active_end_date date, + portal_id constraint dotlrn_c_portal_id_fk + references portals (portal_id), + non_member_portal_id constraint dotlrn_c_non_member_portal_fk + references portals (portal_id), + admin_portal_id constraint dotlrn_c_admin_portal_id_fk + references portals (portal_id), + package_id constraint dotlrn_c_package_id_fk + references apm_packages (package_id), + -- We can't have two communities with the same parent with the same key (url) + -- even if the parent_community_id is null, which it will be for non-subcommunities + constraint dotlrn_c_community_key_un + unique (community_key, parent_community_id) +); + +create or replace view dotlrn_communities_not_closed +as + select dotlrn_communities.*, + groups.join_policy + from dotlrn_communities, + groups + where dotlrn_communities.community_id = groups.group_id + and groups.join_policy <> 'closed'; + +create or replace view dotlrn_active_communities +as + select * + from dotlrn_communities + where (active_start_date is null or active_start_date < sysdate) + and (active_end_date is null or active_end_date > sysdate); + +create or replace view dotlrn_active_comms_not_closed +as + select dotlrn_communities.*, + groups.join_policy + from dotlrn_active_communities dotlrn_communities, + groups + where dotlrn_communities.community_id = groups.group_id + and groups.join_policy <> 'closed'; + +create table dotlrn_applets ( + applet_id integer + constraint dotlrn_applets_applet_id_nn + not null + constraint dotlrn_applets_applet_pk + primary key, + applet_key varchar(100) + constraint dotlrn_applets_applet_key_nn + not null + constraint dotlrn_applets_applet_key_uk + unique, + status char(10) + default 'active' + constraint dotlrn_applets_status_nn + not null + constraint dotlrn_applets_status_ck + check (status in ('active','inactive')) +); + +create table dotlrn_community_applets ( + community_id integer + constraint dotlrn_ca_community_id_nn + not null + constraint dotlrn_ca_community_id_fk + references dotlrn_communities (community_id), + applet_id integer + constraint dotlrn_ca_applet_key_nn + not null + references dotlrn_applets (applet_id), + constraint dotlrn_community_applets_pk primary key (community_id, applet_id), + -- this is the package_id of the package this applet represents + package_id integer, + active_p char(1) + default 't' + constraint dotlrn_ca_active_p_nn + not null + constraint dotlrn_ca_active_p_ck + check (active_p in ('t','f')) +); 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/communities-package-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,360 @@ +-- +-- 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.community_id%TYPE default null, + parent_community_id in dotlrn_communities.parent_community_id%TYPE default null, + community_type in dotlrn_communities.community_type%TYPE, + community_key in dotlrn_communities.community_key%TYPE, + pretty_name in dotlrn_communities.pretty_name%TYPE, + description in dotlrn_communities.description%TYPE, + portal_id in dotlrn_communities.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities.non_member_portal_id%TYPE default null, + package_id in dotlrn_communities.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.community_id%TYPE; + + procedure set_active_dates ( + community_id in dotlrn_communities.community_id%TYPE, + start_date in dotlrn_communities.active_start_date%TYPE, + end_date in dotlrn_communities.active_end_date%TYPE + ); + + procedure delete ( + community_id in dotlrn_communities.community_id%TYPE + ); + + function name ( + community_id in dotlrn_communities.community_id%TYPE + ) return varchar; + + function member_p ( + community_id in dotlrn_communities.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char; + + function admin_p ( + community_id in dotlrn_communities.community_id%TYPE, + party_id in parties.party_id%TYPE + ) return char; + + function url ( + community_id in dotlrn_communities.community_id%TYPE + ) return varchar2; + + function has_subcomm_p ( + community_id in dotlrn_communities.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.community_id%TYPE default null, + parent_community_id in dotlrn_communities.parent_community_id%TYPE default null, + community_type in dotlrn_communities.community_type%TYPE, + community_key in dotlrn_communities.community_key%TYPE, + pretty_name in dotlrn_communities.pretty_name%TYPE, + description in dotlrn_communities.description%TYPE, + portal_id in dotlrn_communities.portal_id%TYPE default null, + non_member_portal_id in dotlrn_communities.non_member_portal_id%TYPE default null, + package_id in dotlrn_communities.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.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 + (community_id, + parent_community_id, + community_type, + community_key, + pretty_name, + description, + package_id, + 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.portal_id, + dotlrn_community.new.non_member_portal_id); + + return c_id; + end; + + procedure set_active_dates ( + community_id in dotlrn_communities.community_id%TYPE, + start_date in dotlrn_communities.active_start_date%TYPE, + end_date in dotlrn_communities.active_end_date%TYPE + ) + is + begin + update dotlrn_communities + set active_start_date = dotlrn_community.set_active_dates.start_date, + active_end_date = dotlrn_community.set_active_dates.end_date + where dotlrn_communities.community_id = dotlrn_community.set_active_dates.community_id; + end; + + procedure delete ( + community_id in dotlrn_communities.community_id%TYPE + ) + is + begin + delete + from dotlrn_communities + where dotlrn_communities.community_id = dotlrn_community.delete.community_id; + + acs_group.delete(dotlrn_community.delete.community_id); + end; + + function name ( + community_id in dotlrn_communities.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.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.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.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, + site_nodes + where dotlrn_communities.community_id = dotlrn_community.url.community_id + and site_nodes.object_id = dotlrn_communities.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.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 + where dotlrn_communities.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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql 6 May 2002 23:55:01 -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 communities membership constructs +-- +-- for Oracle 8/8i. (We're guessing 9i works, too). +-- +-- @author Ben Adida (ben@openforce.net) +-- @author yon (yon@openforce.net) +-- @creation-date November 6th, 2001 +-- @version $Id: community-memberships-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_member_rels ( + rel_id constraint dotlrn_member_rels_rel_id_fk + references membership_rels (rel_id) + constraint dotlrn_member_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_member_rels_full +as + select acs_rels.rel_id as rel_id, + acs_rels.object_id_one as community_id, + acs_rels.object_id_two as user_id, + acs_rels.rel_type, + (select acs_rel_roles.pretty_name + from acs_rel_roles + where acs_rel_roles.role = (select acs_rel_types.role_two + from acs_rel_types + where acs_rel_types.rel_type = acs_rels.rel_type)) as role, + membership_rels.member_state + from dotlrn_member_rels, + acs_rels, + membership_rels + where dotlrn_member_rels.rel_id = acs_rels.rel_id + and acs_rels.rel_id = membership_rels.rel_id; + +create or replace view dotlrn_member_rels_approved +as + select * + from dotlrn_member_rels_full + where member_state = 'approved'; + +create table dotlrn_admin_rels ( + rel_id constraint dotlrn_admin_rels_rel_id_fk + references dotlrn_member_rels (rel_id) + constraint dotlrn_admin_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_admin_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_admin_rels + where dotlrn_member_rels_full.rel_id = dotlrn_admin_rels.rel_id; 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-packages-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,526 @@ +-- +-- 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 memberships packages +-- +-- for Oracle 8/8i. (We're guessing 9i works, too). +-- +-- ben@openforce.net +-- started November 6th, 2001 +-- + +-- +-- Basic dotLRN membership rel +-- + +create or replace package dotlrn_member_rel +is + + function new ( + rel_id in dotlrn_member_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_member_rel', + community_id in dotlrn_communities.community_id%TYPE, + user_id in users.user_id%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 dotlrn_member_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_member_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_member_rel +is + + function new ( + rel_id in dotlrn_member_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_member_rel', + community_id in dotlrn_communities.community_id%TYPE, + user_id in users.user_id%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 dotlrn_member_rels.rel_id%TYPE + is + v_rel_id membership_rels.rel_id%TYPE; + begin + v_rel_id:= membership_rel.new( + rel_id => rel_id, + rel_type => rel_type, + object_id_one => community_id, + object_id_two => user_id, + member_state => dotlrn_member_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_member_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_member_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_member_rels + where rel_id = dotlrn_member_rel.delete.rel_id; + + membership_rel.delete(rel_id); + end; + +end; +/ +show errors; + +create or replace package dotlrn_admin_rel +is + + function new ( + rel_id in dotlrn_admin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_admin_rel', + community_id in dotlrn_communities.community_id%TYPE, + user_id in users.user_id%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 dotlrn_admin_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_admin_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_admin_rel +is + + function new ( + rel_id in dotlrn_admin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_admin_rel', + community_id in dotlrn_communities.community_id%TYPE, + user_id in users.user_id%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 dotlrn_admin_rels.rel_id%TYPE + is + v_rel_id dotlrn_admin_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_member_rel.new( + rel_id => rel_id, + rel_type => rel_type, + community_id => community_id, + user_id => user_id, + member_state => dotlrn_admin_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_admin_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_admin_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_admin_rels + where rel_id = dotlrn_admin_rel.delete.rel_id; + + dotlrn_member_rel.delete(rel_id); + end; + +end; +/ +show errors; + +create or replace package dotlrn_student_rel +is + + function new ( + rel_id in dotlrn_student_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_student_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_student_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_student_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_student_rel +is + + function new ( + rel_id in dotlrn_student_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_student_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_student_rels.rel_id%TYPE + is + v_rel_id dotlrn_student_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_member_rel.new( + rel_id => rel_id, + rel_type => rel_type, + community_id => class_instance_id, + user_id => user_id, + member_state => dotlrn_student_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_student_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_student_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_student_rels + where rel_id = dotlrn_student_rel.delete.rel_id; + + dotlrn_member_rel.delete(rel_id); + end; + +end; +/ +show errors; + +create or replace package dotlrn_ta_rel +is + + function new ( + rel_id in dotlrn_ta_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_ta_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_ta_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_ta_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_ta_rel +is + + function new ( + rel_id in dotlrn_ta_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_ta_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_ta_rels.rel_id%TYPE + is + v_rel_id dotlrn_ta_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_admin_rel.new( + rel_id => rel_id, + rel_type => rel_type, + community_id => class_instance_id, + user_id => user_id, + member_state => dotlrn_ta_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_ta_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_ta_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_ta_rels + where rel_id = dotlrn_ta_rel.delete.rel_id; + + dotlrn_admin_rel.delete(rel_id); + end; + +end; +/ +show errors; + +create or replace package dotlrn_ca_rel +is + + function new ( + rel_id in dotlrn_ca_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_ca_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_ca_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_ca_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_ca_rel +is + + function new ( + rel_id in dotlrn_ca_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_ca_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_ca_rels.rel_id%TYPE + is + v_rel_id dotlrn_ca_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_admin_rel.new( + rel_id => rel_id, + rel_type => rel_type, + community_id => class_instance_id, + user_id => user_id, + member_state => dotlrn_ca_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_ca_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_ca_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_ca_rels + where rel_id = dotlrn_ca_rel.delete.rel_id; + + dotlrn_admin_rel.delete(rel_id); + end; + +end; +/ +show errors; + +create or replace package dotlrn_cadmin_rel +is + + function new ( + rel_id in dotlrn_cadmin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_cadmin_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_cadmin_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_cadmin_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_cadmin_rel +is + + function new ( + rel_id in dotlrn_cadmin_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_cadmin_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_cadmin_rels.rel_id%TYPE + is + v_rel_id dotlrn_cadmin_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_admin_rel.new( + rel_id => rel_id, + rel_type => rel_type, + community_id => class_instance_id, + user_id => user_id, + member_state => dotlrn_cadmin_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_cadmin_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_cadmin_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_cadmin_rels + where rel_id = dotlrn_cadmin_rel.delete.rel_id; + + dotlrn_admin_rel.delete(rel_id); + end; + +end; +/ +show errors; + +create or replace package dotlrn_instructor_rel +is + + function new ( + rel_id in dotlrn_instructor_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_instructor_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_instructor_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_instructor_rels.rel_id%TYPE + ); + +end; +/ +show errors; + +create or replace package body dotlrn_instructor_rel +is + + function new ( + rel_id in dotlrn_instructor_rels.rel_id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_instructor_rel', + class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, + user_id in users.user_id%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 dotlrn_instructor_rels.rel_id%TYPE + is + v_rel_id dotlrn_instructor_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_admin_rel.new( + rel_id => rel_id, + rel_type => rel_type, + community_id => class_instance_id, + user_id => user_id, + member_state => dotlrn_instructor_rel.new.member_state, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_instructor_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_instructor_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_instructor_rels + where rel_id = dotlrn_instructor_rel.delete.rel_id; + + dotlrn_admin_rel.delete(rel_id); + end; + +end; +/ +show errors; Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admin-profile-provider-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admin-profile-provider-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admins-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admins-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admins-init.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admins-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admins-package-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-admins-sanitize.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.12 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.19 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-memberships-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-clubs-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.38 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.13 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.12 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-packages-create.sql'. Fisheye: No comparison available. Pass `N' to diff? 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.13 -r1.14 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 1 Apr 2002 07:33:04 -0000 1.13 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 6 May 2002 23:55:01 -0000 1.14 @@ -25,16 +25,16 @@ -- started August 18th, 2001 -- -@dotlrn-users-create.sql -@dotlrn-communities-create.sql -@dotlrn-community-memberships-create.sql -@dotlrn-communities-package-create.sql -@dotlrn-init.sql -@dotlrn-clubs-create.sql -@dotlrn-classes-create.sql -@dotlrn-classes-memberships-create.sql -@dotlrn-applet-sc-create.sql -@dotlrn-community-memberships-packages-create.sql -@dotlrn-main-portlet-create.sql -@dotlrn-security-create.sql -@dotlrn-user-extension-create.sql +@@ users-create.sql +@@ communities-create.sql +@@ community-memberships-create.sql +@@ communities-package-create.sql +@@ dotlrn-init.sql +@@ clubs-create.sql +@@ classes-create.sql +@@ classes-memberships-create.sql +@@ applet-sc-create.sql +@@ community-memberships-packages-create.sql +@@ main-portlet-create.sql +@@ security-create.sql +@@ user-extension-create.sql Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-external-profile-provider-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-external-profile-provider-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-externals-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-externals-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-externals-init.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-externals-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-externals-package-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-externals-sanitize.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.11 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-main-portlet-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-main-portlet-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professor-profile-provider-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professor-profile-provider-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professors-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professors-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professors-init.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professors-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professors-package-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-professors-sanitize.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-security-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-student-profile-provider-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-student-profile-provider-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-students-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-students-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-students-init.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-students-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-students-package-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-students-sanitize.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-user-extension-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-user-profile-provider-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-user-profile-provider-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.15 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-init.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-drop.sql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-sanitize.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/sql/oracle/external-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/external-profile-provider-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/external-profile-provider-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,72 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Externals. +-- +-- @author yon@openforce.net +-- @version $Id: external-profile-provider-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_owner_name => 'dotlrn_external_profile_provider' + ); + + -- add the bindings to the method implementations + + -- name method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_operation_name => 'name', + impl_alias => 'dotlrn_external_profile_provider::name', + impl_pl => 'TCL' + ); + + -- prettyName method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_operation_name => 'prettyName', + impl_alias => 'dotlrn_external_profile_provider::prettyName', + impl_pl => 'TCL' + ); + + -- render method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_operation_name => 'render', + impl_alias => 'dotlrn_external_profile_provider::render', + impl_pl => 'TCL' + ); + + -- bind this implementation to the interface it implements + acs_sc_binding.new( + contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/external-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/external-profile-provider-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/external-profile-provider-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,66 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Externals. +-- +-- @author yon@openforce.net +-- @version $Id: external-profile-provider-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- drop the binding between this implementation and the interface it + -- implements. + acs_sc_binding.delete( + contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider' + ); + + -- drop the bindings to the method implementations + + -- name method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_operation_name => 'name' + ); + + -- prettyName method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_operation_name => 'prettyName' + ); + + -- render method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider', + impl_operation_name => 'render' + ); + + -- drop the implementation + acs_sc_impl.delete( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_external_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/externals-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/externals-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/externals-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,33 @@ +-- +-- 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 Externals package +-- +-- @author yon@openforce.net +-- @version $Id: externals-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_external_profile_rels ( + rel_id constraint dotlrn_external_p_rels_rel_fk + references dotlrn_user_profile_rels (rel_id) + constraint dotlrn_external_p_rels_pk + primary key +); + +@@ external-profile-provider-create.sql +@@ externals-init.sql +@@ externals-package-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/externals-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/externals-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/externals-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,28 @@ +-- +-- 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 Externals package +-- +-- @author yon@openforce.net +-- @version $Id: externals-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +@@ externals-package-drop.sql +@@ externals-sanitize.sql +@@ external-profile-provider-drop.sql + +drop table dotlrn_external_profile_rels; Index: openacs-4/packages/dotlrn/sql/oracle/externals-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/externals-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/externals-init.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,82 @@ +-- +-- 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. +-- + +-- +-- Initialize the dotLRN Externals package +-- +-- @author yon@openforce.net +-- @version $Id: externals-init.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; + group_id integer; + dotlrn_users_group_id integer; +begin + + acs_rel_type.create_type( + rel_type => 'dotlrn_external_profile_rel', + supertype => 'dotlrn_user_profile_rel', + pretty_name => 'dotLRN Profile External', + pretty_plural => 'dotLRN Profile Externals', + package_name => 'dotlrn_external_profile_rel', + table_name => 'dotlrn_external_profile_rels', + id_column => 'rel_id', + object_type_one => 'profiled_group', + role_one => null, + min_n_rels_one => 0, + max_n_rels_one => null, + object_type_two => 'user', + role_two => null, + min_n_rels_two => 0, + max_n_rels_two => 1 + ); + + select min(impl_id) + into foo + from acs_sc_impls + where impl_name = 'dotlrn_external_profile_provider'; + + group_id := profiled_group.new( + profile_provider => foo, + group_name => 'dotLRN Externals' + ); + + insert + into dotlrn_user_types + (type, pretty_name, group_id) + values + ('external', 'External', group_id); + + foo := rel_segment.new( + segment_name => 'dotLRN Externals', + group_id => group_id, + rel_type => 'dotlrn_external_profile_rel' + ); + + select group_id + into dotlrn_users_group_id + from groups + where group_name = 'dotLRN Users'; + + foo := composition_rel.new( + object_id_one => dotlrn_users_group_id, + object_id_two => group_id + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/externals-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/externals-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/externals-package-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,112 @@ +-- +-- 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 External package +-- +-- @author yon@openforce.net +-- @version $Id: externals-package-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create or replace package dotlrn_external_profile_rel +as + function new ( + rel_id in dotlrn_external_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_external_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_external_profile_rels.rel_id%TYPE + ); + +end; +/ +show errors + +create or replace package body dotlrn_external_profile_rel +as + function new ( + rel_id in dotlrn_external_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_external_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE + is + v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; + v_group_id groups.group_id%TYPE; + begin + if group_id is null then + select min(group_id) + into v_group_id + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_external_profile_provider'); + else + v_group_id := group_id; + end if; + + v_rel_id := dotlrn_user_profile_rel.new( + rel_id => rel_id, + user_id => user_id, + portal_id => portal_id, + access_level => access_level, + theme_id => theme_id, + id => id, + rel_type => rel_type, + group_id => v_group_id, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_external_profile_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_external_profile_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_external_profile_rels + where rel_id = dotlrn_external_profile_rel.delete.rel_id; + + dotlrn_user_profile_rel.delete(rel_id); + end; + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/externals-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/externals-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/externals-package-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,24 @@ +-- +-- 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 Externals package +-- +-- @author yon@openforce.net +-- @version $Id: externals-package-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +drop package dotlrn_external_profile_rel; Index: openacs-4/packages/dotlrn/sql/oracle/externals-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/externals-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/externals-sanitize.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,59 @@ +-- +-- 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 the dotLRN External package +-- +-- @author yon@openforce.net +-- @version $Id: externals-sanitize.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + select min(segment_id) + into foo + from rel_segments + where segment_name = 'dotLRN Externals'; + + rel_segment.delete( + segment_id => foo + ); + + select min(group_id) + into foo + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_external_profile_provider'); + + delete + from dotlrn_user_types + where group_id = foo; + + profiled_group.delete( + group_id => foo + ); + + acs_rel_type.drop_type( + rel_type => 'dotlrn_external_profile_rel', + cascade_p => 't' + ); + +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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/main-portlet-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,184 @@ +-- +-- 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. +-- + +-- +-- packages/dotlrn/sql/oracle/dotlrn-main-portlet-create.sql +-- + +-- Creates a dotLRN datasource for including on a user's main portal page. + +-- Copyright (C) 2001 OpenForce, Inc. +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-11-05 + +-- $Id: main-portlet-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource.new( + name => 'dotlrn_main_portlet', + description => 'Displays the list of communities a user belongs to' + ); + + -- the standard 4 params + + -- 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' +); + + -- 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' +); + + -- 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 + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'portal_datasource', + 'dotlrn_main_portlet', + 'dotlrn_main_portlet' + ); + +end; +/ +show errors + +declare + foo integer; +begin + + -- add all the hooks + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_main_portlet', + 'MyName', + 'dotlrn_main_portlet::my_name', + '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 ( + 'portal_datasource', + 'dotlrn_main_portlet', + 'Link', + 'dotlrn_main_portlet::link', + '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 ( + 'portal_datasource', + 'dotlrn_main_portlet', + 'Show', + 'dotlrn_main_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_main_portlet', + 'Edit', + 'dotlrn_main_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'dotlrn_main_portlet', + 'RemoveSelfFromPage', + 'dotlrn_main_portlet::remove_self_from_page', + 'TCL' + ); + + +end; +/ +show errors + +declare + foo integer; +begin + + -- 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/main-portlet-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,49 @@ +-- +-- 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. +-- + + +-- Drops dotLRN main portlet datasources for portal portlets + +-- Copyright (C) 2001 Openforce, Inc. +-- @author Ben Adida (ben@openforce.net) +-- @creation-date 2001-11-04 + +-- $Id: main-portlet-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +declare + ds_id portal_datasources.datasource_id%TYPE; +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; + + if ds_id is not null then + portal_datasource.delete(ds_id); + end if; + +end; +/ +show errors; + Index: openacs-4/packages/dotlrn/sql/oracle/professor-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professor-profile-provider-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professor-profile-provider-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,72 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Professors. +-- +-- @author yon@openforce.net +-- @version $Id: professor-profile-provider-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_owner_name => 'dotlrn_professor_profile_provider' + ); + + -- add the bindings to the method implementations + + -- name method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_operation_name => 'name', + impl_alias => 'dotlrn_professor_profile_provider::name', + impl_pl => 'TCL' + ); + + -- prettyName method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_operation_name => 'prettyName', + impl_alias => 'dotlrn_professor_profile_provider::prettyName', + impl_pl => 'TCL' + ); + + -- render method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_operation_name => 'render', + impl_alias => 'dotlrn_professor_profile_provider::render', + impl_pl => 'TCL' + ); + + -- bind this implementation to the interface it implements + acs_sc_binding.new( + contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/professor-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professor-profile-provider-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professor-profile-provider-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,66 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Professors. +-- +-- @author yon@openforce.net +-- @version $Id: professor-profile-provider-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- drop the binding between this implementation and the interface it + -- implements. + acs_sc_binding.delete( + contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider' + ); + + -- drop the bindings to the method implementations + + -- name method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_operation_name => 'name' + ); + + -- prettyName method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_operation_name => 'prettyName' + ); + + -- render method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider', + impl_operation_name => 'render' + ); + + -- drop the implementation + acs_sc_impl.delete( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_professor_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/professors-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professors-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professors-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,33 @@ +-- +-- 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 Professors package +-- +-- @author yon@openforce.net +-- @version $Id: professors-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_professor_profile_rels ( + rel_id constraint dotlrn_professor_p_rels_rel_fk + references dotlrn_user_profile_rels (rel_id) + constraint dotlrn_professor_p_rels_pk + primary key +); + +@@ professor-profile-provider-create.sql +@@ professors-init.sql +@@ professors-package-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/professors-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professors-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professors-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,28 @@ +-- +-- 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 Professors package +-- +-- @author yon@openforce.net +-- @version $Id: professors-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +@@ professors-package-drop.sql +@@ professors-sanitize.sql +@@ professor-profile-provider-drop.sql + +drop table dotlrn_professor_profile_rels; Index: openacs-4/packages/dotlrn/sql/oracle/professors-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professors-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professors-init.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,82 @@ +-- +-- 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. +-- + +-- +-- Initialize the dotLRN Professors package +-- +-- @author yon@openforce.net +-- @version $Id: professors-init.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; + group_id integer; + dotlrn_users_group_id integer; +begin + + acs_rel_type.create_type( + rel_type => 'dotlrn_professor_profile_rel', + supertype => 'dotlrn_user_profile_rel', + pretty_name => 'dotLRN Profile Professor', + pretty_plural => 'dotLRN Profile Professors', + package_name => 'dotlrn_professor_profile_rel', + table_name => 'dotlrn_professor_profile_rels', + id_column => 'rel_id', + object_type_one => 'profiled_group', + role_one => null, + min_n_rels_one => 0, + max_n_rels_one => null, + object_type_two => 'user', + role_two => null, + min_n_rels_two => 0, + max_n_rels_two => 1 + ); + + select min(impl_id) + into foo + from acs_sc_impls + where impl_name = 'dotlrn_professor_profile_provider'; + + group_id := profiled_group.new( + profile_provider => foo, + group_name => 'dotLRN Professors' + ); + + insert + into dotlrn_user_types + (type, pretty_name, group_id) + values + ('professor', 'Professor', group_id); + + foo := rel_segment.new( + segment_name => 'dotLRN Professors', + group_id => group_id, + rel_type => 'dotlrn_professor_profile_rel' + ); + + select group_id + into dotlrn_users_group_id + from groups + where group_name = 'dotLRN Users'; + + foo := composition_rel.new( + object_id_one => dotlrn_users_group_id, + object_id_two => group_id + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/professors-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professors-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professors-package-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,112 @@ +-- +-- 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 Professor package +-- +-- @author yon@openforce.net +-- @version $Id: professors-package-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create or replace package dotlrn_professor_profile_rel +as + function new ( + rel_id in dotlrn_professor_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_professor_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_professor_profile_rels.rel_id%TYPE + ); + +end; +/ +show errors + +create or replace package body dotlrn_professor_profile_rel +as + function new ( + rel_id in dotlrn_professor_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_professor_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE + is + v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; + v_group_id groups.group_id%TYPE; + begin + if group_id is null then + select min(group_id) + into v_group_id + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_professor_profile_provider'); + else + v_group_id := group_id; + end if; + + v_rel_id := dotlrn_user_profile_rel.new( + rel_id => rel_id, + user_id => user_id, + portal_id => portal_id, + access_level => access_level, + theme_id => theme_id, + id => id, + rel_type => rel_type, + group_id => v_group_id, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_professor_profile_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_professor_profile_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_professor_profile_rels + where rel_id = dotlrn_professor_profile_rel.delete.rel_id; + + dotlrn_user_profile_rel.delete(rel_id); + end; + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/professors-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professors-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professors-package-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,24 @@ +-- +-- 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 Professors package +-- +-- @author yon@openforce.net +-- @version $Id: professors-package-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +drop package dotlrn_professor_profile_rel; Index: openacs-4/packages/dotlrn/sql/oracle/professors-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/professors-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/professors-sanitize.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,59 @@ +-- +-- 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 the dotLRN Professor package +-- +-- @author yon@openforce.net +-- @version $Id: professors-sanitize.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + select min(segment_id) + into foo + from rel_segments + where segment_name = 'dotLRN Professors'; + + rel_segment.delete( + segment_id => foo + ); + + select min(group_id) + into foo + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_professor_profile_provider'); + + delete + from dotlrn_user_types + where group_id = foo; + + profiled_group.delete( + group_id => foo + ); + + acs_rel_type.drop_type( + rel_type => 'dotlrn_professor_profile_rel', + cascade_p => 't' + ); + +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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/security-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,78 @@ +-- +-- 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. +-- + + +-- +-- dotLRN Project +-- +-- copyright 2001, OpenForce +-- released under the GPL, v2.0 +-- +-- 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'); + + -- the ability to even view that a community exists + acs_privilege.create_privilege('dotlrn_view_community'); + + -- the ability to participate in a community + acs_privilege.create_privilege('dotlrn_edit_community'); + + -- the ability to admin a community + acs_privilege.create_privilege('dotlrn_admin_community'); + + -- the ability to create a community + acs_privilege.create_privilege('dotlrn_create_community'); + + -- the ability to even view a community type + acs_privilege.create_privilege('dotlrn_view_community_type'); + + -- 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'); + + -- Consistent permissions + acs_privilege.add_child('dotlrn_edit_community', 'dotlrn_view_community'); + acs_privilege.add_child('dotlrn_admin_community', 'dotlrn_edit_community'); + + -- 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'); + + -- no default permissions + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/student-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/student-profile-provider-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/student-profile-provider-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,72 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Students. +-- +-- @author yon@openforce.net +-- @version $Id: student-profile-provider-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_owner_name => 'dotlrn_student_profile_provider' + ); + + -- add the bindings to the method implementations + + -- name method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_operation_name => 'name', + impl_alias => 'dotlrn_student_profile_provider::name', + impl_pl => 'TCL' + ); + + -- prettyName method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_operation_name => 'prettyName', + impl_alias => 'dotlrn_student_profile_provider::prettyName', + impl_pl => 'TCL' + ); + + -- render method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_operation_name => 'render', + impl_alias => 'dotlrn_student_profile_provider::render', + impl_pl => 'TCL' + ); + + -- bind this implementation to the interface it implements + acs_sc_binding.new( + contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/student-profile-provider-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/student-profile-provider-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/student-profile-provider-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,66 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotLRN Students. +-- +-- @author yon@openforce.net +-- @version $Id: student-profile-provider-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- drop the binding between this implementation and the interface it + -- implements. + acs_sc_binding.delete( + contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider' + ); + + -- drop the bindings to the method implementations + + -- name method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_operation_name => 'name' + ); + + -- prettyName method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_operation_name => 'prettyName' + ); + + -- render method + foo := acs_sc_impl.delete_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider', + impl_operation_name => 'render' + ); + + -- drop the implementation + acs_sc_impl.delete( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_student_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/students-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/students-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/students-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,33 @@ +-- +-- 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 Students package +-- +-- @author yon@openforce.net +-- @version $Id: students-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_student_profile_rels ( + rel_id constraint dotlrn_student_p_rels_rel_fk + references dotlrn_user_profile_rels (rel_id) + constraint dotlrn_student_p_rels_pk + primary key +); + +@@ student-profile-provider-create.sql +@@ students-init.sql +@@ students-package-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/students-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/students-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/students-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,28 @@ +-- +-- 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 Students package +-- +-- @author yon@openforce.net +-- @version $Id: students-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +@@ students-package-drop.sql +@@ students-sanitize.sql +@@ student-profile-provider-drop.sql + +drop table dotlrn_student_profile_rels; Index: openacs-4/packages/dotlrn/sql/oracle/students-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/students-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/students-init.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,82 @@ +-- +-- 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. +-- + +-- +-- Initialize the dotLRN Students package +-- +-- @author yon@openforce.net +-- @version $Id: students-init.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; + group_id integer; + dotlrn_users_group_id integer; +begin + + acs_rel_type.create_type( + rel_type => 'dotlrn_student_profile_rel', + supertype => 'dotlrn_user_profile_rel', + pretty_name => 'dotLRN Profile Student', + pretty_plural => 'dotLRN Profile Students', + package_name => 'dotlrn_student_profile_rel', + table_name => 'dotlrn_student_profile_rels', + id_column => 'rel_id', + object_type_one => 'profiled_group', + role_one => null, + min_n_rels_one => 0, + max_n_rels_one => null, + object_type_two => 'user', + role_two => null, + min_n_rels_two => 0, + max_n_rels_two => 1 + ); + + select min(impl_id) + into foo + from acs_sc_impls + where impl_name = 'dotlrn_student_profile_provider'; + + group_id := profiled_group.new( + profile_provider => foo, + group_name => 'dotLRN Students' + ); + + insert + into dotlrn_user_types + (type, pretty_name, group_id) + values + ('student', 'Student', group_id); + + foo := rel_segment.new( + segment_name => 'dotLRN Students', + group_id => group_id, + rel_type => 'dotlrn_student_profile_rel' + ); + + select group_id + into dotlrn_users_group_id + from groups + where group_name = 'dotLRN Users'; + + foo := composition_rel.new( + object_id_one => dotlrn_users_group_id, + object_id_two => group_id + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/students-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/students-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/students-package-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,112 @@ +-- +-- 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 Student package +-- +-- @author yon@openforce.net +-- @version $Id: students-package-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create or replace package dotlrn_student_profile_rel +as + function new ( + rel_id in dotlrn_student_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_student_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_student_profile_rels.rel_id%TYPE + ); + +end; +/ +show errors + +create or replace package body dotlrn_student_profile_rel +as + function new ( + rel_id in dotlrn_student_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_student_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE + is + v_rel_id dotlrn_user_profile_rels.rel_id%TYPE; + v_group_id groups.group_id%TYPE; + begin + if group_id is null then + select min(group_id) + into v_group_id + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_student_profile_provider'); + else + v_group_id := group_id; + end if; + + v_rel_id := dotlrn_user_profile_rel.new( + rel_id => rel_id, + user_id => user_id, + portal_id => portal_id, + access_level => access_level, + theme_id => theme_id, + id => id, + rel_type => rel_type, + group_id => v_group_id, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_student_profile_rels + (rel_id) + values + (v_rel_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_student_profile_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_student_profile_rels + where rel_id = dotlrn_student_profile_rel.delete.rel_id; + + dotlrn_user_profile_rel.delete(rel_id); + end; + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/students-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/students-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/students-package-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,24 @@ +-- +-- 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 Students package +-- +-- @author yon@openforce.net +-- @version $Id: students-package-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +drop package dotlrn_student_profile_rel; Index: openacs-4/packages/dotlrn/sql/oracle/students-sanitize.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/students-sanitize.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/students-sanitize.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,59 @@ +-- +-- 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 the dotLRN Student package +-- +-- @author yon@openforce.net +-- @version $Id: students-sanitize.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + select min(segment_id) + into foo + from rel_segments + where segment_name = 'dotLRN Students'; + + rel_segment.delete( + segment_id => foo + ); + + select min(group_id) + into foo + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_student_profile_provider'); + + delete + from dotlrn_user_types + where group_id = foo; + + profiled_group.delete( + group_id => foo + ); + + acs_rel_type.drop_type( + rel_type => 'dotlrn_student_profile_rel', + cascade_p => 't' + ); + +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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/user-extension-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,94 @@ +-- +-- 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 + -- create the implementation + foo := acs_sc_impl.new ( + 'UserData', + 'dotlrn_user_extension', + 'dotlrn_user_extension' + ); + + -- add all the hooks + + -- 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', + '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', + 'UserDelete', + 'dotlrn_user_extension::user_delete', + 'TCL' + ); + + -- 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-profile-provider-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,72 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotlrn users. +-- +-- @author yon@openforce.net +-- @version $Id: user-profile-provider-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- create the implementation + foo := acs_sc_impl.new( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_owner_name => 'dotlrn_user_profile_provider' + ); + + -- add the bindings to the method implementations + + -- name method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_operation_name => 'name', + impl_alias => 'dotlrn_user_profile_provider::name', + impl_pl => 'TCL' + ); + + -- prettyName method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_operation_name => 'prettyName', + impl_alias => 'dotlrn_user_profile_provider::prettyName', + impl_pl => 'TCL' + ); + + -- render method + foo := acs_sc_impl.new_alias( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider', + impl_operation_name => 'render', + impl_alias => 'dotlrn_user_profile_provider::render', + impl_pl => 'TCL' + ); + + -- bind this implementation to the interface it implements + acs_sc_binding.new( + contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider' + ); + +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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/user-profile-provider-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,66 @@ +-- +-- 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. +-- + +-- +-- Implementation of the profile provider interface for dotlrn users. +-- +-- @author yon@openforce.net +-- @version $Id: user-profile-provider-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + -- drop the binding between this implementation and the interface it + -- implements. + acs_sc_binding.delete( + contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider' + ); + + -- 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' + ); + + -- 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' + ); + + -- drop the implementation + acs_sc_impl.delete( + impl_contract_name => 'profile_provider', + impl_name => 'dotlrn_user_profile_provider' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/users-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/users-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/users-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,94 @@ +-- +-- 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 Users package +-- +-- @author yon@openforce.net +-- @version $Id: users-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create table dotlrn_user_profile_rels ( + rel_id constraint dotlrn_user_p_rels_rel_id_fk + references user_profile_rels (rel_id) + constraint dotlrn_user_profile_rels_pk + primary key, + portal_id constraint dotlrn_user_p_rels_portal_fk + references portals (portal_id) + constraint dotlrn_user_p_rels_portal_nn + not null, + theme_id constraint dotlrn_user_p_rels_theme_id_fk + references portal_element_themes (theme_id), + access_level varchar(100) + constraint dotlrn_user_p_rels_access_ck + check (access_level in ('full', 'limited')) + constraint dotlrn_user_p_rels_access_nn + not null, + id varchar(100) +); + +create table dotlrn_user_types ( + type varchar(100) + constraint dotlrn_user_types_pk + primary key, + pretty_name varchar(200), + group_id constraint dotlrn_user_types_group_id_fk + references profiled_groups (group_id) + constraint dotlrn_user_types_group_id_nn + not null +); + +create or replace view dotlrn_users +as + select acs_rels.rel_id, + dotlrn_user_profile_rels.portal_id, + dotlrn_user_profile_rels.theme_id, + dotlrn_user_profile_rels.access_level, + dotlrn_user_profile_rels.id, + users.user_id, + persons.first_names, + persons.last_name, + parties.email, + dotlrn_user_types.type, + dotlrn_user_types.pretty_name as pretty_type, + dotlrn_user_types.group_id + from dotlrn_user_profile_rels, + dotlrn_user_types, + acs_rels, + parties, + users, + persons + where dotlrn_user_profile_rels.rel_id = acs_rels.rel_id + and acs_rels.object_id_one = dotlrn_user_types.group_id + and acs_rels.object_id_two = parties.party_id + and parties.party_id = users.user_id + and users.user_id = persons.person_id; + +@@ user-profile-provider-create.sql +@@ users-init.sql +@@ users-package-create.sql + +-- create administrators +@@ admins-create.sql + +-- create professors +@@ professors-create.sql + +-- create students +@@ students-create.sql + +-- create external users +@@ externals-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/users-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/users-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/users-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,43 @@ +-- +-- 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 User Profile package +-- +-- @author yon@openforce.net +-- @version $Id: users-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +-- drop external users +@@ externals-drop.sql + +-- drop students +@@ students-drop.sql + +-- drop professors +@@ professors-drop.sql + +-- drop admins +@@ admins-drop.sql + +@@ users-package-drop.sql +@@ users-sanitize.sql +@@ user-profile-provider-drop.sql + +drop view dotlrn_users; + +drop table dotlrn_user_types; +drop table dotlrn_user_profile_rels; Index: openacs-4/packages/dotlrn/sql/oracle/users-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/users-init.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/users-init.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,64 @@ +-- +-- 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. +-- + +-- +-- Initialize the User Profile package +-- +-- @author yon@openforce.net +-- @version $Id: users-init.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + acs_rel_type.create_type( + rel_type => 'dotlrn_user_profile_rel', + supertype => 'user_profile_rel', + pretty_name => 'dotLRN Profile User', + pretty_plural => 'dotLRN Profile Users', + package_name => 'dotlrn_user_profile_rel', + table_name => 'dotlrn_user_profile_rels', + id_column => 'rel_id', + object_type_one => 'profiled_group', + role_one => null, + min_n_rels_one => 0, + max_n_rels_one => null, + object_type_two => 'user', + role_two => null, + min_n_rels_two => 0, + max_n_rels_two => 1 + ); + + select min(impl_id) + into foo + from acs_sc_impls + where impl_name = 'dotlrn_user_profile_provider'; + + foo := profiled_group.new( + profile_provider => foo, + group_name => 'dotLRN Users' + ); + + foo := rel_segment.new( + segment_name => 'dotLRN Users', + group_id => foo, + rel_type => 'dotlrn_user_profile_rel' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/users-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/users-package-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/users-package-create.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,108 @@ +-- +-- 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 User Profile package +-- +-- @author yon@openforce.net +-- @version $Id: users-package-create.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +create or replace package dotlrn_user_profile_rel +as + function new ( + rel_id in dotlrn_user_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_user_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_user_profile_rels.rel_id%TYPE + ); + +end; +/ +show errors + +create or replace package body dotlrn_user_profile_rel +as + function new ( + rel_id in dotlrn_user_profile_rels.rel_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_user_profile_rels.portal_id%TYPE, + access_level in dotlrn_user_profile_rels.access_level%TYPE, + theme_id in dotlrn_user_profile_rels.theme_id%TYPE default null, + id in dotlrn_user_profile_rels.id%TYPE default null, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_user_profile_rel', + group_id in groups.group_id%TYPE default null, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_profile_rels.rel_id%TYPE + is + v_rel_id user_profile_rels.rel_id%TYPE; + v_group_id groups.group_id%TYPE; + begin + if group_id is null then + select min(group_id) + into v_group_id + from profiled_groups + where profile_provider = (select min(impl_id) + from acs_sc_impls + where impl_name = 'dotlrn_user_profile_provider'); + else + v_group_id := group_id; + end if; + + v_rel_id := user_profile_rel.new( + rel_id => rel_id, + rel_type => rel_type, + group_id => v_group_id, + user_id => user_id, + creation_user => creation_user, + creation_ip => creation_ip + ); + + insert + into dotlrn_user_profile_rels + (rel_id, portal_id, theme_id, access_level, id) + values + (v_rel_id, portal_id, theme_id, access_level, id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_user_profile_rels.rel_id%TYPE + ) + is + begin + delete + from dotlrn_user_profile_rels + where rel_id = dotlrn_user_profile_rel.delete.rel_id; + + user_profile_rel.delete(rel_id); + end; + +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/users-package-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/users-package-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/users-package-drop.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,24 @@ +-- +-- 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 User Profile package +-- +-- @author yon@openforce.net +-- @version $Id: users-package-drop.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +drop package dotlrn_user_profile_rel; 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/users-sanitize.sql 6 May 2002 23:55:01 -0000 1.1 @@ -0,0 +1,55 @@ +-- +-- 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 the User Profile package +-- +-- @author yon@openforce.net +-- @version $Id: users-sanitize.sql,v 1.1 2002/05/06 23:55:01 yon Exp $ +-- + +declare + foo integer; +begin + + select min(segment_id) + into foo + from rel_segments + where segment_name = 'dotLRN Users'; + + rel_segment.delete( + segment_id => foo + ); + + 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'); + + profiled_group.delete( + group_id => foo + ); + + acs_rel_type.drop_type( + rel_type => 'dotlrn_user_profile_rel', + cascade_p => 't' + ); + +end; +/ +show errors Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.110 -r1.111 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 4 May 2002 04:25:32 -0000 1.110 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 6 May 2002 23:55:02 -0000 1.111 @@ -54,20 +54,20 @@ -url $community_type_url_part \ -pretty_name $pretty_name \ -directory_p "t"] - + dotlrn_community::set_type_package_id $community_type $package_id - + ad_parameter -package_id $package_id -set 0 dotlrn_level_p ad_parameter -package_id $package_id -set 1 community_type_level_p ad_parameter -package_id $package_id -set 0 community_level_p - - # create a "dummy" community for this community - # type to get a portal template with all of the + + # create a "dummy" community for this community + # type to get a portal template with all of the # types portlets - aks dotlrn_community::new \ - -community_type $community_type \ - -pretty_name $pretty_name \ - -dummy_comm_p 1 + -community_type $community_type \ + -pretty_name $pretty_name \ + -dummy_comm_p 1 } } @@ -110,34 +110,37 @@ # Set the site node dotlrn_community::set_type_package_id $community_type_key $package_id - # since new_type is only called when creating a dept or a class, + # since new_type is only called when creating a dept or a class, # not a class instance, club, or subcomm, we just do this - dotlrn_community::set_type_template_id \ - -community_type $community_type_key \ - -template_id [get_type_template_id -community_type [dotlrn_class::community_type]] + dotlrn_community::set_type_portal_id \ + -community_type $community_type_key \ + -portal_id [get_type_portal_id -community_type [dotlrn_class::community_type] \ + ] } + return $community_type_key } - ad_proc -public get_type_template_id { + ad_proc -public get_type_portal_id { {-community_type:required} } { - Get the portal template id for this comm type + Get the portal_id for this community type } { - return [db_string get_community_type_template_id_select \ - "select portal_template_id - from dotlrn_community_types - where community_type = :community_type"] + return [db_string select_type_portal_id { + select portal_id + from dotlrn_community_types + where community_type = :community_type + }] } - ad_proc -public set_type_template_id { + ad_proc -public set_type_portal_id { {-community_type:required} - {-template_id:required} + {-portal_id:required} } { - set the portal template id for this comm type + set the portal_id for this community type } { - db_dml update_template_id {} + db_dml set_type_portal_id {} } ad_proc -public set_type_package_id { @@ -146,7 +149,6 @@ } { Update the package ID for the community type } { - # Exec the statement, easy db_dml update_package_id {} } @@ -171,12 +173,13 @@ } { is this a dummy comm? } { - return [db_0or1row select_node_id " - select 1 from dotlrn_communities + return [db_0or1row select_node_id { + select 1 + from dotlrn_communities where community_id = :community_id - and portal_template_id is not NULL - and portal_id is NULL - and admin_portal_id is NULL"] + and portal_id is not null + and admin_portal_id is null + }] } ad_proc -public new { @@ -254,96 +257,93 @@ if {[empty_string_p $dummy_comm_p]} { set user_id [ad_conn user_id] - + # Create portal template page - set portal_template_id \ - [portal::create \ - -template_id [get_type_template_id -community_type $community_type] \ - -name "$pretty_name Portal Template" \ - -csv_list $csv_list \ - -context_id $community_id \ - $user_id ] + set portal_id [portal::create \ + -template_id [get_type_portal_id -community_type $community_type] \ + -name "$pretty_name Portal" \ + -csv_list $csv_list \ + -context_id $community_id \ + $user_id \ + ] # Create the non-member page - set portal_id \ - [portal::create \ - -name "$pretty_name Non-Member Portal" \ - -default_page_name $non_member_page_name \ - -context_id $community_id \ - $user_id] - + set non_member_portal_id [portal::create \ + -name "$pretty_name Non-Member Portal" \ + -default_page_name $non_member_page_name \ + -context_id $community_id \ + $user_id \ + ] + # Create the admin page - set admin_portal_id \ - [portal::create \ - -name "$pretty_name Administration Portal" \ - -default_page_name $admin_page_name \ - -context_id $community_id \ - $user_id] + set admin_portal_id [portal::create \ + -name "$pretty_name Administration Portal" \ + -default_page_name $admin_page_name \ + -context_id $community_id \ + $user_id \ + ] # Set up the rel segments dotlrn_community::create_rel_segments -community_id $community_id - + # Set up the node if {[empty_string_p $parent_community_id]} { set parent_node_id [get_type_node_id $community_type] } else { set parent_node_id [get_community_node_id $parent_community_id] } - + # Create the node set new_node_id [site_node_create $parent_node_id $community_key] - + # Instantiate the package - set package_id \ - [site_node_create_package_instance \ - $new_node_id \ - $pretty_name \ - $community_id \ - [one_community_package_key] \ - ] - + set package_id [site_node_create_package_instance \ + $new_node_id \ + $pretty_name \ + $community_id \ + [one_community_package_key] \ + ] + # Set the right parameters ad_parameter -package_id $package_id -set 0 dotlrn_level_p ad_parameter -package_id $package_id -set 0 community_type_level_p ad_parameter -package_id $package_id -set 1 community_level_p - + # Set up the node dotlrn_community::set_package_id $community_id $package_id } else { # AKS FIXME nasty hack set user_id -1 - set portal_template_id [portal::create \ - -name "$pretty_name Default Portal Template" \ - -csv_list $csv_list \ - -portal_template_p "t" \ - $user_id ] + set portal_id [portal::create \ + -name "$pretty_name Default Portal" \ + -csv_list $csv_list \ + -portal_template_p "t" \ + $user_id + ] # set a dummy non-member and admin_portals - set portal_id "" + set non_member_portal_id "" set admin_portal_id "" # associate this portal_id with the comm type - dotlrn_community::set_type_template_id \ - -community_type $community_type \ - -template_id $portal_template_id + dotlrn_community::set_type_portal_id \ + -community_type $community_type \ + -portal_id $portal_id } - # update the portal_template_id and non_member_portal_id + # update the portal_id and non_member_portal_id db_dml update_portal_ids {} # Add the default applets specified above. They are # different per community type! - set default_applets_list \ - [string trim [split $default_applets {,}]] + set default_applets_list [string trim [split $default_applets {,}]] foreach applet_key $default_applets_list { if {[dotlrn_applet::applet_exists_p -applet_key $applet_key]} { - dotlrn_community::add_applet_to_community \ - $community_id \ - $applet_key + dotlrn_community::add_applet_to_community $community_id $applet_key } } } @@ -660,18 +660,11 @@ } db_transaction { - # aks - dont do this yet - # Set up a portal page for that user and that community - # set portal_id [portal::create \ - # -name "Your [get_community_name $community_id] page" \ - # -template_id [get_portal_template_id $community_id] \ - # $user_id \ - # ] - - # Create the form with the portal_id + # Create the form if {[empty_string_p $extra_vars]} { set extra_vars [ns_set create] } + # ns_set put $extra_vars portal_id $portal_id ns_set put $extra_vars user_id $user_id ns_set put $extra_vars community_id $community_id @@ -686,7 +679,7 @@ ]} errmsg]} { global errorInfo set savedInfo $errorInfo - + if {[string match -nocase {acs_object_rels_un} $errmsg]} { return } else { @@ -730,11 +723,8 @@ # db_transaction { # membership_rel::reject -rel_id $rel_id - # if {![empty_string_p $portal_id]} { - # portal::delete $portal_id - # } # } - + remove_user $community_id $user_id } @@ -758,45 +748,14 @@ -op RemoveUserFromCommunity \ -list_args [list $community_id $user_id] - # Get a few important things, - # like rel_id and portal portal_id + # get the rel_id db_1row select_rel_info {} # Remove it relation_remove $rel_id - - # Remove the page - portal::delete $portal_id } } - ad_proc -public get_portal_id { - community_id - user_id - } { - Get the page ID for a particular community and user - } { - # BEN HACK - return [db_string select_portal_id {} -default ""] - # return [get_portal_template_id $community_id] - } - - ad_proc -public get_community_non_members_portal_id { - community_id - } { - Get the community page ID for non-members - } { - return [db_string select_community_portal_id {}] - } - - ad_proc -public get_community_admin_portal_id { - community_id - } { - Get the community Admin page ID - } { - return [db_string select_community_admin_portal_id {}] - } - ad_proc -public get_all_communities_by_user { user_id } { @@ -992,7 +951,7 @@ # got a collision return 0 } else { - return 1 + return 1 } } @@ -1013,7 +972,7 @@ } { Returns 1 if the community has a subcommunity, memoized for 1 min } { - return [util_memoize "dotlrn_community::has_subcommunity_p_not_cached -community_id $community_id" 60] + return [util_memoize "dotlrn_community::has_subcommunity_p_not_cached -community_id $community_id" 60] } ad_proc -private has_subcommunity_p_not_cached { @@ -1051,7 +1010,7 @@ } { Returns a html fragment of the subcommunity hierarchy of this community or if none, the empty list. - + Brief notes: his proc always shows the subgroups of the passed-in group, but shows deeper groups _only if_ you are a member of all the supergroups to the leaf subgroup. Not even @@ -1062,7 +1021,7 @@ things to get: has_subcom, member_p, url, name, admin_p, not_closed_p, \ member_pending, needs_approval - things to send: user_id, sc_id, + things to send: user_id, sc_id, } { set chunk "" @@ -1079,7 +1038,7 @@ set url [get_community_url $sc_id] append chunk \ "$pretext [get_community_name $sc_id]\n" - + if {[dotlrn::user_can_admin_community_p $sc_id]} { append chunk \ "\[admin\]" @@ -1090,11 +1049,11 @@ } elseif { [member_p $sc_id $user_id] \ || [dotlrn::user_can_admin_community_p $sc_id] \ || [not_closed_p -community_id $sc_id]} { - # Shows the subcomm if: + # Shows the subcomm if: # 1. I'm a member of this subcomm OR # 2. I'm have admin rights over the subcomm OR # 3. The subcomm has an "open" OR "request" join policy - # but if the only_member_p flag is true, the user must be + # but if the only_member_p flag is true, the user must be # a member of the subcomm to see it. if {$only_member_p && ![member_p $sc_id $user_id]} { @@ -1110,7 +1069,7 @@ append chunk \ "\[" - + if {[member_pending_p -community_id $sc_id -user_id $user_id]} { append chunk \ "waiting for approval" @@ -1121,7 +1080,7 @@ append chunk \ "join" } - + append chunk "\]\n" } @@ -1261,26 +1220,66 @@ return [db_0or1row check_community_needs_approval {}] } - ad_proc -public get_portal_template_id { - {community_id ""} + ad_proc -public get_portal_id { + {-community_id ""} } { get the id of the portal template for a community } { if {[empty_string_p $community_id]} { set community_id [get_community_id] } - return [util_memoize "dotlrn_community::get_portal_template_id_not_cached -community_id $community_id"] + return [util_memoize "dotlrn_community::get_portal_id_not_cached -community_id $community_id"] } - ad_proc -private get_portal_template_id_not_cached { + ad_proc -private get_portal_id_not_cached { {-community_id:required} } { get the id of the portal template for a community } { - return [db_string select_portal_template_id {} -default ""] + return [db_string select_portal_id {} -default ""] } + ad_proc -public get_non_member_portal_id { + {-community_id ""} + } { + Get the community portal_id for non-members + } { + if {[empty_string_p $community_id]} { + set community_id [get_community_id] + } + + return [util_memoize "dotlrn_community::get_non_member_portal_id_not_cached -community_id $community_id"] + } + + ad_proc -private get_non_member_portal_id_not_cached { + {-community_id:required} + } { + Get the community portal_id for non-members + } { + return [db_string select_non_member_portal_id {}] + } + + ad_proc -public get_admin_portal_id { + {-community_id ""} + } { + Get the community Admin portal_id + } { + if {[empty_string_p $community_id]} { + set community_id [get_community_id] + } + + return [util_memoize "dotlrn_community::get_admin_portal_id_not_cached -community_id $community_id"] + } + + ad_proc -private get_admin_portal_id_not_cached { + {-community_id:required} + } { + Get the community Admin portal_id + } { + return [db_string select_admin_portal_id {}] + } + ad_proc -public add_applet_to_community { community_id applet_key @@ -1348,32 +1347,40 @@ foreach user [list_users $community_id] { remove_user $community_id [ns_set get $user user_id] } - + # Remove all applets foreach applet [list_applets -community_id $community_id] { remove_applet_from_community $community_id $applet } - + # Clean up - db_1row select_things_to_clean "select portal_id, admin_portal_id, portal_template_id, package_id from dotlrn_communities where community_id= :community_id" + db_1row select_things_to_clean { + select portal_id, + non_member_portal_id, + admin_portal_id, + package_id + from dotlrn_communities + where community_id = :community_id + } # delete the rel segments delete_rel_segments -community_id $community_id # Remove the row db_exec_plsql remove_community "begin dotlrn_community.delete(:community_id); end;" - if {![empty_string_p $portal_id]} { - portal::delete $portal_id - } - + if {![empty_string_p $admin_portal_id]} { portal::delete $admin_portal_id } - if {![empty_string_p $portal_template_id]} { - portal::delete $portal_template_id + if {![empty_string_p $non_member_portal_id]} { + portal::delete $non_member_portal_id } + if {![empty_string_p $portal_id]} { + portal::delete $portal_id + } + # Remove the package db_exec_plsql delete_package "begin acs_object.delete(:package_id) end;" } @@ -1429,13 +1436,13 @@ } { set list_of_applets [list_active_applets -community_id $community_id] - if {![empty_string_p $reorder_hack_p]} { + if {![empty_string_p $reorder_hack_p]} { ns_log notice "aks1: applets_dispatch: reorder hack!" set reorder_applets_string [ad_parameter user_wsp_applet_ordering "dotlrn" "dotlrn_news,dotlrn_bboard,dotlrn_survey,dotlrn_faq"] set reorder_applets_list [string trim [split $reorder_applets_string {,}]] - + # check if the applet is both in the reorder list and the applet list # if so, put it into the right place in the result list # if not, skip it @@ -1473,4 +1480,3 @@ } } - Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.55 -r1.56 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 2 May 2002 19:14:29 -0000 1.55 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 6 May 2002 23:55:02 -0000 1.56 @@ -20,9 +20,11 @@ - + - update dotlrn_community_types set portal_template_id= :template_id where community_type= :community_type + update dotlrn_community_types + set portal_id = :portal_id + where community_type = :community_type @@ -79,9 +81,9 @@ update dotlrn_communities - set portal_template_id = :portal_template_id, - portal_id = :portal_id, - admin_portal_id= :admin_portal_id + set portal_id = :portal_id, + non_member_portal_id = :non_member_portal_id, + admin_portal_id = :admin_portal_id where community_id = :community_id @@ -206,39 +208,13 @@ - select rel_id, - portal_id + select rel_id from dotlrn_member_rels_full where community_id = :community_id - and user_id= :user_id - - - - - - select portal_id - from dotlrn_member_rels_full - where community_id = :community_id and user_id = :user_id - - - select portal_id - from dotlrn_communities - where community_id = :community_id - - - - - - select admin_portal_id - from dotlrn_communities - where community_id = :community_id - - - select dotlrn_communities_full.* @@ -414,14 +390,30 @@ - + - select portal_template_id + select portal_id from dotlrn_communities where community_id = :community_id + + + select non_member_portal_id + from dotlrn_communities + where community_id = :community_id + + + + + + select admin_portal_id + from dotlrn_communities + where community_id = :community_id + + + insert into dotlrn_community_applets Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v diff -u -r1.46 -r1.47 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 28 Apr 2002 04:08:41 -0000 1.46 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 6 May 2002 23:55:02 -0000 1.47 @@ -89,19 +89,19 @@ } { dotlrn_community::set_type_package_id [community_type] [get_package_id] - # we need to create a portal template for the user workspace and + # we need to create a portal for the user workspace and # it's a sin dotlrn_community::init \ - -community_type "user_workspace" \ - -community_type_url_part "user-workspace-dummy-url" \ - -pretty_name "User Workspace" + -community_type "user_workspace" \ + -community_type_url_part "user-workspace-dummy-url" \ + -pretty_name "User Workspace" # do the same for subgroups (dotlrn_community type) dotlrn_community::init \ - -community_type "dotlrn_community" \ - -community_type_url_part "subgroups-dummy-url" \ - -pretty_name "Subgroups" + -community_type "dotlrn_community" \ + -community_type_url_part "subgroups-dummy-url" \ + -pretty_name "Subgroups" } ad_proc -public is_package_mounted { Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 28 Apr 2002 04:08:41 -0000 1.35 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 6 May 2002 23:55:02 -0000 1.36 @@ -105,7 +105,7 @@ db_transaction { set portal_id [portal::create \ - -template_id [dotlrn_community::get_type_template_id -community_type "user_workspace"] \ + -template_id [dotlrn_community::get_type_portal_id -community_type "user_workspace"] \ -name "Your dotLRN Workspace" \ $user_id ] Index: openacs-4/packages/dotlrn/www/applets.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/applets.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/applets.tcl 29 Mar 2002 19:14:46 -0000 1.10 +++ openacs-4/packages/dotlrn/www/applets.tcl 6 May 2002 23:55:02 -0000 1.11 @@ -25,6 +25,6 @@ set community_id [dotlrn_community::get_community_id] set user_id [ad_get_user_id] -set portal_id [dotlrn_community::get_portal_id $community_id $user_id] +set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set context_bar {{"one-community-admin" Admin} {Manage Applets}} Index: openacs-4/packages/dotlrn/www/community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/community.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/community.tcl 29 Mar 2002 19:14:46 -0000 1.6 +++ openacs-4/packages/dotlrn/www/community.tcl 6 May 2002 23:55:02 -0000 1.7 @@ -40,10 +40,10 @@ if {![dotlrn_community::member_p $community_id $user_id]} { set context_bar [list "Not a member"] - set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] + set portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] # Possible that there is no portal page for non-members - if {! [empty_string_p $portal_id]} { + if {![empty_string_p $portal_id]} { set rendered_page [dotlrn::render_page $portal_id] } else { set rendered_page "" @@ -52,8 +52,7 @@ ad_return_template one-community-not-member return } else { - # Pull out the NPP page ID and render it! - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set rendered_page [dotlrn::render_page $portal_id] Index: openacs-4/packages/dotlrn/www/configure-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-2.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/configure-2.tcl 29 Mar 2002 19:14:46 -0000 1.5 +++ openacs-4/packages/dotlrn/www/configure-2.tcl 6 May 2002 23:55:02 -0000 1.6 @@ -43,5 +43,3 @@ } ad_returnredirect "configure" - - Index: openacs-4/packages/dotlrn/www/configure-element-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-element-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/configure-element-2.tcl 29 Mar 2002 19:14:46 -0000 1.4 +++ openacs-4/packages/dotlrn/www/configure-element-2.tcl 6 May 2002 23:55:02 -0000 1.5 @@ -26,7 +26,6 @@ value } - # Check if this is a community type level thing if {[ad_parameter community_type_level_p] == 1} { ad_returnredirect "one-community-type" @@ -36,10 +35,6 @@ # Make sure user is logged in set user_id [ad_maybe_redirect_for_registration] -# XXX security portal::set_element_param $element_id $key $value - ad_returnredirect "." - - Index: openacs-4/packages/dotlrn/www/configure-element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure-element.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/configure-element.tcl 29 Mar 2002 19:14:46 -0000 1.7 +++ openacs-4/packages/dotlrn/www/configure-element.tcl 6 May 2002 23:55:02 -0000 1.8 @@ -14,7 +14,6 @@ # details. # - ad_page_contract { Displays an element configuration page @@ -35,7 +34,6 @@ # Make sure user is logged in set user_id [ad_maybe_redirect_for_registration] - if {[ad_parameter community_level_p] == 1} { # This is a community # What community type are we at? @@ -48,16 +46,14 @@ ad_return_template one-community-not-member return } else { - # they are a member, do the request - set rendered_page \ - [portal::configure_element $element_id $op "one-community"] + set rendered_page [portal::configure_element $element_id $op "one-community"] } } else { # this not a community, it is the "workspace" deal # Get the page - set portal_id [db_string select_portal_id {} -default ""] + set portal_id [dotlrn::get_workspace_portal_id $user_id] # If there is no portal_id, this user is either a guest or something else if {[empty_string_p $portal_id]} { @@ -69,6 +65,3 @@ } ad_return_template - - - Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/configure-element.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/configure.tcl 29 Mar 2002 19:14:46 -0000 1.7 +++ openacs-4/packages/dotlrn/www/configure.tcl 6 May 2002 23:55:02 -0000 1.8 @@ -46,7 +46,7 @@ ad_return_template one-community-not-member return } else { - set portal_id [dotlrn_community::get_portal_id $community_id $user_id] + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set rendered_page [portal::configure $portal_id "one-community"] set context_bar {Configure} set name [portal::get_name $portal_id] @@ -55,7 +55,7 @@ # this not a community, it is the "workspace" deal # Get the page - set portal_id [db_string select_portal_id {} -default ""] + set portal_id [get_workspace_portal_id $user_id] # If there is no portal_id, this user is either a guest or something else if {[empty_string_p $portal_id]} { Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/dotlrn/www/configure.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/dotlrn-default-master.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl 19 Apr 2002 18:16:48 -0000 1.4 +++ openacs-4/packages/dotlrn/www/dotlrn-default-master.tcl 6 May 2002 23:55:02 -0000 1.5 @@ -100,19 +100,15 @@ set control_panel_text "Control Panel" } - if {$have_comm_id_p} { # get this comm's info - set portal_id [dotlrn_community::get_portal_template_id $community_id] + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set text [dotlrn_community::get_community_header_name $community_id] set link [dotlrn_community::get_community_url $community_id] -# ns_log notice "aks9: $link" - -# ad_return_complaint 1 "$portal_id | $text | $link" if {[empty_string_p $portal_id] && !$admin_p } { # not a member yet - set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] + set portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] } if { $have_portal_id_p && $show_navbar_p } { Index: openacs-4/packages/dotlrn/www/index-not-a-user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index-not-a-user.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/index-not-a-user.tcl 29 Mar 2002 19:14:46 -0000 1.5 +++ openacs-4/packages/dotlrn/www/index-not-a-user.tcl 6 May 2002 23:55:02 -0000 1.6 @@ -24,7 +24,6 @@ } -properties { admin_p:onevalue admin_url:onevalue - portal_id:onevalue } set admin_p [dotlrn::admin_p] Index: openacs-4/packages/dotlrn/www/members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/dotlrn/www/members.tcl 28 Apr 2002 16:46:41 -0000 1.13 +++ openacs-4/packages/dotlrn/www/members.tcl 6 May 2002 23:55:02 -0000 1.14 @@ -27,5 +27,5 @@ set context_bar {{"one-community-admin" Admin} {Manage Members}} set community_id [dotlrn_community::get_community_id] -set portal_id [dotlrn_community::get_portal_template_id $community_id] +set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set admin_p [dotlrn::user_can_admin_community_p -user_id [ad_get_user_id] $community_id] Index: openacs-4/packages/dotlrn/www/one-community-admin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/dotlrn/www/one-community-admin.tcl 29 Mar 2002 19:14:46 -0000 1.17 +++ openacs-4/packages/dotlrn/www/one-community-admin.tcl 6 May 2002 23:55:02 -0000 1.18 @@ -27,7 +27,9 @@ community_type:onevalue pretty_name:onevalue description:onevalue - portal_template_id:onevalue + portal_id:onevalue + admin_portal_id:onevalue + non_member_portal_id:onevalue users:multirow } @@ -42,8 +44,6 @@ # render the admin page set rendered_page [dotlrn::render_page -render_style all_in_one $admin_portal_id] -set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - set context_bar {Admin} ad_return_template Index: openacs-4/packages/dotlrn/www/one-community-admin.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-admin.xql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/one-community-admin.xql 1 May 2002 01:19:47 -0000 1.10 +++ openacs-4/packages/dotlrn/www/one-community-admin.xql 6 May 2002 23:55:02 -0000 1.11 @@ -7,8 +7,9 @@ select community_type, pretty_name, description, - portal_template_id, - admin_portal_id + portal_id, + admin_portal_id, + non_member_portal_id from dotlrn_communities where community_id = :community_id Index: openacs-4/packages/dotlrn/www/one-community-portal-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/one-community-portal-template.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/one-community-portal-template.tcl 29 Mar 2002 19:14:46 -0000 1.5 +++ openacs-4/packages/dotlrn/www/one-community-portal-template.tcl 6 May 2002 23:55:02 -0000 1.6 @@ -24,7 +24,7 @@ {referer "one-community-admin"} } -set portal_id [dotlrn_community::get_portal_template_id] +set portal_id [dotlrn_community::get_portal_id] set rendered_page [portal::template_configure $portal_id $referer] Index: openacs-4/packages/dotlrn/www/one-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/dotlrn/www/one-community.tcl 19 Apr 2002 18:16:48 -0000 1.24 +++ openacs-4/packages/dotlrn/www/one-community.tcl 6 May 2002 23:55:02 -0000 1.25 @@ -59,7 +59,7 @@ set context_bar [list "Pending approval"] } - set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] + set portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] # Possible that there is no portal page for non-members if {! [empty_string_p $portal_id]} { @@ -72,11 +72,7 @@ ad_return_template one-community-not-member return } else { - # Pull out the NPP page ID and render it! - # Ben's MAJOR HACK to emulate SS v1.0 - # Arjun is in major pain - # set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - set portal_id [dotlrn_community::get_portal_template_id $community_id] + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set rendered_page [dotlrn::render_page -hide_links_p "t" -page_num $page_num $portal_id] Index: openacs-4/packages/dotlrn/www/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/spam.tcl 29 Mar 2002 19:14:46 -0000 1.8 +++ openacs-4/packages/dotlrn/www/spam.tcl 6 May 2002 23:55:02 -0000 1.9 @@ -38,7 +38,7 @@ dotlrn::require_user_admin_community $community_id set sender_id [ad_conn user_id] -set portal_id [dotlrn_community::get_portal_id $community_id $sender_id] +set portal_id [dotlrn_community::get_portal_id -community_id $community_id] db_1row select_sender_info { select parties.email as sender_email, Index: openacs-4/packages/dotlrn/www/subcommunity-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/subcommunity-edit.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/subcommunity-edit.adp 30 Apr 2002 21:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/subcommunity-edit.adp 6 May 2002 23:55:02 -0000 1.2 @@ -20,9 +20,8 @@ @title@ -@admin_portal_id@ +@portal_id@ 1 1 - Index: openacs-4/packages/dotlrn/www/subcommunity-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/subcommunity-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/subcommunity-edit.tcl 30 Apr 2002 21:24:42 -0000 1.1 +++ openacs-4/packages/dotlrn/www/subcommunity-edit.tcl 6 May 2002 23:55:02 -0000 1.2 @@ -27,8 +27,7 @@ } set user_id [ad_get_user_id] -set admin_portal_id \ - [dotlrn_community::get_portal_template_id $community_id] +set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set title "Edit [ad_parameter subcommunity_pretty_name]" set old_pn [dotlrn_community::get_community_name $community_id] Index: openacs-4/packages/dotlrn/www/subcommunity-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-new.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/www/subcommunity-new.adp 29 Mar 2002 19:14:46 -0000 1.4 +++ openacs-4/packages/dotlrn/www/subcommunity-new.adp 6 May 2002 23:55:02 -0000 1.5 @@ -20,9 +20,8 @@ @title@ -@admin_portal_id@ +@portal_id@ 1 1 - Index: openacs-4/packages/dotlrn/www/subcommunity-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-new.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/subcommunity-new.tcl 10 Apr 2002 23:28:30 -0000 1.11 +++ openacs-4/packages/dotlrn/www/subcommunity-new.tcl 6 May 2002 23:55:02 -0000 1.12 @@ -29,8 +29,7 @@ set user_id [ad_get_user_id] set parent_community_id [dotlrn_community::get_community_id] set title "New [ad_parameter subcommunity_pretty_name]" -set admin_portal_id \ - [dotlrn_community::get_portal_template_id $parent_community_id] +set portal_id [dotlrn_community::get_portal_id -community_id $parent_community_id] form create add_subcomm Index: openacs-4/packages/dotlrn/www/admin/portal-templates.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/portal-templates.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/portal-templates.xql 1 May 2002 01:19:47 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/portal-templates.xql 6 May 2002 23:55:02 -0000 1.3 @@ -8,8 +8,8 @@ name from portals p, dotlrn_communities dc - where dc.portal_template_id = p.portal_id - and dc.portal_id is null + where dc.portal_id = p.portal_id + and dc.non_member_portal_id is null and dc.admin_portal_id is null and dc.community_type != 'user_workspace' Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 16 Apr 2002 13:55:32 -0000 1.7 +++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 6 May 2002 23:57:19 -0000 1.8 @@ -21,23 +21,21 @@ @author Ben Adida (ben@openforce) @cvs_id $Id$ } -properties { - } array set config $cf - set instance_id $config(instance_id) set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"] -set element_pretty_plural \ - [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"] +set element_pretty_plural [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"] +db_multirow content select_content { + select content_id, + pretty_name + from static_portal_content + where instance_id = :instance_id +} -db_multirow content select_content " -select content_id, pretty_name -from static_portal_content -where instance_id = :instance_id" - -set template_portal_id [dotlrn_community::get_portal_template_id [dotlrn_community::get_community_id]] +set template_portal_id [dotlrn_community::get_portal_id] set applet_url "[dotlrn_applet::get_url]/[static_portlet::my_package_key]" set referer [ad_conn url]