Index: openacs-4/etc/install/dotlrn-basic-setup.test =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/dotlrn-basic-setup.test,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/dotlrn-basic-setup.test 4 Sep 2003 16:51:26 -0000 1.1 +++ openacs-4/etc/install/dotlrn-basic-setup.test 11 Oct 2003 17:20:45 -0000 1.2 @@ -1,59 +1,59 @@ if { [catch { - # Source procedures - source tclwebtest-functions.tcl + source tcl/test-procs.tcl # Test Execution START + + ::twt::util::log "Login the site wide admin" + ::twt::user::login_site_wide_admin + + ::twt::util::log "Add the site wide admin to dotLRN" + ::twt::dotlrn::add_site_wide_admin $server_url + + ::twt::util::log "Upload users" + ::twt::user::upload_users $server_url - # Login the site wide admin - login_site_wide_admin + ::twt::util::log "Set up terms" + ::twt::dotlrn::setup_terms $server_url + + ::twt::util::log "Set up departments" + ::twt::dotlrn::setup_departments $server_url + + ::twt::util::log "Set up subjects" + ::twt::dotlrn::setup_subjects $server_url + + ::twt::util::log "Set up classes" + ::twt::dotlrn::setup_classes $server_url + + ::twt::util::log "Set up communities (i.e. Tennis Club etc.)" + ::twt::dotlrn::setup_communities $server_url + + ::twt::util::log "Add class members, i.e. professors, students and assistants" + ::twt::class::setup_memberships $server_url + + ::twt::util::log "Add class subgroups" + ::twt::class::setup_subgroups $server_url + + ::twt::util::log "Add class member applet" + ::twt::class::add_member_applets $server_url + + ::twt::util::log "Set up class forums - one per class" + ::twt::forums::add_default_forums $server_url + + ::twt::util::log "Add forum postings" + ::twt::forums::add_postings + + ::twt::util::log "Add news items - one per class" + ::twt::news::add_item_to_classes $server_url - # We need a few users - upload_users $server_url - - # We want the users to have a known password so people can log in with them - set_users_passwords $server_url - - # Add the site wide admin to dotLRN - add_site_wide_admin_to_dotlrn $server_url - - # Setup a few terms - setup_terms $server_url - - # Departments - setup_departments $server_url - - # Setup subjects - setup_subjects $server_url - - # We can now add a few classes - setup_classes $server_url - - # Setup members, i.e. professors, students and assistants - setup_class_memberships $server_url - - # We want to show off the subgroup functionality - setup_class_subgroups $server_url - - # Sloan uses this member list - only add it for the computing classes - # So that we can demo adding it to other classes - add_member_applet_to_classes $server_url - - # Add a default forum to each class - add_default_class_forums $server_url - - # Add some communities as well (i.e. Tennis Club etc.) - setup_communities $server_url - - # Add some news items to each class - add_class_news_items $server_url - # Test Execution END + } result] } { global errorInfo + + # Output error stack trace and HTML response body puts stderr $result puts stderr "*** Tcl TRACE ***" puts stderr $errorInfo - puts "The response body is: [response body]" error "Test failed: $result" Index: openacs-4/etc/install/openacs-install.test =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/openacs-install.test,v diff -u -r1.2 -r1.3 --- openacs-4/etc/install/openacs-install.test 10 Oct 2003 15:25:15 -0000 1.2 +++ openacs-4/etc/install/openacs-install.test 11 Oct 2003 17:20:45 -0000 1.3 @@ -1,5 +1,5 @@ # Source procedures -source "tclwebtest-functions.tcl" +source tcl/test-procs.tcl # Test Execution START @@ -41,6 +41,6 @@ form submit -write_response_to_file $openacs_output_file +twt::util::write_response_to_file $install_output_file # Test Execution END Index: openacs-4/etc/install/tcl/admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/admin-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/admin-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/admin-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -6,9 +6,9 @@ # # @author Peter Marklund -namespace eval twt::admin {} +namespace eval ::twt::admin {} -ad_proc twt::admin::install_all_packages { server_url } { +ad_proc ::twt::admin::install_all_packages { server_url } { do_request "$server_url/acs-admin/apm/packages-install?checked_by_default_p=1" #assert text "Package Installation" @@ -30,7 +30,7 @@ form submit } -ad_proc twt::admin::add_main_site_folder { server_url folder_name } { +ad_proc ::twt::admin::add_main_site_folder { server_url folder_name } { do_request "$server_url/admin/site-map" @@ -41,7 +41,7 @@ form submit } -ad_proc twt::admin::mount_main_site_package { server_url folder_name instance_name package_key } { +ad_proc ::twt::admin::mount_main_site_package { server_url folder_name instance_name package_key } { do_request "$server_url/admin/site-map" @@ -62,23 +62,23 @@ # the site-map uses parameter_id to identify parameters # We should put a db-exec.tcl file on the server instead to be able to retrieve # the parameter_id of the parameter. -ad_proc twt::admin::submit_acs_param_internal { old_parameter_value new_parameter_value } { +ad_proc ::twt::admin::submit_acs_param_internal { old_parameter_value new_parameter_value } { form find ~a "parameter-set-2" field find ~v "$old_parameter_value" field fill "$new_parameter_value" form submit } -ad_proc twt::admin::set_acs_subsite_param { server_url old_parameter_value parameter_value } { +ad_proc ::twt::admin::set_acs_subsite_param { server_url old_parameter_value parameter_value } { do_request "$server_url/admin/site-map" link follow ~u {parameter-set\?package%5fid=[0-9]+&package%5fkey=acs%2dsubsite&instance%5fname=Main%20Site} submit_acs_param_internal $old_parameter_value $parameter_value } -ad_proc twt::admin::set_acs_kernel_param { server_url param_section old_parameter_value parameter_value } { +ad_proc ::twt::admin::set_acs_kernel_param { server_url param_section old_parameter_value parameter_value } { do_request "$server_url/admin/site-map" link follow ~u {parameter-set\?package%5fid=[0-9]+&package%5fkey=acs%2dkernel} Index: openacs-4/etc/install/tcl/class-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/class-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/class-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/class-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -4,12 +4,12 @@ # # @author Peter Marklund -namespace eval twt::class {} +namespace eval ::twt::class {} -ad_proc twt::class::get_admin_urls { server_url term_pretty_name } { +ad_proc ::twt::class::get_admin_urls { server_url term_pretty_name } { Returns a list with the fully qualified URLs of the admin pages of all .LRN classes. -} +} { set admin_url_base "$server_url/dotlrn/admin/term" set admin_url_no_term "${admin_url_base}?term_id=-1" @@ -23,20 +23,20 @@ set admin_url_term "${admin_url_base}?term_id=$term_id" - return [util::get_url_list $server_url $admin_url_term {/dotlrn/classes/.*/one-community-admin$}] + return [::twt::util::get_url_list $server_url $admin_url_term {/dotlrn/classes/.*/one-community-admin$}] } -ad_proc twt::class::engineering_p { class_url } { +ad_proc ::twt::class::engineering_p { class_url } { return [regexp {dotlrn/classes/(computer-science|mathematics)} $class_url match] } -ad_proc twt::class::follow_members_link {} { +ad_proc ::twt::class::follow_members_link {} { link follow ~u {members$} } -ad_proc twt::class::get_professor { class_url } { +ad_proc ::twt::class::get_professor { class_url } { # TODO: find the professor of the class class::follow_members_link @@ -48,9 +48,9 @@ return [user::get_random_users professor 1] } -ad_proc twt::class::setup_memberships { server_url } { +ad_proc ::twt::class::setup_memberships { server_url } { - foreach admin_url [class::get_admin_urls $server_url "Fall 2003/2004"] { + foreach admin_url [get_admin_urls $server_url "Fall 2003/2004"] { # Admin page for the class do_request "$admin_url" @@ -59,32 +59,32 @@ follow_members_link # Add all students - add_members [user::get_users student] "Student" + add_members [::twt::user::get_users student] "Student" # Add a random professor - add_member [user::get_random_users professor 1] "Professor" + add_member [::twt::user::get_random_users professor 1] "Professor" # Add two random staff - set admin_users [user::get_random_users staff 2] + set admin_users [::twt::user::get_random_users staff 2] set admin_labels [list "Course Assistant" "Teaching Assistant"] set admin_counter 0 for { set admin_counter 0 } \ { [expr $admin_counter < 2 && $admin_counter < [llength $admin_users]] } \ { incr admin_counter } { - set admin_label [get_random_items_from_list $admin_labels 1] + set admin_label [::twt::util::get_random_items_from_list $admin_labels 1] add_member [lindex $admin_users $admin_counter] $admin_label } } } -ad_proc twt::class::add_members { email_list role } { +ad_proc ::twt::class::add_members { email_list role } { foreach email $email_list { add_member $email $role } } -ad_proc twt::class::add_member { email role } { +ad_proc ::twt::class::add_member { email role } { if { [empty_string_p $email] } { return @@ -107,9 +107,9 @@ form submit } -ad_proc twt::class::setup_subgroups { server_url } { +ad_proc ::twt::class::setup_subgroups { server_url } { - foreach admin_url [class::get_admin_urls $server_url "Fall 2003/2004"] { + foreach admin_url [get_admin_urls $server_url "Fall 2003/2004"] { foreach {name description policy} [subcommunity_properties_list] { @@ -129,7 +129,7 @@ } } -ad_proc twt::class::subcommunity_properties_list {} { +ad_proc ::twt::class::subcommunity_properties_list {} { set property_list [list] @@ -143,9 +143,9 @@ return $property_list } -ad_proc twt::class::add_member_applets { server_url } { +ad_proc ::twt::class::add_member_applets { server_url } { - foreach admin_url [class::get_admin_urls $server_url "Fall 2003/2004"] { + foreach admin_url [get_admin_urls $server_url "Fall 2003/2004"] { # Only add the members applet to computing classes so that we can # demo adding it to other classes manually Index: openacs-4/etc/install/tcl/dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/dotlrn-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/dotlrn-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/dotlrn-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -5,9 +5,9 @@ # # @author Peter Marklund -namespace eval twt::dotlrn {} +namespace eval ::twt::dotlrn {} -ad_proc twt::dotlrn::add_term { server_url term_name start_month start_year end_month end_year } { +ad_proc ::twt::dotlrn::add_term { server_url term_name start_month start_year end_month end_year } { do_request "$server_url/dotlrn/admin/term-new" form find ~n add_term @@ -27,14 +27,14 @@ form submit } -ad_proc twt::dotlrn::setup_terms { server_url } { +ad_proc ::twt::dotlrn::setup_terms { server_url } { - dotlrn::add_term $server_url "Fall" "September" "2003" "January" "2004" - dotlrn::add_term $server_url "Spring" "January" "2004" "July" "2004" - dotlrn::add_term $server_url "Fall" "September" "2004" "January" "2005" + add_term $server_url "Fall" "September" "2003" "January" "2004" + add_term $server_url "Spring" "January" "2004" "July" "2004" + add_term $server_url "Fall" "September" "2004" "January" "2005" } -ad_proc twt::dotlrn::add_department { server_url pretty_name description external_url } { +ad_proc ::twt::dotlrn::add_department { server_url pretty_name description external_url } { do_request "$server_url/dotlrn/admin/department-new" form find ~n add_department @@ -48,26 +48,26 @@ form submit } -ad_proc twt::dotlrn::setup_departments { server_url } { +ad_proc ::twt::dotlrn::setup_departments { server_url } { - dotlrn::add_department $server_url "Mathematics" \ + add_department $server_url "Mathematics" \ "The Faculty of Mathematics consists of the Department of Applied Mathematics & Theoretical Physics (DAMTP) and the Department of Pure Mathematics & Mathematical Statistics (DPMMS). The Statistical Laboratory is a sub-department of the DPMMS. Also located within the University of Cambridge is the Isaac Newton Institute for Mathematical Sciences." \ "http://www.maths.cam.ac.uk/" - dotlrn::add_department $server_url "Computer Science" \ + add_department $server_url "Computer Science" \ "The Computer Laboratory is the Computer Science department of the University of Cambridge. The University Computing Service has a separate set of web pages." \ "http://www.cl.cam.ac.uk/" - dotlrn::add_department $server_url "Architecture" \ + add_department $server_url "Architecture" \ "Because of the great diversity of offerings in the College of Environmental Design and in the Department of Architecture in areas such as building environments, practice of design, design methods, structures and construction, history, social and cultural factors in design, and design itself, it is possible to obtain either a very broad and general foundation or to concentrate in one or several areas." \ "http://arch.ced.berkeley.edu/" - dotlrn::add_department $server_url "Business Administration" \ + add_department $server_url "Business Administration" \ "The department offers a range of courses in Business Administration, Finance, and Law" \ "http://mitsloan.mit.edu/" } -ad_proc twt::dotlrn::add_subject { server_url department_pretty_name pretty_name description } { +ad_proc ::twt::dotlrn::add_subject { server_url department_pretty_name pretty_name description } { do_request "$server_url/dotlrn/admin/class-new" @@ -82,43 +82,43 @@ form submit } -ad_proc twt::setup_subjects { server_url } { +ad_proc ::twt::dotlrn::setup_subjects { server_url } { # Mathematics Department - dotlrn::add_subject $server_url "Mathematics" "Differential Geometry" " An introduction to differential geometry with applications to general relativity. Metrics, Lie bracket, connections, geodesics, tensors, intrinsic and extrinsic curvature are studied on abstractly defined manifolds using coordinate charts. Curves and surfaces in three dimensions are studied as important special cases. Gauss-Bonnet theorem for surfaces and selected introductory topics in special and general relativity are also studied. 18.100 is required, 18.101 is strongly recommended, and 18.901 would be helpful." + add_subject $server_url "Mathematics" "Differential Geometry" " An introduction to differential geometry with applications to general relativity. Metrics, Lie bracket, connections, geodesics, tensors, intrinsic and extrinsic curvature are studied on abstractly defined manifolds using coordinate charts. Curves and surfaces in three dimensions are studied as important special cases. Gauss-Bonnet theorem for surfaces and selected introductory topics in special and general relativity are also studied. 18.100 is required, 18.101 is strongly recommended, and 18.901 would be helpful." # Computer Science department - dotlrn::add_subject $server_url "Computer Science" "Peer to Peer Computing" "The term peer-to-peer (P2P) refers to a class of systems and applications that employ distributed resources to perform a critical function in a decentralized manner..." + add_subject $server_url "Computer Science" "Peer to Peer Computing" "The term peer-to-peer (P2P) refers to a class of systems and applications that employ distributed resources to perform a critical function in a decentralized manner..." - dotlrn::add_subject $server_url "Computer Science" "Advanced Topics in Programming Languages" "This course focuses on bioinformatics applications, high-performance computing, and the application of high-performance computing to bioinformatics applications." + add_subject $server_url "Computer Science" "Advanced Topics in Programming Languages" "This course focuses on bioinformatics applications, high-performance computing, and the application of high-performance computing to bioinformatics applications." - dotlrn::add_subject $server_url "Computer Science" "Computer and Network Security" "This class serves as an introduction to information systems security and covers security issues at an undergraduate level" + add_subject $server_url "Computer Science" "Computer and Network Security" "This class serves as an introduction to information systems security and covers security issues at an undergraduate level" # Architecture Department - dotlrn::add_subject $server_url "Architecture" "Architecture and Culture" "Selected examples of architecture and interior design are used as case studies to illustrate the presence of ideas in built matter. A range of projects are analysed and discussed in terms of the conceptual qualities that underpin the physical manifestations of architecture and interior design." + add_subject $server_url "Architecture" "Architecture and Culture" "Selected examples of architecture and interior design are used as case studies to illustrate the presence of ideas in built matter. A range of projects are analysed and discussed in terms of the conceptual qualities that underpin the physical manifestations of architecture and interior design." # Business Administration Department - dotlrn::add_subject $server_url "Business Administration" "Economic Analysis for Business Decisions" " Introduces students to principles of microeconomic analysis used in managerial decision making. Topics include demand analysis, cost and production functions, the behavior of competitive and non-competitive markets, sources and uses of market power, and game theory and competitive strategy, with applications to various business and public policy decisions. Antitrust policy and other government regulations are also discussed. 15.010 restricted to first-year Sloan masters students. 15.011 primarily for non-Sloan School students." + add_subject $server_url "Business Administration" "Economic Analysis for Business Decisions" " Introduces students to principles of microeconomic analysis used in managerial decision making. Topics include demand analysis, cost and production functions, the behavior of competitive and non-competitive markets, sources and uses of market power, and game theory and competitive strategy, with applications to various business and public policy decisions. Antitrust policy and other government regulations are also discussed. 15.010 restricted to first-year Sloan masters students. 15.011 primarily for non-Sloan School students." - dotlrn::add_subject $server_url "Business Administration" "Organizational Psychology & Sociology" "Organizations are changing rapidly. To deal with these changes requires new skills and attitudes on the part of managers. The goal of the OPS course is to make you aware of this challenge and equip you to better meet it. In short, the purpose is to acquaint you with some of psychological and sociological phenomena that regularly occur in organizations - the less visible forces that influence employee and managerial behavior. The aim is to increase your understanding of these forces -- in yourself and in others -- so that as they become more visible, they become manageable (more or less) and hence subject to analysis and choice." + add_subject $server_url "Business Administration" "Organizational Psychology & Sociology" "Organizations are changing rapidly. To deal with these changes requires new skills and attitudes on the part of managers. The goal of the OPS course is to make you aware of this challenge and equip you to better meet it. In short, the purpose is to acquaint you with some of psychological and sociological phenomena that regularly occur in organizations - the less visible forces that influence employee and managerial behavior. The aim is to increase your understanding of these forces -- in yourself and in others -- so that as they become more visible, they become manageable (more or less) and hence subject to analysis and choice." - dotlrn::add_subject $server_url "Business Administration" "Advanced Corporate Finance" "The primary objective of the advanced corporate finance course is to conduct an in-depth analysis of special topics of interest to corporate finance managers. Our attempt will be to obtain a detailed understanding of the motives and reasons that lead to certain corporate decisions specifically in relation to the following issues: Mergers and Acquisitions, Corporate Restructurings, Corporate Bankruptcy, Corporate Governance" + add_subject $server_url "Business Administration" "Advanced Corporate Finance" "The primary objective of the advanced corporate finance course is to conduct an in-depth analysis of special topics of interest to corporate finance managers. Our attempt will be to obtain a detailed understanding of the motives and reasons that lead to certain corporate decisions specifically in relation to the following issues: Mergers and Acquisitions, Corporate Restructurings, Corporate Bankruptcy, Corporate Governance" } -ad_proc twt::dotlrn::get_class_add_urls { server_url } { +ad_proc ::twt::dotlrn::get_class_add_urls { server_url } { - return [util::get_url_list $server_url "$server_url/dotlrn/admin/classes" "class-instance-new"] + return [::twt::util::get_url_list $server_url "$server_url/dotlrn/admin/classes" "class-instance-new"] } -ad_proc twt::dotlrn::setup_classes { server_url } { +ad_proc ::twt::dotlrn::setup_classes { server_url } { - dotlrn::setup_classes_for_term $server_url "Fall 2003/2004" - dotlrn::setup_classes_for_term $server_url "Spring 2004" + setup_classes_for_term $server_url "Fall 2003/2004" + setup_classes_for_term $server_url "Spring 2004" } -ad_proc twt::dotlrn::setup_classes_for_term { server_url term_name } { +ad_proc ::twt::dotlrn::setup_classes_for_term { server_url term_name } { - foreach link [dotlrn::get_class_add_urls $server_url] { + foreach link [get_class_add_urls $server_url] { do_request $link form find ~n "add_class_instance" @@ -132,15 +132,15 @@ } } -ad_proc twt::dotlrn::setup_communities { server_url } { +ad_proc ::twt::dotlrn::setup_communities { server_url } { add_community $server_url "Tennis Club" "Community for the university tennis club with tournaments and other events, also helps you find people to play with." "Open" add_community $server_url "Business Alumni Class of 1997" "Alumni community for the Business Administration graduates from the class of 1997." "Closed" add_community $server_url "Business Administration Program" "Community for all students following the Business Administration Program" "Closed" add_community $server_url "Star Trek Fan Club" "Community for die-hard fans of Star Trek" "Needs Approval" } -ad_proc twt::dotlrn::add_community { server_url name description policy } { +ad_proc ::twt::dotlrn::add_community { server_url name description policy } { do_request "${server_url}/dotlrn/admin/club-new" @@ -156,7 +156,7 @@ form submit } -ad_proc twt::dotlrn::add_site_wide_admin { server_url } { +ad_proc ::twt::dotlrn::add_site_wide_admin { server_url } { global __admin_last_name Index: openacs-4/etc/install/tcl/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/forums-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/forums-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/forums-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -4,12 +4,12 @@ # # @author Peter Marklund -namespace eval twt::forums {} +namespace eval ::twt::forums {} -ad_proc twt::forums::add_default_forums { server_url } { +ad_proc ::twt::forums::add_default_forums { server_url } { Adds a general forum to each class. Goes via the class admin pages. } { - foreach admin_url [class::get_admin_urls $server_url "Fall 2003/2004"] { + foreach admin_url [::twt::class::get_admin_urls $server_url "Fall 2003/2004"] { # Admin page of one class do_request $admin_url @@ -23,7 +23,7 @@ } } -ad_proc twt::forums::add_postings {} { +ad_proc ::twt::forums::add_postings {} { global __server_url # Request the start page Index: openacs-4/etc/install/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/news-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/news-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/news-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -4,27 +4,27 @@ # # @author Peter Marklund -namespace eval twt::news {} +namespace eval ::twt::news {} -ad_proc twt::news::add_item_to_classes { server_url } { +ad_proc ::twt::news::add_item_to_classes { server_url } { set news_item_list [get_items] set class_counter 0 - foreach admin_url [class::get_admin_urls $server_url "Fall 2003/2004"] { + foreach admin_url [::twt::class::get_admin_urls $server_url "Fall 2003/2004"] { # We want the professor of the class to post the news item # TODO - #set email [class::get_professor $admin_url] - #user::login $email [user::get_password $email] + #set email [::twt::class::get_professor $admin_url] + #user::login $email [::twt::user::get_password $email] # Admin page of the class do_request $admin_url # News item add link follow ~u {news/+item-create} - set news_item [get_random_item $news_item_list $class_counter] + set news_item [lindex [::twt::util::get_random_items_from_list $news_item_list 1] 0] form find ~a preview set publish_title [lindex $news_item 0] @@ -43,18 +43,11 @@ } # Re-login the site-wide admin - login_site_wide_admin + #login_site_wide_admin } -ad_proc twt::news::get_random_item { news_list counter } { +ad_proc ::twt::news::get_items {} { - set item_index [expr $counter % [llength $news_list]] - - return [lindex $news_list $item_index] -} - -ad_proc twt::news::get_items {} { - set news_item_list [list] lappend news_item_list {{The exam is postponed by one week} {The final exam previously planned for the 20:th of December will be on the 3:d of January instead - the calendar has been updated}} Index: openacs-4/etc/install/tcl/test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/test-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/test-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/test-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -5,11 +5,15 @@ # # @author Peter Marklund -namespace eval twt {} +namespace eval ::twt {} -source global-vars.tcl -source util-procs.tcl -source admin-procs.tcl -source dotlrn-procs.tcl -source class-procs.tcl -source forums-procs.tcl +set script_dir [file dirname [info script]] + +source $script_dir/global-vars.tcl +source $script_dir/util-procs.tcl +source $script_dir/user-procs.tcl +source $script_dir/admin-procs.tcl +source $script_dir/dotlrn-procs.tcl +source $script_dir/class-procs.tcl +source $script_dir/forums-procs.tcl +source $script_dir/news-procs.tcl Index: openacs-4/etc/install/tcl/user-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/user-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/user-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/user-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -3,15 +3,15 @@ # # @author Peter Marklund -namespace eval twt::user {} +namespace eval ::twt::user {} -ad_proc twt::user::get_users { {type ""} } { +ad_proc ::twt::user::get_users { {type ""} } { Return a list of emails for .LRN users of a certain type. If type is not specified, returns all .LRN users. } { set user_emails [list] - foreach user_data [get_users_data] { + foreach user_data [get_test_data] { if { [empty_string_p $type] || \ [string equal -nocase [lindex $user_data 4] $type] } { @@ -22,23 +22,23 @@ return $user_emails } -ad_proc twt::user::get_random_users { type number } { +ad_proc ::twt::user::get_random_users { type number } { Get emails for a random set of .LRN users of a certain type. } { - set email_list [user::get_emails $type] + set email_list [get_users $type] return [get_random_items_from_list $email_list $number] } -ad_proc twt::user::get_password { email } { +ad_proc ::twt::user::get_password { email } { global __demo_users_password return $__demo_users_password } -ad_proc twt::user::login { user_email user_password} { +ad_proc ::twt::user::login { user_email user_password} { - logout_user + ::twt::user::logout global __server_url @@ -54,21 +54,21 @@ form submit } -ad_proc twt::user::logout {} { +ad_proc ::twt::user::logout {} { global __server_url do_request "${__server_url}/register/logout" } -ad_proc twt::user::login_site_wide_admin {} { +ad_proc ::twt::user::login_site_wide_admin {} { global __server_url global __admin_email global __admin_password - user::login $__admin_email $__admin_password + ::twt::user::login $__admin_email $__admin_password } -ad_proc twt::user::add { +ad_proc ::twt::user::add { server_url first_names last_name @@ -89,9 +89,9 @@ field find ~n "last_name" field fill $last_name field find ~n "password" - field fill [user::get_password $email] + field fill [::twt::user::get_password $email] field find ~n "password_confirm" - field fill [user::get_password $email] + field fill [::twt::user::get_password $email] form submit form find ~n add_user @@ -106,7 +106,7 @@ form submit } -ad_proc twt::user::get_test_data {} { +ad_proc ::twt::user::get_test_data {} { # Let's cache the data global __users_data @@ -163,22 +163,13 @@ return $return_list } -ad_proc twt::user::upload_users { server_url } { +ad_proc ::twt::user::upload_users { server_url } { -# File upload -# Does not work - TclWebTest does not support file upload yet -# do_request "$server_url/dotlrn/admin/users-bulk-upload" + set users_data_list [get_test_data] -# form find ~a "users-bulk-upload-2" -# field find ~n "users_csv_file" -# field fill "$users_csv_file" -# form submit - - set users_data_list [user::get_test_data] - foreach user_data $users_data_list { - user::add $server_url \ + ::twt::user::add $server_url \ [lindex $user_data 0] \ [lindex $user_data 1] \ [lindex $user_data 2] \ @@ -194,9 +185,9 @@ } -ad_proc twt::user::set_passwords { server_url } { +ad_proc ::twt::user::set_passwords { server_url } { - foreach user_email [user::get_users] { + foreach user_email [get_users] { #puts "setting guest password for user $user_email" # User admin page @@ -213,8 +204,8 @@ link follow ~u {password-update\?} form find ~a password-update-2 - field fill [user::get_password $user_email] ~n password_1 - field fill [user::get_password $user_email] ~n password_2 + field fill [get_password $user_email] ~n password_1 + field fill [get_password $user_email] ~n password_2 form submit } } Index: openacs-4/etc/install/tcl/util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/etc/install/tcl/Attic/util-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/etc/install/tcl/util-procs.tcl 11 Oct 2003 13:43:46 -0000 1.1 +++ openacs-4/etc/install/tcl/util-procs.tcl 11 Oct 2003 17:20:21 -0000 1.2 @@ -4,16 +4,16 @@ # # @author Peter Marklund -namespace eval twt::util {} +namespace eval ::twt::util {} -ad_proc twt::util::randomRange {range} { +ad_proc ::twt::util::randomRange {range} { Given an integer N, return an integer between 0 and N. } { return [expr int([expr rand()] * $range)] } -ad_proc twt::util::get_random_items_from_list { list number } { +ad_proc ::twt::util::get_random_items_from_list { list number } { Given a list and the lenght of the list to return, return a list with a random subset of items from the input list. } { @@ -58,7 +58,7 @@ } } -ad_proc twt::util::write_response_to_file { filename } { +ad_proc ::twt::util::write_response_to_file { filename } { Write the HTML body of the last HTTP response to the file with given path. If the directory of the file doesn't exist then create it. @@ -72,7 +72,7 @@ puts $file_id "[response body]" } -ad_proc twt::util::get_url_list { server_url page_url link_url_pattern } { +ad_proc ::twt::util::get_url_list { server_url page_url link_url_pattern } { do_request "$page_url" @@ -105,7 +105,7 @@ return $urls_list } -ad_proc twt::util::crawl_links {} { +ad_proc ::twt::util::crawl_links {} { TODO: This proc currently doesn't crawl nearly as many links as we would like } { @@ -151,3 +151,14 @@ } } } + +ad_proc ::twt::util::log { message } { + set script_name [file tail [info script]] + puts "" + puts "##############################" + puts "#" + puts "# $script_name - $message" + puts "#" + puts "##############################" + puts "" +} \ No newline at end of file