Index: openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl,v diff -u -N -r1.29 -r1.30 --- openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 29 Nov 2001 07:00:11 -0000 1.29 +++ openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 1 Dec 2001 23:18:49 -0000 1.30 @@ -30,27 +30,27 @@ } ad_proc -public add_self_to_page { - page_id + portal_id instance_id args } { Adds a bboard PE to the given page with the instance key being opaque data in the portal configuration. @return element_id The new element's id - @param page_id The page to add self to + @param portal_id The page to add self to @param instance_id The bboard instace to show @param args an arg string not used @author arjun@openforce.net @creation-date Sept 2001 } { # Add some smarts to only add one portlet for now when it's added multiple times (ben) # Find out if bboard already exists - set element_id_list [portal::get_element_ids_by_ds $page_id [my_name]] + set element_id_list [portal::get_element_ids_by_ds $portal_id [my_name]] if {[llength $element_id_list] == 0} { # Tell portal to add this element to the page - set element_id [portal::add_element $page_id [my_name]] + set element_id [portal::add_element $portal_id [my_name]] # There is already a value for the param which must be overwritten portal::set_element_param $element_id instance_id $instance_id set package_id_list [list] @@ -170,7 +170,7 @@ } { Removes a bboard PE from the given page - @param page_id The page to remove self from + @param portal_id The page to remove self from @param instance_id @author arjun@openforce.net @creation-date Sept 2001 @@ -193,29 +193,29 @@ } ad_proc -public make_self_available { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_available \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } ad_proc -public make_self_unavailable { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_unavailable \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } } Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-classes-create.sql,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 29 Nov 2001 02:28:09 -0000 1.9 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 1 Dec 2001 23:16:27 -0000 1.10 @@ -127,7 +127,7 @@ pretty_name in dotlrn_communities.pretty_name%TYPE, description in dotlrn_communities.description%TYPE, package_id in dotlrn_communities.package_id%TYPE default null, - page_id in dotlrn_communities.page_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, portal_template_id in dotlrn_communities.portal_template_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -156,7 +156,7 @@ pretty_name in dotlrn_communities.pretty_name%TYPE, description in dotlrn_communities.description%TYPE, package_id in dotlrn_communities.package_id%TYPE default null, - page_id in dotlrn_communities.page_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, portal_template_id in dotlrn_communities.portal_template_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -175,7 +175,7 @@ pretty_name => pretty_name, description => description, package_id => package_id, - page_id => page_id, + portal_id => portal_id, portal_template_id => portal_template_id, creation_date => creation_date, creation_user => creation_user, Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 29 Nov 2001 02:25:13 -0000 1.11 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 1 Dec 2001 23:16:27 -0000 1.12 @@ -36,13 +36,19 @@ constraint dlrn_comm_key_un unique, pretty_name varchar(100) not null, description varchar(4000), - page_id references portals(portal_id), + active_start_date date, + active_end_date date, + portal_id references portals(portal_id), portal_template_id references portals(portal_id), package_id constraint dlrn_comm_pack_id_fk references apm_packages(package_id) ); +-- active communities +create view dotlrn_active_comms as select dotlrn_communities.*, join_policy from dotlrn_communities, groups where sysdate between active_start_date and active_end_date and dotlrn_communities.community_id = groups.group_id; +create view dotlrn_active_not_closed_comms as select dotlrn_communities.*, join_policy from dotlrn_communities, groups where sysdate between active_start_date and active_end_date and dotlrn_communities.community_id = groups.group_id and join_policy <> 'closed'; + create table dotlrn_community_applets ( community_id integer not null constraint dlrn_comm_appl_comm_id_fk references dotlrn_communities(community_id), @@ -168,7 +174,7 @@ community_key in dotlrn_communities.community_key%TYPE, pretty_name in dotlrn_communities.pretty_name%TYPE, description in dotlrn_communities.description%TYPE, - page_id in dotlrn_communities.page_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, portal_template_id in dotlrn_communities.portal_template_id%TYPE default null, package_id in dotlrn_communities.package_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE @@ -179,6 +185,12 @@ 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 ); @@ -205,7 +217,7 @@ community_key in dotlrn_communities.community_key%TYPE, pretty_name in dotlrn_communities.pretty_name%TYPE, description in dotlrn_communities.description%TYPE, - page_id in dotlrn_communities.page_id%TYPE default null, + portal_id in dotlrn_communities.portal_id%TYPE default null, portal_template_id in dotlrn_communities.portal_template_id%TYPE default null, package_id in dotlrn_communities.package_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE @@ -228,15 +240,29 @@ ); insert into dotlrn_communities - (community_id, community_type, community_key, pretty_name, description, package_id, page_id, portal_template_id) + (community_id, community_type, community_key, pretty_name, description, package_id, portal_id, portal_template_id) values - (c_id, community_type, community_key, pretty_name, description, package_id, page_id, portal_template_id); + (c_id, community_type, community_key, pretty_name, description, package_id, portal_id, portal_template_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= start_date, + active_end_date= end_date + where + community_id = set_active_dates.community_id; + end; + procedure delete ( community_id in dotlrn_communities.community_id%TYPE ) Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-community-memberships-create.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql 30 Nov 2001 03:41:17 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql 1 Dec 2001 23:16:27 -0000 1.4 @@ -13,21 +13,21 @@ create table dotlrn_member_rels ( rel_id integer not null - constraint dlrn_mem_fk references acs_rels(rel_id) + constraint dlrn_mem_fk references membership_rels(rel_id) constraint dlrn_mem_pk primary key, - page_id integer - constraint dlrn_mem_page_id_fk references portals(portal_id) + portal_id integer + constraint dlrn_mem_portal_id_fk references portals(portal_id) ); -create view dotlrn_member_rels_full as select acs_rels.rel_id as rel_id, object_id_one as community_id, object_id_two as user_id, rel_type, page_id from dotlrn_member_rels, acs_rels where dotlrn_member_rels.rel_id = acs_rels.rel_id; +create view dotlrn_member_rels_full as select acs_rels.rel_id as rel_id, object_id_one as community_id, object_id_two as user_id, rel_type, portal_id from dotlrn_member_rels, acs_rels where dotlrn_member_rels.rel_id = acs_rels.rel_id; create table dotlrn_admin_rels ( rel_id integer not null constraint dlrn_adm_fk references dotlrn_member_rels(rel_id) constraint dlrn_adm_pk primary key ); -create view dotlrn_admin_rels_full as select acs_rels.rel_id as rel_id, object_id_one as community_id, object_id_two as user_id, rel_type, page_id from dotlrn_member_rels, dotlrn_admin_rels, acs_rels where dotlrn_member_rels.rel_id = acs_rels.rel_id and dotlrn_admin_rels.rel_id= acs_rels.rel_id; +create view dotlrn_admin_rels_full as select acs_rels.rel_id as rel_id, object_id_one as community_id, object_id_two as user_id, rel_type, portal_id from dotlrn_member_rels, dotlrn_admin_rels, acs_rels where dotlrn_member_rels.rel_id = acs_rels.rel_id and dotlrn_admin_rels.rel_id= acs_rels.rel_id; -- @@ -71,70 +71,70 @@ acs_rel_type.create_type ( rel_type => 'dotlrn_member_rel', supertype => 'membership_rel', - pretty_name => 'dotLRN Membership', - pretty_plural => 'dotLRN Memberships', + pretty_name => 'dotLRN Community Membership', + pretty_plural => 'dotLRN Community Memberships', package_name => 'dotlrn_member_rel', table_name => 'dotlrn_member_rels', id_column => 'rel_id', object_type_one => 'dotlrn_community', role_one => NULL, min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'dotlrn_user', role_two => NULL, + object_type_two => 'user', role_two => NULL, min_n_rels_two => 0, max_n_rels_two => NULL ); acs_rel_type.create_type ( rel_type => 'dotlrn_admin_rel', supertype => 'dotlrn_member_rel', - pretty_name => 'dotLRN Admin Membership', - pretty_plural => 'dotLRN Admin Memberships', + pretty_name => 'dotLRN Admin Community Membership', + pretty_plural => 'dotLRN Admin Community Memberships', package_name => 'dotlrn_admin_rel', table_name => 'dotlrn_admin_rels', id_column => 'rel_id', object_type_one => 'dotlrn_community', role_one => NULL, min_n_rels_one => 0, max_n_rels_one => NULL, - object_type_two => 'dotlrn_user', role_two => NULL, + object_type_two => 'user', role_two => NULL, min_n_rels_two => 0, max_n_rels_two => NULL ); acs_rel_type.create_type ( rel_type => 'dotlrn_student_rel', supertype => 'dotlrn_member_rel', - pretty_name => 'dotLRN Student Membership', - pretty_plural => 'dotLRN Student Memberships', + 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 => 'dotlrn_user', role_two => NULL, + object_type_two => 'user', role_two => NULL, 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 TA Membership', - pretty_plural => 'dotLRN TA Memberships', + pretty_name => 'dotLRN TA Community Membership', + pretty_plural => 'dotLRN TA 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 => 'dotlrn_user', role_two => NULL, + object_type_two => 'user', role_two => NULL, 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 Membership', - pretty_plural => 'dotLRN Instructor Memberships', + 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 => 'dotlrn_user', role_two => NULL, + object_type_two => 'user', role_two => NULL, min_n_rels_two => 0, max_n_rels_two => NULL ); @@ -143,7 +143,7 @@ -- foo:= acs_attribute.create_attribute ( object_type => 'dotlrn_member_rel', - attribute_name => 'page_id', + attribute_name => 'portal_id', datatype => 'integer', pretty_name => 'Page ID', pretty_plural => 'Page IDs' Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-community-memberships-packages-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-packages-create.sql 28 Nov 2001 20:25:40 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-packages-create.sql 1 Dec 2001 23:16:27 -0000 1.6 @@ -19,9 +19,9 @@ 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', - page_id in dotlrn_member_rels.page_id%TYPE default NULL, + portal_id in dotlrn_member_rels.portal_id%TYPE default NULL, community_id in dotlrn_communities.community_id%TYPE, - user_id in dotlrn_users.user_id%TYPE, + user_id in users.user_id%TYPE, 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; @@ -40,9 +40,9 @@ 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', - page_id in dotlrn_member_rels.page_id%TYPE default NULL, + portal_id in dotlrn_member_rels.portal_id%TYPE default NULL, community_id in dotlrn_communities.community_id%TYPE, - user_id in dotlrn_users.user_id%TYPE, + user_id in users.user_id%TYPE, 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 @@ -57,8 +57,8 @@ creation_ip => creation_ip); insert into dotlrn_member_rels - (rel_id, page_id) values - (v_rel_id, page_id); + (rel_id, portal_id) values + (v_rel_id, portal_id); return v_rel_id; end; @@ -88,8 +88,8 @@ 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 dotlrn_users.user_id%TYPE, - page_id in dotlrn_member_rels.page_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_member_rels.portal_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_admin_rels.rel_id%TYPE; @@ -109,8 +109,8 @@ 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 dotlrn_users.user_id%TYPE, - page_id in dotlrn_member_rels.page_id%TYPE default null, + user_id in users.user_id%TYPE, + portal_id in dotlrn_member_rels.portal_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_admin_rels.rel_id%TYPE @@ -121,7 +121,7 @@ rel_type => rel_type, community_id => community_id, user_id => user_id, - page_id => page_id, + portal_id => portal_id, creation_user => creation_user, creation_ip => creation_ip); @@ -156,9 +156,9 @@ 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', - page_id in dotlrn_member_rels.page_id%TYPE default NULL, + portal_id in dotlrn_member_rels.portal_id%TYPE default NULL, class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, - user_id in dotlrn_users.user_id%TYPE, + user_id in users.user_id%TYPE, 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; @@ -177,9 +177,9 @@ 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', - page_id in dotlrn_member_rels.page_id%TYPE default NULL, + portal_id in dotlrn_member_rels.portal_id%TYPE default NULL, class_instance_id in dotlrn_class_instances.class_instance_id%TYPE, - user_id in dotlrn_users.user_id%TYPE, + user_id in users.user_id%TYPE, 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 @@ -188,7 +188,7 @@ begin v_rel_id:= dotlrn_member_rel.new(rel_id => rel_id, rel_type => rel_type, - page_id => page_id, + portal_id => portal_id, community_id => class_instance_id, user_id => user_id, creation_user => creation_user, @@ -226,8 +226,8 @@ 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 dotlrn_users.user_id%TYPE, - page_id in dotlrn_member_rels.page_id%TYPE, + user_id in users.user_id%TYPE, + portal_id in dotlrn_member_rels.portal_id%TYPE, 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; @@ -247,8 +247,8 @@ 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 dotlrn_users.user_id%TYPE, - page_id in dotlrn_member_rels.page_id%TYPE, + user_id in users.user_id%TYPE, + portal_id in dotlrn_member_rels.portal_id%TYPE, 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 @@ -259,7 +259,7 @@ rel_type => rel_type, community_id => class_instance_id, user_id => user_id, - page_id => page_id, + portal_id => portal_id, creation_user => creation_user, creation_ip => creation_ip); @@ -295,8 +295,8 @@ 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 dotlrn_users.user_id%TYPE, - page_id in dotlrn_member_rels.page_id%TYPE, + user_id in users.user_id%TYPE, + portal_id in dotlrn_member_rels.portal_id%TYPE, 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; @@ -316,8 +316,8 @@ 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 dotlrn_users.user_id%TYPE, - page_id in dotlrn_member_rels.page_id%TYPE, + user_id in users.user_id%TYPE, + portal_id in dotlrn_member_rels.portal_id%TYPE, 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 @@ -328,7 +328,7 @@ rel_type => rel_type, community_id => class_instance_id, user_id => user_id, - page_id => page_id, + portal_id => portal_id, creation_user => creation_user, creation_ip => creation_ip); Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 30 Nov 2001 03:41:17 -0000 1.7 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 1 Dec 2001 23:16:27 -0000 1.8 @@ -72,97 +72,10 @@ acs_rel_type.create_role ('instructor', 'Instructor', 'Instructors'); acs_rel_type.create_role ('admin', 'Administrator', 'Administrators'); - -- a lot of the following stuff is commented out because it has to be done in TCL - - -- create relationships --- acs_rel_type.create_type ( --- rel_type => 'admin_rel', --- supertype => 'membership_rel', --- pretty_name => 'Administration Relation', --- pretty_plural => 'Administration Relationships', --- package_name => 'dotlrn_admin_rel', --- table_name => 'dotlrn_admin_rel', --- id_column => 'XXX', --- object_type_one => 'dotlrn_community', role_one => NULL, --- min_n_rels_one => 0, max_n_rels_one => null, --- object_type_two => 'party', role_two => 'admin', --- min_n_rels_two => 0, max_n_rels_two => null --- ); - --- acs_rel_type.create_type ( --- rel_type => 'instructor_rel', --- supertype => 'admin_rel', --- pretty_name => 'Instructor Relation', --- pretty_plural => 'Instructor Relationships', --- package_name => 'dotlrn_instructor_rel', --- table_name => 'dotlrn_instructor_rel', --- id_column => 'XXX', --- object_type_one => 'dotlrn_class', role_one => NULL, --- min_n_rels_one => 0, max_n_rels_one => null, --- object_type_two => 'party', role_two => 'instructor', --- min_n_rels_two => 0, max_n_rels_two => null --- ); - --- acs_rel_type.create_type ( --- rel_type => 'ta_rel', --- supertype => 'admin_rel', --- pretty_name => 'TA Relation', --- pretty_plural => 'TA Relationships', --- package_name => 'dotlrn_ta_rel', --- table_name => 'dotlrn_ta_rel', --- id_column => 'XXX', --- object_type_one => 'dotlrn_class', role_one => NULL, --- min_n_rels_one => 0, max_n_rels_one => null, --- object_type_two => 'party', role_two => 'teaching_assistant', --- min_n_rels_two => 0, max_n_rels_two => null --- ); - --- acs_rel_type.create_type ( --- rel_type => 'student_rel', --- supertype => 'membership_rel', --- pretty_name => 'Student Relation', --- pretty_plural => 'Student Relationships', --- package_name => 'dotlrn_student_rel', --- table_name => 'dotlrn_student_rel', --- id_column => 'XXX', --- object_type_one => 'dotlrn_class', role_one => NULL, --- min_n_rels_one => 0, max_n_rels_one => null, --- object_type_two => 'party', role_two => 'student', --- min_n_rels_two => 0, max_n_rels_two => null --- ); - - -- add permissible stuff --- insert into group_type_rels --- (group_rel_type_id, group_type, rel_type) --- values --- (acs_object_id_seq.nextval, 'dotlrn_class', 'admin_rel'); - --- insert into group_type_rels --- (group_rel_type_id, group_type, rel_type) --- values --- (acs_object_id_seq.nextval, 'dotlrn_club', 'admin_rel'); - --- insert into group_type_rels --- (group_rel_type_id, group_type, rel_type) --- values --- (acs_object_id_seq.nextval, 'dotlrn_club', 'membership_rel'); - --- insert into group_type_rels --- (group_rel_type_id, group_type, rel_type) --- values --- (acs_object_id_seq.nextval, 'dotlrn_class', 'student_rel'); - --- insert into group_type_rels --- (group_rel_type_id, group_type, rel_type) --- values --- (acs_object_id_seq.nextval, 'dotlrn_class', 'instructor_rel'); - --- insert into group_type_rels --- (group_rel_type_id, group_type, rel_type) --- values --- (acs_object_id_seq.nextval, 'dotlrn_class', 'ta_rel'); - - + -- add the user types + insert into dotlrn_user_types (type_id, type) values (1, 'student'); + insert into dotlrn_user_types (type_id, type) values (2, 'professor'); + insert into dotlrn_user_types (type_id, type) values (3, 'admin'); end; / show errors Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-users-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 27 Nov 2001 23:16:31 -0000 1.5 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-create.sql 1 Dec 2001 23:16:27 -0000 1.6 @@ -15,35 +15,118 @@ -- Users of the dotLRN system -- -create table dotlrn_users ( - user_id integer not null - constraint dlrn_user_id_fk - references users(user_id) - constraint dlrn_user_id_pk - primary key, - role varchar(100) default 'student' not null check (role in ('student','guest','professor','admin')), - theme_id references portal_element_themes(theme_id), - page_id integer - constraint dlrn_user_page_id_fk - references portals(portal_id) +-- not an object, there's really no use for it +-- this is just so other, non-university systems can set up their own user types +create table dotlrn_user_types ( + type_id integer not null + constraint dlrn_user_type_pk primary key, + type varchar(200) not null + constraint dlrn_user_type_un unique ); +create table dotlrn_user_rels ( + rel_id integer not null + constraint dlrn_user_rel_fk references membership_rels(rel_id) + constraint dlrn_user_rel_pk primary key, + type_id integer not null + constraint dlrn_user_rel_type_fk references dotlrn_user_types(type_id) +); -create view dotlrn_users_full as select registered_users.user_id, first_names, last_name, email, role, page_id from dotlrn_users, registered_users where dotlrn_users.user_id= registered_users.user_id; +create table dotlrn_full_user_rels ( + rel_id integer not null + constraint dlrn_full_user_rel_fk references dotlrn_user_rels(rel_id) + constraint dlrn_full_user_rel_pk primary key, + theme_id integer + constraint dlrn_full_user_theme_fk references portal_element_themes(theme_id), + portal_id integer not null + constraint dlrn_full_user_portal_fk references portals(portal_id) +); +-- the user group +declare + foo integer; +begin + foo:= acs_group.new ( + group_id => NULL, + object_type => 'group', + creation_date => sysdate, + group_name => 'dotLRN Users' + ); +end; +/ +show errors + +create or replace function dotlrn_get_group_id return integer is + p_group_id integer; +begin + select max(group_id) into p_group_id from groups where group_name= 'dotLRN Users'; + + return p_group_id; +end; +/ +show errors + +create view dotlrn_users as select acs_rels.rel_id, registered_users.user_id, first_names, last_name, email, type +from dotlrn_user_rels, acs_rels, registered_users, dotlrn_user_types where +acs_rels.object_id_two = registered_users.user_id and +acs_rels.object_id_one = dotlrn_get_group_id() and +acs_rels.rel_id = dotlrn_user_rels.rel_id and +dotlrn_user_rels.type_id= dotlrn_user_types.type_id; + +create view dotlrn_full_users as select acs_rels.rel_id, registered_users.user_id, first_names, last_name, email, type, portal_id, theme_id +from dotlrn_user_rels, dotlrn_full_user_rels, acs_rels, registered_users, dotlrn_user_types where +acs_rels.object_id_two = registered_users.user_id and +acs_rels.object_id_one = dotlrn_get_group_id() and +acs_rels.rel_id = dotlrn_user_rels.rel_id and +dotlrn_user_rels.rel_id = dotlrn_full_user_rels.rel_id and +dotlrn_user_types.type_id = dotlrn_user_rels.type_id; + +-- The packages + declare + v_group_id integer; + foo integer; begin - acs_object_type.create_type ( - supertype => 'user', - object_type => 'dotlrn_user', - pretty_name => 'dotLRN User', - pretty_plural => 'dotLRN Users', - table_name => 'dotlrn_users', - id_column => 'user_id', - package_name => 'dotlrn_user', - name_method => 'acs_object.name' + acs_rel_type.create_type ( + rel_type => 'dotlrn_user_rel', + supertype => 'membership_rel', + pretty_name => 'dotLRN User Membership', + pretty_plural => 'dotLRN User Memberships', + package_name => 'dotlrn_user_rel', + table_name => 'dotlrn_user_rels', + id_column => 'rel_id', + object_type_one => '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 ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_full_user_rel', + supertype => 'dotlrn_user_rel', + pretty_name => 'dotLRN Full User Membership', + pretty_plural => 'dotLRN Full User Memberships', + package_name => 'dotlrn_full_user_rel', + table_name => 'dotlrn_full_user_rels', + id_column => 'rel_id', + object_type_one => '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 + ); + + v_group_id:= dotlrn_get_group_id(); + + -- Now we create the rel segments! + foo:= rel_segment.new ( + segment_name => 'dotLRN Users', + group_id => v_group_id, + rel_type => 'dotlrn_user_rel' + ); + + foo:= rel_segment.new ( + segment_name => 'dotLRN Full Access Users', + group_id => v_group_id, + rel_type => 'dotlrn_full_user_rel' + ); + end; / show errors Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-users-package-create.sql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql 8 Nov 2001 23:57:40 -0000 1.4 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-users-package-create.sql 1 Dec 2001 23:16:27 -0000 1.5 @@ -15,43 +15,147 @@ -- Users of the dotLRN system -- -create or replace package dotlrn_user +create or replace package dotlrn_user_rel is - function new ( - user_id in dotlrn_users.user_id%TYPE, - role in dotlrn_users.role%TYPE - ) return dotlrn_users.user_id%TYPE; - - procedure delete ( - user_id in dotlrn_users.user_id%TYPE - ); + function new ( + rel_id in dotlrn_user_rels.rel_id%TYPE default NULL, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_user_rel', + type_id in dotlrn_user_rels.type_id%TYPE, + group_id in groups.group_id%TYPE default NULL, + user_id in users.user_id%TYPE, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_user_rels.rel_id%TYPE + ); + end; / show errors -create or replace package body dotlrn_user +create or replace package body dotlrn_user_rel is - function new ( - user_id in dotlrn_users.user_id%TYPE, - role in dotlrn_users.role%TYPE - ) return dotlrn_users.user_id%TYPE - is - begin - insert into dotlrn_users (user_id, role) values (user_id, role); - update acs_objects set object_type='dotlrn_user' where object_id=user_id; - return user_id; - end; - - procedure delete ( - user_id in dotlrn_users.user_id%TYPE - ) - is - begin - delete from dotlrn_users where user_id= user_id; - end; + function new ( + rel_id in dotlrn_user_rels.rel_id%TYPE default NULL, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_user_rel', + type_id in dotlrn_user_rels.type_id%TYPE, + group_id in groups.group_id%TYPE default NULL, + user_id in users.user_id%TYPE, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_user_rels.rel_id%TYPE + is + v_rel_id membership_rels.rel_id%TYPE; + p_group_id groups.group_id%TYPE; + begin + if group_id is NULL then + p_group_id:= dotlrn_get_group_id(); + else + p_group_id:= group_id; + end if; + v_rel_id:= membership_rel.new ( + rel_id => rel_id, + rel_type => rel_type, + object_id_one => p_group_id, + object_id_two => user_id, + creation_user => creation_user, + creation_ip => creation_ip); + + insert into dotlrn_user_rels + (rel_id, type_id) values + (v_rel_id, type_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_user_rels.rel_id%TYPE + ) + is + begin + delete from dotlrn_user_rels where rel_id= dotlrn_user_rel.delete.rel_id; + + membership_rel.delete(rel_id); + end; + end; / show errors + + +-- +-- Full Users +-- + +create or replace package dotlrn_full_user_rel +is + function new ( + rel_id in dotlrn_full_user_rels.rel_id%TYPE default NULL, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_full_user_rel', + type_id in dotlrn_user_rels.type_id%TYPE, + portal_id in dotlrn_full_user_rels.portal_id%TYPE, + group_id in groups.group_id%TYPE default NULL, + user_id in users.user_id%TYPE, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_full_user_rels.rel_id%TYPE; + + procedure delete ( + rel_id in dotlrn_full_user_rels.rel_id%TYPE + ); + +end; +/ +show errors + + +create or replace package body dotlrn_full_user_rel +is + function new ( + rel_id in dotlrn_full_user_rels.rel_id%TYPE default NULL, + rel_type in acs_rels.rel_type%TYPE default 'dotlrn_full_user_rel', + type_id in dotlrn_user_rels.type_id%TYPE, + portal_id in dotlrn_full_user_rels.portal_id%TYPE, + group_id in groups.group_id%TYPE default NULL, + user_id in users.user_id%TYPE, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null + ) return dotlrn_full_user_rels.rel_id%TYPE + is + v_rel_id dotlrn_user_rels.rel_id%TYPE; + begin + v_rel_id:= dotlrn_user_rel.new ( + rel_id => rel_id, + rel_type => rel_type, + type_id => type_id, + group_id => group_id, + user_id => user_id, + creation_user => creation_user, + creation_ip => creation_ip); + + insert into dotlrn_full_user_rels + (rel_id, portal_id) values + (v_rel_id, portal_id); + + return v_rel_id; + end; + + procedure delete ( + rel_id in dotlrn_full_user_rels.rel_id%TYPE + ) + is + begin + delete from dotlrn_full_user_rels where rel_id = dotlrn_full_user_rel.delete.rel_id; + + dotlrn_user_rel.delete(rel_id); + end; + +end; +/ +show errors + Index: openacs-4/packages/dotlrn/tcl/class-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/Attic/class-procs-oracle.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/class-procs-oracle.xql 29 Nov 2001 02:26:36 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/class-procs-oracle.xql 1 Dec 2001 23:16:27 -0000 1.6 @@ -20,26 +20,4 @@ - - -declare -begin - -:1 := dotlrn_class_instance.new ( - class_key => :class_type, - year => :year, - term => :term, - community_key => :short_name, - pretty_name => :class_name, - description => :description, - page_id => :page_id, - portal_template_id => :portal_template_id, - creation_user => :user_id -); - -end; - - - - 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 -N -r1.29 -r1.30 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 30 Nov 2001 03:41:17 -0000 1.29 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 1 Dec 2001 23:16:27 -0000 1.30 @@ -112,8 +112,8 @@ # Create the non-member page set non_member_portal_name "$pretty_name Non-Member Portal" - set page_id [portal::create -name $non_member_portal_name -template_id $portal_template_id $user_id] - ns_set put $extra_vars page_id $page_id + set portal_id [portal::create -name $non_member_portal_name -template_id $portal_template_id $user_id] + ns_set put $extra_vars portal_id $portal_id # Insert the community set community_id [package_instantiate_object -extra_vars $extra_vars $object_type] @@ -310,11 +310,11 @@ } { db_transaction { # Set up a portal page for that user and that community - set page_id [portal::create -template_id [get_portal_template_id $community_id] $user_id] + set portal_id [portal::create -template_id [get_portal_template_id $community_id] $user_id] - # Create the form with the page_id + # Create the form with the portal_id set extra_vars [ns_set create] - ns_set put $extra_vars page_id $page_id + 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 ns_set put $extra_vars class_instance_id $community_id @@ -337,40 +337,32 @@ # Callbacks applets_dispatch $community_id RemoveUser [list $community_id $user_id] - # Get a few important things, like rel_id and portal page_id + # Get a few important things, like rel_id and portal portal_id db_1row select_rel_info {} # Remove it relation_remove $rel_id # Remove the page - portal::delete $page_id + portal::delete $portal_id } } - ad_proc -public get_page_id { + ad_proc -public get_portal_id { community_id user_id } { Get the page ID for a particular community and user } { - return [db_string select_page_id {}] + return [db_string select_portal_id {}] } - ad_proc -public get_workspace_page_id { - user_id - } { - Get the workspace page ID for a particular user - } { - return [db_string select_user_page_id {}] - } - - ad_proc -public get_community_non_members_page_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_page_id {}] + return [db_string select_community_portal_id {}] } ad_proc -public get_all_communities_by_user { @@ -404,7 +396,6 @@ community_type } { Returns a list of active communities for a given type. - FIXME: right now all communities are active. } { set list_of_communities [list] 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 -N -r1.14 -r1.15 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 30 Nov 2001 03:41:17 -0000 1.14 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 1 Dec 2001 23:16:27 -0000 1.15 @@ -49,28 +49,22 @@ -select rel_id, page_id from dotlrn_member_rels_full where community_id= :community_id and user_id= :user_id +select rel_id, portal_id from dotlrn_member_rels_full where community_id= :community_id and user_id= :user_id - + -select page_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 page_id from dotlrn_users where user_id= :user_id +select portal_id from dotlrn_communities where community_id= :community_id - - -select page_id from dotlrn_communities where community_id= :community_id - - - select dotlrn_communities.community_id, community_type, community_key, pretty_name from dotlrn_communities, dotlrn_member_rels_full where dotlrn_communities.community_id = dotlrn_member_rels_full.community_id and dotlrn_member_rels_full.user_id = :user_id @@ -90,7 +84,7 @@ select community_id, community_type, pretty_name, description, package_id -from dotlrn_communities +from dotlrn_active_not_closed_comms where community_type= :community_type Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 17 Nov 2001 22:54:28 -0000 1.7 +++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 1 Dec 2001 23:16:27 -0000 1.8 @@ -30,20 +30,20 @@ } ad_proc -public add_self_to_page { - page_id + portal_id instance_id } { Adds a dotLRN PE to the given page with the instance key being opaque data in the portal configuration. @return element_id The new element's id - @param page_id The page to add self to + @param portal_id The page to add self to @param instance_id The bboard instace to show @author arjun@openforce.net @creation-date Nov 2001 } { # Tell portal to add this element to the page - set element_id [portal::add_element $page_id [my_name]] + set element_id [portal::add_element $portal_id [my_name]] return $element_id } @@ -100,7 +100,7 @@ } { Removes a bboard PE from the given page - @param page_id The page to remove self from + @param portal_id The page to remove self from @param instance_id @author ben@openforce.net @creation-date Nov 2001 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 -N -r1.12 -r1.13 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 30 Nov 2001 03:41:17 -0000 1.12 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 1 Dec 2001 23:16:27 -0000 1.13 @@ -68,6 +68,14 @@ } { db_dml update_user_theme {} } + + ad_proc -public get_workspace_portal_id { + user_id + } { + Get the workspace page ID for a particular user + } { + return [db_string select_user_portal_id {} -default ""] + } ad_proc -public instantiate_and_mount { {-mount_point ""} @@ -89,27 +97,27 @@ set parent_node_id [db_string select_node_id {}] # Mount - # FIXME: here we want to figure out how to set the context_id correctly! - # THIS IS A SERIOUS ISSUE - set new_package_id [site_node_mount_application -return package_id $parent_node_id $mount_point $package_key $package_key] + # The context is the community_id + set new_node_id [site_node_create $parent_node_id $package_key] + set new_package_id [site_node_create_package_instance $new_node_id $package_key $community_id $package_key] # Return the newly created package_id return $new_package_id } ad_proc -public render_page { {-user_id ""} - page_id + portal_id } { render a page in a user's favorite style } { if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } - set theme_id [db_string select_user_theme_id "select theme_id from dotlrn_users where user_id= :user_id"] + set theme_id [get_user_theme $user_id] - return [portal::render $page_id $theme_id] + return [portal::render $portal_id $theme_id] } } Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql 10 Nov 2001 19:09:12 -0000 1.5 +++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.xql 1 Dec 2001 23:16:27 -0000 1.6 @@ -22,16 +22,22 @@ -select theme_id from dotlrn_users where user_id = :user_id +select theme_id from dotlrn_full_users where user_id = :user_id -update dotlrn_users set theme_id= :theme_id where user_id= :user_id +update dotlrn_full_user_rels set theme_id= :theme_id where rel_id= (select rel_id from dotlrn_full_users where user_id= :user_id) + + +select portal_id from dotlrn_full_users where user_id= :user_id + + + select node_id from site_nodes where object_id= :package_id Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/Attic/dotlrn-security-procs-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs-oracle.xql 5 Nov 2001 22:34:23 -0000 1.1 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs-oracle.xql 1 Dec 2001 23:16:27 -0000 1.2 @@ -3,13 +3,4 @@ oracle8.1.6 - - -declare -begin -:1 := dotlrn_user.new(:user_id, :role); -end; - - - 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 -N -r1.7 -r1.8 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 29 Nov 2001 05:10:36 -0000 1.7 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 1 Dec 2001 23:16:27 -0000 1.8 @@ -26,71 +26,63 @@ return -code error } + ad_proc -public get_user_types {} { + return the list of possible user types, first type then type_id + } { + return [db_list_of_lists select_user_types {}] + } + ad_proc -public user_add { - {-role "user"} - user_id + {-rel_type "dotlrn_user_rel"} + {-user_id:required} + {-type_id 1} } { Add a user as a dotLRN user } { + # set up extra vars + set extra_vars [ns_set create] + + ns_set put $extra_vars user_id $user_id + ns_set put $extra_vars type_id $type_id + db_transaction { - db_exec_plsql add_user {} + if {$rel_type == "dotlrn_full_user_rel"} { + # Create a portal page for this user + set portal_id [portal::create $user_id] + + # Add the basic dotLRN class listing portlet + dotlrn_main_portlet::add_self_to_page $portal_id {} + + # Update the user and set the portal page correctly + ns_set put $extra_vars portal_id $portal_id + } - # Create a portal page for this user - set page_id [portal::create $user_id] - - # Add the basic dotLRN class listing portlet - dotlrn_main_portlet::add_self_to_page $page_id {} - - # Update the user and set the portal page correctly - db_dml update_user_page_id {} - - # FIXME: what do we do about permissions? + # Add the relation (no need to feed in anything for object_id_one, or two for that matter). + set rel_id [relation_add -extra_vars $extra_vars -member_state approved $rel_type "" $user_id] } + + return $rel_id } ad_proc -public user_remove { user_id } { Remove a user from the set of dotLRN users } { - db_dml remove_user {} - } + # Get the rel_id and remove it + set rel_id [db_string select_rel_id {} -default ""] - ad_proc -private user_get_role { - user_id - } { - returns the dotLRN user role or empty string if not a dotLRN user - } { - return [db_string select_user_role {} -default ""] - } - - ad_proc -public guest_add { - community_id - user_id - } { - Add a guest to a particular community - } { - db_transaction { - # Check if this user is a user already - if {[empty_string_p [user_get_role $user_id]]} { - # Add the user as a guest - user_add -role guest $user_id - } - - # Subscribe the guest to that community - dotlrn_community::add_user $community_id $user_id - - # FIXME: what do we do about permissions? + if {![empty_string_p $rel_id]} { + relation_remove $rel_id } } - ad_proc -public guest_remove { - community_id + ad_proc -private user_get_type { user_id } { - Remove a guest from a particular community + returns the dotLRN user role or empty string if not a dotLRN user } { - dotlrn_community::remove_user $community_id $user_id + return [db_string select_user_type {} -default ""] } ad_proc -public user_can_browse_p { @@ -102,11 +94,8 @@ set user_id [ad_conn user_id] } - if {[user_get_role $user_id] == "guest"} { - return 0 - } else { - return 1 - } + # FIXME: must check that a user can browse + return 1 } ad_proc -public require_user_browse { @@ -128,11 +117,8 @@ set user_id [ad_conn user_id] } - if {[user_get_role $user_id] == "guest"} { - return 0 - } else { - return 1 - } + # FIXME + return 1 } ad_proc -public require_user_read_sensitive_data { Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 13 Nov 2001 17:57:30 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.xql 1 Dec 2001 23:16:27 -0000 1.4 @@ -2,21 +2,27 @@ - + -select role from dotlrn_users where user_id = :user_id +select type, type_id from dotlrn_user_types order by type - + -update dotlrn_users set page_id= :page_id where user_id= :user_id +select rel_id from dotlrn_users where user_id= :user_id - + -dotlrn_user.remove(:user_id) +select type from dotlrn_users, dotlrn_user_types where dotlrn_user_rels.type_id= dotlrn_user_types.type_id and user_id= :user_id +> + + + + +update dotlrn_full_user_rels set portal_id= :portal_id where rel_id = (select rel_id from dotlrn_full_users where user_id= :user_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 -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/configure-2.tcl 9 Nov 2001 03:57:18 -0000 1.1 +++ openacs-4/packages/dotlrn/www/configure-2.tcl 1 Dec 2001 23:16:27 -0000 1.2 @@ -11,7 +11,7 @@ set form [ns_getform] -set page_id [ns_set get $form portal_id] +set portal_id [ns_set get $form portal_id] # Check if this is a community type level thing if {[ad_parameter community_type_level_p] == 1} { @@ -23,9 +23,9 @@ # Make sure user is logged in set user_id [ad_maybe_redirect_for_registration] -# If there is no page_id, this user is either a guest or something else -if {![empty_string_p $page_id]} { - portal::configure_dispatch $page_id $form +# If there is no portal_id, this user is either a guest or something else +if {![empty_string_p $portal_id]} { + portal::configure_dispatch $portal_id $form } ad_returnredirect "configure" 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 -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/configure-element.tcl 9 Nov 2001 18:13:26 -0000 1.1 +++ openacs-4/packages/dotlrn/www/configure-element.tcl 1 Dec 2001 23:16:27 -0000 1.2 @@ -41,10 +41,10 @@ # this not a community, it is the "workspace" deal # Get the page - set page_id [db_string select_page_id {} -default ""] + set portal_id [db_string select_portal_id {} -default ""] - # If there is no page_id, this user is either a guest or something else - if {[empty_string_p $page_id]} { + # If there is no portal_id, this user is either a guest or something else + if {[empty_string_p $portal_id]} { # do something ad_returnredirect "/." } else { Index: openacs-4/packages/dotlrn/www/configure-element.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/configure-element.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/configure-element.xql 10 Nov 2001 19:00:43 -0000 1.1 +++ openacs-4/packages/dotlrn/www/configure-element.xql 1 Dec 2001 23:16:27 -0000 1.2 @@ -2,9 +2,9 @@ - + -select page_id from dotlrn_users where user_id= :user_id +select portal_id from dotlrn_full_users where user_id= :user_id Index: openacs-4/packages/dotlrn/www/configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/configure.tcl 9 Nov 2001 04:03:15 -0000 1.2 +++ openacs-4/packages/dotlrn/www/configure.tcl 1 Dec 2001 23:16:27 -0000 1.3 @@ -30,25 +30,25 @@ ad_return_template one-community-not-member return } else { - set page_id [dotlrn_community::get_page_id $community_id $user_id] - set rendered_page [portal::configure $page_id "one-community"] + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] + set rendered_page [portal::configure $portal_id "one-community"] set context_bar {Configure} - set name [portal::get_name $page_id] + set name [portal::get_name $portal_id] } } else { # this not a community, it is the "workspace" deal # Get the page - set page_id [db_string select_page_id {} -default ""] + set portal_id [db_string select_portal_id {} -default ""] - # If there is no page_id, this user is either a guest or something else - if {[empty_string_p $page_id]} { + # If there is no portal_id, this user is either a guest or something else + if {[empty_string_p $portal_id]} { # do something ad_returnredirect "/." } else { - set rendered_page [portal::configure $page_id "index"] - set name [portal::get_name $page_id] + set rendered_page [portal::configure $portal_id "index"] + set name [portal::get_name $portal_id] } } Index: openacs-4/packages/dotlrn/www/configure.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/configure.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/configure.xql 9 Nov 2001 04:02:48 -0000 1.1 +++ openacs-4/packages/dotlrn/www/configure.xql 1 Dec 2001 23:16:27 -0000 1.2 @@ -2,9 +2,9 @@ - + -select page_id from dotlrn_users where user_id= :user_id +select portal_id from dotlrn_full_users where user_id= :user_id Index: openacs-4/packages/dotlrn/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/dotlrn/www/index.tcl 29 Nov 2001 04:33:52 -0000 1.10 +++ openacs-4/packages/dotlrn/www/index.tcl 1 Dec 2001 23:16:27 -0000 1.11 @@ -23,15 +23,15 @@ set user_id [ad_maybe_redirect_for_registration] # Get the page -set page_id [db_string select_page_id {} -default ""] +set portal_id [dotlrn::get_workspace_portal_id $user_id] -# If there is no page_id, this user is either a guest or something else -if {[empty_string_p $page_id]} { +# If there is no portal_id, this user is either a guest or something else +if {[empty_string_p $portal_id]} { # do something ad_return_template index-not-a-user return } else { - set rendered_page [dotlrn::render_page $page_id] + set rendered_page [dotlrn::render_page $portal_id] } Index: openacs-4/packages/dotlrn/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/index.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/index.xql 5 Nov 2001 22:34:23 -0000 1.3 +++ openacs-4/packages/dotlrn/www/index.xql 1 Dec 2001 23:16:27 -0000 1.4 @@ -2,9 +2,9 @@ - + -select page_id from dotlrn_users where user_id= :user_id +select portal_id from dotlrn_full_users where user_id= :user_id Index: openacs-4/packages/dotlrn/www/one-community-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.adp,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/one-community-type.adp 28 Nov 2001 00:11:48 -0000 1.9 +++ openacs-4/packages/dotlrn/www/one-community-type.adp 1 Dec 2001 23:16:27 -0000 1.10 @@ -6,13 +6,6 @@ @description@ -

Communities You're a Member Of

- -

Index: openacs-4/packages/dotlrn/www/one-community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-type.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/dotlrn/www/one-community-type.tcl 27 Nov 2001 23:32:03 -0000 1.5 +++ openacs-4/packages/dotlrn/www/one-community-type.tcl 1 Dec 2001 23:16:27 -0000 1.6 @@ -23,21 +23,13 @@ # Check what communities of this type the user is a member of # cause we want to display that! -set list_of_communities [dotlrn_community::get_communities_by_user $community_type $user_id] +set member_communities [dotlrn_community::get_communities_by_user $community_type $user_id] -# communities should be a data source -template::multirow create communities community_id community_type pretty_name description url - -# Loop and create the data source (I am very unhappy with db_multirow. VERY - bma) -foreach comm $list_of_communities { - template::multirow append communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] -} - # Load all active communities for this community type set list_of_active_communities [dotlrn_community::get_active_communities $community_type] # data source -template::multirow create active_communities community_id community_type pretty_name description url admin_p +template::multirow create active_communities community_id community_type pretty_name description url admin_p member_p # Loop and create the data source (I am very unhappy with db_multirow. VERY - bma) foreach comm $list_of_active_communities { @@ -48,7 +40,13 @@ set admin_p 0 } - template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] $admin_p + if {[lsearch [lindex $comm 0] $member_communities]} { + set member_p 1 + } else { + set member_p 0 + } + + template::multirow append active_communities [lindex $comm 0] [lindex $comm 1] [lindex $comm 2] [lindex $comm 3] [lindex $comm 4] $admin_p $member_p } set context_bar {View} 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 -N -r1.7 -r1.8 --- openacs-4/packages/dotlrn/www/one-community.tcl 28 Nov 2001 00:11:48 -0000 1.7 +++ openacs-4/packages/dotlrn/www/one-community.tcl 1 Dec 2001 23:16:27 -0000 1.8 @@ -25,11 +25,11 @@ if {![dotlrn_community::member_p $community_id $user_id]} { set context_bar [list "Not a member"] - set page_id [dotlrn_community::get_community_non_members_page_id $community_id] + set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] # Possible that there is no portal page for non-members - if {! [empty_string_p $page_id]} { - set rendered_page [dotlrn::render_page $page_id] + if {! [empty_string_p $portal_id]} { + set rendered_page [dotlrn::render_page $portal_id] } else { set rendered_page "" } @@ -38,9 +38,9 @@ return } else { # Pull out the NPP page ID and render it! - set page_id [dotlrn_community::get_page_id $community_id $user_id] + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] - set rendered_page [dotlrn::render_page $page_id] + set rendered_page [dotlrn::render_page $portal_id] set context_bar {View} Index: openacs-4/packages/dotlrn/www/admin/user-new-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/user-new-2.adp 27 Nov 2001 23:16:32 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/user-new-2.adp 1 Dec 2001 23:16:27 -0000 1.3 @@ -4,18 +4,7 @@ You've chosen to add @first_names@ @last_name@.

-

- + -Choose a role: - - -
- - Index: openacs-4/packages/dotlrn/www/admin/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/user-new-2.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 10 Nov 2001 18:03:23 -0000 1.3 +++ openacs-4/packages/dotlrn/www/admin/user-new-2.tcl 1 Dec 2001 23:16:27 -0000 1.4 @@ -8,6 +8,28 @@ user_id } +form create add_user + +element create add_user user_id \ + -label "User ID" -datatype integer -widget hidden -value $user_id + +element create add_user type_id \ + -label "User Type" -datatype text -widget select -options [dotlrn::get_user_types] + +element create add_user rel_type \ + -label "Access" -datatype text -widget select -options {{{Limited Access} dotlrn_user_rel} {{Full Access} dotlrn_full_user_rel}} + +if {[form is_valid add_user]} { + template::form get_values add_user user_id type_id rel_type + + # add the user + dotlrn::user_add -rel_type $rel_type -user_id $user_id -type_id $type_id + + # redirect + ad_returnredirect "users" + return +} + db_1row select_user_info "select first_names,last_name from registered_users where user_id= :user_id" ad_return_template Index: openacs-4/packages/dotlrn/www/admin/user-new-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/Attic/user-new-3.tcl,v diff -u -N --- openacs-4/packages/dotlrn/www/admin/user-new-3.tcl 27 Nov 2001 23:16:32 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ - -ad_page_contract { - Add an actual user - - @author Ben Adida (ben@openforce.net) - @creation-date 2001-11-04 -} { - user_id - {role student} -} - -# Add the user -dotlrn::user_add -role $role $user_id - -ad_returnredirect "users" - Index: openacs-4/packages/dotlrn/www/admin/users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/www/admin/users.adp 29 Nov 2001 06:05:37 -0000 1.3 +++ openacs-4/packages/dotlrn/www/admin/users.adp 1 Dec 2001 23:16:27 -0000 1.4 @@ -5,7 +5,7 @@

dotLRN users

    -
  • @users.last_name@, @users.first_names@ (@users.email@) - @users.role@ +
  • @users.last_name@, @users.first_names@ (@users.email@) - @users.type@
Index: openacs-4/packages/dotlrn/www/admin/users.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/admin/users.xql 10 Nov 2001 18:03:23 -0000 1.2 +++ openacs-4/packages/dotlrn/www/admin/users.xql 1 Dec 2001 23:16:27 -0000 1.3 @@ -4,7 +4,7 @@ -select first_names, last_name, email, role from dotlrn_users_full order by last_name +select first_names, last_name, email, type from dotlrn_users order by last_name Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 29 Nov 2001 22:49:19 -0000 1.9 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 1 Dec 2001 23:16:41 -0000 1.10 @@ -109,8 +109,8 @@ } { Add a user to a specific dotlrn community } { - # Get the page_id by callback - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_bboard] @@ -119,16 +119,16 @@ # nothing for now # Make bboard DS available to this page - bboard_portlet::make_self_available $page_id + bboard_portlet::make_self_available $portal_id # Call the portal element to be added correctly - bboard_portlet::add_self_to_page $page_id $package_id + bboard_portlet::add_self_to_page $portal_id $package_id # Now for the user workspace - set workspace_page_id [dotlrn_community::get_workspace_page_id $user_id] + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] # Add the portlet here - bboard_portlet::add_self_to_page $workspace_page_id $package_id + bboard_portlet::add_self_to_page $workspace_portal_id $package_id } ad_proc -public remove_user { @@ -137,26 +137,26 @@ } { Remove a user from a community } { - # Get the page_id - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] # Remove the portal element - bboard_portlet::remove_self_from_page $page_id $package_id + bboard_portlet::remove_self_from_page $portal_id $package_id # Buh Bye. - bboard_portlet::make_self_unavailable $page_id + bboard_portlet::make_self_unavailable $portal_id # remove user permissions to see bboards # nothing to do here # Remove from the main workspace - set workspace_page_id [dotlrn_community::get_workspace_page_id $user_id] + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] # Add the portlet here - bboard_portlet::remove_self_from_page $workspace_page_id $package_id + bboard_portlet::remove_self_from_page $workspace_portal_id $package_id } } Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 29 Nov 2001 23:11:12 -0000 1.9 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 1 Dec 2001 23:16:46 -0000 1.10 @@ -113,11 +113,10 @@ # set calendar_id [calendar_create $user_id "t" $community_name] # add this PE to the user's workspace! - set workspace_page_id [dotlrn_community::get_workspace_page_id $user_id] - # Add the portlet here - calendar_portlet::add_self_to_page $workspace_page_id $calendar_id + set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] - + # Add the portlet here + calendar_portlet::add_self_to_page $workspace_portal_id $calendar_id } ad_proc -public add_user_to_community { @@ -133,12 +132,12 @@ # aks XXX # add the portlet, to this user's community portal - set page_id [dotlrn_community::get_page_id $community_id $user_id] + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Add the calendar DS to the user's community portal. # This will copy the params from the portal template if exists - calendar_portlet::make_self_available $page_id - calendar_portlet::add_self_to_page $page_id $calendar_id + calendar_portlet::make_self_available $portal_id + calendar_portlet::add_self_to_page $portal_id $calendar_id # temporary hack by ben to make calendar unique (FIXME) set calendar_id [calendar_create $user_id "t" "$community_name-$user_id"] @@ -157,17 +156,17 @@ } { Remove a user from a community } { - # Get the page_id - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_package_id $community_id] # Remove the portal element - calendar_portlet::remove_self_from_page $page_id $package_id + calendar_portlet::remove_self_from_page $portal_id $package_id # Buh Bye. - calendar_portlet::make_self_unavailable $page_id + calendar_portlet::make_self_unavailable $portal_id # remove user permissions to see calendar folders # nothing to do here Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 30 Nov 2001 17:56:58 -0000 1.8 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 1 Dec 2001 23:18:16 -0000 1.9 @@ -56,12 +56,12 @@ # No mounting of anything # Non-member page stuff - # Get the non-member page_id - set page_id [dotlrn_community::get_community_non_members_page_id $community_id] + # Get the non-member portal_id + set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] # Add the element there, too - dotlrn_portlet::make_self_available $page_id - dotlrn_portlet::add_self_to_page $page_id $community_id + dotlrn_portlet::make_self_available $portal_id + dotlrn_portlet::add_self_to_page $portal_id $community_id # portal template stuff # get the portal_template_id @@ -105,15 +105,15 @@ } { Called when a user is added to a spceific dotlrn community } { - # Get the page_id by callback - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Allow user to see the dotlrn forums # nothing for now # Make dotlrn DS available to this page - dotlrn_portlet::make_self_available $page_id - dotlrn_portlet::add_self_to_page $page_id $community_id + dotlrn_portlet::make_self_available $portal_id + dotlrn_portlet::add_self_to_page $portal_id $community_id } ad_proc -public remove_user { @@ -122,17 +122,17 @@ } { Remove a user from a community } { - # Get the page_id - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback # set package_id [dotlrn_community::get_package_id $community_id] # Remove the portal element - dotlrn_portlet::remove_self_from_page $page_id $community_id + dotlrn_portlet::remove_self_from_page $portal_id $community_id # Buh Bye. - dotlrn_portlet::make_self_unavailable $page_id + dotlrn_portlet::make_self_unavailable $portal_id # remove user permissions to see dotlrns # nothing to do here Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 30 Nov 2001 18:12:57 -0000 1.7 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 1 Dec 2001 23:17:01 -0000 1.8 @@ -98,8 +98,8 @@ } { Called when a user is added to a specific dotlrn community } { - # Get the page_id by callback - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the faq applet's package_id by callback set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_faq] @@ -108,10 +108,10 @@ # nothing for now # Make faq DS available to this page - faq_portlet::make_self_available $page_id + faq_portlet::make_self_available $portal_id # Call the portal element to be added correctly - faq_portlet::add_self_to_page $page_id $package_id + faq_portlet::add_self_to_page $portal_id $package_id } ad_proc -public remove_user { @@ -120,17 +120,17 @@ } { Remove a user from a community } { - # Get the page_id - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_package_id $community_id] # Remove the portal element - faq_portlet::remove_self_from_page $page_id $package_id + faq_portlet::remove_self_from_page $portal_id $package_id # Buh Bye. - faq_portlet::make_self_unavailable $page_id + faq_portlet::make_self_unavailable $portal_id # remove user permissions to see faqs # nothing to do here Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 30 Nov 2001 18:18:01 -0000 1.10 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 1 Dec 2001 23:16:53 -0000 1.11 @@ -80,11 +80,11 @@ # FIXME: Set up permissions on this folder # non-member page stuff - # Get non member page_id - set non_member_page_id [dotlrn_community::get_community_non_members_page_id $community_id] + # Get non member portal_id + set non_member_portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] # Make file storage available public-folder only at community non-member page - fs_portlet::add_self_to_page $non_member_page_id $package_id $public_folder_id + fs_portlet::add_self_to_page $non_member_portal_id $package_id $public_folder_id # portal template stuff # get the portal_template_id by callback @@ -136,8 +136,8 @@ } { Add a user to a to a specifc dotlrn community } { - # Get the page_id by callback - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_fs] @@ -150,7 +150,7 @@ set folder_id [fs_get_root_folder -package_id $package_id] # Make file storage available at community-user page level - fs_portlet::add_self_to_page $page_id $package_id $folder_id + fs_portlet::add_self_to_page $portal_id $package_id $folder_id } ad_proc -public remove_user { @@ -159,17 +159,17 @@ } { Remove a user from a community } { - # Get the page_id - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_package_id $community_id] # Remove the portal element - fs_portlet::remove_self_from_page $page_id $package_id + fs_portlet::remove_self_from_page $portal_id $package_id # Buh Bye. - fs_portlet::make_self_unavailable $page_id + fs_portlet::make_self_unavailable $portal_id # remove user permissions to see fs folders # nothing to do here Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 30 Nov 2001 18:21:30 -0000 1.4 +++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 1 Dec 2001 23:18:08 -0000 1.5 @@ -99,8 +99,8 @@ } { # ad_return_complaint 1 "$community_id $user_id" - # Get the page_id by callback - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id by callback + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_applet_package_id $community_id dotlrn_news] @@ -112,9 +112,9 @@ # Make news DS available to this page - news_portlet::make_self_available $page_id + news_portlet::make_self_available $portal_id - news_portlet::add_self_to_page $page_id $package_id + news_portlet::add_self_to_page $portal_id $package_id } ad_proc -public remove_user { @@ -123,17 +123,17 @@ } { Remove a user from a community } { - # Get the page_id - set page_id [dotlrn_community::get_page_id $community_id $user_id] + # Get the portal_id + set portal_id [dotlrn_community::get_portal_id $community_id $user_id] # Get the package_id by callback set package_id [dotlrn_community::get_package_id $community_id] # Remove the portal element - news_portlet::remove_self_from_page $page_id $package_id + news_portlet::remove_self_from_page $portal_id $package_id # Buh Bye. - news_portlet::make_self_unavailable $page_id + news_portlet::make_self_unavailable $portal_id # remove user permissions to see news folders # nothing to do here Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 17 Nov 2001 23:49:03 -0000 1.14 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 1 Dec 2001 23:18:40 -0000 1.15 @@ -32,20 +32,20 @@ ad_proc -public add_self_to_page { - page_id + portal_id community_id } { Adds a dotlrn PE to the given page with the community_id as opaque data in the portal configuration. @return element_id The new element's id - @param page_id The page to add self to + @param portal_id The page to add self to @param community_id The dotlrn community to show info about @author arjun@openforce.net @creation-date Sept 2001 } { # Tell portal to add this element to the page - set element_id [portal::add_element_to_region $page_id [my_name] 2] + set element_id [portal::add_element_to_region $portal_id [my_name] 2] # The default param must be configured set key "community_id" @@ -100,7 +100,7 @@ } { Removes a dotlrn PE from the given page - @param page_id The page to remove self from + @param portal_id The page to remove self from @param community_id @author arjun@openforce.net @creation-date Sept 2001 @@ -123,29 +123,29 @@ } ad_proc -public make_self_available { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_available \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } ad_proc -public make_self_unavailable { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_unavailable \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } } Index: openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 19 Nov 2001 14:59:48 -0000 1.13 +++ openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 1 Dec 2001 23:18:44 -0000 1.14 @@ -31,20 +31,20 @@ } ad_proc -public add_self_to_page { - page_id + portal_id package_id } { Adds a faq PE to the given page with the package_id being opaque data in the portal configuration. @return element_id The new element's id - @param page_id The page to add self to + @param portal_id The page to add self to @param package_id the id of the faq package for this community @author arjun@openforce.net @creation-date Sept 2001 } { # Tell portal to add this element to the page - set element_id [portal::add_element $page_id [my_name]] + set element_id [portal::add_element $portal_id [my_name]] # The default param "package_id" must be configured set key "package_id" @@ -121,7 +121,7 @@ } { Removes a faq PE from the given page - @param page_id The page to remove self from + @param portal_id The page to remove self from @param package_id @author arjun@openforce.net @creation-date Sept 2001 @@ -138,29 +138,29 @@ } ad_proc -public make_self_available { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_available \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } ad_proc -public make_self_unavailable { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_unavailable \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } } Index: openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 19 Nov 2001 15:15:52 -0000 1.15 +++ openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 1 Dec 2001 23:18:53 -0000 1.16 @@ -31,22 +31,22 @@ } ad_proc -public add_self_to_page { - page_id + portal_id community_id folder_id } { Adds a fs PE to the given page with the community_id and folder_id being opaque data in the portal configuration. @return element_id The new element's id - @param page_id The page to add self to + @param portal_id The page to add self to @param community_id The community with the folder @param folder_id The folder to show @author arjun@openforce.net @creation-date Sept 2001 } { # Tell portal to add this element to the page - set element_id [portal::add_element $page_id [my_name]] + set element_id [portal::add_element $portal_id [my_name]] # The default param "community_id" must be configured set key "community_id" @@ -159,7 +159,7 @@ } { Removes a fs PE from the given page - @param page_id The page to remove self from + @param portal_id The page to remove self from @param community_id @author arjun@openforce.net @creation-date Sept 2001 @@ -176,29 +176,29 @@ } ad_proc -public make_self_available { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_available \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } ad_proc -public make_self_unavailable { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_unavailable \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } } Index: openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 19 Nov 2001 15:24:02 -0000 1.5 +++ openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 1 Dec 2001 23:19:03 -0000 1.6 @@ -31,19 +31,19 @@ } ad_proc -public add_self_to_page { - page_id + portal_id community_id } { Adds a news PE to the given page with the community_id. @return element_id The new element's id - @param page_id The page to add self to + @param portal_id The page to add self to @param community_id The community with the folder @author arjun@openforce.net @creation-date Sept 2001 } { # Tell portal to add this element to the page - set element_id [portal::add_element $page_id [my_name]] + set element_id [portal::add_element $portal_id [my_name]] # The default param "community_id" must be configured set key "community_id" @@ -125,7 +125,7 @@ } { Removes a news PE from the given page - @param page_id The page to remove self from + @param portal_id The page to remove self from @param community_id @author arjun@openforce.net @creation-date Sept 2001 @@ -142,29 +142,29 @@ } ad_proc -public make_self_available { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_available \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } ad_proc -public make_self_unavailable { - page_id + portal_id } { Wrapper for the portal:: proc - @param page_id + @param portal_id @author arjun@openforce.net @creation-date Nov 2001 } { portal::make_datasource_unavailable \ - $page_id [portal::get_datasource_id [my_name]] + $portal_id [portal::get_datasource_id [my_name]] } }