Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-memberships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-classes-memberships-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-classes-memberships-create.sql 1 Apr 2002 07:33:04 -0000 1.1 @@ -0,0 +1,200 @@ +-- +-- Copyright (C) 2001, 2002 OpenForce, Inc. +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- Membership stuff for classes +-- ben@openforce + +-- +-- For Classes +-- + +create table dotlrn_student_rels ( + rel_id constraint dotlrn_student_rels_rel_id_fk + references dotlrn_member_rels (rel_id) + constraint dotlrn_student_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_student_rels_full +as + select dotlrn_member_rels_full.rel_id, + dotlrn_member_rels_full.community_id, + dotlrn_member_rels_full.user_id, + dotlrn_member_rels_full.rel_type, + dotlrn_member_rels_full.role, + dotlrn_member_rels_full.portal_id, + dotlrn_member_rels_full.member_state + from dotlrn_member_rels_full, + dotlrn_student_rels + where dotlrn_member_rels_full.rel_id = dotlrn_student_rels.rel_id; + +create table dotlrn_ta_rels ( + rel_id constraint dotlrn_ta_rels_rel_id_fk + references dotlrn_admin_rels (rel_id) + constraint dotlrn_ta_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_ta_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.portal_id, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_ta_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_ta_rels.rel_id; + +create table dotlrn_ca_rels ( + rel_id constraint dotlrn_ca_rels_rel_id_fk + references dotlrn_admin_rels (rel_id) + constraint dotlrn_ca_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_ca_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.portal_id, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_ca_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_ca_rels.rel_id; + +create table dotlrn_cadmin_rels ( + rel_id constraint dotlrn_cadmin_rels_rel_id_fk + references dotlrn_admin_rels (rel_id) + constraint dotlrn_cadmin_rels_rel_id_pk + primary key +); + +create or replace view dotlrn_cadmin_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.portal_id, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_cadmin_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_cadmin_rels.rel_id; + +create table dotlrn_instructor_rels ( + rel_id constraint dotlrn_instructor_rels_rel_fk + references dotlrn_admin_rels(rel_id) + constraint dotlrn_instructor_rels_rel_pk + primary key +); + +create or replace view dotlrn_instructor_rels_full +as + select dotlrn_admin_rels_full.rel_id, + dotlrn_admin_rels_full.community_id, + dotlrn_admin_rels_full.user_id, + dotlrn_admin_rels_full.rel_type, + dotlrn_admin_rels_full.role, + dotlrn_admin_rels_full.portal_id, + dotlrn_admin_rels_full.member_state + from dotlrn_admin_rels_full, + dotlrn_instructor_rels + where dotlrn_admin_rels_full.rel_id = dotlrn_instructor_rels.rel_id; + + + +declare + foo integer; +begin + acs_rel_type.create_type ( + rel_type => 'dotlrn_student_rel', + supertype => 'dotlrn_member_rel', + pretty_name => 'dotLRN Student Community Membership', + pretty_plural => 'dotLRN Student Community Memberships', + package_name => 'dotlrn_student_rel', + table_name => 'dotlrn_student_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'student', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_ta_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Teaching Assistant Community Membership', + pretty_plural => 'dotLRN Teaching Assistant Community Memberships', + package_name => 'dotlrn_ta_rel', + table_name => 'dotlrn_ta_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'teaching_assistant', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_ca_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Course Assitant Community Membership', + pretty_plural => 'dotLRN Course Assitant Community Memberships', + package_name => 'dotlrn_ca_rel', + table_name => 'dotlrn_ca_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'course_assistant', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_cadmin_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Course Administrator Community Membership', + pretty_plural => 'dotLRN Course Administrator Community Memberships', + package_name => 'dotlrn_cadmin_rel', + table_name => 'dotlrn_cadmin_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'course_admin', + min_n_rels_two => 0, max_n_rels_two => null + ); + + acs_rel_type.create_type ( + rel_type => 'dotlrn_instructor_rel', + supertype => 'dotlrn_admin_rel', + pretty_name => 'dotLRN Instructor Community Membership', + pretty_plural => 'dotLRN Instructor Community Memberships', + package_name => 'dotlrn_instructor_rel', + table_name => 'dotlrn_instructor_rels', + id_column => 'rel_id', + object_type_one => 'dotlrn_class_instance', role_one => null, + min_n_rels_one => 0, max_n_rels_one => null, + object_type_two => 'user', role_two => 'instructor', + min_n_rels_two => 0, max_n_rels_two => null + ); +end; +/ +show errors Index: openacs-4/packages/dotlrn/sql/oracle/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 -r1.11 -r1.12 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql 29 Mar 2002 19:14:44 -0000 1.11 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-community-memberships-create.sql 1 Apr 2002 07:33:04 -0000 1.12 @@ -82,225 +82,4 @@ dotlrn_admin_rels where dotlrn_member_rels_full.rel_id = dotlrn_admin_rels.rel_id; --- --- For Classes --- -create table dotlrn_student_rels ( - rel_id constraint dotlrn_student_rels_rel_id_fk - references dotlrn_member_rels (rel_id) - constraint dotlrn_student_rels_rel_id_pk - primary key -); - -create or replace view dotlrn_student_rels_full -as - select dotlrn_member_rels_full.rel_id, - dotlrn_member_rels_full.community_id, - dotlrn_member_rels_full.user_id, - dotlrn_member_rels_full.rel_type, - dotlrn_member_rels_full.role, - dotlrn_member_rels_full.portal_id, - dotlrn_member_rels_full.member_state - from dotlrn_member_rels_full, - dotlrn_student_rels - where dotlrn_member_rels_full.rel_id = dotlrn_student_rels.rel_id; - -create table dotlrn_ta_rels ( - rel_id constraint dotlrn_ta_rels_rel_id_fk - references dotlrn_admin_rels (rel_id) - constraint dotlrn_ta_rels_rel_id_pk - primary key -); - -create or replace view dotlrn_ta_rels_full -as - select dotlrn_admin_rels_full.rel_id, - dotlrn_admin_rels_full.community_id, - dotlrn_admin_rels_full.user_id, - dotlrn_admin_rels_full.rel_type, - dotlrn_admin_rels_full.role, - dotlrn_admin_rels_full.portal_id, - dotlrn_admin_rels_full.member_state - from dotlrn_admin_rels_full, - dotlrn_ta_rels - where dotlrn_admin_rels_full.rel_id = dotlrn_ta_rels.rel_id; - -create table dotlrn_ca_rels ( - rel_id constraint dotlrn_ca_rels_rel_id_fk - references dotlrn_admin_rels (rel_id) - constraint dotlrn_ca_rels_rel_id_pk - primary key -); - -create or replace view dotlrn_ca_rels_full -as - select dotlrn_admin_rels_full.rel_id, - dotlrn_admin_rels_full.community_id, - dotlrn_admin_rels_full.user_id, - dotlrn_admin_rels_full.rel_type, - dotlrn_admin_rels_full.role, - dotlrn_admin_rels_full.portal_id, - dotlrn_admin_rels_full.member_state - from dotlrn_admin_rels_full, - dotlrn_ca_rels - where dotlrn_admin_rels_full.rel_id = dotlrn_ca_rels.rel_id; - -create table dotlrn_cadmin_rels ( - rel_id constraint dotlrn_cadmin_rels_rel_id_fk - references dotlrn_admin_rels (rel_id) - constraint dotlrn_cadmin_rels_rel_id_pk - primary key -); - -create or replace view dotlrn_cadmin_rels_full -as - select dotlrn_admin_rels_full.rel_id, - dotlrn_admin_rels_full.community_id, - dotlrn_admin_rels_full.user_id, - dotlrn_admin_rels_full.rel_type, - dotlrn_admin_rels_full.role, - dotlrn_admin_rels_full.portal_id, - dotlrn_admin_rels_full.member_state - from dotlrn_admin_rels_full, - dotlrn_cadmin_rels - where dotlrn_admin_rels_full.rel_id = dotlrn_cadmin_rels.rel_id; - -create table dotlrn_instructor_rels ( - rel_id constraint dotlrn_instructor_rels_rel_fk - references dotlrn_admin_rels(rel_id) - constraint dotlrn_instructor_rels_rel_pk - primary key -); - -create or replace view dotlrn_instructor_rels_full -as - select dotlrn_admin_rels_full.rel_id, - dotlrn_admin_rels_full.community_id, - dotlrn_admin_rels_full.user_id, - dotlrn_admin_rels_full.rel_type, - dotlrn_admin_rels_full.role, - dotlrn_admin_rels_full.portal_id, - dotlrn_admin_rels_full.member_state - from dotlrn_admin_rels_full, - dotlrn_instructor_rels - where dotlrn_admin_rels_full.rel_id = dotlrn_instructor_rels.rel_id; - --- --- Object Types and Attributes --- - -declare - foo integer; -begin - acs_rel_type.create_type ( - rel_type => 'dotlrn_member_rel', - supertype => 'membership_rel', - 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 => 'user', role_two => 'member', - 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 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 => 'user', role_two => 'admin', - 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 Community Membership', - pretty_plural => 'dotLRN Student Community Memberships', - package_name => 'dotlrn_student_rel', - table_name => 'dotlrn_student_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => null, - min_n_rels_one => 0, max_n_rels_one => null, - object_type_two => 'user', role_two => 'student', - min_n_rels_two => 0, max_n_rels_two => null - ); - - acs_rel_type.create_type ( - rel_type => 'dotlrn_ta_rel', - supertype => 'dotlrn_admin_rel', - pretty_name => 'dotLRN Teaching Assistant Community Membership', - pretty_plural => 'dotLRN Teaching Assistant Community Memberships', - package_name => 'dotlrn_ta_rel', - table_name => 'dotlrn_ta_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => null, - min_n_rels_one => 0, max_n_rels_one => null, - object_type_two => 'user', role_two => 'teaching_assistant', - min_n_rels_two => 0, max_n_rels_two => null - ); - - acs_rel_type.create_type ( - rel_type => 'dotlrn_ca_rel', - supertype => 'dotlrn_admin_rel', - pretty_name => 'dotLRN Course Assitant Community Membership', - pretty_plural => 'dotLRN Course Assitant Community Memberships', - package_name => 'dotlrn_ca_rel', - table_name => 'dotlrn_ca_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => null, - min_n_rels_one => 0, max_n_rels_one => null, - object_type_two => 'user', role_two => 'course_assistant', - min_n_rels_two => 0, max_n_rels_two => null - ); - - acs_rel_type.create_type ( - rel_type => 'dotlrn_cadmin_rel', - supertype => 'dotlrn_admin_rel', - pretty_name => 'dotLRN Course Administrator Community Membership', - pretty_plural => 'dotLRN Course Administrator Community Memberships', - package_name => 'dotlrn_cadmin_rel', - table_name => 'dotlrn_cadmin_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => null, - min_n_rels_one => 0, max_n_rels_one => null, - object_type_two => 'user', role_two => 'course_admin', - min_n_rels_two => 0, max_n_rels_two => null - ); - - acs_rel_type.create_type ( - rel_type => 'dotlrn_instructor_rel', - supertype => 'dotlrn_admin_rel', - pretty_name => 'dotLRN Instructor Community Membership', - pretty_plural => 'dotLRN Instructor Community Memberships', - package_name => 'dotlrn_instructor_rel', - table_name => 'dotlrn_instructor_rels', - id_column => 'rel_id', - object_type_one => 'dotlrn_class_instance', role_one => null, - min_n_rels_one => 0, max_n_rels_one => null, - object_type_two => 'user', role_two => 'instructor', - min_n_rels_two => 0, max_n_rels_two => null - ); - - -- - -- and now for the attributes - -- - foo:= acs_attribute.create_attribute ( - object_type => 'dotlrn_member_rel', - attribute_name => 'portal_id', - datatype => 'integer', - pretty_name => 'Page ID', - pretty_plural => 'Page IDs' - ); -end; -/ -show errors Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 29 Mar 2002 20:02:46 -0000 1.12 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 1 Apr 2002 07:33:04 -0000 1.13 @@ -27,12 +27,13 @@ @dotlrn-users-create.sql @dotlrn-communities-create.sql +@dotlrn-community-memberships-create.sql +@dotlrn-communities-package-create.sql +@dotlrn-init.sql @dotlrn-clubs-create.sql @dotlrn-classes-create.sql +@dotlrn-classes-memberships-create.sql @dotlrn-applet-sc-create.sql -@dotlrn-init.sql -@dotlrn-community-memberships-create.sql -@dotlrn-communities-package-create.sql @dotlrn-community-memberships-packages-create.sql @dotlrn-main-portlet-create.sql @dotlrn-security-create.sql Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql,v diff -u -r1.17 -r1.18 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 29 Mar 2002 19:59:46 -0000 1.17 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-init.sql 1 Apr 2002 07:33:04 -0000 1.18 @@ -71,3 +71,53 @@ end; / show errors + + +-- +-- Object Types and Attributes +-- + +declare + foo integer; +begin + acs_rel_type.create_type ( + rel_type => 'dotlrn_member_rel', + supertype => 'membership_rel', + 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 => 'user', role_two => 'member', + 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 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 => 'user', role_two => 'admin', + min_n_rels_two => 0, max_n_rels_two => null + ); + + -- + -- and now for the attributes + -- + foo:= acs_attribute.create_attribute ( + object_type => 'dotlrn_member_rel', + attribute_name => 'portal_id', + datatype => 'integer', + pretty_name => 'Page ID', + pretty_plural => 'Page IDs' + ); +end; +/ +show errors