Index: openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 14 Jul 2001 23:03:25 -0000 1.19 +++ openacs-4/packages/acs-bootstrap-installer/tcl/40-db-query-dispatcher-procs.tcl 11 Aug 2001 21:31:03 -0000 1.20 @@ -754,6 +754,6 @@ proc db_qd_log {level msg} { # Centralized DB QD logging # We switch everything to debug for now - ns_log Notice "QD_LOGGER = $msg" + ns_log Debug "QD_LOGGER = $msg" } Index: openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql 20 Mar 2001 22:51:55 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/oracle/groups-body-create.sql 11 Aug 2001 21:31:03 -0000 1.2 @@ -644,7 +644,7 @@ (v_group_id, group_name, v_join_policy); - -- setup the permissable relationship types for this group + -- setup the permissible relationship types for this group insert into group_rels (group_rel_id, group_id, rel_type) select acs_object_id_seq.nextval, v_group_id, g.rel_type Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.0.1-4.1b.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.0.1-4.1b.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.0.1-4.1b.sql 20 Mar 2001 22:51:56 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.0.1-4.1b.sql 11 Aug 2001 21:31:03 -0000 1.2 @@ -1388,7 +1388,7 @@ -- 1/5/2001 -- -- CHANGES --- defined default and permissable relationship types for group +-- defined default and permissible relationship types for group -- types and groups -- NEW TABLES: group_type_rels, group_rels with defaults set for existing groups ----------------------------- @@ -2374,7 +2374,7 @@ values (v_group_id, group_name); - -- setup the permissable relationship types for this group + -- setup the permissible relationship types for this group insert into group_rels (group_rel_id, group_id, rel_type) select acs_object_id_seq.nextval, v_group_id, g.rel_type @@ -3352,7 +3352,7 @@ values (v_group_id, group_name); - -- setup the permissable relationship types for this group + -- setup the permissible relationship types for this group insert into group_rels (group_rel_id, group_id, rel_type) select acs_object_id_seq.nextval, v_group_id, g.rel_type Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.1.1-4.2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.1.1-4.2.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.1.1-4.2.sql 20 Mar 2001 22:51:56 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-4.1.1-4.2.sql 11 Aug 2001 21:31:03 -0000 1.2 @@ -901,7 +901,7 @@ (v_group_id, group_name, v_join_policy); - -- setup the permissable relationship types for this group + -- setup the permissible relationship types for this group insert into group_rels (group_rel_id, group_id, rel_type) select acs_object_id_seq.nextval, v_group_id, g.rel_type Index: openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 3 Aug 2001 21:08:10 -0000 1.11 +++ openacs-4/packages/acs-kernel/sql/postgresql/groups-body-create.sql 11 Aug 2001 21:31:03 -0000 1.12 @@ -485,6 +485,8 @@ -- create or replace package body membership_rel -- function new +select define_function_args('membership_rel__new','rel_id,rel_type:membership_rel,object_id_one,object_id_two,member_state:approved,creation_user,creation_ip'); + create function membership_rel__new (integer,varchar,integer,integer,varchar,integer,varchar) returns integer as ' declare @@ -750,7 +752,7 @@ values (v_group_id, new__group_name, v_join_policy); - -- setup the permissable relationship types for this group + -- setup the permissible relationship types for this group insert into group_rels (group_rel_id, group_id, rel_type) select acs_object_id_seq.nextval, v_group_id, g.rel_type Index: openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql 3 Aug 2001 21:08:10 -0000 1.11 +++ openacs-4/packages/acs-kernel/sql/postgresql/postgresql.sql 11 Aug 2001 21:31:03 -0000 1.12 @@ -554,7 +554,7 @@ v_elem varchar; v_pos integer; begin - delete from acs_function_args where function = p_function; + delete from acs_function_args where function = upper(p_function); v_elem = split(p_arg_list, '','', v_arg_seq); while v_elem is not null loop Index: openacs-4/packages/acs-subsite/sql/postgresql/user-profiles-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/user-profiles-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/sql/postgresql/user-profiles-create.sql 17 Apr 2001 04:10:06 -0000 1.2 +++ openacs-4/packages/acs-subsite/sql/postgresql/user-profiles-create.sql 11 Aug 2001 21:31:03 -0000 1.3 @@ -137,6 +137,8 @@ -- return v_profile_id; -- end new; +select define_function_args('user_profile__new','profile_id,rel_type:user_profile,object_id_one,object_id_two,member_state,creation_user,creation_ip'); + create function user_profile__new(integer,varchar,integer,integer,varchar,integer,varchar) returns integer as ' declare Index: openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql 15 May 2001 16:59:00 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs-oracle.xql 11 Aug 2001 21:31:03 -0000 1.3 @@ -70,4 +70,54 @@ + + +begin acs_attribute.drop_attribute(:object_type, :attribute_name); end; + + + + + +declare + attr_id acs_attributes.attribute_id%TYPE; +begin + attr_id := acs_attribute.create_attribute ( + object_type => '$object_type', + attribute_name => '$attribute_name', + min_n_values => '$min_n_values', + max_n_values => '$max_n_values', + default_value => '$default_value', + datatype => '$datatype', + pretty_name => '$pretty_name', + pretty_plural => '$pretty_plural' + ); +end; + + + + + + +alter table $table_name drop column $attribute_name + + + + + +alter table $table_name add $attribute_name $sql_type + + + + + +begin acs_attribute.drop_attribute(:object_type, :attribute_name); end; + + + + + +alter table $table_name drop column $column_name + + + Index: openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql 15 May 2001 16:59:00 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.3 @@ -67,4 +67,56 @@ + + +select acs_attribute__drop_attribute(:object_type, :attribute_name) + + + + + +select acs_attribute__create_attribute ( + '$object_type', + '$attribute_name', + '$datatype', + '$pretty_name', + '$pretty_plural', + NULL, + NULL, + '$default_value', + '$min_n_values', + '$max_n_values', + NULL, + 'type_specific', + 'f' +); + + + + + +alter table $table_name drop column $attribute_name + + + + + +alter table $table_name add $attribute_name $sql_type + + + + + +select acs_attribute__drop_attribute(:object_type, :attribute_name) + + + + + + + +alter table $table_name rename column $column_name to __DELETED__$column_name + + + Index: openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -104,6 +104,8 @@ } { + set default_value $default + # We always use type-specific storage. Grab the tablename from the # object_type if { ![db_0or1row select_table { @@ -114,47 +116,46 @@ error "Specified object type \"$object_type\" does not exist" } + # In OpenACS, where we care that SQL must be separate from code, we don't + # use these annoying formatting procs on our SQL. We write out the queries in full. (ben) + # Attribute name returned from this function will be oracle # friendly and is thus used as the column name set attribute_name [plsql_utility::generate_oracle_name $pretty_name] - set attr_list [list] - lappend attr_list [list "object_type" '$object_type'] - lappend attr_list [list "attribute_name" '$attribute_name'] - lappend attr_list [list "min_n_values" '$min_n_values'] - lappend attr_list [list "max_n_values" '$max_n_values'] - lappend attr_list [list "default_value" '$default'] - lappend attr_list [list "datatype" '$datatype'] - lappend attr_list [list "pretty_name" '$pretty_name'] - lappend attr_list [list "pretty_plural" '$pretty_plural'] +# set attr_list [list] +# lappend attr_list [list "object_type" '$object_type'] +# lappend attr_list [list "attribute_name" '$attribute_name'] +# lappend attr_list [list "min_n_values" '$min_n_values'] +# lappend attr_list [list "max_n_values" '$max_n_values'] +# lappend attr_list [list "default_value" '$default'] +# lappend attr_list [list "datatype" '$datatype'] +# lappend attr_list [list "pretty_name" '$pretty_name'] +# lappend attr_list [list "pretty_plural" '$pretty_plural'] + # A note (by ben) + # the queries are empty because they are pulled out later in db_exec_plsql + set plsql [list] - lappend plsql_drop [list "drop_attribute" "begin acs_attribute.drop_attribute(:object_type, :attribute_name); end;"] - lappend plsql [list "create_attribute" " -declare - attr_id acs_attributes.attribute_id%TYPE; -begin - attr_id := acs_attribute.create_attribute ( - [plsql_utility::format_pieces -delim " => " $attr_list] - ); -end;"] + lappend plsql_drop [list "drop_attribute" "FOO" db_exec_plsql] + lappend plsql [list "create_attribute" "FOO" db_exec_plsql] - set sql_type [datatype_to_sql_type -default $default $table_name $attribute_name $datatype] + set sql_type [datatype_to_sql_type -default $default_value $table_name $attribute_name $datatype] - lappend plsql_drop [list "drop_attr_column" "alter table $table_name drop column $attribute_name"] - lappend plsql [list "add_column" "alter table $table_name add $attribute_name $sql_type"] + lappend plsql_drop [list "drop_attr_column" "FOO" db_dml] + lappend plsql [list "add_column" "FOO" db_dml] for { set i 0 } { $i < [llength $plsql] } { incr i } { set pair [lindex $plsql $i] - if { [catch {db_exec_plsql [lindex $pair 0] [lindex $pair 1]} err_msg] } { + if { [catch {eval [lindex $pair 2] [lindex $pair 0] [lindex $pair 1]} err_msg] } { # Rollback what we've done so far. The loop contitionals are: # start at the end of the plsql_drop list (Drop things in reverse order of creation) # execute drop statements until we reach position $i+1 # This position represents the operation on which we failed, and thus # is not executed for { set inner [expr [llength $plsql_drop] - 1] } { $inner > [expr $i + 1] } { set inner [expr $inner - 1] } { set drop_pair [lindex $plsql_drop $inner] - if { [catch {db_exec_plsql [lindex $drop_pair 0] [lindex $drop_pair 1]} err_msg_2] } { + if { [catch {eval [lindex $drop_pair 2] [lindex $drop_pair 0] [lindex $drop_pair 1]} err_msg_2] } { append err_msg "\nAdditional error while trying to roll back: $err_msg_2" return -code error $err_msg } @@ -194,16 +195,16 @@ set constraint "" switch $datatype { - "string" { set type "varchar2(1000)" } + "string" { set type "varchar(1000)" } "boolean" { set type "char(1)" set constraint "[generate_constraint $table $column "ck"] check ($column in ('t','f'))" } "number" { set type "number" } "money" { set type "number (12,2)" } "date" { set type "date" } - "text" { set type "varchar2(4000)" } + "text" { set type "varchar(4000)" } "integer" { set type "integer" } - "enumeration" { set type "varchar2(100)" } - "keyword" { set type "varchar2(1000)" } + "enumeration" { set type "varchar(100)" } + "keyword" { set type "varchar(1000)" } default {error "Unsupported datatype. Datatype $datatype is not implemented at this time"} } @@ -257,13 +258,13 @@ } set plsql [list] - lappend plsql [list "drop_attribute" "begin acs_attribute.drop_attribute(:object_type, :attribute_name); end;"] + lappend plsql [list "drop_attribute" "FOO" "db_exec_plsql"] if { [db_column_exists $table_name $column_name] } { - lappend plsql [list "drop_attr_column" "alter table $table_name drop column $column_name"] + lappend plsql [list "drop_attr_column" "FOO" "db_dml"] } foreach pair $plsql { - db_exec_plsql [lindex $pair 0] [lindex $pair 1] + eval [lindex $pair 2] [lindex $pair 0] [lindex $pair 1] } return 1 Index: openacs-4/packages/acs-subsite/tcl/attribute-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/attribute-procs.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/attribute-procs.xql 15 May 2001 16:59:00 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/attribute-procs.xql 11 Aug 2001 21:31:03 -0000 1.3 @@ -1,7 +1,7 @@ - + select t.table_name @@ -12,7 +12,7 @@ - + select a.attribute_id @@ -24,7 +24,7 @@ - + select a.object_type, a.attribute_name, @@ -38,7 +38,7 @@ - + select v.sort_order as old_sort_order @@ -50,7 +50,7 @@ - + delete from acs_enum_values v @@ -61,7 +61,7 @@ - + update acs_enum_values v @@ -73,7 +73,7 @@ - + select object_type from acs_objects where object_id = :object_id @@ -82,7 +82,7 @@ - + select * @@ -93,7 +93,7 @@ - + select enum.pretty_name, enum.enum_value Index: openacs-4/packages/acs-subsite/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/package-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/package-procs.tcl 3 Aug 2001 21:09:20 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/package-procs.tcl 11 Aug 2001 21:31:03 -0000 1.3 @@ -824,7 +824,11 @@ } } } - + + # Ben's temporary hack + lappend pieces object_type + ns_log Notice "BEN_ACS_SUBSITE: $object_type; $pieces" + set object_id [db_exec_plsql create_object " BEGIN :1 := ${package_name}.new([plsql_utility::generate_attribute_parameter_call \ Index: openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/tcl/rel-types-procs.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -42,7 +42,7 @@ } { Returns 1 if there is a relationship type not being used by the specified group_id or group_type. Useful for deciding when - to offer the user a link to create a add a new permissable + to offer the user a link to create a add a new permissible relationship type @author Michael Bryzek (mbryzek@arsdigita.com) Index: openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql 15 May 2001 16:59:00 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/relation-procs-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.3 @@ -14,7 +14,7 @@ - begin ${package_name}.delete(:rel_id); end; + select ${package_name}__delete(:rel_id) @@ -46,36 +46,30 @@ - - FIX ME OUTER JOIN -FIX ME CONNECT BY -FIX ME ROWNUM - - select - pretty_name, object_type, level, indent, - case when valid_types.rel_type = null then 0 else 1 end as valid_p + + select + pretty_name, object_type, level, indent, + case when valid_types.rel_type = null then 0 else 1 end as valid_p from - (select - t.pretty_name, t.object_type, level, - replace(lpad(' ', (level - 1) * 4), - ' ', ' ') as indent, - rownum as tree_rownum - from - acs_object_types t - connect by - prior t.object_type = t.supertype - start with - t.object_type = :start_with ) types, - (select - rel_type - from - rc_valid_rel_types - where - group_id = :group_id ) valid_types - where - types.object_type = valid_types.rel_type(+) - order by tree_rownum - + (select + t.pretty_name, t.object_type, tree_level(t.tree_sortkey) as level, + lpad(' ', (tree_level(t.tree_sortkey) - 1) * 4) as indent, + t.tree_sortkey as sortkey + from + acs_object_types t + where tree_sortkey like (select tree_sortkey || '%' + from acs_object_types where object_type = :start_with)) types left join + (select + rel_type + from + rc_valid_rel_types + where + group_id= :group_id) valid_types + on (types.object_type = valid_types.rel_type) + order by sortkey + + + Index: openacs-4/packages/acs-subsite/www/admin/group-types/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/one.adp 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/one.adp 11 Aug 2001 21:31:03 -0000 1.2 @@ -63,7 +63,7 @@ -

  • Add a permissable relationship type
  • +

  • Add a permissible relationship type
  • Index: openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.adp 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/rel-type-add.adp 11 Aug 2001 21:31:03 -0000 1.2 @@ -1,6 +1,6 @@ @context_bar@ -Add permissable relationship type +Add permissible relationship type There are no other relationship types that you can add. You can Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-by-rel-type.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-by-rel-type.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/groups/elements-by-rel-type.adp 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/elements-by-rel-type.adp 11 Aug 2001 21:31:03 -0000 1.2 @@ -45,5 +45,5 @@ -

  • Add a permissable relationship type
  • +

  • Add a permissible relationship type
  • Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql 3 Aug 2001 21:09:20 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.3 @@ -12,9 +12,9 @@ and object_type in ( select t1.object_type from acs_object_types t1, acs_object_types t2 - where t2.tree_sortkey <= t1.tree_sortkey - and t1.tree_sortkey like (t2.tree_sortkey || '%') - and t1.object_type = :rel_type + where t1.tree_sortkey <= t2.tree_sortkey + and t2.tree_sortkey like (t1.tree_sortkey || '%') + and t2.object_type = :rel_type )
    Index: openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/elements-display-list.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -3,11 +3,10 @@ - FIX ME REMOVE OPTIMIZATION HINT select r.rel_id, party_names.party_name as element_name -from (select /*+ ORDERED */ DISTINCT rels.rel_id, object_id_two +from (select DISTINCT rels.rel_id, object_id_two from $extra_tables acs_rels rels, all_object_party_privilege_map perm where perm.object_id = rels.rel_id and perm.party_id = :user_id @@ -16,7 +15,7 @@ and rels.object_id_one = :group_id $extra_where_clauses) r, party_names where r.object_id_two = party_names.party_id -order by lower(element_name) +order by element_name Index: openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/groups/rel-type-add-2.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -2,7 +2,7 @@ ad_page_contract { - Adds a relationship type to the list of permissable ones for this + Adds a relationship type to the list of permissible ones for this group @author mbryzek@arsdigita.com Index: openacs-4/packages/acs-subsite/www/admin/object-types/one.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/object-types/one.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/object-types/one.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/object-types/one.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -50,16 +50,13 @@ - FIX ME OUTER JOIN select utc.column_name, utc.data_type, ucc.comments - from user_tab_columns utc, - user_col_comments ucc + from user_tab_columns utc left join + user_col_comments ucc on (utc.table_name= ucc.table_name and utc.column_name = ucc.column_name) where utc.table_name = '[string toupper $table_name]' - and utc.table_name = ucc.table_name(+) - and utc.column_name = ucc.column_name(+) Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/Attic/elements-display-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display-oracle.xql 11 Aug 2001 21:31:03 -0000 1.1 @@ -0,0 +1,19 @@ + + + + oracle8.1.6 + + + + + select acs_object.name(map.party_id) as name, map.rel_id, + decode(map.container_id, :group_id, 1, 0) as direct_p, + acs_object.name(map.container_id) as container_name + from rel_segment_party_map map + where acs_permission.permission_p(map.party_id, :user_id, 'read') = 't' + and map.segment_id = :segment_id + order by lower(name) + + + + \ No newline at end of file Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/Attic/elements-display-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.1 @@ -0,0 +1,18 @@ + + + + postgresql7.1 + + + + select acs_object__name(map.party_id) as name, map.rel_id, + case when map.container_id = :group_id then 1 else 0 end as direct_p, + acs_object__name(map.container_id) as container_name + from rel_segment_party_map map + where acs_permission__permission_p(map.party_id, :user_id, 'read') = 't' + and map.segment_id = :segment_id + order by name + + + + \ No newline at end of file Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.adp 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-display.adp 11 Aug 2001 21:31:03 -0000 1.2 @@ -2,8 +2,6 @@ ad_require_permission $segment_id "read" set write_p [ad_permission_p $segment_id "write"] -# Expects segment_id, segment_name, group_id, role to be passed in - set package_url [ad_conn package_url] set user_id [ad_conn user_id] Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/Attic/elements-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-oracle.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements-oracle.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -15,5 +15,4 @@
    -
    Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/elements.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -34,4 +34,6 @@ set context_bar [list [list "" "Relational segments"] [list one?[ad_export_vars {segment_id}] "One segment"] "Elements"] +# Expects segment_id, segment_name, group_id, role to be passed in + ad_return_template Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/new-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -5,14 +5,12 @@ - FIX ME CONNECT BY - select t.pretty_name, t.object_type as rel_type, - replace(lpad(' ', (level - 1) * 4), ' ', ' ') as indent + lpad(' ', (level - 1) * 4) as indent from acs_object_types t where t.object_type not in (select s.rel_type from rel_segments s where s.group_id = :group_id) - connect by prior t.object_type = t.supertype - start with t.object_type in ('membership_rel', 'composition_rel') + and (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type='membership_rel') or + t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types where object_type='composition_rel')) order by lower(t.pretty_name) desc Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -28,7 +28,7 @@ } } -set context_bar [list [list "" "Relational segments"] "One segment"] +set context_bar [list [list "./" "Relational segments"] "One segment"] if { ![db_0or1row select_segment_properties { select s.segment_id, s.segment_name, s.group_id, acs_object.name(s.group_id) as group_name, Index: openacs-4/packages/acs-subsite/www/admin/rel-types/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/add.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/add.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -2,7 +2,7 @@ ad_page_contract { - Add a permissable relation type to a group type + Add a permissible relation type to a group type @author mbryzek@arsdigita.com @creation-date Sun Nov 12 17:50:04 2000 Index: openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/delete-2-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -17,7 +17,6 @@ - FIX ME PLSQL drop table $table_name Index: openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/index-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -5,27 +5,25 @@ - FIX ME OUTER JOIN -FIX ME CONNECT BY -FIX ME ROWNUM - select t.object_type as rel_type, t.pretty_name, t.indent, coalesce(num.number_relationships,0) as number_relationships - from (select t.pretty_name, t.object_type, rownum as inner_rownum, - replace(lpad(' ', (level - 1) * 4), ' ', ' ') as indent + from (select t.pretty_name, t.object_type, tree_sortkey as inner_sortkey, + lpad(' ', (tree_level(tree_sortkey) - 1) * 4) as indent from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type in ('membership_rel','composition_rel') - order by lower(t.pretty_name)) t, + where (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types + where object_type='membership_rel') + or t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types + where object_type='composition_rel')) + order by lower(t.pretty_name)) t left join (select r.rel_type, count(*) as number_relationships from acs_objects o, acs_rel_types r, app_group_distinct_rel_map m where r.rel_type = o.object_type and o.object_id = m.rel_id and m.package_id = :package_id group by r.rel_type) num - where t.object_type = num.rel_type(+) - order by t.inner_rownum + on (t.object_type = num.rel_type) + order by t.inner_sortkey Index: openacs-4/packages/acs-subsite/www/admin/rel-types/mapping-remove-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/mapping-remove-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/mapping-remove-2.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/mapping-remove-2.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -2,7 +2,7 @@ ad_page_contract { - Removes a mapping for a permissable rel_type between either a + Removes a mapping for a permissible rel_type between either a group or a group_type @author mbryzek@arsdigita.com Index: openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/new-2-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -5,27 +5,25 @@ - FIX ME CONNECT BY - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name, + select lpad(' ', (level - 1) * 4) || t.pretty_name, t.object_type as rel_type from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type=:max_object_type_one + where tree_sortkey like (select tree_sortkey || '%' from acs_object_types + where object_type= :max_object_type_one) - FIX ME CONNECT BY - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name, + select lpad(' ', (level - 1) * 4) || t.pretty_name, t.object_type as rel_type from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type=:max_object_type_one + where tree_sortkey like (select tree_sortkey || '%' from acs_object_types + where object_type = :max_object_type_one) Index: openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/new-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -5,13 +5,14 @@ - FIX ME CONNECT BY - select replace(lpad(' ', (level - 1) * 4), ' ', ' ') || t.pretty_name as name, + select lpad(' ', (level - 1) * 4) || t.pretty_name as name, t.object_type from acs_object_types t - connect by prior t.object_type = t.supertype - start with t.object_type in ('membership_rel','composition_rel') + where (t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types + where object_type= 'membership_rel') + or t.tree_sortkey like (select tree_sortkey || '%' from acs_object_types + where object_type= 'composition_rel')) Index: openacs-4/packages/acs-subsite/www/admin/rel-types/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/Attic/one-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/one-postgresql.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/one-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -23,9 +23,8 @@ - FIX ME ROWNUM - select inner.* + select v_inner.* from (select r.rel_id, acs_object__name(r.object_id_one) || ' and ' || acs_object__name(r.object_id_two) as name from acs_rels r, acs_object_party_privilege_map perm, app_group_distinct_rel_map m @@ -35,8 +34,8 @@ and r.rel_type = :rel_type and m.rel_id = r.rel_id and m.package_id = :package_id - order by lower(acs_object__name(r.object_id_one)), lower(acs_object__name(r.object_id_two))) inner - where rownum <= 26 + order by lower(acs_object__name(r.object_id_one)), lower(acs_object__name(r.object_id_two))) v_inner + limit 26 Index: openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-types/one.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -28,7 +28,7 @@ set package_id [ad_conn package_id] -set context_bar [list [list "" "Relationship types"] "One type"] +set context_bar [list [list "./" "Relationship types"] "One type"] if { ![db_0or1row select_pretty_name { select t.pretty_name as rel_type_pretty_name, t.table_name, t.id_column, t.dynamic_p Index: openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/Attic/add-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/relations/add-oracle.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -24,7 +24,13 @@ - + + +, (select element_id from application_group_element_map + where package_id = :package_id) app_elements + + + Index: openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/Attic/add-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql 15 May 2001 16:59:01 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/relations/add-postgresql.xql 11 Aug 2001 21:31:03 -0000 1.2 @@ -5,8 +5,6 @@ - FIX ME CONNECT BY - select t.object_type_two, t.role_two as role, acs_rel_type__role_pretty_name(t.role_two) as role_pretty_name, acs_object_type__pretty_name(t.object_type_two) as object_type_two_name, @@ -17,52 +15,58 @@ and t.rel_type = obj_types.object_type and ancestor_rel_types.supertype = 'relationship' and ancestor_rel_types.object_type in ( - select object_type from acs_object_types - start with object_type = :rel_type - connect by object_type = prior supertype - ) + select t2.object_type from + acs_object_types t1, acs_object_types t2 + where t1.object_type= :rel_type + and t2.tree_sortkey <= t1.tree_sortkey + and t1.tree_sortkey like (t2.tree_sortkey || '%') + ) + + +cross join (select element_id from application_group_element_map + where package_id = :package_id) app_elements + + + - FIX ME DECODE (USE SQL92 CASE) -FIX ME OUTER JOIN -FIX ME CONNECT BY - select DISTINCT - decode(groups.group_id, - null, case when persons.person_id = null then 'INVALID' else persons.first_names || ' ' || persons.last_name end, - groups.group_name) as party_name, + case when groups.group_id is null then + case when persons.person_id is null then 'INVALID' + else persons.first_names || ' ' || persons.last_name + end else + groups.group_name end as party_name, p.party_id from (select o.object_id as party_id from acs_objects o, (select object_type from acs_object_types - start with $start_with - connect by prior object_type = supertype) t - where o.object_type = t.object_type) p, + where tree_sortkey like (select tree_sortkey || '%' + from acs_object_types + where $start_with)) t + where o.object_type = t.object_type) p left join (select element_id from group_element_map where group_id = :group_id and rel_type = :rel_type UNION ALL - select to_number(:group_id) ) m, + select :group_id::integer ) m on (p.party_id = m.element_id) cross join (select object_id from all_object_party_privilege_map - where party_id = :user_id and privilege = 'read') perm, + where party_id = :user_id and privilege = 'read') perm cross join (select party_id from rc_parties_in_required_segs where group_id = :group_id - and rel_type = :rel_type) pirs $scope_query, - groups, - persons - where p.party_id = m.element_id(+) - and m.element_id is null + and rel_type = :rel_type) pirs $scope_query left join + groups on (p.party_id = groups.group_id) + left join persons on (p.party_id = persons.person_id) + where + m.element_id is null and p.party_id = perm.object_id and p.party_id = pirs.party_id $scope_clause - and p.party_id = groups.group_id(+) - and p.party_id = persons.person_id(+) Index: openacs-4/packages/acs-subsite/www/admin/relations/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/relations/add.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 11 Aug 2001 21:31:03 -0000 1.2 @@ -198,10 +198,7 @@ # of type $rel_type. if {[string equal $allow_out_of_scope_p "f"]} { - set scope_query ", - (select element_id - from application_group_element_map - where package_id = :package_id) app_elements" + set scope_query [db_map select_parties_scope_query] set scope_clause " and p.party_id = app_elements.element_id" Index: openacs-4/packages/acs-subsite/www/doc/group-admin-pages-acceptance-test.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/doc/group-admin-pages-acceptance-test.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/doc/group-admin-pages-acceptance-test.html 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/doc/group-admin-pages-acceptance-test.html 11 Aug 2001 21:31:03 -0000 1.2 @@ -102,7 +102,7 @@
    1. Go to /admin/group-types and select "Developer defined test types" -
    2. Add a permissable rel type of Membership Relation +
    3. Add a permissible rel type of Membership Relation
    4. Add a group named "Test group"
    @@ -180,7 +180,7 @@
  • You have a link to delete the group type -
  • Click on "Add a permissable relationship type." Ensure that you +
  • Click on "Add a permissible relationship type." Ensure that you are not given a select bar but are offered a link to "create a new relationship type" @@ -272,7 +272,7 @@
  • remove the composition rel type -
  • Add a permissable rel type: project_lead_relation +
  • Add a permissible rel type: project_lead_relation
  • Click yes to create a rel segment named "GuideStar Project Leads" Index: openacs-4/packages/acs-subsite/www/doc/group-admin-pages-design.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/doc/group-admin-pages-design.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/doc/group-admin-pages-design.html 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/doc/group-admin-pages-design.html 11 Aug 2001 21:31:03 -0000 1.2 @@ -60,10 +60,10 @@

    V. API

    -

    Permissable relationship types

    +

    Permissible relationship types

    We defined the following two tables to store the relationship type -used to store the permissable relationship types for group types and +used to store the permissible relationship types for group types and individual groups. Whenever a group is created using the acs_group.new function, the relationship types for the new group are automatically copied from those allowed for its group Index: openacs-4/packages/acs-subsite/www/doc/group-admin-pages-requirements.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/doc/group-admin-pages-requirements.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/doc/group-admin-pages-requirements.html 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/doc/group-admin-pages-requirements.html 11 Aug 2001 21:31:03 -0000 1.2 @@ -109,16 +109,16 @@

    - Each group type should specify a set of permissable relationship + Each group type should specify a set of permissible relationship types to use for groups of that type.

    10.20 Default relationship types for groups

    - The administrator must be able to specify the permissable + The administrator must be able to specify the permissible relationship types to use for each group. The defaults are - inherited from the list of permissable relationship types for the + inherited from the list of permissible relationship types for the group's type.

    @@ -166,7 +166,7 @@

    -

    40.10.10 Permissable relationships
    +
    40.10.10 Permissible relationships

    @@ -226,7 +226,7 @@ The group type summary page should display all the relationship types used to add relations to groups of this type and allow the - user to add permissable relationship types or to remove existing + user to add permissible relationship types or to remove existing ones.