Index: openacs-4/packages/dotlrn-static/sql/oracle/dotlrn-static-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/sql/oracle/dotlrn-static-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-static/sql/oracle/dotlrn-static-create.sql 15 Feb 2002 21:10:06 -0000 1.1 @@ -0,0 +1,98 @@ +-- +-- The dotlrn applet for the STATIC data portlet +-- copyright 2001, OpenForce +-- distributed under GPL v2.0 +-- +-- +-- arjun@openforce.net +-- +-- $Id: dotlrn-static-create.sql,v 1.1 2002/02/15 21:10:06 arjun Exp $ +-- + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'dotlrn_applet', + 'dotlrn_static', + 'dotlrn_static' + ); + + -- add all the hooks + + -- GetPrettyName + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'GetPrettyName', + 'dotlrn_static::get_pretty_name', + 'TCL' + ); + + -- AddApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'AddApplet', + 'dotlrn_static::add_applet', + 'TCL' + ); + + + -- AddAppletToCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'AddAppletToCommunity', + 'dotlrn_static::add_applet_to_community', + 'TCL' + ); + + + + -- RemoveApplet + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'RemoveApplet', + 'dotlrn_static::remove_applet', + 'TCL' + ); + + -- AddUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'AddUser', + 'dotlrn_static::add_user', + 'TCL' + ); + + -- AddUserToCommunity + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'AddUserToCommunity', + 'dotlrn_static::add_user_to_community', + 'TCL' + ); + + -- RemoveUser + foo := acs_sc_impl.new_alias ( + 'dotlrn_applet', + 'dotlrn_static', + 'RemoveUser', + 'dotlrn_static::remove_user', + 'TCL' + ); + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'dotlrn_applet', + impl_name => 'dotlrn_static' + ); +end; +/ +show errors + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 15 Feb 2002 21:10:06 -0000 1.1 @@ -0,0 +1,156 @@ +# +# Procs for DOTLRN static Applet +# Copyright 2001 OpenForce, inc. +# Distributed under the GNU GPL v2 +# +# arjun@openforce.net +# +# $Id: dotlrn-static-procs.tcl,v 1.1 2002/02/15 21:10:06 arjun Exp $ + +ad_library { + + Procs for the dotLRN Static applet + + @author arjun@openforce.net +} + +namespace eval dotlrn_static { + + ad_proc -private my_package_key { + } { + return "dotlrn-static" + } + + ad_proc -public applet_key {} { + get the applet key + } { + return "dotlrn_static" + } + + ad_proc -public package_key { + } { + Get the package_key this applet deals with. + + This is _unlike_ a package like bboard since there's + no "static" package but a combined "static-portlet" + package. I named it "static-portlet" instead of + "static" since it's tied to (new-portal) so strongly + } { + return "static-portlet" + } + + ad_proc -public get_pretty_name { + } { + returns the pretty name + } { + return "dotLRN static data" + } + + ad_proc -public add_applet { + } { + Add the static applet to dotlrn - for one-time init + Must be repeatable! + } { + dotlrn_community::add_applet_to_dotlrn \ + -applet_key [applet_key] + } + + ad_proc -public add_applet_to_community { + community_id + } { + Add the static applet to a dotlrn community + } { + # Create and Mount myself at /static under the community + set instance_id [dotlrn::instantiate_and_mount \ + -mount_point "static" $community_id [package_key]] + + # get the portal_template_id by callback + set pt_id [dotlrn_community::get_portal_template_id $community_id] + + # set up the DS for the portal template + static_portlet::make_self_available $pt_id + static_portlet::add_self_to_page $pt_id $instance_id + + # set up the DS for the admin page + set admin_portal_id \ + [dotlrn_community::get_community_admin_portal_id $community_id] + static_admin_portlet::make_self_available $admin_portal_id + static_admin_portlet::add_self_to_page $admin_portal_id $instance_id + + # FIXME aks - perms? + + # return the instance_id + return $instance_id + } + + ad_proc -public remove_applet { + community_id + package_id + } { + remove the applet from the community + } { + # Remove all instances of the static portlet! + # Killing the package + } + + ad_proc -public add_user { + community_id + } { + Called when the user is initially added as a dotlrn user. + For one-time init stuff + + } { + + } + + + ad_proc -public add_user_to_community { + community_id + user_id + } { + Add a user to a specific dotlrn community + } { + # Get the portal_id by callback + set portal_id \ + [dotlrn_community::get_portal_id $community_id $user_id] + + # Get the package_id by callback + set package_id \ + [dotlrn_community::get_applet_package_id \ + $community_id \ + [applet_key] + + # Make static DS available to this page + static_portlet::make_self_available $portal_id + + # Call the portal element to be added correctly + static_portlet::add_self_to_page $portal_id $package_id + + # don't muck with the user workspace page for now + } + + ad_proc -public remove_user { + community_id + user_id + } { + Remove a user from a community + } { + # Get the portal_id + set portal_id \ + [dotlrn_community::get_portal_id $community_id $user_id] + + # Get the package_id by callback + set package_id \ + [dotlrn_community::get_applet_package_id \ + $community_id \ + [applet_key]] + + # Remove the portal element + static_portlet::remove_self_from_page $portal_id $package_id + + # Buh Bye. + static_portlet::make_self_unavailable $portal_id + + # perms? wsp? + } +} Index: openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,181 @@ +-- +-- static-admin-portlet.sql +-- + +-- Creates a portal datasource for the static portlet factory +-- (admin interface) + +-- Copyright (C) 2001 OpenForce, Inc. +-- @author Arjun Sanyal (arjun@openforce.net) + +-- $Id: static-admin-portlet.sql,v 1.1 2002/02/15 21:10:44 arjun Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource.new( + name => 'static_admin_portlet', + description => 'Displays the admin interface for the static data portlets' + ); + + -- 4 defaults procs + + -- shadeable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 'f' +); + + -- shaded_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' +); + + -- hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 't' +); + + -- user_editable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' +); + + -- link_hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' +); + + + -- static-admin-specific procs + + -- Instance_id must be configured + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'instance_id', + value => '' +); + + +end; +/ +show errors + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'portal_datasource', + 'static_admin_portlet', + 'static_admin_portlet' + ); + + -- add all the hooks + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'MyName', + 'static_admin_portlet::my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'GetPrettyName', + 'static_admin_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'Link', + 'static_admin_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'AddSelfToPage', + 'static_admin_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'Show', + 'static_admin_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'Edit', + 'static_admin_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'RemoveSelfFromPage', + 'static_admin_portlet::remove_self_from_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'MakeSelfAvailable', + 'static_admin_portlet::make_self_available', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_admin_portlet', + 'MakeSelfUnavailable', + 'static_admin_portlet::make_self_unavailable', + 'TCL' + ); + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'portal_datasource', + impl_name => 'static_admin_portlet' + ); +end; +/ +show errors + Index: openacs-4/packages/static-portlet/sql/oracle/static-core.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-core.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/sql/oracle/static-core.sql 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,138 @@ +-- +-- static-core.sql +-- +-- arjun@openforce.net +-- +-- The core DM and API for static portal content +-- +-- $Id: static-core.sql,v 1.1 2002/02/15 21:10:44 arjun Exp $ +-- + +-- +-- Datamodel +-- +create table static_portal_content ( + content_id constraint static_p_c_fk + references acs_objects(object_id) + constraint static_p_c_pk + primary key, + instance_id constraint static_p_c_instance_id_nn + not null + constraint static_p_c_instance_id_fk + references apm_packages (package_id) + on delete cascade, + content varchar2(4000) +); + + +-- +-- Objects +-- +begin + acs_object_type.create_type ( + supertype => 'acs_object', + object_type => 'static_portal_content', + pretty_name => 'Static Content', + pretty_plural => 'Static Content', + table_name => 'static_portal_content', + id_column => 'content_id' + ); +end; +/ +show errors + +-- +-- API +-- + +create or replace package static_portal_content +as + function new ( + content_id in static_portal_content.content_id%TYPE default null, + instance_id in static_portal_content.instance_id%TYPE default null, + content in static_portal_content.content%TYPE default null, + object_type in acs_objects.object_type%TYPE default 'static_portal_content', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return acs_objects.object_id%TYPE; + + procedure delete ( + content_id in static_portal_content.content_id%TYPE + ); + +end static_portal_content; +/ +show errors + +create or replace package body static_portal_content +as + function new ( + f_instance_id in static_portal_content.instance_id%TYPE default null, + f_content in static_portal_content.content%TYPE default null, + f_object_type in acs_objects.object_type%TYPE default 'static_portal_content', + f_creation_date in acs_objects.creation_date%TYPE default sysdate, + f_creation_user in acs_objects.creation_user%TYPE default null, + f_creation_ip in acs_objects.creation_ip%TYPE default null, + f_context_id in acs_objects.context_id%TYPE default null + ) return acs_objects.object_id%TYPE; + is + v_content_id static_portal_content.content_id%TYPE; + begin + v_content_id := acs_object.new ( + f_object_type => object_type, + f_creation_date => creation_date, + f_creation_user => creation_user, + f_creation_ip => creation_ip, + f_context_id => context_id + ); + + insert into static_portal_content + (content_id, instance_id, content) + values + (v_content_id, f_instance_id, f_content); + + return v_content_id; + end new; + + procedure delete ( + p_content_id in static_portal_content.content_id%TYPE + ) + is + begin + delete from static_portal_content where content_id = p_content_id; + acs_object.delete(p_content_id); + end delete; + +end static_portal_content; +/ +show errors + +-- +-- perms +-- + +begin + acs_privilege.create_privilege('static_portal_create'); + acs_privilege.create_privilege('static_portal_read'); + acs_privilege.create_privilege('static_portal_delete'); + acs_privilege.create_privilege('static_portal_modify'); + acs_privilege.create_privilege('static_portal_admin'); + + -- set up the admin priv + + acs_privilege.add_child('static_portal_admin', 'static_portal_create'); + acs_privilege.add_child('static_portal_admin', 'static_portal_read'); + acs_privilege.add_child('static_portal_admin', 'static_portal_delete'); + acs_privilege.add_child('static_portal_admin', 'static_portal_modify'); + + -- bind privileges to global names + + acs_privilege.add_child('create','static_portal_create'); + acs_privilege.add_child('read','static_portal_read'); + acs_privilege.add_child('delete','static_portal_delete'); + acs_privilege.add_child('write','static_portal_modify'); + acs_privilege.add_child('admin','static_portal_admin'); +end; +/ Index: openacs-4/packages/static-portlet/sql/oracle/static-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/sql/oracle/static-portlet-create.sql 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,3 @@ +@static-core.sql +@static-portlet.sql +@static-admin-portlet.sql Index: openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,191 @@ +-- +-- static-portlet.sql +-- + +-- Creates a portal datasource for the static portlet factory + +-- Copyright (C) 2001 OpenForce, Inc. +-- @author Arjun Sanyal (arjun@openforce.net) + +-- $Id: static-portlet.sql,v 1.1 2002/02/15 21:10:44 arjun Exp $ + +-- This is free software distributed under the terms of the GNU Public +-- License version 2 or higher. Full text of the license is available +-- from the GNU Project: http://www.fsf.org/copyleft/gpl.html + +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource.new( + name => 'static_portlet', + description => 'Displays static data portlet' + ); + + -- 4 defaults procs + + -- shadeable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shadeable_p', + value => 't' +); + + -- shaded_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'shaded_p', + value => 'f' +); + + -- hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'hideable_p', + value => 't' +); + + -- user_editable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'user_editable_p', + value => 'f' +); + + -- link_hideable_p + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 't', + key => 'link_hideable_p', + value => 't' +); + + + -- static-specific procs + + -- instance_id must be configured + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'instance_id', + value => '' +); + + -- instance_id must be configured + portal_datasource.set_def_param ( + datasource_id => ds_id, + config_required_p => 't', + configured_p => 'f', + key => 'content_id', + value => '' +); + + + +end; +/ +show errors + + +declare + foo integer; +begin + -- create the implementation + foo := acs_sc_impl.new ( + 'portal_datasource', + 'static_portlet', + 'static_portlet' + ); + + -- add all the hooks + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'MyName', + 'static_portlet::my_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'GetPrettyName', + 'static_portlet::get_pretty_name', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'Link', + 'static_portlet::link', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'AddSelfToPage', + 'static_portlet::add_self_to_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'Show', + 'static_portlet::show', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'Edit', + 'static_portlet::edit', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'RemoveSelfFromPage', + 'static_portlet::remove_self_from_page', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'MakeSelfAvailable', + 'static_portlet::make_self_available', + 'TCL' + ); + + foo := acs_sc_impl.new_alias ( + 'portal_datasource', + 'static_portlet', + 'MakeSelfUnavailable', + 'static_portlet::make_self_unavailable', + 'TCL' + ); + + -- Add the binding + acs_sc_binding.new ( + contract_name => 'portal_datasource', + impl_name => 'static_portlet' + ); +end; +/ +show errors + + Index: openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,109 @@ +# /packages/dotlrn-static/tcl/static-admin-portlet-procs.tcl +ad_library { + +Procedures to support the static ADMIN portlet + +Copyright Openforce, Inc. +Licensed under GNU GPL v2 + +@author arjun@openforce.net +@cvs-id $Id: static-admin-portlet-procs.tcl,v 1.1 2002/02/15 21:10:44 arjun Exp $ + +} + +namespace eval static_admin_portlet { + + ad_proc -private my_name { + } { + return "static_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "Static Data Administration FIXME better name?" + } + + ad_proc -private my_package_key { + } { + return "static-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + portal_id + instance_id + } { + Adds a static PE to the given page with the instance key being + opaque data in the portal configuration. + } { + # we don't care if there are other instaces of the + # static portlet in this portal since this PE only has one + # and only one instace_id. i.e. There is no aggregation + # unlike bboard-portlet + + # Tell portal to add this element to the page + set element_id [portal::add_element $portal_id [my_name]] + + # Set the instace of "static" that this PE will know + portal::set_element_param $element_id instance_id $instance_id + + return $element_id + } + + ad_proc -public show { + cf + } { + Display the PE + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "static-admin-portlet" + } + + ad_proc -public edit { + element_id + } { + Display the PE's edit page + } { + return "" + } + + ad_proc -public remove_self_from_page { + portal_id + instance_id + } { + Removes static PE from the given page + } { + # This is easy since there's one and only one instace_id + portal::remove_element $element_id + } + + ad_proc -public make_self_available { + portal_id + } { + Wrapper for the portal:: proc + + @param portal_id + } { + portal::make_datasource_available \ + $portal_id [portal::get_datasource_id [my_name]] + } + + ad_proc -public make_self_unavailable { + portal_id + } { + Wrapper for the portal:: proc + + @param portal_id + } { + portal::make_datasource_unavailable \ + $portal_id [portal::get_datasource_id [my_name]] + } +} + + Index: openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,108 @@ +# /packages/dotlrn-static/tcl/static-portlet-procs.tcl +ad_library { + +Procedures to supports static portlets + +Copyright Openforce, Inc. +Licensed under GNU GPL v2 + +@author arjun@openforce.net +@cvs-id $Id: static-portlet-procs.tcl,v 1.1 2002/02/15 21:10:44 arjun Exp $ + +} + +namespace eval static_portlet { + + ad_proc -private my_name { + } { + return "static_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "FIXME maybe NULL?" + } + + ad_proc -private my_package_key { + } { + return "static-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + portal_id + instance_id + } { + Adds a static PE to the given page + } { + # we don't care if there are other instaces of the + # static portlet in this portal since this PE only has one + # and only one instace_id. i.e. There is no aggregation + # unlike bboard-portlet for instance + + # Tell portal to add this element to the page + set element_id [portal::add_element $portal_id [my_name]] + + # Set the instace of "static-portlet" that this PE will know + portal::set_element_param $element_id instance_id $instance_id + + return $element_id + } + + ad_proc -public show { + cf + } { + Display the PE + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "static-portlet" + } + + ad_proc -public edit { + element_id + } { + Display the PE's edit page + } { + return "" + } + + ad_proc -public remove_self_from_page { + portal_id + instance_id + } { + Removes static PE from the given page + } { + # This is easy since there's one and only one instace_id + portal::remove_element $element_id + } + + ad_proc -public make_self_available { + portal_id + } { + Wrapper for the portal:: proc + + @param portal_id + } { + portal::make_datasource_available \ + $portal_id [portal::get_datasource_id [my_name]] + } + + ad_proc -public make_self_unavailable { + portal_id + } { + Wrapper for the portal:: proc + + @param portal_id + } { + portal::make_datasource_unavailable \ + $portal_id [portal::get_datasource_id [my_name]] + } +} + + Index: openacs-4/packages/static-portlet/www/static-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/www/static-admin-portlet.adp 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,12 @@ + +No static elements + + + + +

+New static element Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,30 @@ +ad_page_contract { + The display logic for the static admin portlet + + @author arjun (arjun@openforce) + @author Ben Adida (ben@openforce) + @cvs_id $Id: static-admin-portlet.tcl,v 1.1 2002/02/15 21:10:44 arjun Exp $ +} -properties { + +} + +array set config $cf + +set instance_id $config(instance_id) + +# aks - i forget if this is a list, so just keep this stuff here +# +#if {[llength $list_of_instance_ids] > 1} { +# # We have a problem! +# return -code error "There should be only one instance of bboard for admin purposes" +#} +# +#set instance_id [lindex $list_of_instance_ids 0] +# + +db_multirow content select_content " +select content_id, short_name +from dotlrn_static_content +where instance_id = :instance_id" + +# set url [dotlrn_community::get_url_from_package_id -package_id $instance_id] Index: openacs-4/packages/static-portlet/www/static-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/www/static-portlet.adp 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1 @@ +aks FIXME here's the content: @content@ Index: openacs-4/packages/static-portlet/www/static-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-portlet/www/static-portlet.tcl 15 Feb 2002 21:10:44 -0000 1.1 @@ -0,0 +1,19 @@ +ad_page_contract { + The display logic for the STATIC portlet + + @author arjun (arjun@openforce) + @author Ben Adida (ben@openforce) + @cvs_id $Id: static-portlet.tcl,v 1.1 2002/02/15 21:10:44 arjun Exp $ +} + +array set config $cf + +# aks FIXME testing + +set query " +select content +from dotlrn_static_content +where instance_id = :instance_id)" + +# aks - maybe a list, i forget +set list_of_instance_ids $config(instance_id)