Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -r1.82 -r1.83 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 30 May 2009 20:42:11 -0000 1.82 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 2 Jun 2009 00:40:22 -0000 1.83 @@ -953,7 +953,7 @@ # Update person.bio if { [info exists user_info(bio)] } { - acs_user::update_bio \ + person::update_bio \ -user_id $user_id \ -bio $user_info(bio) } @@ -1067,7 +1067,7 @@ # Update person.bio if { [info exists user_info(bio)] } { - acs_user::update_bio \ + person::update_bio \ -user_id $user_id \ -bio $user_info(bio) } Index: openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql 31 May 2009 00:58:33 -0000 1.18 +++ openacs-4/packages/acs-kernel/sql/oracle/community-core-create.sql 2 Jun 2009 00:40:22 -0000 1.19 @@ -185,6 +185,16 @@ max_n_values => 1 ); + attr_id := acs_attribute.create_attribute ( + object_type => 'person', + attribute_name => 'bio', + datatype => 'string', + pretty_name => '#acs-kernel.Bio#', + pretty_plural => '#acs-kernel.Bios#', + min_n_values => 0, + max_n_values => 1 + ); + -- -- User: people who have registered in the system -- @@ -200,16 +210,6 @@ attr_id := acs_attribute.create_attribute ( object_type => 'user', - attribute_name => 'bio', - datatype => 'string', - pretty_name => '#acs-kernel.Bio#', - pretty_plural => '#acs-kernel.Bios#', - min_n_values => 0, - max_n_values => 1 - ); - - attr_id := acs_attribute.create_attribute ( - object_type => 'user', attribute_name => 'username', datatype => 'string', pretty_name => '#acs-kernel.Username#', @@ -399,7 +399,8 @@ first_names varchar2(100) constraint persons_first_names_nn not null, last_name varchar2(100) - constraint persons_last_name_nn not null + constraint persons_last_name_nn not null, + bio varchar2(4000) ); comment on table persons is ' @@ -563,7 +564,6 @@ screen_name varchar2(100) constraint users_screen_name_un unique, - bio varchar2(4000), priv_name integer default 0 not null, priv_email integer default 5 not null, email_verified_p char(1) default 't' Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d1-5.6.0d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d1-5.6.0d2.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d1-5.6.0d2.sql 30 May 2009 21:45:35 -0000 1.2 +++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.6.0d1-5.6.0d2.sql 2 Jun 2009 00:40:22 -0000 1.3 @@ -1,4 +1,4 @@ -alter table users add bio varchar2(4000); +alter table persons add bio varchar2(4000); -- DRB: effing oracle @@ -55,6 +55,7 @@ declare bio_id integer; exists_count integer; + attr_id integer; begin select attribute_id into bio_id @@ -83,6 +84,16 @@ acs_attribute.drop_attribute ('person','bio'); acs_attribute.drop_attribute ('person','bio_mime_type'); + attr_id := acs_attribute.create_attribute ( + object_type => 'person', + attribute_name => 'bio', + datatype => 'string', + pretty_name => '#acs-kernel.Bio#', + pretty_plural => '#acs-kernel.Bios#', + min_n_values => 0, + max_n_values => 1 + ); + end; / show errors; Index: openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql,v diff -u -r1.27 -r1.28 --- openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql 31 May 2009 00:58:33 -0000 1.27 +++ openacs-4/packages/acs-kernel/sql/postgresql/community-core-create.sql 2 Jun 2009 00:40:22 -0000 1.28 @@ -263,7 +263,7 @@ ); attr_id := acs_attribute__create_attribute ( - ''user'', + ''person'', ''bio'', ''string'', ''#acs-kernel.Bio#'', @@ -278,9 +278,6 @@ ''f'' ); - - - return 0; end;' language 'plpgsql'; @@ -394,7 +391,8 @@ references parties (party_id) constraint persons_person_id_pk primary key, first_names varchar(100) not null, - last_name varchar(100) not null + last_name varchar(100) not null, + bio text ); comment on table persons is ' @@ -545,7 +543,6 @@ screen_name varchar(100) constraint users_screen_name_un unique, - bio text, priv_name integer default 0 not null, priv_email integer default 5 not null, email_verified_p boolean default 't', Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql 30 May 2009 20:48:57 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.6.0d1-5.6.0d2.sql 2 Jun 2009 00:40:22 -0000 1.2 @@ -1,10 +1,11 @@ -alter table users add bio text; +alter table persons add bio text; create function inline_0 () returns integer as ' declare one_user_id integer; bio_id integer; + attr_id integer; begin bio_id := attribute_id @@ -17,12 +18,12 @@ from acs_attribute_values where object_id = one_user_id and attribute_id = bio_id) then - update users + update persons set bio = (select attr_value from acs_attribute_values where object_id = one_user_id and attribute_id = bio_id) - where user_id = one_user_id; + where person_id = one_user_id; end if; end loop; @@ -32,6 +33,22 @@ perform acs_attribute__drop_attribute (''person'',''bio''); perform acs_attribute__drop_attribute (''person'',''bio_mime_type''); + attr_id := acs_attribute__create_attribute ( + ''person'', + ''bio'', + ''string'', + ''#acs-kernel.Bio#'', + ''#acs-kernel.Bios#'', + null, + null, + null, + 0, + 1, + null, + ''type_specific'', + ''f'' + ); + return 0; end;' language 'plpgsql'; Index: openacs-4/packages/acs-subsite/www/shared/community-member.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/community-member.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-subsite/www/shared/community-member.tcl 30 May 2009 20:42:12 -0000 1.16 +++ openacs-4/packages/acs-subsite/www/shared/community-member.tcl 2 Jun 2009 00:40:22 -0000 1.17 @@ -69,7 +69,7 @@ set url "http://$url" } -set bio [ad_text_to_html -- [acs_user::get_bio -user_id $user_id]] +set bio [ad_text_to_html -- [person::get_bio -user_id $user_id]] # Do we show the portrait? set inline_portrait_state "none" Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl,v diff -u -r1.57 -r1.58 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 30 May 2009 20:42:12 -0000 1.57 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 2 Jun 2009 00:40:22 -0000 1.58 @@ -251,12 +251,12 @@ } # DRB: Though I've moved the bio field to type specific rather than generic storage, I've -# maintained the API semantics exactly as they were before (other than changing person to user), -# mostly in order to make upgrade possible. In the future, the number of database hits can -# be diminished by getting rid of the seperate queries for bio stuff. However, I have removed -# bio_mime_type because it's unused and unsupported in the existing code. +# maintained the API semantics exactly as they were before mostly in order to make upgrade +# possible. In the future, the number of database hits can be diminished by getting rid of +# the seperate queries for bio stuff. However, I have removed bio_mime_type because it's +# unused and unsupported in the existing code. -ad_proc -public acs_user::get_bio { +ad_proc -public person::get_bio { {-user_id {}} {-exists_var {}} } { @@ -288,7 +288,7 @@ return $bio } -ad_proc -public acs_user::update_bio { +ad_proc -public person::update_bio { {-user_id:required} {-bio:required} } { @@ -476,7 +476,7 @@ } if { $include_bio_p } { - set row(bio) [acs_user::get_bio -user_id $user_id] + set row(bio) [person::get_bio -user_id $user_id] } } Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.xql,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 30 May 2009 20:42:12 -0000 1.22 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 2 Jun 2009 00:40:22 -0000 1.23 @@ -88,19 +88,19 @@ - + select bio - from users - where user_id = :user_id + from persons + where person_id = :user_id - + - update users + update persons set bio = :bio - where user_id = :user_id + where person_id = :user_id Index: openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl 30 May 2009 20:42:12 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/test/community-core-test-procs.tcl 2 Jun 2009 00:40:22 -0000 1.4 @@ -36,8 +36,8 @@ } aa_register_case \ -cats {api smoke} \ - -procs {person::person_p person::get person::new person::update acs_user::get_bio acs_user::update_bio} \ - person_user_procs_test \ + -procs {person::person_p person::get person::new person::update person::get_bio person::update_bio} \ + person_procs_test \ { test if the values returned by the person procs are correct } { @@ -84,9 +84,9 @@ aa_true "name changed" [string match [person::name -person_id $prs_id] "hh$first_names hh$last_name"] set bio "bio :: [ad_generate_random_string] :: bio" - acs_user::update_bio -user_id $prs_id -bio $bio + person::update_bio -user_id $prs_id -bio $bio - aa_true "bio(graphy) ok" [string match $bio [acs_user::get_bio -user_id $prs_id -exists_var bio_p]] + aa_true "bio(graphy) ok" [string match $bio [person::get_bio -user_id $prs_id -exists_var bio_p]] person::delete -person_id $prs_id aa_true "person deleted" ![person::person_p -party_id $prs_id]