Index: openacs-4/packages/acs-service-contract/acs-service-contract.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/acs-service-contract.info,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-service-contract/acs-service-contract.info 25 Feb 2003 15:15:00 -0000 1.12 +++ openacs-4/packages/acs-service-contract/acs-service-contract.info 17 May 2003 09:55:57 -0000 1.13 @@ -8,6 +8,7 @@ t + oracle postgresql @@ -19,74 +20,8 @@ OpenACS + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql 20 Aug 2002 21:05:04 -0000 1.8 +++ openacs-4/packages/acs-service-contract/sql/oracle/acs-sc-packages-create.sql 17 May 2003 09:56:18 -0000 1.9 @@ -565,7 +565,7 @@ v_contract_name || ' to ' || v_impl_name || - ' failed.'); + ' failed since certain operations are not implemented.'); end if; insert into acs_sc_bindings ( Index: openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-drop.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-drop.sql 1 Sep 2001 20:22:57 -0000 1.1 +++ openacs-4/packages/acs-service-contract/sql/postgresql/acs-sc-packages-drop.sql 17 May 2003 09:56:31 -0000 1.2 @@ -3,7 +3,7 @@ drop function acs_sc_binding__delete(integer,integer); drop function acs_sc_binding__new(integer,integer); drop function acs_sc_binding__new(varchar,varchar); -drop function acs_sc_impl_alias__delete(varchar,varchar); +drop function acs_sc_impl_alias__delete(varchar,varchar,varchar); drop function acs_sc_impl_alias__new(varchar,varchar,varchar,varchar,varchar); drop function acs_sc_impl__delete(varchar,varchar); drop function acs_sc_impl__get_name(integer); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-service-contract/www/contract-display-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-service-contract/www/contract-display-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-service-contract/www/contract-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/contract-display.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/www/contract-display.adp 16 Oct 2002 15:09:59 -0000 1.2 +++ openacs-4/packages/acs-service-contract/www/contract-display.adp 17 May 2003 09:56:59 -0000 1.3 @@ -13,4 +13,21 @@ - \ No newline at end of file + + +

Valid Installed Bindings

+ +
    + +
  • None
  • +
    + + +
  • @valid_installed_binding.impl_id@ + @valid_installed_binding.impl_name@ + (@valid_installed_binding.impl_owner_name@) + [Uninstall]
  • +
    +
    +
+ Index: openacs-4/packages/acs-service-contract/www/contract-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/contract-display.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-service-contract/www/contract-display.tcl 16 Oct 2002 15:09:59 -0000 1.2 +++ openacs-4/packages/acs-service-contract/www/contract-display.tcl 17 May 2003 09:56:59 -0000 1.3 @@ -17,3 +17,6 @@ and e.msg_type_id = t.msg_type_id and et.msg_type_id = e.element_msg_type_id order by o.contract_name, o.operation_name, t.msg_type_name, e.element_pos } + + +db_multirow valid_installed_binding valid_installed_binding "" Index: openacs-4/packages/acs-service-contract/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/Attic/index-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/www/index-oracle.xql 31 Jan 2002 03:04:32 -0000 1.1 +++ openacs-4/packages/acs-service-contract/www/index-oracle.xql 17 May 2003 09:56:59 -0000 1.2 @@ -6,12 +6,16 @@ select - contract_id, - impl_id, + b.contract_id, + b.impl_id, acs_sc_contract.get_name(contract_id) as contract_name, - acs_sc_impl.get_name(impl_id) as impl_name + acs_sc_impl.get_name(b.impl_id) as impl_name, + impl.impl_owner_name from - acs_sc_bindings + acs_sc_bindings b, + acs_sc_impls impl + where + impl.impl_id = b.impl_id Index: openacs-4/packages/acs-service-contract/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/Attic/index-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-service-contract/www/index-postgresql.xql 31 Jan 2002 03:04:32 -0000 1.1 +++ openacs-4/packages/acs-service-contract/www/index-postgresql.xql 17 May 2003 09:56:59 -0000 1.2 @@ -5,13 +5,17 @@ - select - contract_id, - impl_id, + select + b.contract_id, + b.impl_id, acs_sc_contract__get_name(contract_id) as contract_name, - acs_sc_impl__get_name(impl_id) as impl_name + acs_sc_impl__get_name(b.impl_id) as impl_name, + impl.impl_owner_name from - acs_sc_bindings + acs_sc_bindings b, + acs_sc_impls impl + where + impl.impl_id = b.impl_id Index: openacs-4/packages/acs-service-contract/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/www/index.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-service-contract/www/index.adp 16 Oct 2002 15:09:59 -0000 1.4 +++ openacs-4/packages/acs-service-contract/www/index.adp 17 May 2003 09:56:59 -0000 1.5 @@ -24,6 +24,7 @@ @valid_installed_binding.contract_name@, @valid_installed_binding.impl_id@ @valid_installed_binding.impl_name@ +(@valid_installed_binding.impl_owner_name@) [Uninstall] @@ -76,4 +77,4 @@ @orphan_implementation.impl_contract_name@ - \ No newline at end of file + Index: openacs-4/packages/acs-subsite/acs-subsite.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v diff -u -r1.41 -r1.42 --- openacs-4/packages/acs-subsite/acs-subsite.info 29 Jan 2003 16:08:45 -0000 1.41 +++ openacs-4/packages/acs-subsite/acs-subsite.info 17 May 2003 09:57:17 -0000 1.42 @@ -6,11 +6,10 @@ ACS Subsite Services t f + + - - oracle - postgresql Michael Bryzek Oumi Mehrotra @@ -21,627 +20,46 @@ OpenACS Aware of parties, groups, users, portraits, ... - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/sql/oracle/upgrade/upgrade-4.5-4.5.1.sql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql 21 Dec 2002 22:30:31 -0000 1.6 +++ openacs-4/packages/acs-subsite/sql/postgresql/application-groups-create.sql 17 May 2003 09:58:17 -0000 1.7 @@ -38,7 +38,7 @@ select define_function_args('application_group__new','group_id,object_type;application_group,creation_date;now(),creation_user,creation_ip,email,url,group_name,package_id,context_id'); -create function application_group__new(integer,varchar,timestamp with time zone,integer,varchar,varchar,varchar,varchar,integer,integer) +create function application_group__new(integer,varchar,timestamptz,integer,varchar,varchar,varchar,varchar,integer,integer) returns integer as ' declare new__group_id alias for $1; Index: openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql 12 May 2002 20:57:02 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs-oracle.xql 17 May 2003 09:58:37 -0000 1.3 @@ -87,24 +87,6 @@ - - - - select ag.group_id as parent_group_id - from application_groups ag, - apm_packages, - (select object_id, rownum as tree_rownum - from site_nodes - start with node_id = :parent_node_id - connect by node_id = prior parent_id) nodes - where nodes.object_id = apm_packages.package_id - and apm_packages.package_id = ag.package_id - and tree_rownum=1 - - - - - @@ -114,7 +96,7 @@ object_type => :group_type, group_name => :group_name, package_id => :package_id, - context_id => :context_id, + context_id => :package_id, creation_user => :creation_user, creation_ip => :creation_ip, email => :email, @@ -124,23 +106,17 @@ - - + - begin - :1 := composition_rel.new ( - rel_type => 'composition_rel', - object_id_one => :parent_group_id, - object_id_two => :group_id, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - end; - + begin + :1 := application_group.delete ( + group_id => :group_id, + ); + end; + - Index: openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql 12 May 2002 20:57:02 -0000 1.4 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs-postgresql.xql 17 May 2003 09:58:37 -0000 1.5 @@ -83,24 +83,7 @@ - - - - - select ag.group_id as parent_group_id - from (select tree_ancestor_keys(site_node_get_tree_sortkey(:parent_node_id)) as tree_sortkey) parents, - application_groups ag, site_nodes s, apm_packages a - where s.tree_sortkey = parents.tree_sortkey - and s.object_id = a.package_id - and a.package_id = ag.package_id - order by s.tree_sortkey desc - limit 1; - - - - - @@ -114,27 +97,20 @@ :url, :group_name, :package_id, - :context_id + :package_id ) - - + - select composition_rel__new ( - null, - 'composition_rel', - :parent_group_id, - :group_id, - :creation_user, - :creation_ip - ) - + select application_group__delete ( + :group_id + ) + - Index: openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl 12 May 2002 20:57:02 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs.tcl 17 May 2003 09:58:37 -0000 1.3 @@ -180,10 +180,8 @@ ad_proc new { { -group_id "" } { -group_type "application_group"} - { -parent_group_id "" } { -package_id "" } { -group_name "" } - { -context_id "" } { -creation_user "" } { -creation_ip "" } { -email "" } @@ -192,9 +190,6 @@ Creates an application group (i.e., group of "users/parties of this application") - NOTE: Doesn't deal with specializing membership and composition yet. - TO DO: Fix this. - Returns the group_id of the new application group. } { @@ -210,15 +205,6 @@ if { [empty_string_p $package_id] } { set package_id [ad_conn package_id] } - - if {[empty_string_p $parent_group_id]} { - # by default, this application group will be a subgroup - # of the first parent application group based on the site map. - - set parent_node_id [db_string parent_node_id ""] - - db_0or1row parent_group_id_query "" - } } if {[empty_string_p $package_id]} { @@ -234,48 +220,23 @@ append group_name " Parties" } - if {[empty_string_p $context_id]} { - set context_id $parent_group_id - } - db_transaction { - # creating the new group - set group_id [db_exec_plsql add_group { - begin - :1 := application_group.new ( - group_id => :group_id, - object_type => :group_type, - group_name => :group_name, - package_id => :package_id, - context_id => :context_id, - creation_user => :creation_user, - creation_ip => :creation_ip, - email => :email, - url => :url - ); - end; - }] - - if {![empty_string_p $parent_group_id]} { - - set rel_id [db_exec_plsql add_composition_rel { - begin - :1 := composition_rel.new ( - rel_type => 'composition_rel', - object_id_one => :parent_group_id, - object_id_two => :group_id, - creation_user => :creation_user, - creation_ip => :creation_ip - ); - end; - }] - - } + set group_id [db_exec_plsql add_group {}] } return $group_id } + + ad_proc delete { + -group_id:required + } { + Delete the given application group and all relational segments and constraints dependent + on it (handled by the PL/[pg]SQL API + } { + db_exec_plsql delete {} + } + } Index: openacs-4/packages/acs-subsite/tcl/application-group-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/application-group-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/application-group-procs.xql 12 May 2002 20:57:02 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/application-group-procs.xql 17 May 2003 09:58:37 -0000 1.4 @@ -10,17 +10,5 @@ - - - - - - select parent_id - from site_nodes - where object_id = :package_id - - - - Index: openacs-4/packages/acs-subsite/tcl/rel-segments-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-segments-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/tcl/rel-segments-procs-oracle.xql 6 May 2001 21:40:21 -0000 1.1 +++ openacs-4/packages/acs-subsite/tcl/rel-segments-procs-oracle.xql 17 May 2003 09:58:37 -0000 1.2 @@ -24,7 +24,7 @@ - begin rel_segment.delete(:constraint_id); end; + begin rel_constraint.delete(:constraint_id); end; Index: openacs-4/packages/acs-subsite/tcl/rel-segments-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-segments-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/rel-segments-procs-postgresql.xql 15 May 2001 16:59:00 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/rel-segments-procs-postgresql.xql 17 May 2003 09:58:37 -0000 1.3 @@ -27,7 +27,7 @@ - select rel_segment__delete(:constraint_id) + select rel_constraint__delete(:constraint_id) Index: openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/tcl/rel-segments-procs.tcl 17 May 2003 09:58:37 -0000 1.2 @@ -66,7 +66,7 @@ where c.required_rel_segment = :segment_id } { db_exec_plsql constraint_delete { - begin rel_segment.delete(:constraint_id); end; + begin rel_constraint.delete(:constraint_id); end; } } Index: openacs-4/packages/acs-subsite/tcl/relation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 10 Sep 2002 22:22:11 -0000 1.5 +++ openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 17 May 2003 09:58:37 -0000 1.6 @@ -79,8 +79,6 @@ db_transaction { - ns_log Notice "DOTLRN: relation_add: var_list is $var_list" - set rel_id [package_instantiate_object \ -creation_user $creation_user \ -creation_ip $creation_ip \ Index: openacs-4/packages/acs-subsite/tcl/subsite-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/subsite-procs-oracle.xql 10 Oct 2001 06:56:44 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs-oracle.xql 17 May 2003 09:58:37 -0000 1.4 @@ -3,7 +3,7 @@ oracle8.1.6 - + BEGIN Index: openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql 4 Dec 2001 00:20:47 -0000 1.5 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs-postgresql.xql 17 May 2003 09:58:37 -0000 1.6 @@ -3,7 +3,7 @@ postgresql7.1 - + select rel_constraint__new( Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 29 Jan 2003 16:09:01 -0000 1.2 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.tcl 17 May 2003 09:58:37 -0000 1.3 @@ -14,175 +14,68 @@ namespace eval util {} } - -ad_proc -public acs_subsite_after_mount_callback { +ad_proc -public subsite::after_mount { {-package_id:required} {-node_id:required} } { This is the TCL proc that is called automatically by the APM whenever a new instance of the subsites application is mounted. - @author Peter Marklund -} { - subsite::configure_if_necessary -package_id $package_id -} + We do three things: - ad_proc subsite::configure_if_necessary { - {-package_id ""} - } { - Performs post-install configuration if necessary. - See subsite::configured_p to learn how we determine if a subsite has - already been configured. See subsite::configure to learn what - is involved in configuring a subsite. +
    +
  • Create application group +
  • Create segment "Subsite Users" +
  • Create relational constraint to make subsite registration + require supersite registration. +
-

+ @author Don Baccus (dhogaza@pacifier.com) + @creation-date 2003-03-05 - NOTE: this proc might not work without a connection (i.e., - [ad_conn isconnected]==1). I haven't tested it without a connection, - but I think the code would work right now (assuming the caller passes - in a valid package_id). However, in the future, this proc may redirect - the administrator to a configuration "wizard" in case we need or want - some input from the admin to properly configure the subsite. +} { - @author Oumi Mehrotra (oumi@arsdigita.com) - @creation-date 2000-02-05 + if { [empty_string_p [application_group::group_id_from_package_id -no_complain -package_id $package_id]] } { - @param package_id The package_id of the subsite application instance - to configure. If package_id is not specified, then - [ad_conn package_id] will be used. + set subsite_name [db_string subsite_name_query {}] - } { - if {![configured_p -package_id $package_id]} { - configure -package_id $package_id - } + set truncated_subsite_name [string range $subsite_name 0 89] - } + db_transaction { + # Create subsite application group + set group_name "$truncated_subsite_name Parties" + set subsite_group_id [application_group::new \ + -package_id $package_id \ + -group_name $group_name] - ad_proc subsite::configured_p { - {-package_id ""} - } { - Determines whether a subsite has been configured. Returns 1 if - configured, or 0 otherwise. Right now, a subsite is considered - to be configured if its application group exists. In the future, - we may store an explicit "configured_p" setting in the DB. + # Create segment of registered users + set segment_name "$truncated_subsite_name Members" + set segment_id [rel_segments_new $subsite_group_id membership_rel $segment_name] - @author Oumi Mehrotra (oumi@arsdigita.com) - @creation-date 2000-02-05 + # Create a constraint that says "to be a member of this subsite you must be a member + # of the parent subsite. - @param package_id The package_id of the subsite application instance - to configure. If package_id is not specified, then - [ad_conn package_id] will be used. - } { - if {[empty_string_p [application_group::group_id_from_package_id \ - -no_complain \ - -package_id $package_id]]} { - return 0 - } - return 1 - } + db_1row parent_subsite_query {} + set constraint_name "Members of [string range $subsite_name 0 30] must be members of [string range $supersite_name 0 30]" + set user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + db_exec_plsql add_constraint {} - - - ad_proc subsite::configure { - {-package_id ""} - } { - Configures a subsite. This involves 3 steps: - -

    -
  • Create application group -
  • Create segment "Subsite Users" -
  • Create relational constraint to make subsite registration - require supersite registration. -
- - @author Oumi Mehrotra (oumi@arsdigita.com) - @creation-date 2000-02-05 - - @param package_id The package_id of the subsite application instance - to configure. If package_id is not specified, then - [ad_conn package_id] will be used. - - } { - - if {[ad_conn isconnected]} { - if {[empty_string_p $package_id]} { - set package_id [ad_conn package_id] - } - } - - if {[empty_string_p $package_id]} { - error "subsite::configure - package_id not specified" - } - - set subsite_name [db_string subsite_name_query { - select instance_name - from apm_packages - where package_id = :package_id - }] - - set truncated_subsite_name [string range $subsite_name 0 89] - - db_transaction { - - # Create subsite application group - set group_name "$truncated_subsite_name Parties" - set subsite_group_id [application_group::new \ - -package_id $package_id \ - -group_name $group_name] - - # Create segment of registered users - set segment_name "$truncated_subsite_name Members" - set segment_id [rel_segments_new $subsite_group_id membership_rel $segment_name] - - # Create constraint that says "to be a member of this - # subsite, you have to be a member of the parent subsite" - - set supersite_group_id "" - - db_0or1row parent_subsite_query { - select m.group_id as supersite_group_id, - p.instance_name as supersite_name - from application_group_element_map m, - apm_packages p - where p.package_id = m.package_id - and container_id = group_id - and element_id = :subsite_group_id - and rel_type = 'composition_rel' - } - - # First get parent application group's id and instance name - if { ![empty_string_p $supersite_group_id] } { - - set constraint_name "Members of [string range $subsite_name 0 30] must be members of [string range $supersite_name 0 30]" - - if {[ad_conn isconnected]} { - set user_id [ad_conn user_id] - set creation_ip [ad_conn peeraddr] - } else { - set user_id "" - set creation_ip "" - } - - set constraint_id [db_exec_plsql add_constraint { - BEGIN - :1 := rel_constraint.new( - constraint_name => :constraint_name, - rel_segment => :segment_id, - rel_side => 'two', - required_rel_segment => rel_segment.get(:supersite_group_id, 'membership_rel'), - creation_user => :user_id, - creation_ip => :creation_ip - ); - END; - }] - } - } - + } } +} +ad_proc -public subsite::before_uninstantiate { + {-package_id:required} +} { + Delete the application group associated with this subsite. +} { + application_group::delete -group_id [application_group::group_id_from_package_id -package_id $package_id] +} + ad_proc -private subsite::instance_name_exists_p { node_id instance_name @@ -202,24 +95,24 @@ }] } - ad_proc -public subsite::auto_mount_application { { -instance_name "" } { -pretty_name "" } { -node_id "" } package_key } { Mounts a new instance of the application specified by package_key - beneath node_id. This proc makes sure that the instance_name (the + beneath node_id. This proc makes sure that the instance_name (the name of the new node) is unique before invoking site_node::instantiate_and_mount. - + + @author Michael Bryzek (mbryzek@arsdigita.com) @creation-date 2001-02-28 @param instance_name The name to use for the url in the site-map. Defaults to the package_key plus a possible digit to serve as a unique identifier (e.g. news-2) - + @param pretty_name The english name to use for the site-map and for things like context bars. Defaults to the name of the object mounted at this node + the package pretty name (e.g. Intranet News) @@ -269,14 +162,71 @@ -package_key $package_key] } + +ad_proc -public subsite::get { + {-subsite_id {}} + {-array:required} +} { + Get information about a subsite. + + @param subsite_id The id of the subsite for which info is requested. + If no id is provided, then the id of the closest ancestor subsite will + be used. + @param array The name of an array in which information will be returned. + + @author Frank Nikolajsen (frank@warpspace.com) + @creation-date 2003-03-08 +} { + upvar $array subsite_info + + if { [empty_string_p $subsite_id] } { + set subsite_id [site_node_closest_ancestor_package "acs-subsite"] + } + + array unset subsite_info + array set subsite_info [site_node::get_from_object_id -object_id $subsite_id] +} + +ad_proc -public subsite::get_element { + {-subsite_id {}} + {-element:required} + {-notrailing:boolean} +} { + Return a single element from the information about a subsite. + + @param subsite_id The node id of the subsite for which info is requested. + If no id is provided, then the id of the closest ancestor subsite will + be used. + @param element The element you want, one of: + directory_p object_type package_key package_id name pattern_p + instance_name node_id parent_id url object_id + @notrailing If true and the element requested is an url, then strip any + trailing slash ('/'). This means the empty string is returned for the root. + @return The element you asked for + + @author Frank Nikolajsen (frank@warpspace.com) + @creation-date 2003-03-08 +} { + get -subsite_id $subsite_id -array subsite_info + + if { $notrailing_p && [string match $element "url"]} { + set returnval [string trimright $subsite_info($element) "/"] + } else { + set returnval $subsite_info($element) + } + + return $returnval +} + + ad_proc subsite::util::sub_type_exists_p { object_type } { returns 1 if object_type has sub types, or 0 otherwise @author Oumi Mehrotra (oumi@arsdigita.com) @creation-date 2000-02-07 - + @param object_type } { @@ -328,7 +278,7 @@ @author Oumi Mehrotra (oumi@arsdigita.com) @creation-date 2000-02-07 - + @param object_type } { return [db_string select_pretty_name { Index: openacs-4/packages/acs-subsite/tcl/subsite-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/Attic/subsite-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/tcl/subsite-procs.xql 10 Oct 2001 06:56:44 -0000 1.3 +++ openacs-4/packages/acs-subsite/tcl/subsite-procs.xql 17 May 2003 09:58:37 -0000 1.4 @@ -1,9 +1,21 @@ - + + select 1 + from dual + where exists (select 1 + from application_groups + where package_id = :package_id) + + + + + + + select instance_name from apm_packages where package_id = :package_id @@ -12,18 +24,16 @@ - + - select m.group_id as supersite_group_id, - p.instance_name as supersite_name - from application_group_element_map m, - apm_packages p - where p.package_id = m.package_id - and container_id = group_id - and element_id = :subsite_group_id - and rel_type = 'composition_rel' - + select m.group_id as supersite_group_id, p.instance_name as supersite_name + from application_groups m, apm_packages p, site_nodes s1, site_nodes s2 + where s1.node_id = :node_id + and s2.node_id = s1.parent_id + and p.package_id = s2.object_id + and m.package_id = s2.object_id + Index: openacs-4/packages/acs-subsite/www/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/Attic/index-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/index-oracle.xql 16 Jan 2003 13:38:49 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/index-oracle.xql 17 May 2003 09:58:56 -0000 1.3 @@ -19,6 +19,7 @@ from site_nodes n where n.parent_id = :node_id and n.object_id is not null + and acs_permission.permission_p(n.object_id, :user_id, 'read') = 't' order by name
Index: openacs-4/packages/acs-subsite/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/Attic/index-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/index-postgresql.xql 16 Jan 2003 13:38:49 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/index-postgresql.xql 17 May 2003 09:58:56 -0000 1.5 @@ -14,11 +14,12 @@ - + select site_node__url(n.node_id) as url, acs_object__name(n.object_id) as name from site_nodes n where n.parent_id = :node_id and n.object_id is not null + and acs_permission__permission_p(n.object_id, :user_id, 'read') = 't' order by name Index: openacs-4/packages/acs-subsite/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/index.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/admin/index.adp 19 Feb 2003 15:03:27 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/admin/index.adp 17 May 2003 09:59:24 -0000 1.8 @@ -12,5 +12,22 @@
  • Object Types -To administer the site-wide services of OpenACS, use -@acs_admin_name@. + +

    To administer the site-wide services of OpenACS, use:

    + +
    + +

    The Site-Wide Administration service is not available. If you are a + site-wide administrator, use the Site Map to + mount the Site-Wide Administration service. This provides an + interface for administering the site-wide services of OpenACS.

    +
    + Index: openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl 6 Sep 2002 21:49:58 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/group-types/index.tcl 17 May 2003 09:59:47 -0000 1.3 @@ -13,8 +13,6 @@ group_types:multirow } -subsite::configure_if_necessary - set context [list "Group types"] # we may want to move the inner count to get the number of groups of Index: openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl 6 Sep 2002 21:49:58 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/group-types/one.tcl 17 May 2003 09:59:47 -0000 1.4 @@ -23,8 +23,6 @@ more_relation_types_p:onevalue } -subsite::configure_if_necessary - set user_id [ad_conn user_id] set return_url_enc [ad_urlencode [ad_conn url]?[ad_conn query]] set group_type_enc [ad_urlencode $group_type] Index: openacs-4/packages/acs-subsite/www/admin/groups/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/groups/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/groups/index.tcl 6 Sep 2002 21:49:59 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/groups/index.tcl 17 May 2003 10:00:06 -0000 1.3 @@ -24,8 +24,6 @@ view_by:onevalue } -subsite::configure_if_necessary - set context [list "Groups"] set this_url [ad_conn url] Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/one-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/Attic/one-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/one-postgresql.xql 28 Nov 2001 18:39:39 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/one-postgresql.xql 17 May 2003 10:00:36 -0000 1.3 @@ -2,19 +2,7 @@ postgresql7.1 - - - - - select count(*) as number_elements - from rel_segment_party_map map - where acs_permission__permission_p(map.party_id, :user_id, 'read') - and map.segment_id = :segment_id - - - - Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/one.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/one.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/one.xql 15 May 2001 16:59:00 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/one.xql 17 May 2003 10:00:36 -0000 1.2 @@ -15,12 +15,14 @@ - select count(*) as number_elements - from rel_segment_party_map map, acs_object_party_privilege_map perm - where perm.object_id = map.party_id - and perm.party_id = :user_id - and perm.privilege = 'read' - and map.segment_id = :segment_id + select count(*) as number_elements + from rel_segment_party_map map + where map.segment_id = :segment_id + and exists (select 1 + from acs_object_party_privilege_map perm + where perm.object_id = map.party_id + and perm.party_id = :user_id + and perm.privilege = 'read') 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.6 -r1.7 --- openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 5 Dec 2002 13:11:21 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/admin/relations/add.tcl 17 May 2003 10:00:50 -0000 1.7 @@ -126,7 +126,7 @@ set party_type_exact_p f set add_to_group_id $group_id set add_with_rel_type $rel_type -set add_party_url "[ad_conn package_url]admin/parties/new?[ad_export_vars {add_to_group_id add_with_rel_type party_type party_type_exact_p}]" +set add_party_url "[ad_conn package_url]admin/parties/new?[ad_export_vars {add_to_group_id add_with_rel_type party_type party_type_exact_p return_url}]" # Build a url used to select an existing party from the system (as opposed # to limiting the selection to parties on the current subsite). Index: openacs-4/packages/acs-subsite/www/admin/site-map/mount-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/mount-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/site-map/mount-oracle.xql 21 Jun 2002 19:08:33 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/site-map/mount-oracle.xql 17 May 2003 10:01:14 -0000 1.3 @@ -5,48 +5,76 @@ - select package_id, acs_object.name(package_id) as name - from apm_packages - where ( - acs_permission.permission_p(package_id, :user_id, 'read') = 't' - or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't' - ) - and apm_package.singleton_p(package_key) = 0 - and not exists (select 1 - from site_nodes - where object_id = package_id) + select p.package_id, + acs_object.name(p.package_id) as name, + pt.pretty_name as package_pretty_name + from apm_packages p, + apm_package_types pt, + apm_package_versions v + where pt.package_key = p.package_key + and v.package_key = pt.package_key + and (v.installed_p = 't' or v.enabled_p = 't' or not exists ( + select 1 from apm_package_versions v2 + where v2.package_key = v.package_key + and (v2.installed_p = 't' or v2.enabled_p = 't') + and apm_package_version.sortable_version_name(v2.version_name) > + apm_package_version.sortable_version_name(v.version_name))) + and ( + acs_permission.permission_p(package_id, :user_id, 'read') = 't' + or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't' + ) + and (apm_package.singleton_p(p.package_key) = 0 or v.auto_mount is not null) + and not exists (select 1 + from site_nodes + where object_id = p.package_id) order by name - select package_id, acs_object.name(package_id) as name - from apm_packages - where ( - acs_permission.permission_p(package_id, :user_id, 'read') = 't' - or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't' - ) - and exists (select 1 - from site_nodes - where object_id = package_id) + select p.package_id, + acs_object.name(p.package_id) as name, + pt.pretty_name as package_pretty_name + from apm_packages p, + apm_package_types pt + where pt.package_key = p.package_key + and ( + acs_permission.permission_p(package_id, :user_id, 'read') = 't' + or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't' + ) + and exists (select 1 + from site_nodes + where object_id = p.package_id) order by name - select package_id, acs_object.name(package_id) as name - from apm_packages - where ( - acs_permission.permission_p(package_id, :user_id, 'read') = 't' - or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't' - ) - and apm_package.singleton_p(package_key) = 1 - and not exists (select 1 - from site_nodes - where object_id = package_id) + select p.package_id, + acs_object.name(p.package_id) as name, + pt.pretty_name as package_pretty_name + from apm_packages p, + apm_package_types pt, + apm_package_versions v + where pt.package_key = p.package_key + and v.package_key = pt.package_key + and (v.installed_p = 't' or v.enabled_p = 't' or not exists ( + select 1 from apm_package_versions v2 + where v2.package_key = v.package_key + and (v2.installed_p = 't' or v2.enabled_p = 't') + and apm_package_version.sortable_version_name(v2.version_name) > + apm_package_version.sortable_version_name(v.version_name))) + and ( + acs_permission.permission_p(package_id, :user_id, 'read') = 't' + or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't' + ) + and (apm_package.singleton_p(p.package_key) = 1 and v.auto_mount is null) + and not exists (select 1 + from site_nodes + where object_id = p.package_id) order by name Index: openacs-4/packages/acs-subsite/www/admin/site-map/mount-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/mount-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/admin/site-map/mount-postgresql.xql 21 Jun 2002 19:08:33 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/site-map/mount-postgresql.xql 17 May 2003 10:01:14 -0000 1.4 @@ -5,48 +5,77 @@ - select package_id, acs_object__name(package_id) as name - from apm_packages - where ( - acs_permission__permission_p(package_id, :user_id, 'read') = 't' - or acs_permission__permission_p(package_id, acs__magic_object_id('the_public'), 'read') = 't' - ) - and apm_package__singleton_p(package_key) = 0 - and not exists (select 1 - from site_nodes - where object_id = package_id) + select p.package_id, + acs_object__name(p.package_id) as name, + pt.pretty_name as package_pretty_name + from apm_packages p, + apm_package_types pt, + apm_package_versions v + where pt.package_key = p.package_key + and v.package_key = pt.package_key + and (v.installed_p = 't' or v.enabled_p = 't' or not exists ( + select 1 from apm_package_versions v2 + where v2.package_key = v.package_key + and (v2.installed_p = 't' or v2.enabled_p = 't') + and apm_package_version__sortable_version_name(v2.version_name) > + apm_package_version__sortable_version_name(v.version_name))) + and ( + acs_permission__permission_p(p.package_id, :user_id, 'read') = 't' + or acs_permission__permission_p(p.package_id, acs__magic_object_id('the_public'), 'read') = 't' + ) + and (apm_package__singleton_p(p.package_key) = 0 or coalesce(v.auto_mount,'') != '') + and not exists (select 1 + from site_nodes + where object_id = p.package_id) - order by name + order by name - select package_id, acs_object__name(package_id) as name - from apm_packages - where ( - acs_permission__permission_p(package_id, :user_id, 'read') = 't' - or acs_permission__permission_p(package_id, acs__magic_object_id('the_public'), 'read') = 't' - ) - and exists (select 1 - from site_nodes - where object_id = package_id) - order by name + select p.package_id, + acs_object__name(p.package_id) as name, + pt.pretty_name as package_pretty_name + from apm_packages p, + apm_package_types pt + where pt.package_key = p.package_key + and ( + acs_permission__permission_p(p.package_id, :user_id, 'read') = 't' + or acs_permission__permission_p(p.package_id, acs__magic_object_id('the_public'), 'read') = 't' + ) + and exists (select 1 + from site_nodes + where object_id = p.package_id) + order by name - select package_id, acs_object__name(package_id) as name - from apm_packages - where ( - acs_permission__permission_p(package_id, :user_id, 'read') = 't' - or acs_permission__permission_p(package_id, acs__magic_object_id('the_public'), 'read') = 't' - ) - and apm_package__singleton_p(package_key) = 1 - and not exists (select 1 - from site_nodes - where object_id = package_id) + select p.package_id, + acs_object__name(p.package_id) as name, + pt.pretty_name as package_pretty_name + from apm_packages p, + apm_package_types pt, + apm_package_versions v + where pt.package_key = p.package_key + and v.package_key = pt.package_key + and (v.installed_p = 't' or v.enabled_p = 't' or not exists ( + select 1 from apm_package_versions v2 + where v2.package_key = v.package_key + and (v2.installed_p = 't' or v2.enabled_p = 't') + and apm_package_version__sortable_version_name(v2.version_name) > + apm_package_version__sortable_version_name(v.version_name))) + and ( + acs_permission__permission_p(p.package_id, :user_id, 'read') = 't' + or acs_permission__permission_p(p.package_id, acs__magic_object_id('the_public'), 'read') = 't' + ) + and (apm_package__singleton_p(p.package_key) = 1 and coalesce(v.auto_mount,'') = '') + and apm_package__singleton_p(p.package_key) = 1 + and not exists (select 1 + from site_nodes + where object_id = p.package_id) order by name Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/admin/site-map/mount.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/admin/site-map/mount.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/mount.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/admin/site-map/mount.tcl 21 Jun 2002 19:08:33 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/site-map/mount.tcl 17 May 2003 10:01:14 -0000 1.3 @@ -13,40 +13,22 @@ set user_id [ad_conn user_id] -doc_body_append "[ad_header "Mount A Package Instance"] +set page_title "Mount A Package Instance" -Please select one of the following packages to mount on [site_node::get_url -node_id $node_id]. -

    -The package instances are not mounted anywhere else: +set context [list [list . "Site Map"] $page_title] -

      -" +set site_node_url [site_node::get_url -node_id $node_id] -db_foreach packages_unmounted_select {} { - doc_body_append "
    • $name" +db_multirow -extend { url } unmounted packages_unmounted_select {} { + set url "mount-2?[export_vars { expand:multiple root_id node_id package_id }]" } -doc_body_append "
    These instances are already mounted -elsewhere. Selecting one of them will create an additional location -for the same application:
      " - -db_foreach packages_mounted_select {} { - doc_body_append "
    • $name" +db_multirow -extend { url } mounted packages_mounted_select {} { + set url "mount-2?[export_vars { expand:multiple root_id node_id package_id}]" } -doc_body_append "
    - -The packages are centralized services and are -probably not meant to be mounted anywhere: - -
      " - -db_foreach packages_singleton_select {} { - doc_body_append "
    • $name" +db_multirow -extend { url } singleton packages_singleton_select {} { + set url "mount-2?[export_vars { expand:multiple root_id node_id package_id}]" } -doc_body_append " -
    -[ad_footer] -" Index: openacs-4/packages/acs-subsite/www/admin/users/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/users/new.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/admin/users/new.tcl 20 Jan 2003 13:49:57 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/admin/users/new.tcl 17 May 2003 10:01:44 -0000 1.6 @@ -182,7 +182,13 @@ $member_state \ $user_id] - relation_add -form_id add_user -variable_prefix rel -member_state $rel_member_state $add_with_rel_type $add_to_group_id $user_id + # Hack for adding users to the main subsite, whose application group is the registered users group. + + if { $add_to_group_id != [acs_lookup_magic_object "registered_users"] || + ![string equal $add_with_rel_type "membership_rel"] } { + relation_add -form_id add_user -variable_prefix rel -member_state $rel_member_state $add_with_rel_type $add_to_group_id $user_id + } + } on_error { ad_return_error "User Creation Failed" "We were unable to create the user record in the database." } Index: openacs-4/packages/acs-subsite/www/permissions/grant-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/Attic/grant-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/permissions/grant-2.tcl 22 Apr 2001 16:13:15 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/permissions/grant-2.tcl 17 May 2003 10:02:04 -0000 1.3 @@ -9,6 +9,7 @@ object_id:integer,notnull party_id:integer,notnull privilege + {application_url ""} } ad_require_permission $object_id admin @@ -19,4 +20,4 @@ end; } -ad_returnredirect "one?[export_url_vars object_id]" +ad_returnredirect "one?[export_vars {object_id application_url}]" Index: openacs-4/packages/acs-subsite/www/permissions/grant-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/Attic/grant-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/permissions/grant-oracle.xql 30 Apr 2001 22:02:48 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/permissions/grant-oracle.xql 17 May 2003 10:02:04 -0000 1.2 @@ -13,8 +13,10 @@ - select party_id, acs_object.name(party_id) as name - from parties + select p.party_id, + acs_object.name(p.party_id) || nvl2(p.email, ' ('||p.email||')', '') as name + from parties p + order by upper(acs_object.name(p.party_id)) Index: openacs-4/packages/acs-subsite/www/permissions/grant-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/Attic/grant-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/permissions/grant-postgresql.xql 30 Apr 2001 22:02:48 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/permissions/grant-postgresql.xql 17 May 2003 10:02:04 -0000 1.3 @@ -13,8 +13,10 @@ - select party_id, acs_object__name(party_id) as name - from parties + select p.party_id, + acs_object__name(p.party_id)|| coalesce(' ('||p.email||')', '') as name + from parties p + order by upper(acs_object__name(p.party_id)) Index: openacs-4/packages/acs-subsite/www/permissions/grant.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/grant.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/permissions/grant.tcl 7 Nov 2002 18:06:55 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/permissions/grant.tcl 17 May 2003 10:02:04 -0000 1.4 @@ -7,6 +7,7 @@ @cvs-id $Id$ } { object_id:integer,notnull + {application_url ""} } ad_require_permission $object_id admin @@ -22,17 +23,13 @@
    -[export_form_vars object_id] +[export_vars -form {application_url object_id}] " -db_foreach parties { - select party_id, acs_object.name(party_id) as name - from parties -} { +db_foreach parties {} { doc_body_append "\n" } doc_body_append " + +
    [ad_footer] Index: openacs-4/packages/acs-subsite/www/permissions/one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/permissions/one.adp 20 Jan 2003 22:35:34 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/permissions/one.adp 17 May 2003 10:02:04 -0000 1.4 @@ -16,12 +16,14 @@

    #acs-subsite.Direct_Permissions#

    - -
      + @export_form_vars@ +
      -
    • @acl.grantee_name@, @acl.privilege@
    • + +
      -
    +

    #acs-subsite.none#

    @@ -40,15 +42,25 @@
  • @children.c_name@ @children.c_type@
  • + + [Hide]

    #acs-subsite.none#

    + #acs-subsite.lt_num_children_Children# [#acs-subsite.Show#] #acs-subsite.none# -

    [#acs-subsite.up_to_context_name#]

    + +

    + [return to application] +

    +
    + +

    [#acs-subsite.up_to_context_name#]

    +
    Index: openacs-4/packages/acs-subsite/www/permissions/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/one.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/permissions/one.tcl 20 Jan 2003 22:35:34 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/permissions/one.tcl 17 May 2003 10:02:04 -0000 1.5 @@ -1,4 +1,4 @@ -# packages/acs-core-ui/www/acs_object/permissions/index.tcl +# packages-core-ui/www/acs_object/permissions/index.tcl ad_page_contract { Display permissions and children for the given object_id @@ -10,6 +10,7 @@ } { object_id:integer,notnull {children_p "f"} + {application_url ""} } set user_id [ad_maybe_redirect_for_registration] @@ -29,18 +30,23 @@ set controls [list] -lappend controls "[_ acs-subsite.Grant_Permission]" +lappend controls "[_ acs-subsite.Grant_Permission]" db_1row context { *SQL* } if { $security_inherit_p == "t" && ![empty_string_p $context_id] } { - lappend controls "Don't Inherit Permissions from $context_name" + lappend controls "Don't Inherit Permissions from $context_name" } else { - lappend controls "Inherit Permissions from $context_name" + lappend controls "Inherit Permissions from $context_name" } set controls "\[ [join $controls " | "] \]" +set export_form_vars [export_vars -form {object_id application_url}] + +set show_children_url "one?[export_vars {object_id application_url {children_p t}}]" +set hide_children_url "one?[export_vars {object_id application_url {children_p f}}]" + if [string equal $children_p "t"] { db_multirow children children { *SQL* } { set c_name [ad_quotehtml $c_name] Index: openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl 30 Nov 2002 17:22:35 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/permissions/revoke-2.tcl 17 May 2003 10:02:04 -0000 1.4 @@ -9,6 +9,7 @@ object_id:integer,notnull revoke_list:multiple { operation "" } + {application_url ""} } permission::require_permission -object_id $object_id -privilege admin @@ -23,4 +24,4 @@ } } -ad_returnredirect "one?[export_url_vars object_id]" +ad_returnredirect "one?[export_vars {object_id application_url}]" Index: openacs-4/packages/acs-subsite/www/permissions/revoke.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/revoke.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/www/permissions/revoke.tcl 18 Sep 2002 12:16:44 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/permissions/revoke.tcl 17 May 2003 10:02:04 -0000 1.4 @@ -8,6 +8,7 @@ } { object_id:integer,notnull {revoke_list:multiple,optional {}} + {application_url ""} } ad_require_permission $object_id admin @@ -38,7 +39,7 @@ doc_body_append " -[export_form_vars object_id] +[export_vars -form {object_id application_url}] " Index: openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl 13 Mar 2002 22:54:34 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/permissions/toggle-inherit.tcl 17 May 2003 10:02:04 -0000 1.3 @@ -9,10 +9,11 @@ @cvs-id $Id$ } { object_id:integer,notnull + {application_url ""} } ad_require_permission $object_id admin permission::toggle_inherit -object_id $object_id -ad_returnredirect one?[export_url_vars object_id] +ad_returnredirect one?[export_vars {application_url object_id}] Index: openacs-4/packages/acs-subsite/www/register/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/register/index.tcl 16 Mar 2002 21:08:37 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/register/index.tcl 17 May 2003 10:02:25 -0000 1.3 @@ -13,11 +13,11 @@ persistent_login_p:onevalue } -set old_login_process [ad_parameter "SeparateEmailPasswordPagesP" security "0"] -set allow_persistent_login_p [ad_parameter AllowPersistentLoginP security 1] -set persistent_login_p [ad_parameter AllowPersistentLoginP security 1] +set old_login_process [parameter::get -parameter SeparateEmailPasswordPagesP -default 0] +set allow_persistent_login_p [parameter::get -parameter AllowPersistentLoginP -default 1] +set persistent_login_p [parameter::get -parameter AllowPersistentLoginP -default 1] -set email_forgotten_password_p [ad_parameter EmailForgottenPasswordP security 1] +set email_forgotten_password_p [parameter::get -parameter EmailForgottenPasswordP -default 1] if {![info exists return_url]} { set return_url [ad_pvt_home] @@ -35,6 +35,6 @@ set token [sec_get_token $token_id] set hash [ns_sha1 "$time$token_id$token"] -set export_vars [export_form_vars return_url time token_id hash] +set export_vars [export_vars -form {return_url time token_id hash}] ad_return_template Index: openacs-4/packages/acs-subsite/www/register/logout.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/logout.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/www/register/logout.tcl 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-subsite/www/register/logout.tcl 17 May 2003 10:02:25 -0000 1.2 @@ -6,11 +6,12 @@ @cvs-id $Id$ } { + {return_url "/"} } ad_user_logout db_release_unused_handles -ad_returnredirect "/" +ad_returnredirect $return_url Index: openacs-4/packages/acs-subsite/www/shared/1pixel.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/1pixel.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/www/shared/1pixel.tcl 13 Mar 2002 22:50:53 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/shared/1pixel.tcl 17 May 2003 10:02:50 -0000 1.3 @@ -1,40 +1,55 @@ # 1pixel.tcl,v 1.1.2.2 2000/02/03 10:00:24 ron Exp -# File: index.tcl -# Date: 28 Nov 1999 -# Author: Jon Salz -# Description: Generates a 1-pixel GIF image with a certain color. -# Inputs: r g b +ad_page_contract { + Generates a 1-pixel GIF image with a certain color. + + @author Jon Salz + @creation-date 28 Nov 1999 + @cvs-id $Id$ +} { + r:integer + g:integer + b:integer +} + ReturnHeaders "image/gif" -set_the_usual_form_variables +if { [catch { + set file [open "[acs_package_root_dir "acs-subsite"]/www/shared/1pixel.header"] + ns_writefp $file + close $file -set file [open "[acs_package_root_dir "acs-subsite"]/www/shared/1pixel.header"] -ns_writefp $file -close $file + if { [util_aolserver_2_p] } { + if { $r == 0 } { set r 1 } + if { $g == 0 } { set g 1 } + if { $b == 0 } { set b 1 } -if { [util_aolserver_2_p] } { - if { $r == 0 } { set r 1 } - if { $g == 0 } { set g 1 } - if { $b == 0 } { set b 1 } + ns_write "[format "%c%c%c" $r $g $b]" + } else { + # Can't figure out how to write binary data using AOLserver 3 (it + # insist on UTF8-encoding it). So we write to a file, then dump + # the file's contents. - ns_write "[format "%c%c%c" $r $g $b]" -} else { - # Can't figure out how to write binary data using AOLserver 3 (it - # insist on UTF8-encoding it). So we write to a file, then dump - # the file's contents. + set file_name [ns_tmpnam] + ns_log "Notice" "logging to $file_name" + set file [open $file_name w+] + fconfigure $file -encoding binary + puts -nonewline $file "[format "%c%c%c" $r $g $b]" + seek $file 0 + ns_writefp $file + close $file + ns_unlink $file_name + } - set file_name [ns_tmpnam] - ns_log "Notice" "logging to $file_name" - set file [open $file_name w+] - fconfigure $file -encoding binary - puts -nonewline $file "[format "%c%c%c" $r $g $b]" - seek $file 0 + set file [open "[acs_package_root_dir "acs-subsite"]/www/shared/1pixel.footer"] ns_writefp $file close $file - ns_unlink $file_name -} -set file [open "[acs_package_root_dir "acs-subsite"]/www/shared/1pixel.footer"] -ns_writefp $file -close $file +} errMsg] } { + # Ignore simple i/o errors, which probably just mean that the user surfed on + # to some other page before we finished serving + if { ![string equal $errMsg {i/o failed}] } { + global errorInfo + ns_log Error "$errMsg\n$errorInfo" + } +} Index: openacs-4/packages/acs-subsite/www/shared/images/Delete16.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/images/Delete16.gif,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/acs-subsite/www/shared/images/Delete24.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/images/Delete24.gif,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/acs-subsite/www/shared/images/Edit16.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/images/Edit16.gif,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/acs-subsite/www/shared/images/Edit24.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/images/Edit24.gif,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/acs-subsite/www/shared/images/spacer.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/images/spacer.gif,v diff -u -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/acs-subsite/www/user/basic-info-update-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/Attic/basic-info-update-2.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/user/basic-info-update-2.tcl 20 Sep 2002 22:28:56 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/user/basic-info-update-2.tcl 17 May 2003 10:03:44 -0000 1.7 @@ -130,6 +130,7 @@ set first_names = :first_names, last_name = :last_name where person_id = :user_id" + person::name_flush -person_id $user_id db_dml update_users "update users set screen_name=:screen_name where user_id = :user_id" Index: openacs-4/packages/acs-tcl/acs-tcl.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v diff -u -r1.26 -r1.27 --- openacs-4/packages/acs-tcl/acs-tcl.info 25 Feb 2003 16:41:31 -0000 1.26 +++ openacs-4/packages/acs-tcl/acs-tcl.info 17 May 2003 10:04:03 -0000 1.27 @@ -6,7 +6,7 @@ ACS Tcl Libraries t t - + oracle @@ -19,121 +19,8 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 11 Apr 2003 03:57:30 -0000 1.28 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl 17 May 2003 10:04:18 -0000 1.29 @@ -689,14 +689,14 @@ # if a table is being created, we need to bypass things, too (OpenACS - Ben). set test_sql [db_qd_replace_sql $full_statement_name $sql] if {[regexp -nocase -- {^\s*select} $test_sql match]} { - db_qd_log QDDebug "PLPGSQL: bypassed anon function" + ns_log Debug "PLPGSQL: bypassed anon function" set selection [db_exec 0or1row $db $full_statement_name $sql] } elseif {[regexp -nocase -- {^\s*create table} $test_sql match] || [regexp -nocase -- {^\s*drop table} $test_sql match]} { - db_qd_log QDDebug "PLPGSQL: bypassed anon function -- create/drop table" + ns_log Debug "PLPGSQL: bypassed anon function -- create/drop table" set selection [db_exec dml $db $full_statement_name $sql] return "" } else { - db_qd_log QDDebug "PLPGSQL: using anonymous function" + ns_log Debug "PLPGSQL: using anonymous function" set selection [db_exec_plpgsql $db $full_statement_name $sql \ $statement_name] } @@ -735,13 +735,8 @@ } { set start_time [clock clicks] - db_qd_log QDDebug "PRE-QD: the SQL is $pre_sql" - - # Query Dispatcher (OpenACS - ben) set sql [db_qd_replace_sql $statement_name $pre_sql] - db_qd_log QDDebug "POST-QD: the SQL is $sql" - set unique_id [db_nextval "anon_func_seq"] set function_name "__exec_${unique_id}_${fname}" @@ -750,7 +745,7 @@ if {![string equal $sql $pre_sql]} { set sql [uplevel 2 [list subst -nobackslashes $sql]] } - db_qd_log QDDebug "PLPGSQL: converted: $sql to: select $function_name ()" + ns_log Debug Debug "PLPGSQL: converted: $sql to: select $function_name ()" # create a function definition statement for the inline code # binding is emulated in tcl. (OpenACS - Dan) @@ -926,18 +921,13 @@ # db_driverkey, so db_driverkey MUST support its -handle switch. # --atp@piskorski.com, 2003/04/09 12:13 EDT - db_qd_log QDDebug "PRE-QD: the SQL is $pre_sql for $statement_name" - - # Query Dispatcher (OpenACS - ben) set sql [db_qd_replace_sql $statement_name $pre_sql] # insert tcl variable values (Openacs - Dan) if {![string equal $sql $pre_sql]} { set sql [uplevel $ulevel [list subst -nobackslashes $sql]] } - db_qd_log QDDebug "POST-QD: the SQL is $sql" - set errno [catch { upvar bind bind @@ -1810,21 +1800,40 @@ # An error was triggered or the transaction has been aborted. db_abort_transaction if { [info exists on_error] && ![empty_string_p $on_error] } { - # An on_error block exists, so execute it. + if {[string equal postgresql [db_type]]} { + # JCD: with postgres we abort the transaction prior to # executing the on_error block since there is nothing # you can do to "fix it" and keeping it meant things like # queries in the on_error block would then fail. # # Note that the semantics described in the proc doc # are not possible to support on postresql. + + # DRB: I removed the db_release_unused_handles call that + # this patch included because additional aborts further + # down triggered an illegal db handle error. I'm going to + # have the code start a new transaction as well. If we + # don't, if a transaction fails and the on_error block + # fails, the on_error block DML will have been committed. + # Starting a new transaction here means that DML by both + # the transaction and on_error clause will be rolled back. + # On the other hand, if the on_error clause doesn't fail, + # any DML in that block will be committed. This seems more + # useful than simply punting ... + ns_db dml $dbh "abort transaction" - db_release_unused_handles + ns_db dml $dbh "begin transaction" + } + + # An on_error block exists, so execute it. + set errno [catch { uplevel 1 $on_error } on_errmsg] + # Determine what do with the error. set err_p 0 switch $errno { @@ -2186,7 +2195,7 @@ if { $error_found } { global errorCode - return -code error -errorinfo $error_lines -errorcode $errorCode + return -code error -errorinfo $error_lines -errorcode $errorCode $error_lines } } @@ -2601,9 +2610,6 @@ } { set start_time [clock clicks] - db_qd_log QDDebug "PRE-QD: the SQL is $pre_sql for $statement_name" - - # Query Dispatcher (OpenACS - ben) set sql [db_qd_replace_sql $statement_name $pre_sql] # insert tcl variable values (Openacs - Dan) @@ -2618,14 +2624,12 @@ set file_storage_p 1 set original_type $type set qtype 1row - ns_log Notice "db_exec_lob: file storage in use" + ns_log Debug "db_exec_lob: file storage in use" } else { set qtype $type - ns_log Notice "db_exec_lob: blob storage in use" + ns_log Debug "db_exec_lob: blob storage in use" } - db_qd_log QDDebug "POST-QD: the SQL is $sql" - set errno [catch { upvar bind bind Index: openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/acs-kernel-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.xql 18 Feb 2003 20:55:00 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.xql 17 May 2003 10:04:18 -0000 1.4 @@ -19,11 +19,11 @@ - select case when count(object_id) = 0 then 0 else 1 end - from site_nodes - where object_id = (select package_id - from apm_packages - where package_key = 'acs-admin') + select case when count(object_id) = 0 then 0 else 1 end + from site_nodes + where object_id = (select package_id + from apm_packages + where package_key = 'acs-admin') Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 4 Apr 2003 09:49:08 -0000 1.23 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 17 May 2003 10:04:18 -0000 1.24 @@ -281,6 +281,10 @@ @param path The path of the file relative to server root } { + if { [string equal $path "packages/acs-bootstrap-installer/tcl/30-apm-load-procs.tcl"] } { + ns_log Warning "apm_file_watch: Skipping file $path as it cannot be watched. You have to restart the server instead" + } + nsv_set apm_reload_watch $path 1 } Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql 25 Feb 2003 16:42:12 -0000 1.7 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs-oracle.xql 17 May 2003 10:04:18 -0000 1.8 @@ -27,6 +27,30 @@ + + + + begin + :1 := apm_package_version.new( + version_id => :version_id, + package_key => :package_key, + version_name => :version_name, + version_uri => :version_uri, + summary => :summary, + description_format => :description_format, + description => :description, + release_date => :release_date, + vendor => :vendor, + vendor_uri => :vendor_uri, + auto_mount => :auto_mount, + installed_p => 't', + data_model_loaded_p => 't' + ); + end; + + + + Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql 10 Mar 2003 19:59:04 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.xql 17 May 2003 10:04:18 -0000 1.4 @@ -92,5 +92,12 @@ + + + + delete from apm_package_callbacks + where version_id = :version_id + + Index: openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 31 Mar 2003 12:59:09 -0000 1.19 +++ openacs-4/packages/acs-tcl/tcl/apm-xml-procs.tcl 17 May 2003 10:04:18 -0000 1.20 @@ -132,7 +132,6 @@ } append spec " " append spec "\n \n" - apm_log APMDebug "APM: Writing parameters" db_foreach parameter_info {} { append spec " + + + select type, + proc + from apm_package_callbacks + where version_id = :version_id + + + 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.13 -r1.14 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 16 Jan 2003 13:41:57 -0000 1.13 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 17 May 2003 10:04:18 -0000 1.14 @@ -179,6 +179,22 @@ ad_proc -public name { {-person_id:required} } { + get the name of a person. Cached. + } { + return [util_memoize [list person::name_not_cached -person_id $person_id]] + } + + ad_proc -public name_flush { + {-person_id:required} + } { + Flush the person::name cache. + } { + util_memoize_flush [list person::name_not_cached -person_id $person_id] + } + + ad_proc -public name_not_cached { + {-person_id:required} + } { get the name of a person } { db_1row get_person_name {} @@ -193,6 +209,7 @@ update the name of a person } { db_dml update_person {} + name_flush -person_id $person_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.2 -r1.3 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 9 Aug 2002 20:02:27 -0000 1.2 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 17 May 2003 10:04:18 -0000 1.3 @@ -57,7 +57,7 @@ - + select first_names||' '||last_name as person_name Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 13 Feb 2003 13:28:51 -0000 1.24 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 17 May 2003 10:04:18 -0000 1.25 @@ -821,19 +821,20 @@ } { - set query_list [ns_conn query] + set query_list [export_entire_form_as_url_vars] foreach {extra_arg} $extra_args { lappend query_list [join $extra_arg "="] } if { [llength $query_list] == 0 } { - return [ns_conn url] + set url [ns_conn url] } else { - if { $urlencode_p } { - return [ns_urlencode "[ns_conn url]?[join $query_list "&"]"] - } else { - return "[ns_conn url]?[join $query_list "&"]" - } + set url "[ns_conn url]?[join $query_list "&"]" } + if { $urlencode_p } { + return [ns_urlencode $url] + } else { + return $url + } } Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 15 Apr 2003 15:57:34 -0000 1.29 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 17 May 2003 10:04:18 -0000 1.30 @@ -27,7 +27,7 @@ In general the full functionality of the form builder is exposed by ad_form, but with a much more user-friendly and readable syntax and with state management handled automatically. - +

    In order to make it possible to use ad_form to build common form snippets within procs, code @@ -114,7 +114,7 @@ If the validation check returns true, one of the new_data or edit_data code blocks will be executed depending on whether or not "my_table_key" was defined during the initial request. "my_table_key" is passed as a hidden form variable and is signed and verified, reducing the opportunity for key spoofing by malicious outsiders. - +

    This example includes dummy redirects to a script named "somewhere" to make clear the fact that after @@ -171,27 +171,38 @@

    Declare form elements (described in detail below)
    +

    -on_request

    +

    A code block which sets the values for each element of the form meant to be modifiable by + the user when the built-in key management feature is being used or to define options for + select lists etc. You just need to set the values as local + variables in the code block, and they'll get fetched and used as element values for you. +
    +

    -select_query

    Defines a query that returns a single row containing values for each element of the form meant to be - modifiable by the user. + modifiable by the user. Can only be used if an element of type key has been declared.

    -select_query_name

    The name of a query to be looked up in the appropriate query file that returns a single row containing values for each element of the form meant to be modifiable by the user. In the OpenACS 4 environment this should normally be used rather than -select_query, as query files are the mechanism used to make the - support of multiple RDMBS systems possible. + support of multiple RDMBS systems possible. Can only be used if an element of type key has been + declared

    -edit_request

    A code block which sets the values for each element of the form meant to be modifiable by the user. Use - this when a single query to grab database values is insufficient. You just need to set the values as local + this when a single query to grab database values is insufficient. Can only be used if an element of + type key is defined. This block is only executed if the page is called with a valid key, i.e. a + self-submit form to add or edit an item called to edit the data. You just need to set the values as local variables in the code block, and they'll get fetched and used as element values for you.

    -new_request

    -

    A code block which initializes elements for a new row. Use this to set default values. - You just need to set the values as local +
    A code block which sets the values for each element of the form meant to be modifiable by the user. Use + this when a single query to grab database values is insufficient. Can only be used if an element of + type key is defined. This block complements the -edit_request block. You just need to set the values as local variables in the code block, and they'll get fetched and used as element values for you.
    @@ -205,10 +216,14 @@ block. +

    -on_refresh

    +

    Executed when the form comes back from being refreshed using javascript with the __refreshing_p flag set. +
    +

    -on_submit

    When the form is submitted, this code block will be executed before any new_data or edit_data code block. Use this if your form doesn't interact with the database or if the database type involved includes a Tcl - API that works for both new and existing data. + API that works for both new and existing data. The values of the form's elements will be available as local variables.

    -new_data

    @@ -292,7 +307,7 @@ ad_form. If the sequence name is not specified, the sequence acs_object_id_seq is used to generate new keys. Examples: - +

         my_key:key
         

    @@ -301,7 +316,7 @@

    - +
         my_key:key(some_sequence_name)
         

    @@ -310,7 +325,7 @@

    - +
         {my_key:text(multiselect),multiple       {label "select some values"}
                                                   {options {first second third fourth fifth}}
    @@ -322,7 +337,7 @@
     
         

    - +
         {hide_me:text(hidden)                     {value 3}}
         

    @@ -331,7 +346,7 @@

    - +
         start_date:date,to_sql(sql_date),to_html(sql_date),optional
         

    @@ -363,7 +378,7 @@ } set valid_args { form method action mode html name select_query select_query_name new_data on_refresh - edit_data validate on_submit after_submit confirm_template new_request edit_request + edit_data validate on_submit after_submit confirm_template on_request new_request edit_request export cancel_url cancel_label has_edit actions }; ad_arg_parser $valid_args $args @@ -672,12 +687,16 @@ after_html - result_datatype - search_query - - search_query_name { + search_query_name - + maxlength { if { [llength $extra_arg] > 2 || [llength $extra_arg] == 1 } { return -code error "element $element_name: \"$extra_arg\" requires exactly one argument" } lappend form_command [uplevel [list subst [lindex $extra_arg 1]]] } + default { + ns_log Error "Unknown switch '[lindex $extra_arg 0]' to ad_form on url [ad_return_url]" + } } } eval $form_command @@ -725,90 +744,108 @@ return } - if { [template::form is_request $form_name] && [info exists af_key_name($form_name)] } { + if { [template::form is_request $form_name] } { - set key_name $af_key_name($form_name) - upvar #$level $key_name $key_name upvar #$level __ad_form_values__ values - # Check to see if we're editing an existing database value - if { [info exists $key_name] } { - if { [info exists edit_request] } { - if { [info exists select_query] || [info exists select_query_name] } { - return -code error "Edit request block conflicts with select query" - } - ad_page_contract_eval uplevel #$level $edit_request - foreach element_name $af_element_names($form_name) { - if { [llength $element_name] == 1 } { - if { [uplevel \#$level [list info exists $element_name]] } { - set values($element_name) [uplevel \#$level [list set $element_name]] + if { [template::form is_request $form_name] && [info exists on_request] } { + ad_page_contract_eval uplevel #$level $on_request + foreach element_name $af_element_names($form_name) { + if { [llength $element_name] == 1 } { + if { [uplevel \#$level [list info exists $element_name]] } { + set values($element_name) [uplevel \#$level [list set $element_name]] + if { [info exists af_from_sql(${form_name}__$element_name)] } { + set values($element_name) [template::util::$af_type(${form_name}__$element_name)::acquire \ + $af_from_sql(${form_name}__$element_name) $values($element_name)] } } - } + } + } + } - } else { + if { [info exists af_key_name($form_name)] } { - # The key exists, grab the existing values if we have an select_query clause + set key_name $af_key_name($form_name) + upvar #$level $key_name $key_name - if { ![info exists select_query] && ![info exists select_query_name] } { - return -code error "Key \"$key_name\" has the value \"[set $key_name]\" but no select_query or select_query_name clause exists" - } + # Check to see if we're editing an existing database value + if { [info exists $key_name] } { + if { [info exists edit_request] } { + if { [info exists select_query] || [info exists select_query_name] } { + return -code error "Edit request block conflicts with select query" + } + ad_page_contract_eval uplevel #$level $edit_request + foreach element_name $af_element_names($form_name) { + if { [llength $element_name] == 1 } { + if { [uplevel \#$level [list info exists $element_name]] } { + set values($element_name) [uplevel \#$level [list set $element_name]] + } + } + } - if { [info exists select_query_name] } { - set select_query "" } else { - set select_query_name "" - } - if { ![uplevel #$level [list db_0or1row $select_query_name [join $select_query " "] -column_array __ad_form_values__]] } { - return -code error "Error when selecting values" - } + # The key exists, grab the existing values if we have an select_query clause - foreach element_name $af_element_names($form_name) { - if { [llength $element_name] == 1 } { - if { [info exists af_from_sql(${form_name}__$element_name)] } { - set values($element_name) [template::util::$af_type(${form_name}__$element_name)::acquire \ - $af_from_sql(${form_name}__$element_name) $values($element_name)] + if { ![info exists select_query] && ![info exists select_query_name] } { + return -code error "Key \"$key_name\" has the value \"[set $key_name]\" but no select_query or select_query_name clause exists" + } + + if { [info exists select_query_name] } { + set select_query "" + } else { + set select_query_name "" + } + + if { ![uplevel #$level [list db_0or1row $select_query_name [join $select_query " "] -column_array __ad_form_values__]] } { + return -code error "Error when selecting values" + } + + foreach element_name $af_element_names($form_name) { + if { [llength $element_name] == 1 } { + if { [info exists af_from_sql(${form_name}__$element_name)] } { + set values($element_name) [template::util::$af_type(${form_name}__$element_name)::acquire \ + $af_from_sql(${form_name}__$element_name) $values($element_name)] + } } } } - } - set values($key_name) [set $key_name] - set values(__new_p) 0 + set values($key_name) [set $key_name] + set values(__new_p) 0 - } else { + } else { - # Make life easy for the OACS 4.5 hacker by automagically generating a value for - # our new database row. Set a local so the query can use bindvar notation (the driver - # doesn't support array bind vars) + # Make life easy for the OACS 4.5 hacker by automagically generating a value for + # our new database row. Set a local so the query can use bindvar notation (the driver + # doesn't support array bind vars) - if { [info exists af_sequence_name($form_name)] } { - set sequence_name $af_sequence_name($form_name) - } else { - set sequence_name "acs_object_id_seq" - } + if { [info exists af_sequence_name($form_name)] } { + set sequence_name $af_sequence_name($form_name) + } else { + set sequence_name "acs_object_id_seq" + } - if { ![db_0or1row get_key "" -column_array values] } { - return -code error "Couldn't get the next value from sequence \"$af_sequence_name($form_name)\"" - } - set values(__new_p) 1 + if { [catch {set values($key_name) [db_nextval $sequence_name]} errmsg]} { + return -code error "Couldn't get the next value from sequence: $errmsg\"" + } + set values(__new_p) 1 - if { [info exists new_request] } { - ad_page_contract_eval uplevel #$level $new_request - # LARS: Set form values based on local vars in the new_request block - foreach element_name $af_element_names($form_name) { - if { [llength $element_name] == 1 } { - if { [uplevel \#$level [list info exists $element_name]] } { - set values($element_name) [uplevel \#$level [list set $element_name]] + if { [info exists new_request] } { + ad_page_contract_eval uplevel #$level $new_request + # LARS: Set form values based on local vars in the new_request block + foreach element_name $af_element_names($form_name) { + if { [llength $element_name] == 1 } { + if { [uplevel \#$level [list info exists $element_name]] } { + set values($element_name) [uplevel \#$level [list set $element_name]] + } } - } - } + } + } } + set values(__key_signature) [ad_sign "$values($key_name):$form_name"] } - set values(__key_signature) [ad_sign "$values($key_name):$form_name"] - foreach element_name $properties(element_names) { if { [info exists values($element_name)] } { if { [info exists af_flag_list(${form_name}__$element_name)] && \ @@ -989,7 +1026,7 @@ This is for pages built with ad_form that handle edit and add requests in one file. It returns 1 if the current form being built for the entry of new data, 0 if for the editing of existing data. - +

    It does not make sense to use this in pages that don't use ad_form. @@ -1016,7 +1053,7 @@ } { set form [ns_getform] - + return [expr {[empty_string_p $form] || [ns_set find $form $key] == -1 || [ns_set get $form __new_p] == 1 }] } Fisheye: Tag 1.2 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/form-processing-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 8 Feb 2003 20:31:36 -0000 1.11 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 17 May 2003 10:04:18 -0000 1.12 @@ -21,7 +21,7 @@ [list [list url1 text1] [list url2 text2] ... "terminal text"]

         and generates the html fragment.  In general the higher level 
    -    calls like ad_context_bar and ad_admin_context_bar should be
    +    proc ad_context_bar should be
         used, and then only in the sitewide master rather than on 
         individual pages.
     
    @@ -31,7 +31,6 @@
         @return html fragment
     
         @see ad_context_bar
    -    @see ad_admin_context_bar
     } { 
         set out {}
         foreach element [lrange $context 0 [expr [llength $context] - 2]] { 
    @@ -56,7 +55,8 @@
             # JCD: Provide something for the name if the instance name is
             # absent.  name is the tail bit of the url which seems like a
             # reasonable thing to display.
    -        if {[empty_string_p $node(instance_name)]} { 
    +        if {[empty_string_p $node(instance_name)]
    +            && [info exists node(name)]} { 
                 set node(instance_name) $node(name)
             }
     
    @@ -73,15 +73,14 @@
         -separator
         args
     } {
    -    Returns a Yahoo-style hierarchical navbar. Includes "Your Workspace" or "Administration"
    +    Returns a Yahoo-style hierarchical navbar. Includes "Administration"
         if applicable, and the subsite if not global.
     
         @param node_id If provided work up from this node, otherwise the current node
         @param separator The text placed between each link (passed to ad_context_bar_html if provided)
         @return an html fragment generated by ad_context_bar_html
         
         @see ad_context_bar_html
    -    @see ad_admin_context_bar
     } {
         if {![parameter::get -package_id [site_node_closest_ancestor_package "acs-subsite"] -parameter ShowContextBarP -default 1]} {
     	return ""
    @@ -93,11 +92,6 @@
     
         set context [list]
     
    -    if {[ad_conn user_id] != 0 && ![string match /pvt/home* [ad_conn url]]} {
    -        lappend context [list "[ad_pvt_home]" "[ad_pvt_home_name]"]
    -    }
    -
    -
         set context [concat $context [ad_context_node_list $node_id]]
     
         if { [string match admin/* [ad_conn extra_url]] } {
    @@ -119,74 +113,53 @@
     
     
     
    -# a context bar, rooted at the workspace
    -
     ad_proc -deprecated -public ad_context_bar_ws args {
    -    Returns a Yahoo-style hierarchical navbar, starting with a link to workspace.
    +    Returns a Yahoo-style hierarchical navbar. Use ad_context_bar instead.
     
         @param list of url desc ([list [list url desc] [list url desc] ... "terminal"])
         @return an html fragment generated by ad_context_bar_html
     
         @see ad_context_bar
     } {
    -    return [ad_context_bar_html [concat [list [list "[ad_pvt_home]" "[ad_pvt_home_name]"]] $args]]
    +    return [ad_context_bar $args]
     }
     
     # a context bar, rooted at the workspace or index, depending on whether
     # user is logged in
     
     ad_proc -deprecated -public ad_context_bar_ws_or_index args {
    -    Returns a Yahoo-style hierarchical navbar, starting with a link to
    -    either the workspace or /, depending on whether or not the user is
    -    logged in.  You should probably be using ad_context_bar and 
    -    then only in the sitewide master.
    +    Returns a Yahoo-style hierarchical navbar. Use ad_context_bar instead.
     
         @param args list of url desc ([list [list url desc] [list url desc] ... "terminal"])
    -    @return an html fragment generated by ad_context_bar_html
    +    @return an html fragment generated by ad_context_bar
     
         @see ad_context_bar
     } {
    -    if { [ad_conn user_id] == 0 && ![string match /pvt/home* [ad_conn url]] } { 
    -	set choices [list [list "/" [ad_system_name]]]
    -    } else {
    -	set choices [list [list [ad_pvt_home] [ad_pvt_home_name]]]
    -    }
    -
    -    return [ad_context_bar_html [concat $choices $args]]
    +    return [ad_context_bar $args]
     }
     
    -ad_proc -public ad_admin_context_bar args { 
    -    Returns a Yahoo-style hierarchical navbar, starting with links
    -    workspace and admin home.
    -    Suitable for use in pages underneath /admin.
    +ad_proc -public -deprecated ad_admin_context_bar args { 
    +    Returns a Yahoo-style hierarchical navbar. Use ad_context_bar instead.
     
         @param args list of url desc ([list [list url desc] [list url desc] ... "terminal"])
    -    @return an html fragment generated by ad_context_bar_html
    +    @return an html fragment generated by ad_context_bar
     
         @see ad_context_bar
     } {
    -
    -    if { [llength $args] > 0 } { 
    -        set choices [list [list [ad_pvt_home] [ad_pvt_home_name]] \
    -                         [list /acs-admin/ "ACS System Wide Administration"]]
    -    } else { 
    -        set choices [list [list [ad_pvt_home] [ad_pvt_home_name]] \
    -                         "ACS System Wide Administration"]
    -    }
    -
    -    return [ad_context_bar_html [concat $choices $args]]
    +    return [ad_context_bar $args]
     }
     
     ad_proc -public ad_navbar args {
         produces navigation bar. notice that navigation bar is different
    -    than context bar, which exploits a tree structure. navbar will just
    -    display a list of nicely formatted links.
    +    than context bar, which displays packages in the site map. Navbar will
    +    only generate HTML for those links passed to it.
     
         @param args list of url desc ([list [list url desc] [list url desc]])
     
         @return html fragment
     
         @see ad_choice_bar
    +    @see ad_context_bar_html
     } {
         set counter 0
         foreach arg $args {
    Index: openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/openacs-kernel-procs.tcl,v
    diff -u -r1.4 -r1.5
    --- openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl	15 May 2002 04:19:00 -0000	1.4
    +++ openacs-4/packages/acs-tcl/tcl/openacs-kernel-procs.tcl	17 May 2003 10:04:18 -0000	1.5
    @@ -114,7 +114,6 @@
                 for {set i 0} {$i < $n_fields} {incr i} {
                     set varname [string tolower [lindex $headers $i]]
                     set varvalue [lindex $one_line $i]
    -                
                     set row_array($varname) $varvalue
                 }
     
    Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v
    diff -u -r1.34 -r1.35
    --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl	12 Feb 2003 18:42:55 -0000	1.34
    +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl	17 May 2003 10:04:18 -0000	1.35
    @@ -227,22 +227,21 @@
     
         util_unlist $filter_info filter_index debug_p arg_count proc arg
     
    -#      if { $debug_p } {
    -#      ns_log "Notice" "Invoking $why filter $proc"
    -#      }
         rp_debug -debug $debug_p "Invoking $why filter $proc"
     
         switch $arg_count {
     	0 { set errno [catch { set result [$proc] } error] }
     	1 { set errno [catch { set result [$proc $why] } error] }
     	2 { set errno [catch { set result [$proc $conn $why] } error] }
    -	default { set errno [catch {
    -	  ad_try {
    -	    set result [$proc $conn $arg $why]
    -	  } ad_script_abort val {
    -	    set result "filter_return"
    -	  }
    -	} error] }
    +	default {
    +            set errno [catch {
    +                ad_try {
    +                    set result [$proc $conn $arg $why]
    +                } ad_script_abort val {
    +                    set result "filter_return"
    +                }
    +            } error] 
    +        }
         }
     
         global errorCode
    @@ -258,22 +257,21 @@
     	    [string compare $result "filter_return"] } {
            set error_msg "error in filter $proc for [ns_conn method] [ns_conn url]?[ns_conn query].  Filter returned invalid result \"$result\""
            ad_call_proc_if_exists ds_add rp [list filter [list $why [ns_conn method] [ns_conn url] $proc $arg] $startclicks [clock clicks] "error" $error_msg]
    -        # report the bad filter_return message
    -        rp_debug error $error_msg
    +       # report the bad filter_return message
    +       rp_debug -debug t error $error_msg
            rp_report_error -message $error_msg
    -	set result "filter_return"
    +       set result "filter_return"
         } else {
            ad_call_proc_if_exists ds_add rp [list filter [list $why [ns_conn method] [ns_conn url] $proc $arg] $startclicks [clock clicks] $result]
         }
     
    -#      if { $debug_p } {
    -#      ns_log "Notice" "Done invoking $why filter $proc (returning $result)"
    -#      }
         rp_debug -debug $debug_p "Done invoking $why filter $proc (returning $result)"
     
    -    if { [string compare $result "filter_return"] } {
    -      rp_finish_serving_page
    -    }
    +# JCD: Why was this here?  the rp_finish_serving_page is called inside the 
    +# handlers and this handles trace filters 
    +#    if { [string compare $result "filter_return"] } {
    +#      rp_finish_serving_page
    +#    }
     
         return $result
     }
    @@ -287,9 +285,6 @@
     
         util_unlist $argv proc_index debug_p arg_count proc arg
     
    -#      if { $debug_p } {
    -#      ns_log "Notice" "Invoking registered procedure $proc"
    -#      }
         rp_debug -debug $debug_p "Invoking registered procedure $proc"
     
         switch $arg_count {
    @@ -315,9 +310,6 @@
           ad_call_proc_if_exists ds_add rp [list registered_proc [list $proc $arg] $startclicks [clock clicks]]
         }
     
    -#      if { $debug_p } {
    -#        ns_log "Notice" "Done invoking registered procedure $proc"
    -#      }
         rp_debug -debug $debug_p "Done Invoking registered procedure $proc"
     
         rp_finish_serving_page
    @@ -326,8 +318,7 @@
     ad_proc -private rp_finish_serving_page {} {
         global doc_properties
         if { [info exists doc_properties(body)] } {
    -        set l [string length $doc_properties(body)]
    -       rp_debug "Returning page: $l [ad_quotehtml [string range $doc_properties(body) 0 100]]"
    +        rp_debug "Returning page:[info level [expr [info level] - 1]]: [ad_quotehtml [string range $doc_properties(body) 0 100]]"
     	doc_return 200 text/html $doc_properties(body)
         }
     }
    @@ -468,6 +459,10 @@
         ad_conn -set user_id 0
         ad_conn -set start_clicks [clock clicks]
     
    +    ad_call_proc_if_exists ds_collect_connection_info
    +
    +
    +
         # -------------------------------------------------------------------------
         # Start of patch "hostname-based subsites"
         # -------------------------------------------------------------------------
    @@ -634,25 +629,26 @@
     
     ad_proc -private rp_debug { { -debug f } { -ns_log_level notice } string } {
     
    -  Logs a debugging message, including a high-resolution (millisecond)
    -  timestamp.
    +    Logs a debugging message, including a high-resolution (millisecond)
    +    timestamp. 
     
     } {
    -    if { [util_memoize {ad_parameter -package_id [ad_acs_kernel_id] DebugP request-processor 0} 60] } {
    +    if { [ad_parameter -package_id [ad_acs_kernel_id] DebugP request-processor 0] } { 
     	global ad_conn
     	set clicks [clock clicks]
             ad_call_proc_if_exists ds_add rp [list debug $string $clicks $clicks]
         }
    -    if {
    -        [util_memoize {ad_parameter -package_id [ad_acs_kernel_id] LogDebugP request-processor 0} 60] || [string equal $debug t] || [string equal $debug 1]
    -    } {
    +    if { [ad_parameter -package_id [ad_acs_kernel_id] LogDebugP request-processor 0]
    +         || [string equal $debug t] 
    +         || [string equal $debug 1]
    +     } {
     	global ad_conn
     	if { [info exists ad_conn(start_clicks)] } {
    -           set timing " ([expr {([clock clicks] - $ad_conn(start_clicks))/1000.0}] ms)"
    +            set timing " ([expr {([clock clicks] - $ad_conn(start_clicks))/1000.0}] ms)"
     	} else {
    -           set timing ""
    +            set timing ""
     	}
    -       ns_log $ns_log_level "RP$timing: $string"
    +        ns_log $ns_log_level "RP$timing: $string"
         }
     }
     
    @@ -671,9 +667,7 @@
     
         set error_url [ad_conn url]
     
    -    if { [llength [info procs ds_collection_enabled_p]] == 1 && [ds_collection_enabled_p] } {
    -	ad_call_proc_if_exists ds_add conn error $message
    -    }
    +    ad_call_proc_if_exists ds_add conn error $message
     
         if {![ad_parameter -package_id [ad_acs_kernel_id] "RestrictErrorsToAdminsP" dummy 0] || \
     	[permission::permission_p -object_id [ad_conn package_id] -privilege admin] } {
    @@ -739,8 +733,6 @@
       the server.
     
     } {
    -  ad_call_proc_if_exists ds_collect_connection_info
    -
       # JCD: keep track of rp_handler call count to prevent dev support from recording 
       # information twice when for example we get a 404 internal redirect. We should probably 
       set recursion_count [ad_conn recursion_count] 
    @@ -1129,6 +1121,9 @@
             if { $var == "form" } {
                 return [ns_getform] 
             }
    +        if { $var == "all" } {
    +            return [array get ad_conn]
    +        }
     
             if { [info exists ad_conn($var)] } {
                 return $ad_conn($var)
    @@ -1339,4 +1334,3 @@
     ad_proc -private rp_lookup_node_from_host { host } {
         return [db_string  node_id { *SQL* } -default ""]
     } 
    -
    Index: openacs-4/packages/acs-tcl/tcl/security-procs.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.tcl,v
    diff -u -r1.13 -r1.14
    --- openacs-4/packages/acs-tcl/tcl/security-procs.tcl	15 Sep 2002 22:10:50 -0000	1.13
    +++ openacs-4/packages/acs-tcl/tcl/security-procs.tcl	17 May 2003 10:04:18 -0000	1.14
    @@ -52,14 +52,10 @@
         return [ad_parameter -package_id [ad_acs_kernel_id] SessionLifetime security 604800]
     }
     
    -proc sec_sweep_sessions {} {
    -    set current_time [ns_time]
    -    set property_life [sec_session_lifetime]
    +ad_proc -private sec_sweep_sessions {} {
    +    set expires [expr {[ns_time] - [sec_session_lifetime]}]
     
    -    db_dml sessions_sweep {
    -	delete from sec_session_properties
    -	where  :current_time - last_hit > :property_life
    -    }
    +    db_dml sessions_sweep {} 
     }
     
     proc_doc sec_handler {} {
    @@ -962,7 +958,9 @@
     
         set url [ad_conn url]
         if { [string match "*register/*" $url] || [string match "/index*" $url] || \
    -	    [string match "/" $url] } {
    +            [string match "/index*" $url] || \
    +            [string match "/" $url] || \
    +            [string match "*password-update*" $url] } {
     	return 1
         }
     
    @@ -990,17 +988,21 @@
         @param secret allows the caller to specify a known secret external
         to the random secret management mechanism.
     
    -    @param token_id allows the caller to specify a token_id.
    +    @param token_id allows the caller to specify a token_id which is then ignored so don't use it.
     
         @param value the value to be signed.
     } {
    -    # pick a random token_id
    +
         if { [empty_string_p $secret] } {
    -	set token_id [sec_get_random_cached_token_id]
    +        if {[empty_string_p $token_id]} { 
    +            # pick a random token_id
    +            set token_id [sec_get_random_cached_token_id]
    +        }
     	set secret_token [sec_get_token $token_id]
         } else {
     	set secret_token $secret
         }
    +    
     
         ns_log Debug "Security: Getting token_id $token_id, value $secret_token"
     
    Index: openacs-4/packages/acs-tcl/tcl/security-procs.xql
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs.xql,v
    diff -u -r1.6 -r1.7
    --- openacs-4/packages/acs-tcl/tcl/security-procs.xql	13 Mar 2002 22:50:53 -0000	1.6
    +++ openacs-4/packages/acs-tcl/tcl/security-procs.xql	17 May 2003 10:04:18 -0000	1.7
    @@ -5,7 +5,7 @@
           
           
     	delete from sec_session_properties
    -	where  :current_time - last_hit > :property_life
    +	where last_hit < :expires
         
           
     
    Index: openacs-4/packages/acs-tcl/tcl/site-node-apm-integration-procs.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-node-apm-integration-procs.tcl,v
    diff -u -r1.6 -r1.7
    --- openacs-4/packages/acs-tcl/tcl/site-node-apm-integration-procs.tcl	29 Jan 2003 15:37:13 -0000	1.6
    +++ openacs-4/packages/acs-tcl/tcl/site-node-apm-integration-procs.tcl	17 May 2003 10:04:18 -0000	1.7
    @@ -49,7 +49,7 @@
                     site_node::update_cache -node_id $site_node(node_id)
                 }
                 
    -            apm_package_delete_instance $package_id
    +            apm_package_instance_delete $package_id
             }
         }
     
    Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql,v
    diff -u -r1.11 -r1.12
    --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql	14 Sep 2002 20:20:47 -0000	1.11
    +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs-oracle.xql	17 May 2003 10:04:18 -0000	1.12
    @@ -14,6 +14,7 @@
                 select site_node.url(site_nodes.node_id) as url,
                        site_nodes.node_id,
                        site_nodes.parent_id,
    +                   site_nodes.name,
                        site_nodes.directory_p,
                        site_nodes.pattern_p,
                        site_nodes.object_id,
    @@ -34,6 +35,7 @@
                 select site_node.url(site_nodes.node_id) as url,
                        site_nodes.node_id,
                        site_nodes.parent_id,
    +                   site_nodes.name,
                        site_nodes.directory_p,
                        site_nodes.pattern_p,
                        site_nodes.object_id,
    @@ -55,6 +57,7 @@
                 select site_node.url(node_id)
                 from site_nodes
                 where object_id = :object_id
    +            order by site_node.url(node_id) desc
             
         
     
    Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql,v
    diff -u -r1.15 -r1.16
    --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql	14 Sep 2002 20:20:47 -0000	1.15
    +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql	17 May 2003 10:04:18 -0000	1.16
    @@ -14,6 +14,7 @@
                 select site_node__url(site_nodes.node_id) as url,
                        site_nodes.node_id,
                        site_nodes.parent_id,
    +                   site_nodes.name,
                        site_nodes.directory_p,
                        site_nodes.pattern_p,
                        site_nodes.object_id,
    @@ -32,6 +33,7 @@
                 select site_node__url(site_nodes.node_id) as url,
                        site_nodes.node_id,
                        site_nodes.parent_id,
    +                   site_nodes.name,
                        site_nodes.directory_p,
                        site_nodes.pattern_p,
                        site_nodes.object_id,
    @@ -51,6 +53,7 @@
                 select site_node__url(node_id)
                 from site_nodes
                 where object_id = :object_id
    +            order by site_node__url(node_id) desc
             
         
     
    Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl
    ===================================================================
    RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v
    diff -u -r1.25 -r1.26
    --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl	14 Apr 2003 14:01:05 -0000	1.25
    +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl	17 May 2003 10:04:18 -0000	1.26
    @@ -60,10 +60,8 @@
             {-package_name ""}
             {-context_id ""}
             {-package_key:required}
    -        {-package_id ""}
         } {
    -        Instantiate and mount a package of given type. If the package is a singleton (should only have one instance)
    -        and an instance already exists then this proc will attempt to mount that instance.
    +        Instantiate and mount a package of given type.
     
             @param node_id        The id of the node in the site map where the package should be mounted.
                                   If not specified a new node under the main site will be created.
    @@ -72,11 +70,9 @@
             @param node_name      If node_id is not specified then this will be the name of the
                                   new site node that is created. Defaults to package_key.
             @param package_name The name of the new package instance. Defaults to pretty name of package type.
    -        @param context_id     The context_id of the package. Defaults to the package_id at the parent
    -                              node in the site map. If there is no such package then context_id will be the
    -                              id of the parent node itself.
    +        @param context_id     The context_id of the package. Defaults to the closest ancestor package
    +                              in the site map.
             @param package_key    The key of the package type to instantiate.
    -        @param package_id     The id of the new package. Optional.
     
             @return The id of the instantiated package
                               
    @@ -96,25 +92,12 @@
     
             # Get the context_id of the new package
             if {[empty_string_p $context_id]} {
    -            # Attempt to use the package_id at the parent node
    -            if { [empty_string_p $parent_node_id] } {
    -                set parent_node_id [site_node::get_parent_id -node_id $node_id]
    -            }
    -            array set node [site_node::get -node_id $parent_node_id]
    -            set context_id $node(object_id)
    -
    -            if {[empty_string_p $context_id]} {
    -                # No package at parent node, so use the id of the node itself instead
    -                # Should we use default_context here instead?
    -                set context_id $parent_node_id
    -            }
    +            # Default to the closest ancestor package_id
    +            set context_id [site_node::closest_ancestor_package -node_id $node_id]
             }
     
             # Instantiate the package
    -        set package_id [apm_package_instance_new -instance_name $package_name \
    -                                                 -context_id $context_id \
    -                                                 -package_key $package_key \
    -                                                 -package_id $package_id]
    +        set package_id [apm_package_instance_new -- $package_name $context_id $package_key]
     
             # Mount the package
             site_node::mount -node_id $node_id -object_id $package_id
    @@ -216,9 +199,15 @@
     
         ad_proc -public get_from_url {
             {-url:required}
    +    	{-exact:boolean}
         } {
    -        returns an array representing the site node that matches the given url
    +        Returns an array representing the site node that matches the given url.

    + A trailing '/' will be appended to $url if required and not present.

    + + If the '-exact' switch is not present and $url is not found, returns the + first match found by successively removing the trailing $url path component.

    + @see site_node::get } { # attempt an exact match @@ -236,20 +225,22 @@ } # chomp off part of the url and re-attempt - while {![empty_string_p $url]} { - set url [string trimright $url /] - set url [string range $url 0 [string last / $url]] + if {!$exact_p} { + while {![empty_string_p $url]} { + set url [string trimright $url /] + set url [string range $url 0 [string last / $url]] - if {[nsv_exists site_nodes $url]} { - array set node [nsv_get site_nodes $url] + if {[nsv_exists site_nodes $url]} { + array set node [nsv_get site_nodes $url] - if {[string equal $node(pattern_p) t] && ![empty_string_p $node(object_id)]} { - return [array get node] - } - } - } + if {[string equal $node(pattern_p) t] && ![empty_string_p $node(object_id)]} { + return [array get node] + } + } + } + } - error "site node not found at url $url" + error "site node not found at url \"$url\"" } ad_proc -public get_from_object_id { @@ -265,10 +256,12 @@ ad_proc -public get_all_from_object_id { {-object_id:required} } { - return a list of site nodes associated with the given object_id + Return a list of site node info associated with the given object_id. + The nodes will be ordered descendingly by url (children before their parents). } { set node_id_list [list] + set url_list [list] foreach url [get_url_from_object_id -object_id $object_id] { lappend node_id_list [get -url $url] } @@ -293,7 +286,10 @@ {-object_id:required} } { returns a list of urls for site_nodes that have the given object - mounted or the empty list if there are none + mounted or the empty list if there are none. The + url:s will be returned in descending order meaning any children will + come before their parents. This ordering is useful when deleting site nodes + as we must delete child site nodes before their parents. } { return [db_list select_url_from_object_id {}] } @@ -342,7 +338,58 @@ return $node(object_id) } - + ad_proc -public closest_ancestor_package { + {-url ""} + {-node_id ""} + {-package_key ""} + } { + Starting with the node at with given id, or at given url, + climb up the site map and return the id of the first not-null + mounted object. If no ancestor object is found the empty string is returned. + The id of the object at the given node itself will never be returned. + + @param url The url of the node to start from. You must provide either url or node_id. + An empty url is taken to mean the main site. + @param node_id The id of the node to start from. Takes precedence over any provided url. + @param package_key Restrict search to objects of this package type. + + @return The id of the first object found and an empty string if no object + is found. Throws an error if no node with given url can be found. + + @author Peter Marklund + } { + # Make sure we have the id of the start node to work with + if { [empty_string_p $node_id] } { + if { [empty_string_p $url] } { + set url "/" + } + + set node_id [site_node::get_node_id -url $url] + } + + # Climb up the site map starting with node_id and stop when we have + # an object to use as context or when we have reached the root node + set loop_node_id $node_id + set main_node_id [site_node::get_node_id -url "/"] + set context_id "" + set context_package_key "___${package_key}" + while { [empty_string_p $context_id] && \ + [expr [empty_string_p $package_key] || [string equal $package_key $context_package_key]]} { + + set loop_node_id [site_node::get_parent_id -node_id $loop_node_id] + + if { [string equal $loop_node_id ""] } { + # There is no parent node - we reached the root of the site map + break + } + + array set node_array [site_node::get -node_id $loop_node_id] + set context_id $node_array(object_id) + set context_package_key $node_array(package_key) + } + + return $context_id + } } ############## @@ -438,10 +485,11 @@ @return The package id of the newly mounted package } { - return [site_node::instantiate_and_mount -parent_node_id $parent_node_id \ - -node_name $url_path_component - -package_name $instance_name \ - -package_key $package_key] + return [site_node::instantiate_and_mount \ + -parent_node_id $parent_node_id \ + -node_name $url_path_component \ + -package_name $instance_name \ + -package_key $package_key] } ad_proc -public site_map_unmount_application { Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 19 Feb 2003 15:09:28 -0000 1.15 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 17 May 2003 10:04:18 -0000 1.16 @@ -18,6 +18,7 @@ -no_links:boolean -no_lines:boolean -no_quote:boolean + -includes_html:boolean text } { Converts plaintext to html. Also translates any recognized @@ -71,7 +72,7 @@ # Convert line breaks if { !$no_lines_p } { - set text [util_convert_line_breaks_to_html $text] + set text [util_convert_line_breaks_to_html -includes_html=$includes_html_p -- $text] } if { !$no_quote_p } { @@ -103,6 +104,7 @@ } ad_proc -public util_convert_line_breaks_to_html { + {-includes_html:boolean} text } { Convert line breaks to

    and
    tags, respectively. @@ -115,8 +117,8 @@ regsub -all {\r\n} $text "\n" text regsub -all {\r} $text "\n" text - # Remove whitespace around \n's - regsub -all {\s+\n\s+} $text "\n" text + # Remove whitespace before \n's + regsub -all {[ \t]*\n} $text "\n" text # Wrap P's around paragraphs set text "

    $text

    " @@ -125,6 +127,15 @@ # Convert _single_ CRLF's to
    's to preserve line breaks # Lars: This must be done after we've made P tags, because otherwise the line # breaks will already have been converted into BR's. + + # remove line breaks right before and after HTML tags that will insert a paragraph break themselves + if { $includes_html_p } { + foreach tag { ul ol li blockquote p div table tr td th } { + regsub -all -nocase "\\n\\s*(\]*>)" $text {\1} text + regsub -all -nocase "(\]*>)\\s*\\n" $text {\1} text + } + } + regsub -all {\n} $text "
    \n" text # Add line breaks to P tags @@ -685,6 +696,7 @@ ad_proc -public ad_html_to_text { {-maxlen 70} {-showtags:boolean} + {-no_format:boolean} html } { Returns a best-guess plain text version of an HTML fragment. @@ -694,7 +706,8 @@ @param maxlen the line length you want your output wrapped to. @param showtags causes any unknown (and uninterpreted) tags to get shown in the output. - + @param no_format causes hyperlink tags not to get listed at the end of the output. + @author Lars Pind (lars@pinds.com) @author Aaron Swartz (aaron@swartzfam.com) @creation-date 19 July 2000 @@ -815,8 +828,8 @@ ad_html_to_text_put_text output "_" } a { - if { [empty_string_p $slash] } { - if { [info exists attribute_array(href)] } { + if { [empty_string_p $slash] && !$no_format_p} { + if { [info exists attribute_array(href)] } { if { [info exists attribute_array(title)] } { set title ": '$attribute_array(title)'" } else { @@ -1282,7 +1295,7 @@ @author Lars Pind (lars@pinds.com) @creation-date 2003-01-27 } { - return [ad_text_to_html -no_quote -- [util_close_html_tags $text]] + return [ad_text_to_html -no_quote -includes_html -- [util_close_html_tags $text]] } ad_proc -public ad_enhanced_text_to_plain_text { @@ -1377,6 +1390,7 @@ ad_proc string_truncate { {-len 200} {-format html} + {-no_format:boolean} string } { Truncates a string to len characters (defaults to the @@ -1387,6 +1401,7 @@ @param len The lenght to truncate to. Defaults to parameter TruncateDescriptionLength. @param format html or text. + @param no_format causes hyperlink tags not to get listed at the end of the output. @param string The string to truncate. @return The truncated string, with HTML tags cloosed or converted to text, depending on format. @@ -1398,10 +1413,14 @@ set string "[string range $string 0 $len]..." } - if { [string equal $format "html"] } { + if { [string equal $format "html"] && !$no_format_p } { set string [util_close_html_tags $string] } else { - set string [ad_html_to_text -- $string] + if { $no_format_p } { + set string [ad_html_to_text -no_format $string] + } else { + set string [ad_html_to_text -- $string] + } } return $string } Index: openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl 16 Jan 2003 13:41:57 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/user-extensions-procs.tcl 17 May 2003 10:04:18 -0000 1.4 @@ -20,7 +20,8 @@ } { Dispatches (calls the service contract routines) the requested - method so that the operation gets executed. + method so that the operation gets executed, and packages are + notified of changes in user information. } { if {[empty_string_p $impl]} { @@ -44,39 +45,49 @@ ad_proc -public user_new { {-user_id:required} } { - New User + Notifies packages when a new user is added to the system. + + @see dispatch } { dispatch -op UserNew -list_of_args [list $user_id] } ad_proc -public user_approve { {-user_id:required} } { - Approve User + Notifies packages when a user is approved. + + @see dispatch } { dispatch -op UserApprove -list_of_args [list $user_id] } ad_proc -public user_deapprove { {-user_id:required} } { - Deapprove User + Notifies packages when a user is deapproved. + + @see dispatch } { dispatch -op UserDeapprove -list_of_args [list $user_id] } ad_proc -public user_modify { {-user_id:required} } { - Modify User + Notifies packages when a user is modified. + + @see dispatch } { dispatch -op UserModify -list_of_args [list $user_id] } ad_proc -public user_delete { {-user_id:required} } { - Delete User + Notifies packages when a user is deleted. + + @see dispatch } { dispatch -op UserDelete -list_of_args [list $user_id] } Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 28 Apr 2003 08:52:10 -0000 1.31 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 17 May 2003 10:04:18 -0000 1.32 @@ -2726,6 +2726,30 @@ return $set_id } +ad_proc -public util_sets_equal_p { list1 list2 } { + Tests whether each unique string in list1 occurs as many + times in list1 as in list2 and vice versa (regarless of order). + + @return 1 if the lists have identical sets and 0 otherwise + + @author Peter Marklund +} { + if { [llength $list1] != [llength $list2] } { + return 0 + } + + set sorted_list1 [lsort $list1] + set sorted_list2 [lsort $list2] + + for { set index1 0 } { $index1 < [llength $sorted_list1] } { incr index1 } { + if { ![string equal [lindex $sorted_list1 $index1] [lindex $sorted_list2 $index1]] } { + return 0 + } + } + + return 1 +} + ad_proc -public ad_tcl_list_list_to_ns_set { -set_id -put:boolean Index: openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl 2 Sep 2002 15:18:30 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/widgets-procs.tcl 17 May 2003 10:04:18 -0000 1.5 @@ -208,7 +208,7 @@ set value [lindex $opt 0] if { (!$multiple && [string compare $value $default] == 0) || ($multiple && [lsearch -exact $default $value] > -1)} { - append retval "\n" + append retval "\n" } else { append retval "\n" } Index: openacs-4/packages/acs-templating/acs-templating.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-templating/acs-templating.info 19 Feb 2003 15:17:57 -0000 1.12 +++ openacs-4/packages/acs-templating/acs-templating.info 17 May 2003 10:04:33 -0000 1.13 @@ -7,340 +7,28 @@ t t - + - oracle - postgresql - Christian Brechb Karl Goldstein + Christian Brechb Separate page layout and implementation. - 2002-05-15 + 2003-03-07 ArsDigita Corporation - The template system provides mechanisms that allow developers and graphic designers to work independently. Templates specify the layout of the page seperately from the contents of the page. Graphic designers work primarily on the layout part of the template (the template), while programmers work primarily a script that generates the the content part of the template (the code). In addition, the -template system provides a way to use a single layout + The template system provides mechanisms that allow developers and graphic designers to work independently. Templates specify the layout of the page seperately from the contents of the page. Graphic designers work primarily on the layout part of the template (the template), while programmers work primarily a script that generates the the content part of the template (the code). In addition, the +template system provides a way to use a single layout specification for many physical pages, so the overall layout of a site can be more easily administered. - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Index: openacs-4/packages/acs-templating/resources/forms/plainest.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/plainest.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/resources/forms/plainest.adp 13 Jan 2003 15:23:30 -0000 1.3 +++ openacs-4/packages/acs-templating/resources/forms/plainest.adp 17 May 2003 10:04:53 -0000 1.4 @@ -1,13 +1,19 @@ - + + +
    - - - + - - - - - + + +
    + + + +
    + - +
    - + @@ -18,49 +24,48 @@ - - - - - @@ -78,7 +83,6 @@ - +
    @elements.section@
    @elements.section@
    +
    @elements.label@   + @elements.label@   -
       -
    +
       +
    + > - +
    \@formgroup.widget@

    - \@formerror.@elements.id@\@ + \@formerror.@elements.id@\@
    - + - + + -
    - \@formerror.@elements.id@\@ +
    \@formerror.@elements.id@\@
    @@ -88,4 +92,9 @@
    + + +
    Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/resources/forms/tiny-plain.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/resources/forms/wizard.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/wizard.adp,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-templating/resources/forms/wizard.adp 16 Jan 2003 13:42:09 -0000 1.5 +++ openacs-4/packages/acs-templating/resources/forms/wizard.adp 17 May 2003 10:04:53 -0000 1.6 @@ -98,28 +98,22 @@
    +
    + -
    - - - + + + - + - -
    -
    Index: openacs-4/packages/acs-templating/tcl/data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/data-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/acs-templating/tcl/data-procs.tcl 22 Apr 2003 11:58:55 -0000 1.8 +++ openacs-4/packages/acs-templating/tcl/data-procs.tcl 17 May 2003 10:05:27 -0000 1.9 @@ -10,7 +10,20 @@ # http://www.fsf.org/copyleft/gpl.html ad_proc -public template::data::validate { type value_ref message_ref } { + This proc invokes the validation code for a given type. + @see template::data::validate::boolean + @see template::data::validate::date + @see template::data::validate::email + @see template::data::validate::filename + @see template::data::validate::integer + @see template::data::validate::keyword + @see template::data::validate::search + @see template::data::validate::string + @see template::data::validate::text + @see template::data::validate::url +} { + return [validate::$type $value_ref $message_ref] } @@ -79,6 +92,12 @@ return 1 } +ad_proc -public template::data::validate::string { value_ref message_ref } { + + # anything is valid for string + return 1 +} + ad_proc -public template::data::validate::keyword { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -105,11 +124,24 @@ return $result } +ad_proc -public template::data::validate::email { value_ref message_ref } { + + upvar 2 $message_ref message $value_ref value + + set result [util_email_valid_p $value] + + if { ! $result } { + set message "Invalid email format \"$value\"" + } + + return $result +} + ad_proc -public template::data::validate::url { value_ref message_ref } { upvar 2 $message_ref message $value_ref value - set expr {^(http://)?([a-zA-Z0-9_\-\.]+(:[0-9]+)?)?[a-zA-Z0-9_.%/?=&-]+$} + set expr {^(https?://)?([a-zA-Z0-9_\-\.]+(:[0-9]+)?)?[a-zA-Z0-9_.%/?=&-]+$} set result [regexp $expr $value] if { ! $result } { Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/acs-templating/tcl/date-procs.tcl 19 Feb 2003 15:14:20 -0000 1.17 +++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 17 May 2003 10:05:27 -0000 1.18 @@ -429,7 +429,7 @@ Get the default ranges for all the numeric fields of a Date object } { switch $what { - year { return [list 2000 2010 1 ] } + year { return [list 2002 2012 1 ] } month { return [list 1 12 1] } day { return [list 1 31 1] } hours { return [list 0 23 1] } Index: openacs-4/packages/acs-templating/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/element-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-templating/tcl/element-procs.tcl 17 Feb 2003 13:25:56 -0000 1.12 +++ openacs-4/packages/acs-templating/tcl/element-procs.tcl 17 May 2003 10:05:27 -0000 1.13 @@ -10,11 +10,12 @@ # License. Full text of the license is available from the GNU Project: # http://www.fsf.org/copyleft/gpl.html ad_proc -public element { command form_id element_id args } { - form is really template::element although when in - the "template" namespace you may omit the - template:: + element is really template::element although when in the + "template" namespace you may omit the template:: qualifier. + See the template::form api for creating the form element container. @see template::element + @see template::form } - ad_proc -public template::element { command form_id element_id args } { @@ -46,57 +47,84 @@ Append an element to a form object. If a submission is in progress, values for the element are prepared and validated. - @param form_id The identifier of the form to which the element is to - be added. The form must have been previously created - with a form create statement. + @param form_id The identifier of the form to which the element is to + be added. The form must have been previously created + with a form create statement. + @param element_id A keyword identifier for the element that is unique + in the context of the form. - @param element_id A keyword identifier for the element that is unique - in the context of the form. + @option widget The name of an input widget for the element. Valid + widgets must have a rendering procedure defined in + the template::widget namespace. + @option datatype The name of a datatype for the element values. Valid + datatypes must have a validation procedure defined in + the template::data::validate namespace. - @option widget The name of an input widget for the element. Valid - widgets must have a rendering procedure defined in - the template::widget namespace. + @option label The label for the form element. + + @option section The section name for the element. + @option html A list of name-value attribute pairs to include in + the HTML tag for widget. Typically used for additional + formatting options, such as cols or + rows, or for JavaScript handlers. - @option datatype The name of a datatype for the element values. Valid - datatypes must have a validation procedure defined in - the template::data::validate namespace. + @option maxlength The maximum allowable length in bytes. Will be checked using + 'string bytelength'. Will also cause 'input' widgets (text, integer, etc.) + to get a maxlength="..." attribute. + @option options A list of options for select lists and button groups + (check boxes or radio buttons). The list contains + two-element lists in the form + { {label value} {label value} {label value} ...} - @option html A list of name-value attribute pairs to include in - the HTML tag for widget. Typically used for additional - formatting options, such as cols or - rows, or for JavaScript handlers. + @option value The default value of the element + @option values The default values of the element, where multiple values + are allowed (checkbox groups and multiselect widgets) - @option options A list of options for select lists and button groups - (check boxes or radio buttons). The list contains - two-element lists in the form - { {label value} {label value} {label value} ...} + @option validate A list of custom validation blocks in the form + { name { expression } { message } \ + name { expression } { message } ...} + where name is a unique identifier for the validation + step, expression is a block to Tcl code that evaluates to + 1 or 0, and message is to be displayed to the user when + the validation step fails. + @option sign specify for a hidden widget that its value should be + signed - @option value The default value of the element + @option help_text Text displayed with the element + @option help Display helpful hints (date widget only?) - @option values The default values of the element, where multiple values - are allowed (checkbox groups and multiselect widgets) + @option optional A flag indicating that no value is required for this + element. If a default value is specified, the default + is used instead. + @option mode Valid values are 'display', 'edit', and the empty string. + If set to 'display', the element will render as static HTML + which doesn't allow editing of the value, instead of the + HTML form element (e.g. <input>) which would otherwise + get used. If set to 'edit', the element is as normal, allowing + the user to edit the contents. If set to the empty string or + not specified at all, the form's 'mode' setting is used instead. - @option validate A list of custom validation blocks in the form - { name { expression } { message } \ - name { expression } { message } ...} - where name is a unique identifier for the validation - step, expression is a block to Tcl code that evaluates to - 1 or 0, and message is to be displayed to the user when - the validation step fails. + @option before_html A chunk of HTML displayed immediately before the rendered element. + @option after_html A chunk of HTML displayed immediately after the rendered element. - @option optional A flag indicating that no value is required for this - element. If a default value is specified, the default - is used instead. + @option display_value Alternative value used when the element is in display mode. + If specified, this value is used when the mode is set to 'display', + instead of asking the element widget to render itself in display mode. + + @see template::widget + @see template::data::validate + @see template::form::create } { + set level [template::adp_level] # add the element to the element list @@ -164,6 +192,22 @@ if { [llength $opts(values)] || ! [info exists opts(value)] } { set opts(value) [lindex $opts(values) 0] } + } + + if { [string equal $opts(widget) hidden] + && [info exists opts(sign)] + && $opts(sign) + } { + if {[info exists opts(value)] } { + set val $opts(value) + } else { + set val {} + } + template::element::create $opts(form_id) $opts(id):sig \ + -datatype text \ + -widget hidden \ + -section $opts(section) \ + -value [ad_sign $val] } } @@ -184,6 +228,22 @@ template::util::get_opts $args + if { [string equal $opts(widget) hidden] + && [info exists opts(sign)] + && $opts(sign) + && [info exists opts(value)] } { + if { [template::element::exists $form_id $element_id:sig] } { + template::element::set_properties $form_id $element_id:sig \ + -value [ad_sign $opts(value)] + + } else { + template::element::create $form_id $element_id:sig \ + -datatype text \ + -widget hidden \ + -value [ad_sign $opts(value)] + } + } + copy_value_to_values_if_defined } @@ -308,7 +368,9 @@ set label $element(name) } - set is_inform [string equal $element(widget) inform] + # Element shouldn't be validated if it's an inform widget, or the element is not in edit mode. + # The element will be in edit mode if its mode is either blank or set to 'edit'. + set is_inform [expr [string equal $element(widget) inform] || (![string equal $element(mode) "edit"] && ![string equal $element(mode) ""])] # Check for required element if { ! $is_inform && ! $is_optional && ! [llength $values] } { @@ -356,6 +418,16 @@ continue } + if { [info exists element(maxlength)] } { + set value_bytelength [string bytelength $value] + if { $value_bytelength > $element(maxlength) } { + set excess_no_bytes [expr { $value_bytelength - $element(maxlength) }] + set message "$label is [ad_decode $excess_no_bytes "1" "one character" "$excess_no_bytes characters"] too long." + lappend v_errors $message + set formerror($element_id:maxlength) $message + } + } + if { ! [template::data::validate $element(datatype) value message] } { # the submission is invalid Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 13 Jan 2003 15:23:50 -0000 1.11 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 17 May 2003 10:05:27 -0000 1.12 @@ -18,12 +18,14 @@ template:: @see template::form + @see template::element } - ad_proc -public template::form { command args } { - template::form command invokes form functions. - Please see the individual functions for - their arguments. + + template::form command invokes form functions. Please see the + individual functions for their arguments. The template::element + api is used to manipulate form elements. @see template::form::create @see template::form::get_button @@ -40,27 +42,71 @@ @see template::form::section @see template::form::set_values @see template::form::size + @see template::element } { eval template::form::$command $args } ad_proc -public template::form::create { id args } { Initialize the data structures for a form. - @param id A keyword identifier for the form, such as "add_user" or - "edit_item". The ID must be unique in the context of a - single page. + @param id A keyword identifier for the form, such as "add_user" or + "edit_item". The ID must be unique in the context of a + single page. - @option method The standard METHOD attribute to specify in the HTML FORM - tag at the beginning of the rendered form. Defaults to POST. + @option method The standard METHOD attribute to specify in the HTML FORM + tag at the beginning of the rendered form. Defaults to POST. - @option html A list of additional name-value attribute pairs to - include in the HTML FORM tag at the beginning of the - rendered form. Common attributes include JavaScript - event handlers and multipart form encoding. For example, - "-html { enctype multipart/form-data onSubmit validate() }" + @option html A list of additional name-value attribute pairs to + include in the HTML FORM tag at the beginning of the + rendered form. Common attributes include JavaScript + event handlers and multipart form encoding. For example, + "-html { enctype multipart/form-data onSubmit validate() }" + + @option mode If set to 'display', the form is shown in display-only mode, where + the user cannot edit the fields. Each widget knows how to display its contents + appropriately, e.g. a select widget will show the label, not the value. If set to + 'edit', the form is displayed as normal, for editing. Defaults to 'edit'. Switching + to edit mode when a button is clicked in display mode is handled automatically. + + @option cancel_url A url to redirect to when the user hits the Cancel button. + If you do not supply a cancel_url, there will be no Cancel button. + + @option cancel_label The label of the Cancel button, if cancel_url is supplied. + Default is "Cancel". + + @option display_buttons List of buttons to show when the form is in display mode. + The value should be a list of lists, with the first element being the form label + and the second element being the name of the name of the form element. Defaults to + { { "Edit" edit } }. The name of the button clicked can be retrieved using + template::form::get_button. The name of the button clicked while in display mode + is called the 'action', and can be retrieved using template::form::get_action. + The action is automatically carried forward to the form submission, so that the value + that you get from calling template::form::get_action on the final form submission + is the name of the button which was called when the form changed from display + mode to edit mode. - @option elements A block of element specifications. + @option edit_buttons List of buttons to show when the form is in display mode. + The value should be a list of lists, with the first element being the form label + and the second element being the name of the name of the form element. Defaults to + { { "Ok" ok } }. The name of the button clicked can be retrieved using + template::form::get_button. + + @option actions A list of actions available on the form. Equivalent to, and + overrides display_buttons. + + @option has_submit Set to 1 to suppress the OK or submit button automatically + added by the form builder. Use this if your form already includes its own + submit button. + + @option has_edit Set to 1 to suppress the Edit button automatically added by the + form builder. Use this if you include your own. + + @option elements A block of element specifications. + + @see template::form::get_button + @see template::form::get_action + } { set level [template::adp_level] @@ -95,8 +141,13 @@ ad_script_abort } - set formaction [get_action $id] + # If the user hit a button named "cancel", redirect and about + if { $submission && [string equal $formbutton "cancel"] && [exists_and_not_null opts(cancel_url)]} { + ad_returnredirect $opts(cancel_url) + ad_script_abort + } + set formaction [get_action $id] # If we were in display mode, and a button was clicked, we should be in edit mode now if { $submission && [string equal [ns_queryget "form:mode"] "display"] } { set opts(mode) "edit" @@ -175,15 +226,16 @@ } ad_proc -public template::form::get_action { id } { - Find out which action is in progress + Find out which action is in progress. This is the name of the button + which was clicked when the form was in display mode. @param id The ID of an ATS form object. @return the name of the action in progress } { set level [template::adp_level] # keep form properties and a list of the element items - upvar #$level $id:action formaction + upvar #$level $id:formaction formaction # If we've already found the action, just return that if { [info exists formaction] } { @@ -207,8 +259,8 @@ return $formaction } - # Otherwise, there should be a form:action variable in the form - set formaction [ns_queryget "form:action"] + # Otherwise, there should be a form:formaction variable in the form + set formaction [ns_queryget "form:formaction"] return $formaction } @@ -295,7 +347,13 @@ set "buttons:${buttons:rowcount}(name)" "formbutton:$name" } - if { [string equal $style {}] } { set style standard } + if { [string equal $style {}] } { + set style [parameter::get \ + -package_id [apm_package_id_from_key "acs-templating"] \ + -parameter DefaultFormStyle \ + -default "standard"] + } + set file_stub [template::get_resource_path]/forms/$style # set the asset url for images @@ -440,10 +498,10 @@ append output [export_vars -form { { form\:id $id } { form\:mode $properties(mode) } }] # If we're in edit mode, output the action - upvar #$level $id:action form_action - if { [string equal $properties(mode) "edit"] && [exists_and_not_null form_action] } { - upvar #$level $id:action action - append output [export_vars -form { { form\:action $form_action } }] + upvar #$level $id:formaction formaction + if { [string equal $properties(mode) "edit"] && [exists_and_not_null formaction] } { + upvar #$level $id:formaction action + append output [export_vars -form { { form\:formaction $formaction } }] } return $output Index: openacs-4/packages/acs-templating/tcl/paginator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/paginator-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 30 Nov 2002 17:24:15 -0000 1.10 +++ openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 17 May 2003 10:05:27 -0000 1.11 @@ -272,7 +272,7 @@ set pages [list] - for { set i $start } { $i < $end } { incr i } { + for { set i $start } { $i <= $end } { incr i } { lappend pages $i } Index: openacs-4/packages/acs-templating/tcl/query-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/query-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-templating/tcl/query-procs.tcl 30 Nov 2002 17:24:15 -0000 1.12 +++ openacs-4/packages/acs-templating/tcl/query-procs.tcl 17 May 2003 10:05:27 -0000 1.13 @@ -629,6 +629,8 @@
    appends the row to an existing multirow.
    template::multirow size datasourcename
    returns the rowcount
    +
    template::multirow columns datasourcename
    +
    returns the columns in the datasource
    template::multirow get datasourcename rownum [column]
    returns the row of of data (or the particular row/column if column is provided)
    template::multirow get datasourcename rownum column value
    @@ -694,10 +696,18 @@ size { upvar $multirow_level_up $name:rowcount rowcount if { [template::util::is_nil rowcount] } { - error "malformed multirow datasource - $name" + return 0 } return $rowcount } + + columns { + upvar $multirow_level_up $name:columns columns + if { [template::util::is_nil columns] } { + return {} + } + return $columns + } get { @@ -750,6 +760,10 @@ upvar $multirow_level_up $name:rowcount rowcount $name:columns columns + if {![info exists rowcount] || ![info exists columns]} { + return + } + for { set i 1 } { $i <= $rowcount } { incr i } { # Pull values into variables (and into the array - aks), # evaluate the code block, and pull values back out to Index: openacs-4/packages/acs-templating/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/widget-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-templating/tcl/widget-procs.tcl 13 Mar 2003 20:25:06 -0000 1.18 +++ openacs-4/packages/acs-templating/tcl/widget-procs.tcl 17 May 2003 10:05:27 -0000 1.19 @@ -55,7 +55,7 @@ # include an extra hidden element to indicate that the # value is being selected as opposed to entered - set output "" + set output "\n" append output [select element $tag_attributes] } @@ -130,9 +130,9 @@ upvar $element_reference element if { [info exists element(value)] } { - return $element(value) + return "$element(value)[input hidden element $tag_attributes]" } else { - return "" + return [input hidden element $tag_attributes] } } @@ -150,6 +150,29 @@ # This can be used in the form template in a tag. set attributes(id) "$element(form_id):elements:$element(name):$element(value)" } + + # Handle display mode of visible normal form elements, i.e. not hidden, not submit, not button, not clear + if { ![string equal $element(mode) "edit"] && ![string equal $type "hidden"] && \ + ![string equal $type "submit"] && ![string equal $type "button"] && \ + ![string equal $type "clear"] } { + + set output "" + switch $type { + checkbox - radio { + # There's a 'subst' done on the contents here + append output "" + # This is ugly, but it works: Only export the value when we're on a selected option + append output "\[ad_decode \$checked \"checked\" \"\" \"\"\]" + } + default { + if { [info exists element(value)] } { + append output [ad_quotehtml $element(value)] + append output "" + } + } + } + } else { + set output "" @@ -269,7 +284,7 @@ # Create an array for easier testing of selected values template::util::list_to_lookup $values_list values - + if { ![string equal $mode "edit"] } { set selected_list [list] set output {} @@ -300,16 +315,20 @@ append output ">\n" foreach option $options_list { - + set label [lindex $option 0] set value [lindex $option 1] - - append output " \n" } @@ -386,13 +405,8 @@ } set query $element(search_query) - if { [info exists element(search_query_name)] } { - set query_name $element(search_query_name) - } else { - set query_name "get_options" - } - set options [db_list_of_lists $query_name $query] + set options [db_list_of_lists get_options $query] set option_count [llength $options] Index: openacs-4/packages/acs-templating/www/doc/api/element.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/api/element.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/api/element.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/api/element.html 17 May 2003 10:05:51 -0000 1.2 @@ -23,6 +23,7 @@ name { expression } { message } \ ... } \ -options { { label value } { label value } ... } \ + -maxlength maxlength \ -value value \ -values { value value ... }