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 -N -r1.11 -r1.12
--- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 11 Jul 2002 04:30:28 -0000 1.11
+++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 13 Jul 2002 00:13:03 -0000 1.12
@@ -196,7 +196,7 @@
} {
return the site node associated with the given object_id
} {
- return [get -url [get_url_from_object_id -object_id $object_id]]
+ return [get -url [lindex [get_url_from_object_id -object_id $object_id] 0]]
}
ad_proc -public get_url {
@@ -215,9 +215,10 @@
ad_proc -public get_url_from_object_id {
{-object_id:required}
} {
- return the url of the site node associated with the given object
+ returns a list of urls for site_nodes that have the given object
+ mounted or the empty list if there are none
} {
- return [db_string select_url_from_object_id {} -default ""]
+ return [db_list select_url_from_object_id {} -default [list]]
}
ad_proc -public get_node_id {
@@ -234,7 +235,7 @@
} {
return the site node id associated with the given object_id
} {
- return [get_node_id -url [get_url_from_object_id -object_id $object_id]]
+ return [get_node_id -url [lindex [get_url_from_object_id -object_id $object_id] 0]]
}
ad_proc -public get_parent_id {
@@ -514,5 +515,5 @@
return $default
}
- return [site_node::get_url_from_object_id -object_id $subsite_pkg_id]
+ return [lindex [site_node::get_url_from_object_id -object_id $subsite_pkg_id] 0]
}
Index: openacs-4/packages/bm-portlet/www/bm-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bm-portlet/www/bm-portlet.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/bm-portlet/www/bm-portlet.tcl 22 Jun 2002 20:11:03 -0000 1.3
+++ openacs-4/packages/bm-portlet/www/bm-portlet.tcl 13 Jul 2002 00:13:10 -0000 1.4
@@ -38,6 +38,6 @@
set admin_p [permission::permission_p -object_id $package_id -privilege admin]
set spam_name [bulk_mail::parameter -parameter PrettyName -default Spam]
-set spam_url [site_node::get_url_from_object_id -object_id $package_id]
+set spam_url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
ad_return_template
Index: openacs-4/packages/bulk-mail/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bulk-mail/www/index.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/bulk-mail/www/index.tcl 22 Jun 2002 20:09:31 -0000 1.3
+++ openacs-4/packages/bulk-mail/www/index.tcl 13 Jul 2002 00:13:03 -0000 1.4
@@ -22,7 +22,7 @@
set table_def {
{send_date {Send Date} {bulk_mail_messages.send_date $order} {
[util_AnsiDatetoPrettyDate $send_date] | }}
{from_addr From {bulk_mail_messages.from_addr $order} {$from_addr | }}
- {subject Subject {bulk_mail_messages.subject $order} {$subject | }}
+ {subject Subject {bulk_mail_messages.subject $order} {$subject | }}
{sent_p {Sent?} {bulk_mail_messages.sent_p $order} {[ad_decode $sent_p t Yes No] | }}
}
Index: openacs-4/packages/dotlrn/sql/oracle/applets-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/applets-create.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/sql/oracle/applets-create.sql 13 Jul 2002 00:13:09 -0000 1.1
@@ -0,0 +1,65 @@
+--
+-- Copyright (C) 2001, 2002 OpenForce, Inc.
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- create the dotLRN applets model
+--
+-- @author Ben Adida (ben@openforce.net)
+-- @author yon (yon@openforce.net
+-- @author arjun (arjun@openforce.net)
+-- @creation-date September 20th, 2001 (redone)
+-- @version $Id: applets-create.sql,v 1.1 2002/07/13 00:13:09 yon Exp $
+--
+
+create table dotlrn_applets (
+ applet_id integer
+ constraint dotlrn_applets_pk
+ primary key,
+ applet_key varchar(100)
+ constraint dotlrn_applets_applet_key_nn
+ not null
+ constraint dotlrn_applets_applet_key_un
+ unique,
+ package_key constraint dotlrn_applets_package_key_fk
+ references apm_packages (package_key),
+ active_p char(1)
+ default 't'
+ constraint dotlrn_applets_active_p_ck
+ check (active_p in ('t', 'f'))
+ constraint dotlrn_applets_active_p_nn
+ not null
+);
+
+create table dotlrn_community_applets (
+ community_id constraint dotlrn_ca_community_id_fk
+ references dotlrn_communities_all (community_id)
+ constraint dotlrn_ca_community_id_nn
+ not null,
+ applet_id constraint dotlrn_ca_applet_key_fk
+ references dotlrn_applets (applet_id)
+ constraint dotlrn_ca_applet_key_nn
+ not null,
+ -- this is the package_id of the package this applet represents
+ package_id integer,
+ active_p char(1)
+ default 't'
+ constraint dotlrn_ca_active_p_ck
+ check (active_p in ('t', 'f'))
+ constraint dotlrn_ca_active_p_nn
+ not null,
+ constraint dotlrn_community_applets_pk
+ primary key (community_id, applet_id)
+);
Index: openacs-4/packages/dotlrn/sql/oracle/applets-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/applets-drop.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/sql/oracle/applets-drop.sql 13 Jul 2002 00:13:09 -0000 1.1
@@ -0,0 +1,28 @@
+--
+-- Copyright (C) 2001, 2002 OpenForce, Inc.
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- drop the dotLRN applets model
+--
+-- @author Ben Adida (ben@openforce.net)
+-- @author yon (yon@openforce.net
+-- @author arjun (arjun@openforce.net)
+-- @creation-date September 20th, 2001 (redone)
+-- @version $Id: applets-drop.sql,v 1.1 2002/07/13 00:13:09 yon Exp $
+--
+
+drop table dotlrn_community_applets;
+drop table dotlrn_applets;
Index: openacs-4/packages/dotlrn/sql/oracle/communities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-create.sql,v
diff -u -N -r1.10 -r1.11
--- openacs-4/packages/dotlrn/sql/oracle/communities-create.sql 28 Jun 2002 19:50:44 -0000 1.10
+++ openacs-4/packages/dotlrn/sql/oracle/communities-create.sql 13 Jul 2002 00:13:09 -0000 1.11
@@ -117,42 +117,4 @@
where dotlrn_communities.community_id = groups.group_id
and groups.join_policy <> 'closed';
-create table dotlrn_applets (
- applet_id integer
- constraint dotlrn_applets_applet_pk
- primary key,
- applet_key varchar(100)
- constraint dotlrn_applets_applet_key_nn
- not null
- constraint dotlrn_applets_applet_key_un
- unique,
- status char(10)
- default 'active'
- constraint dotlrn_applets_status_ck
- check (status in ('active', 'inactive'))
- constraint dotlrn_applets_status_nn
- not null
-);
-
-create table dotlrn_community_applets (
- community_id constraint dotlrn_ca_community_id_fk
- references dotlrn_communities_all (community_id)
- constraint dotlrn_ca_community_id_nn
- not null,
- applet_id constraint dotlrn_ca_applet_key_fk
- references dotlrn_applets (applet_id)
- constraint dotlrn_ca_applet_key_nn
- not null,
- -- this is the package_id of the package this applet represents
- package_id integer,
- active_p char(1)
- default 't'
- constraint dotlrn_ca_active_p_ck
- check (active_p in ('t','f'))
- constraint dotlrn_ca_active_p_nn
- not null,
- constraint dotlrn_community_applets_pk
- primary key (community_id, applet_id)
-);
-
@@ communities-tree-create.sql
Index: openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql 31 May 2002 06:23:49 -0000 1.2
+++ openacs-4/packages/dotlrn/sql/oracle/communities-drop.sql 13 Jul 2002 00:13:09 -0000 1.3
@@ -26,8 +26,6 @@
@@ communities-tree-drop.sql;
-drop table dotlrn_community_applets;
-drop table dotlrn_applets;
drop view dotlrn_active_comms_not_closed;
drop view dotlrn_active_communities;
drop view dotlrn_communities_not_closed;
Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql,v
diff -u -N -r1.16 -r1.17
--- openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 30 May 2002 22:04:58 -0000 1.16
+++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-create.sql 13 Jul 2002 00:13:09 -0000 1.17
@@ -25,6 +25,7 @@
@@ users-create.sql
@@ portal-types-create.sql
@@ communities-create.sql
+@@ applets-create.sql
@@ community-memberships-create.sql
@@ communities-package-create.sql
@@ dotlrn-init.sql
Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql 30 May 2002 22:04:58 -0000 1.1
+++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-drop.sql 13 Jul 2002 00:13:09 -0000 1.2
@@ -33,6 +33,7 @@
@@ dotlrn-sanitize.sql
@@ communities-package-drop.sql
@@ community-memberships-drop.sql
+@@ applets-drop.sql
@@ communities-drop.sql
@@ portal-types-drop.sql
@@ users-drop.sql
Index: openacs-4/packages/dotlrn/sql/postgresql/applets-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/applets-create.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/sql/postgresql/applets-create.sql 13 Jul 2002 00:13:09 -0000 1.1
@@ -0,0 +1,68 @@
+--
+-- Copyright (C) 2001, 2002 OpenForce, Inc.
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- create the dotLRN applets model
+--
+-- @author Ben Adida (ben@openforce.net)
+-- @author yon (yon@openforce.net
+-- @author arjun (arjun@openforce.net)
+-- @creation-date September 20th, 2001 (redone)
+-- @version $Id: applets-create.sql,v 1.1 2002/07/13 00:13:09 yon Exp $
+--
+
+create table dotlrn_applets (
+ applet_id integer
+ constraint dotlrn_applets_pk
+ primary key,
+ applet_key varchar(100)
+ constraint dotlrn_applets_applet_key_nn
+ not null
+ constraint dotlrn_applets_applet_key_un
+ unique,
+ package_key varchar(100)
+ constraint dotlrn_applets_package_key_fk
+ references apm_packages (package_key),
+ active_p char(1)
+ default 't'
+ constraint dotlrn_applets_active_p_ck
+ check (active_p in ('t', 'f'))
+ constraint dotlrn_applets_active_p_nn
+ not null
+);
+
+create table dotlrn_community_applets (
+ community_id integer
+ constraint dotlrn_ca_community_id_fk
+ references dotlrn_communities_all (community_id)
+ constraint dotlrn_ca_community_id_nn
+ not null,
+ applet_id integer
+ constraint dotlrn_ca_applet_key_fk
+ references dotlrn_applets (applet_id)
+ constraint dotlrn_ca_applet_key_nn
+ not null,
+ -- this is the package_id of the package this applet represents
+ package_id integer,
+ active_p char(1)
+ default 't'
+ constraint dotlrn_ca_active_p_ck
+ check (active_p in ('t', 'f'))
+ constraint dotlrn_ca_active_p_nn
+ not null,
+ constraint dotlrn_community_applets_pk
+ primary key (community_id, applet_id)
+);
Index: openacs-4/packages/dotlrn/sql/postgresql/applets-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/applets-drop.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/sql/postgresql/applets-drop.sql 13 Jul 2002 00:13:09 -0000 1.1
@@ -0,0 +1,28 @@
+--
+-- Copyright (C) 2001, 2002 OpenForce, Inc.
+--
+-- This file is part of dotLRN.
+--
+-- dotLRN is free software; you can redistribute it and/or modify it under the
+-- terms of the GNU General Public License as published by the Free Software
+-- Foundation; either version 2 of the License, or (at your option) any later
+-- version.
+--
+-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY
+-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+-- details.
+--
+
+--
+-- drop the dotLRN applets model
+--
+-- @author Ben Adida (ben@openforce.net)
+-- @author yon (yon@openforce.net
+-- @author arjun (arjun@openforce.net)
+-- @creation-date September 20th, 2001 (redone)
+-- @version $Id: applets-drop.sql,v 1.1 2002/07/13 00:13:09 yon Exp $
+--
+
+drop table dotlrn_community_applets;
+drop table dotlrn_applets;
Index: openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql 8 Jul 2002 21:04:16 -0000 1.1
+++ openacs-4/packages/dotlrn/sql/postgresql/communities-create.sql 13 Jul 2002 00:13:09 -0000 1.2
@@ -135,43 +135,4 @@
where dotlrn_communities.community_id = groups.group_id
and groups.join_policy <> 'closed';
-create table dotlrn_applets (
- applet_id integer
- constraint dotlrn_applets_applet_pk
- primary key,
- applet_key varchar(100)
- constraint dotlrn_applets_applet_key_nn
- not null
- constraint dotlrn_applets_applet_key_uk
- unique,
- status char(10)
- default 'active'
- constraint dotlrn_applets_status_nn
- not null
- constraint dotlrn_applets_status_ck
- check (status in ('active','inactive'))
-);
-
-create table dotlrn_community_applets (
- community_id integer
- constraint dotlrn_ca_community_id_nn
- not null
- constraint dotlrn_ca_community_id_fk
- references dotlrn_communities_all (community_id),
- applet_id integer
- constraint dotlrn_ca_applet_key_nn
- not null
- references dotlrn_applets (applet_id),
- -- this is the package_id of the package this applet represents
- package_id integer,
- active_p char(1)
- default 't'
- constraint dotlrn_ca_active_p_ck
- check (active_p in ('t','f'))
- constraint dotlrn_ca_active_p_nn
- not null,
- constraint dotlrn_community_applets_pk
- primary key (community_id, applet_id)
-);
-
\i communities-tree-create.sql
Index: openacs-4/packages/dotlrn/sql/postgresql/communities-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/communities-drop.sql,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn/sql/postgresql/communities-drop.sql 8 Jul 2002 21:04:16 -0000 1.1
+++ openacs-4/packages/dotlrn/sql/postgresql/communities-drop.sql 13 Jul 2002 00:13:09 -0000 1.2
@@ -28,8 +28,6 @@
\i communities-tree-drop.sql;
-drop table dotlrn_community_applets;
-drop table dotlrn_applets;
drop view dotlrn_active_comms_not_closed;
drop view dotlrn_active_communities;
drop view dotlrn_communities_not_closed;
Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql,v
diff -u -N -r1.7 -r1.8
--- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql 8 Jul 2002 21:04:16 -0000 1.7
+++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-create.sql 13 Jul 2002 00:13:09 -0000 1.8
@@ -28,6 +28,7 @@
\i users-create.sql
\i portal-types-create.sql
\i communities-create.sql
+\i applets-create.sql
\i community-memberships-create.sql
\i communities-package-create.sql
\i dotlrn-init.sql
Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/dotlrn-drop.sql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-drop.sql 8 Jul 2002 21:50:57 -0000 1.4
+++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-drop.sql 13 Jul 2002 00:13:09 -0000 1.5
@@ -33,6 +33,7 @@
\i dotlrn-sanitize.sql
\i communities-package-drop.sql
\i community-memberships-drop.sql
+\i applets-drop.sql
\i communities-drop.sql
\i portal-types-drop.sql
\i users-drop.sql
Index: openacs-4/packages/dotlrn/tcl/applets-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/applets-procs.tcl,v
diff -u -N -r1.13 -r1.14
--- openacs-4/packages/dotlrn/tcl/applets-procs.tcl 9 Jul 2002 22:05:10 -0000 1.13
+++ openacs-4/packages/dotlrn/tcl/applets-procs.tcl 13 Jul 2002 00:13:09 -0000 1.14
@@ -46,39 +46,6 @@
site_node::new -name applets -parent_id [dotlrn::get_node_id]
}
- ad_proc -public register {
- applet_key
- } {
- Register an applet.
- } {
- nsv_lappend dotlrn applets $applet_key
- }
-
- ad_proc -public deregister {
- applet_key
- } {
- Deregister an applet. Not currently threadsafe!
- } {
- # If the array hasn't even been created! The Horror!
- if {![nsv_exists dotlrn applets]} {
- return
- }
-
- # Get the list, remove the element, reset the list
- set current_list [nsv_get dotlrn applets]
- set index [lsearch -exact $current_list $applet_key]
- set new_list [lreplace $current_list $index $index]
-
- nsv_set dotlrn applets $new_list
- }
-
- ad_proc -public list_applets {
- } {
- List all registered applets.
- } {
- return [nsv_get dotlrn applets]
- }
-
ad_proc -public applet_exists_p {
{-applet_key:required}
} {
@@ -89,28 +56,19 @@
ad_proc -public add_applet_to_dotlrn {
{-applet_key:required}
- {-activate_p t}
+ {-package_key:required}
+ {-active_p t}
} {
dotlrn-init.tcl calls AddApplet on all applets using acs_sc directly.
The add_applet proc in the applet (e.g. dotlrn-calendar) calls this
proc to tell dotlrn to register and/or activate itself. This _must_
be able to be run multiple times!
} {
-
if {![empty_string_p [get_applet_id_from_key -applet_key $applet_key]]} {
return
}
- if {[string equal $activate_p t] == 1} {
- set status active
- } else {
- set status inactive
- }
-
- db_transaction {
- set applet_id [db_nextval acs_object_id_seq]
- db_dml insert {}
- }
+ db_dml insert {}
}
ad_proc -public get_applet_id_from_key {
@@ -135,7 +93,6 @@
set pretty_name $package_key
}
- # Find the parent node
set parent_node_id [site_node::get_node_id -url [get_url]]
set package_id [dotlrn::mount_package \
@@ -149,16 +106,46 @@
return $package_id
}
+ ad_proc -public get_applet_url {
+ {applet_key:required}
+ } {
+ get the applet's url
+ } {
+ }
+
+ ad_proc -public list_applets {} {
+ list the applet_keys for all dotlrn applets
+ } {
+ return [util_memoize {dotlrn_applet::list_applets_not_cached}]
+ }
+
+ ad_proc -private list_applets_not_cached {} {
+ list the applet_keys for all dotlrn applets
+ } {
+ return [db_list select_dotlrn_applets {}]
+ }
+
ad_proc -public is_applet_mounted {
- {-url:required}
+ {-applet_key:required}
} {
- is the applet specified mounted at the specified url?
+ is the applet specified mounted
} {
+ if {[apm_package_id_from_key $package_key]} {
+ }
if {[nsv_exists site_nodes "[get_url]/$url/"]} {
return 1
} else {
return 0
}
}
+ ad_proc -public list_mounted_applets {} {
+ list all applets that are mounted
+ } {
+
+ foreach applet [list_applets] {
+ }
+
+ }
+
}
Index: openacs-4/packages/dotlrn/tcl/applets-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/applets-procs.xql,v
diff -u -N -r1.4 -r1.5
--- openacs-4/packages/dotlrn/tcl/applets-procs.xql 29 Mar 2002 19:38:25 -0000 1.4
+++ openacs-4/packages/dotlrn/tcl/applets-procs.xql 13 Jul 2002 00:13:09 -0000 1.5
@@ -24,10 +24,17 @@
insert
into dotlrn_applets
- (applet_id, applet_key, status)
+ (applet_id, applet_key, package_key, status)
values
- (:applet_id, :applet_key, :status)
+ (acs_object_id_seq.nextval, :applet_key, :package_key, :active_p)
+
+
+ select applet_key
+ from dotlrn_applets
+
+
+
Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v
diff -u -N -r1.157 -r1.158
--- openacs-4/packages/dotlrn/tcl/community-procs.tcl 12 Jul 2002 21:26:48 -0000 1.157
+++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 13 Jul 2002 00:13:09 -0000 1.158
@@ -1163,15 +1163,15 @@
} {
Get the URL for a community type
} {
- return [site_node::get_url_from_object_id -object_id [get_community_type_package_id $community_type]]
+ return [lindex [site_node::get_url_from_object_id -object_id [get_community_type_package_id $community_type]] 0]
}
ad_proc -public get_community_url {
community_id
} {
Get the URL for a community
} {
- return [site_node::get_url_from_object_id -object_id [get_package_id $community_id]]
+ return [lindex [site_node::get_url_from_object_id -object_id [get_package_id $community_id]] 0]
}
ad_proc -public get_community_type_package_id {
@@ -1191,8 +1191,8 @@
}
ad_proc -public get_applet_package_id {
- community_id
- applet_key
+ {-community_id:required}
+ {-applet_key:required}
} {
get the package ID for a particular community
} {
Index: openacs-4/packages/dotlrn/tcl/community-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v
diff -u -N -r1.73 -r1.74
--- openacs-4/packages/dotlrn/tcl/community-procs.xql 12 Jul 2002 21:26:48 -0000 1.73
+++ openacs-4/packages/dotlrn/tcl/community-procs.xql 13 Jul 2002 00:13:09 -0000 1.74
@@ -390,10 +390,12 @@
-
- delete from dotlrn_community_applets
- where community_id= :community_id and applet_id = :applet_id
-
+
+ delete
+ from dotlrn_community_applets
+ where community_id = :community_id
+ and applet_id = :applet_id
+
@@ -453,7 +455,8 @@
- delete from dotlrn_community_applets
+ delete
+ from dotlrn_community_applets
where community_id = :community_id
and applet_id = :applet_id
@@ -473,44 +476,44 @@
- select applet_key
- from dotlrn_community_applets dca,
- dotlrn_applets da
- where community_id = :community_id
- and dca.applet_id = da.applet_id
+ select dotlrn_applets.applet_key
+ from dotlrn_community_applets
+ dotlrn_applets
+ where dotlrn_community_applets.community_id = :community_id
+ and dotlrn_community_applets.applet_id = dotlrn_applets.applet_id
select applet_key
from dotlrn_applets
- where status = 'active'
+ where active_p = 't'
- select applet_key
- from dotlrn_community_applets dca,
- dotlrn_applets da
- where community_id = :community_id
- and active_p = 't'
- and dca.applet_id = da.applet_id
- and status = 'active'
+ select dotlrn_applets.applet_key
+ from dotlrn_community_applets,
+ dotlrn_applets
+ where dotlrn_community_applets.community_id = :community_id
+ and dotlrn_community_applets.active_p = 't'
+ and dotlrn_community_applets.applet_id = dotlrn_applets.applet_id
+ and dotlrn_applets.active_p = 't'
select 1
- from dotlrn_community_applets dca,
- dotlrn_applets da
- where community_id = :community_id
- and da.applet_key = :applet_key
- and active_p = 't'
- and dca.applet_id = da.applet_id
- and status = 'active'
+ from dotlrn_community_applets,
+ dotlrn_applets
+ where dotlrn_community_applets.community_id = :community_id
+ and dotlrn_community_applets.applet_id = dotlrn_applets.applet_id
+ and dotlrn_applets.applet_key = :applet_key
+ and dotlrn_community_applets.active_p = 't'
+ and dotlrn_applets.active_p = 't'
Index: openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl,v
diff -u -N -r1.61 -r1.62
--- openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 11 Jul 2002 04:30:33 -0000 1.61
+++ openacs-4/packages/dotlrn/tcl/dotlrn-procs.tcl 13 Jul 2002 00:13:09 -0000 1.62
@@ -176,56 +176,6 @@
}
}
- ad_proc -public get_community_applet_node_id {
- {-community_id:required}
- {-package_key:required}
- } {
- returns the node_id of the applet in the given community.
- this should probably be done by querying the dotlrn_community_applets table
- directly, but we can do it through site_map:: too
- } {
- set parent_node_id [site_node::get_node_id_from_object_id \
- -object_id [dotlrn_community::get_package_id $community_id]
- ]
-
- return [site_nodes::get_node_id_from_child_name \
- -parent_node_id $parent_node_id \
- -name $package_key \
- ]
- }
-
- ad_proc -public get_community_applet_package_id {
- {-community_id:required}
- {-package_key:required}
- } {
- like above but returns the package_id
- } {
- set node_id [get_community_applet_node_id \
- -community_id $community_id \
- -package_key $package_key
- ]
-
- return [site_node::get_object_id -node_id $node_id]
- }
-
- ad_proc -public unmount_community_applet_package {
- {-community_id:required}
- {-package_key:required}
- } {
- unmount a package from under a community.
- should be in dotlrn_community::
- } {
- db_transaction {
- set child_node_id [get_community_applet_node_id \
- -community_id $community_id \
- -package_key $package_key
- ]
-
- # site node del package instance
- site_node_delete_package_instance -node_id $child_node_id
- }
- }
-
ad_proc -public get_node_id {} {
return the root node id for dotLRN
} {
@@ -449,10 +399,9 @@
set user_id -1
set portal_id [portal::create \
- -name "$pretty_name Portal" \
- -csv_list $csv_list \
- $user_id
-
+ -name "$pretty_name Portal" \
+ -csv_list $csv_list \
+ $user_id
]
# Associate this type with portal_id, must be before applet
Index: openacs-4/packages/dotlrn-bm/tcl/dotlrn-bm-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bm/tcl/dotlrn-bm-procs.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/dotlrn-bm/tcl/dotlrn-bm-procs.tcl 2 Jul 2002 23:01:51 -0000 1.5
+++ openacs-4/packages/dotlrn-bm/tcl/dotlrn-bm-procs.tcl 13 Jul 2002 00:13:09 -0000 1.6
@@ -64,7 +64,7 @@
-directory_p t \
]
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
dotlrn_applet::mount \
-package_key [my_package_key] \
@@ -98,9 +98,9 @@
remove the bulk-mail applet from a dotlrn community
} {
set portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
- set package_id [dotlrn::get_community_applet_package_id \
+ set package_id [dotlrn_community::get_applet_package_id \
-community_id $community_id \
- -package_key [package_key] \
+ -applet_key [applet_key] \
]
bm_portlet::remove_self_from_page -portal_id $portal_id -package_id $package_id
@@ -182,7 +182,7 @@
} {
returns the URL for the dotlrn-bm package
} {
- return [site_node::get_url_from_object_id -object_id [get_package_id]]
+ return [lindex [site_node::get_url_from_object_id -object_id [get_package_id]] 0]
}
}
Index: openacs-4/packages/dotlrn-bm/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bm/www/admin/index.tcl,v
diff -u -N -r1.1 -r1.2
--- openacs-4/packages/dotlrn-bm/www/admin/index.tcl 2 Jul 2002 23:01:51 -0000 1.1
+++ openacs-4/packages/dotlrn-bm/www/admin/index.tcl 13 Jul 2002 00:13:09 -0000 1.2
@@ -20,7 +20,7 @@
set table_def {
{send_date {Send Date} {bulk_mail_messages.send_date $order} {[util_AnsiDatetoPrettyDate $send_date] | }}
{from_addr From {bulk_mail_messages.from_addr $order} {$from_addr | }}
- {subject Subject {bulk_mail_messages.subject $order} {$subject | }}
+ {subject Subject {bulk_mail_messages.subject $order} {$subject | }}
{sent_p {Sent?} {bulk_mail_messages.sent_p $order} {[ad_decode $sent_p t Yes No] | }}
}
Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v
diff -u -N -r1.61 -r1.62
--- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 9 Jul 2002 20:18:15 -0000 1.61
+++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 13 Jul 2002 00:13:09 -0000 1.62
@@ -72,7 +72,7 @@
-value $package_id
}
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
ad_proc -public remove_applet {
@@ -124,7 +124,7 @@
#
# automount calendar in this community
set node_id [site_node::get_node_id \
- -url [site_node::get_url_from_object_id -object_id [dotlrn_community::get_package_id $community_id]] \
+ -url [lindex [site_node::get_url_from_object_id -object_id [dotlrn_community::get_package_id $community_id]] 0] \
]
set package_id [dotlrn::mount_package \
@@ -151,9 +151,9 @@
-node_id $attachments_node_id \
-object_id [apm_package_id_from_key attachments]
- set fs_package_id [dotlrn::get_community_applet_package_id \
+ set fs_package_id [dotlrn_community::get_applet_package_id \
-community_id $community_id \
- -package_key [dotlrn_fs::package_key]
+ -applet_key [dotlrn_fs::applet_key]
]
# map the fs root folder to the package_id of the new forums pkg
Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v
diff -u -N -r1.31 -r1.32
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 29 May 2002 23:00:25 -0000 1.31
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 13 Jul 2002 00:13:09 -0000 1.32
@@ -47,6 +47,13 @@
return "Core DotLRN Applets"
}
+ ad_proc -public my_package_key {
+ } {
+ What's my package key?
+ } {
+ return "dotlrn-dotlrn"
+ }
+
ad_proc -public applet_key {
} {
} {
@@ -57,7 +64,7 @@
} {
Add the applet to dotlrn - one time init - must be repeatable!
} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
ad_proc -public remove_applet {
Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl,v
diff -u -N -r1.14 -r1.15
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 29 May 2002 23:00:25 -0000 1.14
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 13 Jul 2002 00:13:09 -0000 1.15
@@ -45,14 +45,27 @@
return "Group Members Info"
}
+ ad_proc -public my_package_key {
+ } {
+ What's my package key?
+ } {
+ return "dotlrn-dotlrn"
+ }
+
+ ad_proc -public applet_key {
+ } {
+ What's my package key?
+ } {
+ return dotlrn_members
+ }
+
ad_proc -public add_applet {
} {
Add the dotlrn applet to dotlrn - one time init - must be repeatable!
} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_members"
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
-
ad_proc -public remove_applet {
package_id
} {
Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl,v
diff -u -N -r1.11 -r1.12
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 29 May 2002 23:00:25 -0000 1.11
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 13 Jul 2002 00:13:09 -0000 1.12
@@ -45,11 +45,25 @@
return "dotLRN Staff List Info"
}
+ ad_proc -public my_package_key {
+ } {
+ What's my package key?
+ } {
+ return "dotlrn-dotlrn"
+ }
+
+ ad_proc -public applet_key {
+ } {
+ What's my package key?
+ } {
+ return dotlrn_members_staff
+ }
+
ad_proc -public add_applet {
} {
Add the dotlrn applet to dotlrn - one time init - must be repeatable!
} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_members_staff"
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
ad_proc -public add_applet_to_community {
Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v
diff -u -N -r1.35 -r1.36
--- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 4 Jun 2002 00:03:44 -0000 1.35
+++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 13 Jul 2002 00:13:10 -0000 1.36
@@ -36,6 +36,13 @@
return "dotlrn_faq"
}
+ ad_proc -public my_package_key {
+ } {
+ What's my package key?
+ } {
+ return "dotlrn-faq"
+ }
+
ad_proc -public package_key {
} {
What package is associated with this applet?
@@ -47,7 +54,7 @@
} {
Add the faq applet to dotlrn - one time init - must be repeatable!
} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
ad_proc -public remove_applet {
Index: openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl 9 Jul 2002 21:47:55 -0000 1.5
+++ openacs-4/packages/dotlrn-forums/tcl/dotlrn-forums-procs.tcl 13 Jul 2002 00:13:10 -0000 1.6
@@ -62,7 +62,7 @@
Must be repeatable!
} {
if {![dotlrn_applet::is_applet_mounted -url forums]} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
dotlrn_applet::mount -package_key [my_package_key] -url forums -pretty_name [get_pretty_name]
}
}
Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v
diff -u -N -r1.73 -r1.74
--- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 11 Jul 2002 05:00:26 -0000 1.73
+++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 13 Jul 2002 00:13:10 -0000 1.74
@@ -83,7 +83,7 @@
permission::revoke -party_id $party_id -object_id $folder_id -privilege write
permission::revoke -party_id $party_id -object_id $folder_id -privilege admin
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
# Mount the package
dotlrn_applet::mount -package_key [my_package_key] -url fs -pretty_name "File Storage"
@@ -673,7 +673,7 @@
} {
returns the URL for the dotlrn-fs package
} {
- return [site_node::get_url_from_object_id -object_id [get_package_id]]
+ return [lindex [site_node::get_url_from_object_id -object_id [get_package_id]] 0]
}
ad_proc -private get_public_folder_id {
Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v
diff -u -N -r1.24 -r1.25
--- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 29 May 2002 23:00:25 -0000 1.24
+++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 13 Jul 2002 00:13:10 -0000 1.25
@@ -50,7 +50,7 @@
} {
One time init - must be repeatable!
} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
ad_proc -public remove_applet {
Index: openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl,v
diff -u -N -r1.23 -r1.24
--- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 29 May 2002 23:00:25 -0000 1.23
+++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 13 Jul 2002 00:13:10 -0000 1.24
@@ -66,7 +66,7 @@
-pretty_name [get_pretty_name]
}
- dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
}
ad_proc -public remove_applet {
Index: openacs-4/packages/faq-portlet/www/faq-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/www/faq-admin-portlet.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/faq-portlet/www/faq-admin-portlet.tcl 22 Jun 2002 20:11:03 -0000 1.3
+++ openacs-4/packages/faq-portlet/www/faq-admin-portlet.tcl 13 Jul 2002 00:13:10 -0000 1.4
@@ -45,6 +45,6 @@
and o.context_id = :package_id
}
-set url [site_node::get_url_from_object_id -object_id $package_id]
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
ad_return_template
Index: openacs-4/packages/forums-portlet/www/forums-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/forums-portlet/www/forums-admin-portlet.tcl,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/forums-portlet/www/forums-admin-portlet.tcl 22 Jun 2002 20:11:03 -0000 1.3
+++ openacs-4/packages/forums-portlet/www/forums-admin-portlet.tcl 13 Jul 2002 00:13:10 -0000 1.4
@@ -40,7 +40,7 @@
where package_id = :package_id
}
-set url [site_node::get_url_from_object_id -object_id $package_id]
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
set package_id [ad_conn package_id]
set default_name [db_string select_package_name {
Index: openacs-4/packages/news-portlet/www/news-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-admin-portlet.tcl,v
diff -u -N -r1.5 -r1.6
--- openacs-4/packages/news-portlet/www/news-admin-portlet.tcl 22 Jun 2002 20:11:03 -0000 1.5
+++ openacs-4/packages/news-portlet/www/news-admin-portlet.tcl 13 Jul 2002 00:13:10 -0000 1.6
@@ -36,6 +36,6 @@
set package_id [lindex $list_of_package_ids 0]
-set url [site_node::get_url_from_object_id -object_id $package_id]
+set url [lindex [site_node::get_url_from_object_id -object_id $package_id] 0]
ad_return_template