Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-applet-sc-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql 3 Oct 2001 21:10:59 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql 5 Oct 2001 15:14:21 -0000 1.3 @@ -18,93 +18,93 @@ foo integer; begin sc_dotlrn_contract := acs_sc_contract.new ( - contract_name => 'dotLRN_Applet', + contract_name => 'dotlrn_applet', contract_desc => 'dotLRN Applet implement a specific interface' ); -- Add the applet to a community foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.AddApplet.InputType', + msg_type_name => 'dotlrn_applet.AddApplet.InputType', msg_type_spec => 'community_id:integer' ); foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.AddApplet.OutputType', + msg_type_name => 'dotlrn_applet.AddApplet.OutputType', msg_type_spec => 'success_p:boolean,error_message:string' ); foo := acs_sc_operation.new ( - 'dotLRN_Applet', + 'dotlrn_applet', 'AddApplet', 'Add the Applet to a community', 'f', -- not cacheable 1, -- n_args - 'dotLRN_Applet.AddApplet.InputType', - 'dotLRN_Applet.AddApplet.OutputType' + 'dotlrn_applet.AddApplet.InputType', + 'dotlrn_applet.AddApplet.OutputType' ); -- add a user to the community foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.AddUser.InputType', + msg_type_name => 'dotlrn_applet.AddUser.InputType', msg_type_spec => 'community_id:integer,user_id:integer' ); foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.AddUser.OutputType', + msg_type_name => 'dotlrn_applet.AddUser.OutputType', msg_type_spec => 'success_p:boolean,error_message:string' ); foo := acs_sc_operation.new ( - 'dotLRN_Applet', + 'dotlrn_applet', 'AddUser', 'Add a user to a community, and set up appropriate things for that applet', 'f', -- not cacheable 2, -- n_args - 'dotLRN_Applet.AddUser.InputType', - 'dotLRN_Applet.AddUser.OutputType' + 'dotlrn_applet.AddUser.InputType', + 'dotlrn_applet.AddUser.OutputType' ); -- remove a user from the community foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.RemoveUser.InputType', + msg_type_name => 'dotlrn_applet.RemoveUser.InputType', msg_type_spec => 'community_id:integer,user_id:integer' ); foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.RemoveUser.OutputType', + msg_type_name => 'dotlrn_applet.RemoveUser.OutputType', msg_type_spec => 'success_p:boolean,error_message:string' ); foo := acs_sc_operation.new ( - 'dotLRN_Applet', + 'dotlrn_applet', 'RemoveUser', 'Remove a user from a community, and set up appropriate things for that applet', 'f', -- not cacheable 2, -- n_args - 'dotLRN_Applet.RemoveUser.InputType', - 'dotLRN_Applet.RemoveUser.OutputType' + 'dotlrn_applet.RemoveUser.InputType', + 'dotlrn_applet.RemoveUser.OutputType' ); -- remove the applet from a community foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.RemoveApplet.InputType', - msg_type_spec => 'community_id:integer' + msg_type_name => 'dotlrn_applet.RemoveApplet.InputType', + msg_type_spec => 'community_id:integer,package_id:integer' ); foo := acs_sc_msg_type.new( - msg_type_name => 'dotLRN_Applet.RemoveApplet.OutputType', + msg_type_name => 'dotlrn_applet.RemoveApplet.OutputType', msg_type_spec => 'success_p:boolean,error_message:string' ); foo := acs_sc_operation.new ( - 'dotLRN_Applet', + 'dotlrn_applet', 'RemoveApplet', - 'Remove a user from a community, and set up appropriate things for that applet', + 'Remove the applet', 'f', -- not cacheable - 1, -- n_args - 'dotLRN_Applet.RemoveApplet.InputType', - 'dotLRN_Applet.RemoveApplet.OutputType' + 2, -- n_args + 'dotlrn_applet.RemoveApplet.InputType', + 'dotlrn_applet.RemoveApplet.OutputType' ); 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 -r1.1 -r1.2 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 20 Sep 2001 18:54:51 -0000 1.1 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-create.sql 5 Oct 2001 15:14:21 -0000 1.2 @@ -23,6 +23,175 @@ constraint dotlrn_class_i_id_pk primary key, class_key constraint dotlrn_class_i_class_key_fk - references dotlrn_classes(class_key) + references dotlrn_classes(class_key), + year varchar(10), + term varchar(20) ); + + +-- +-- PL/SQL stuff +-- + +create or replace package dotlrn_class +is + function new ( + class_key in dotlrn_classes.class_key%TYPE, + pretty_name in dotlrn_communities.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_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, + pretty_name in dotlrn_communities.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_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 => 'dotlrn_class', + 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) values (v_class_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, + class_key in dotlrn_class_instances.class_key%TYPE, + year in dotlrn_class_instances.year%TYPE, + term in dotlrn_class_instances.term%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, + 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, + year in dotlrn_class_instances.year%TYPE, + term in dotlrn_class_instances.term%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, + 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, + 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, year, term) + values + (v_class_instance_id, class_key, year, term); + + 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/dotlrn-communities-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-communities-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 3 Oct 2001 21:10:59 -0000 1.3 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-communities-create.sql 5 Oct 2001 15:14:21 -0000 1.4 @@ -17,8 +17,8 @@ references group_types (group_type), pretty_name varchar(100) not null, description varchar(4000), - node_id constraint dlrn_comm_type_node_id_fk - references site_nodes(node_id), + package_id constraint dlrn_comm_type_pack_id_fk + references apm_packages(package_id), supertype constraint dlrn_comm_supertype_fk references dotlrn_community_types(community_type) ); @@ -36,8 +36,8 @@ constraint dlrn_comm_key_un unique, pretty_name varchar(100) not null, description varchar(4000), - node_id constraint dlrn_comm_node_id_fk - references site_nodes(node_id) + package_id constraint dlrn_comm_pack_id_fk + references apm_packages(package_id) ); @@ -59,6 +59,218 @@ constraint dlrn_comm_appl_comm_id_fk references dotlrn_communities(community_id), applet_key varchar(100) not null, constraint dlrn_comm_appl_pk primary key (community_id, applet_key), + package_id integer, -- this is the package_id for what packge this applet represents active_p char(1) default 't' not null constraint dlrn_comm_appl_act_p_ch check (active_p in ('t','f')) ); + + +-- +-- PL/SQL for community and community types +-- + +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; + begin + if parent_type is null + then v_parent_object_type:= 'group'; + else v_parent_object_type:= parent_type; + end if; + + acs_object_type.create_type ( + supertype => v_parent_object_type, + object_type => community_type, + pretty_name => pretty_name, + pretty_plural => pretty_plural, + table_name => community_type, + id_column => 'XXX', + package_name => community_type, + name_method => 'acs_group.name' + ); + + insert into group_types + (group_type, default_join_policy) values (community_type, 'closed'); + + insert into dotlrn_community_types + (community_type, pretty_name, description, package_id, supertype) + values + (community_type, pretty_name, description, package_id, 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= community_type; + + acs_object_type.drop_type(community_type); + end; + + function name ( + community_type in dotlrn_community_types.community_type%TYPE + ) return varchar + is + name dotlrn_community_types.pretty_name%TYPE; + begin + select pretty_name into name from dotlrn_community_types; + + return name; + end; + +end; +/ +show errors + + +create or replace package dotlrn_community +is + function new ( + community_id in dotlrn_communities.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, + package_id in dotlrn_communities.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_communities.community_id%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; + +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, + 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, + package_id in dotlrn_communities.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_communities.community_id%TYPE + is + c_id integer; + begin + c_id := acs_group.new ( + group_id => community_id, + object_type => community_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + group_name => community_key + ); + + insert into dotlrn_communities + (community_id, community_type, community_key, pretty_name, description, package_id) + values + (c_id, community_type, community_key, pretty_name, description, package_id); + + return c_id; + end; + + procedure delete ( + community_id in dotlrn_communities.community_id%TYPE + ) + is + begin + delete from dotlrn_communities where community_id= community_id; + + acs_group.delete(community_id); + end; + + function name ( + community_id in dotlrn_communities.community_id%TYPE + ) return varchar + is + begin + return acs_group.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 + begin + -- TODO: a-la aD, implement this for real (bma) + return 't'; + end; + +end; +/ +show errors + Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 3 Oct 2001 21:10:59 -0000 1.2 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 5 Oct 2001 15:14:21 -0000 1.3 @@ -15,43 +15,35 @@ declare year_attr_id acs_attributes.attribute_id%TYPE; term_attr_id acs_attributes.attribute_id%TYPE; + foo dotlrn_community_types.community_type%TYPE; begin - -- create the major group types - acs_object_type.create_type ( - supertype => 'group', - object_type => 'dotlrn_community', + -- Create the base community type + foo := dotlrn_community_type.new ( + community_type => 'dotlrn_community', + parent_type => NULL, pretty_name => 'dotLRN Community', pretty_plural => 'dotLRN Communities', - table_name => 'dotlrn_communities', - id_column => 'community_id', - package_name => 'dotlrn_community', - type_extension_table => 'dotlrn_community_types', - name_method => 'acs_group.name' - ); + description => 'dotLRN Communities - the base community type' + ); - acs_object_type.create_type ( - supertype => 'dotlrn_community', - object_type => 'dotlrn_club', - pretty_name => 'dotLRN Club', - pretty_plural => 'dotLRN Clubs', - table_name => 'dotlrn_clubs', - id_column => 'club_id', - package_name => 'dotlrn_club', - name_method => 'acs_group.name' - ); - - acs_object_type.create_type ( - supertype => 'dotlrn_community', - object_type => 'dotlrn_class', + -- create the dotlrn_class community type + foo := dotlrn_community_type.new ( + community_type => 'dotlrn_class', + parent_type => 'dotlrn_community', pretty_name => 'dotLRN Class', pretty_plural => 'dotLRN Classes', - table_name => 'dotlrn_class_instances', - id_column => 'class_instance_id', - package_name => 'dotlrn_class', - name_method => 'acs_group.name' - ); + description => 'dotLRN Classes - e.g. 6.001' + ); - + -- create the dotlrn_club community type + foo := dotlrn_community_type.new ( + community_type => 'dotlrn_club', + parent_type => 'dotlrn_community', + pretty_name => 'dotLRN Club', + pretty_plural => 'dotLRN Clubs', + description => 'dotLRN Clubs - e.g. Alumni' + ); + -- year attribute year_attr_id:= acs_attribute.create_attribute ( object_type => 'dotlrn_class', Index: openacs-4/packages/dotlrn/tcl/class-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/class-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/tcl/class-procs.tcl 3 Oct 2001 21:11:00 -0000 1.4 +++ openacs-4/packages/dotlrn/tcl/class-procs.tcl 5 Oct 2001 15:14:25 -0000 1.5 @@ -19,6 +19,7 @@ namespace eval dotlrn_class { ad_proc -public new { + {-description ""} name pretty_name } { @@ -28,15 +29,17 @@ This class can then be instantiated for a particular semester. } { - set top_group_type [dotlrn::class_group_type_key] - set parent_node_id [ad_conn -get node_id] set group_type_name "dotlrn_class_$name" db_transaction { + # Create the class directly using PL/SQL API + set class_group_type_key [db_exec_plsql create_class {}] + # Create a new group type for that class - set class_group_type_key [group_type::new -group_type $group_type_name -supertype $top_group_type $pretty_name $pretty_name] + # OLD STUFF (not relevant with PL/SQL API) + # set class_group_type_key [group_type::new -group_type $group_type_name -supertype $top_group_type $pretty_name $pretty_name] # Instantiate the DOTLRN Class Manager package at that node set result [site_node_mount_application -return "package_id,node_id" $parent_node_id $name [package_key] $name] @@ -48,12 +51,15 @@ ad_parameter -package_id $package_id -set 1 community_type_level_p ad_parameter -package_id $package_id -set 0 community_level_p - # Insert the community - dotlrn_community::new_type $class_group_type_key dotlrn_class $pretty_name + # Old stuff + # dotlrn_community::new_type $class_group_type_key dotlrn_class $pretty_name + + # Set the site node dotlrn_community::set_type_site_node $class_group_type_key $node_id # insert the class into the DB - db_dml insert_class {} + # ALREADY DONE by PL/SQL API + # db_dml insert_class {} } return $class_group_type_key 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.3 -r1.4 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 3 Oct 2001 21:11:00 -0000 1.3 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 5 Oct 2001 15:14:25 -0000 1.4 @@ -18,56 +18,50 @@ namespace eval dotlrn_community { - ad_proc new_type { + ad_proc -public new_type { + {-description ""} community_type supertype pretty_name - {-description ""} } { Create a new community type. } { - # Create the group type - set group_type_key [group_type::new -group_type $community_type -supertype $parent_type $pretty_name $pretty_name] - # Insert the community type - db_dml insert_community_type {} + db_exec_plsql create_community_type {} } - ad_proc set_type_site_node { + ad_proc set_type_package_id { community_type - node_id + package_id } { - Update the node ID for the community type + Update the package ID for the community type } { # Exec the statement, easy - db_dml update_site_node {} + db_dml update_package_id {} } ad_proc new { + {-description ""} community_type name pretty_name - {-description ""} } { create a new community } { - # Create the group - set community_id [group::new -group_name $name $community_type] + # Create the community + set community_id [db_exec_plsql create_community {}] - # insert the community row - db_dml insert_community {} - return $community_id } - ad_proc set_site_node { + ad_proc set_package_id { community_id - node_id + package_id } { Update the node ID for the community } { # Exec the statement, easy - db_dml update_site_node {} + db_dml update_package_id {} } @@ -89,6 +83,15 @@ return [db_list_of_lists select_users {}] } + ad_proc -public member_p { + community_id + user_id + } { + check membership + } { + return [db_string select_count_membership {}] + } + ad_proc -public add_user { community_id rel_type @@ -100,8 +103,7 @@ set rel_id [relation_add $rel_type $community_id $user_id] # Set up a portal page for that user - # NPP call - set page_id [] + set page_id [portal::create_portal $user_id] # Insert the membership db_dml insert_membership {} @@ -138,6 +140,41 @@ return [db_string select_page_id {}] } + ad_proc -public get_communities_by_user { + community_type + user_id + } { + Return a datasource of the communities that a user belongs to in a particular type + } { + return [db_multirow select_communities {}] + } + + ad_proc -public get_community_type { + } { + Returns the community type key depending on the node we're at + } { + set package_id [ad_conn package_id] + + return [db_string select_community_type {} -default ""] + } + + ad_proc -public get_community_id { + } { + Returns the community id depending on the node we're at + } { + set package_id [ad_conn package_id] + + return [db_string select_community {} -default ""] + } + + ad_proc -public get_package_id { + community_id + } { + get the package ID for a particular community + } { + return [db_string select_package_id {} -default ""] + } + ad_proc -public add_applet { community_id applet_key Index: openacs-4/packages/dotlrn/www/class-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/class-new-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/class-new-2.tcl 20 Sep 2001 18:29:35 -0000 1.1 +++ openacs-4/packages/dotlrn/www/class-new-2.tcl 5 Oct 2001 15:14:29 -0000 1.2 @@ -7,9 +7,10 @@ } { class_key:trim class_pretty_name:trim + description } -set class_key [dotlrn_class::new $class_key $class_pretty_name] +set class_key [dotlrn_class::new -description $description $class_key $class_pretty_name] ns_returnredirect ./ Index: openacs-4/packages/dotlrn/www/class-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/class-new.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/class-new.adp 20 Sep 2001 18:29:35 -0000 1.1 +++ openacs-4/packages/dotlrn/www/class-new.adp 5 Oct 2001 15:14:29 -0000 1.2 @@ -11,6 +11,10 @@ Class Pretty Name: + +Description: + + - \ No newline at end of file + Index: openacs-4/packages/dotlrn/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/index-oracle.xql 20 Sep 2001 18:29:35 -0000 1.1 +++ openacs-4/packages/dotlrn/www/index-oracle.xql 5 Oct 2001 15:14:29 -0000 1.2 @@ -5,7 +5,7 @@ -select class_key, node_id, site_node.url(node_id) as url from dotlrn_classes order by class_key +select class_key, node_id, site_node.url(node_id) as url from dotlrn_classes, dotlrn_community_types where dotlrn_community_types.community_type=dotlrn_classes.class_key order by class_key Index: openacs-4/packages/dotlrn/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/index.tcl 3 Oct 2001 21:11:02 -0000 1.2 +++ openacs-4/packages/dotlrn/www/index.tcl 5 Oct 2001 15:14:29 -0000 1.3 @@ -9,7 +9,12 @@ classes:multirow } +if {[ad_parameter community_type_level_p] == 1} { + ns_returnredirect one-community-type + return +} + # Select the classes that exist -db_multirow communities select_communities {} +db_multirow classes select_classes {} ad_return_template Index: openacs-4/packages/dotlrn/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/index.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/index.xql 20 Sep 2001 18:29:35 -0000 1.1 +++ openacs-4/packages/dotlrn/www/index.xql 5 Oct 2001 15:14:29 -0000 1.2 @@ -4,7 +4,7 @@ -select class_key, node_id, site_node.url(node_id) from dotlrn_classes order by class_key +select class_key, node_id, site_node.url(node_id) from dotlrn_classes, dotlrn_community_types where dotlrn_community_types.community_type=dotlrn_classes.class_key order by class_key