Index: openacs-4/packages/xowiki-portlet/xowiki-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/xowiki-portlet.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/xowiki-portlet.info 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,31 @@ + + + + + Xowiki Portlet + Xowiki Portlets + f + t + + + Michael Totschnig + Gustaf Neumann + 2007-01-28 + OpenACS + 0 + + + + + + + + + + + + + + + + Index: openacs-4/packages/xowiki-portlet/catalog/xowiki-portlet.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/catalog/xowiki-portlet.de_DE.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/catalog/xowiki-portlet.de_DE.ISO-8859-1.xml 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,9 @@ + + + + Xowiki Portlet + Xowiki Portlets verwalten + Neues %element_pretty_name% + Name + Neu + Index: openacs-4/packages/xowiki-portlet/catalog/xowiki-portlet.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/catalog/xowiki-portlet.en_US.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/catalog/xowiki-portlet.en_US.ISO-8859-1.xml 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,9 @@ + + + + Xowiki Portlet + Xowiki Portlet Administration + New %element_pretty_name% + Name + New + Index: openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-admin-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/sql/postgresql/Attic/xowiki-portlet-admin-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-admin-drop.sql 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,118 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- 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. +-- + +-- +-- xowiki-portlet-admin-drop.sql +-- + +-- Deletes a portal datasource for the static portlet factory +-- (admin interface) + +-- Copyright (C) 2001 MIT +-- @author Arjun Sanyal (arjun@openforce.net) + +-- $Id: xowiki-portlet-admin-drop.sql,v 1.1 2007/01/31 10:52:47 gustafn 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 +-- +-- PostGreSQL port samir@symphinity.com 11 July 2002 +-- + + + +create function inline_1() +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + select datasource_id into ds_id + from portal_datasources + where name = ''xowiki_admin_portlet''; + + if not found then + RAISE EXCEPTION '' No datasource id found '', ds_id; + ds_id := null; + end if; + + if ds_id is NOT null then + perform portal_datasource__delete(ds_id); + end if; + + -- drop the hooks + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''GetMyName'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''GetPrettyName'' + ); + + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''Link'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''AddSelfToPage'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''Show'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''Edit'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''RemoveSelfFromPage'' + ); + + -- Drop the binding + perform acs_sc_binding__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'' + ); + + -- drop the impl + perform acs_sc_impl__delete ( + ''portal_datasource'', + ''xowiki_admin_portlet'' + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1(); +drop function inline_1(); + Index: openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-admin.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/sql/postgresql/Attic/xowiki-portlet-admin.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-admin.sql 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,190 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- 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. +-- + +-- +-- xowiki-admin-portlet.sql +-- + +-- Creates a portal datasource for the xowiki portlet factory +-- (admin interface) + +-- Copyright (C) 2001 MIT +-- @author Arjun Sanyal (arjun@openforce.net) + +-- $Id: xowiki-portlet-admin.sql,v 1.1 2007/01/31 10:52:47 gustafn 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 +-- +-- PostGreSQL port samir@symphinity.com 11 July 2002 +-- + +create function inline_0() +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource__new( + ''xowiki_admin_portlet'', -- name + ''Displays the admin interface for the xowiki data portlets'' -- Description + ); + + -- 4 defaults procs + + -- shadeable_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''shadeable_p'', -- key + ''f'' -- value +); + + -- shaded_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' +); + + -- hideable_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''t'' +); + + -- user_editable_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' +); + + -- link_hideable_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' +); + + + -- xowiki-admin-specific procs + + -- package_id must be configured + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '''' +); + return 0; +end;' language 'plpgsql'; + +select inline_0(); + +drop function inline_0(); + + +create function inline_1() +returns integer as ' +begin + -- create the implementation + perform acs_sc_impl__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''xowiki_admin_portlet'' + ); + + -- add all the hooks + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''GetMyName'', + ''xowiki_admin_portlet::get_my_name'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''GetPrettyName'', + ''xowiki_admin_portlet::get_pretty_name'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''Link'', + ''xowiki_admin_portlet::link'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''AddSelfToPage'', + ''xowiki_admin_portlet::add_self_to_page'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''Show'', + ''xowiki_admin_portlet::show'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''Edit'', + ''xowiki_admin_portlet::edit'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_admin_portlet'', + ''RemoveSelfFromPage'', + ''xowiki_admin_portlet::remove_self_from_page'', + ''TCL'' + ); + + -- Add the binding + perform acs_sc_binding__new ( + ''portal_datasource'', -- contract_name + ''xowiki_admin_portlet'' -- impl_name + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1(); + +drop function inline_1(); Index: openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/sql/postgresql/Attic/xowiki-portlet-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-create.sql 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- 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. +-- +-- +-- PostGreSQL port samir@symphinity.com 11 July 2002 +-- +\i xowiki-portlet-portlet.sql +\i xowiki-portlet-admin.sql Index: openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/sql/postgresql/Attic/xowiki-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-drop.sql 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,20 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- 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. +-- +-- +-- PostGreSQL port samir@symphinity.com 11 July 2002 +-- +\i xowiki-portlet-portlet-drop.sql +\i xowiki-portlet-admin-drop.sql Index: openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-portlet-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/sql/postgresql/Attic/xowiki-portlet-portlet-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-portlet-drop.sql 31 Jan 2007 10:52:47 -0000 1.1 @@ -0,0 +1,121 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- 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. +-- + +-- +-- xowiki-portlet-portlet-drop.sql +-- + +-- Deletes a portal datasource for the xowiki portlet factory + +-- Copyright (C) 2001 MIT +-- @author Arjun Sanyal (arjun@openforce.net) + +-- $Id: xowiki-portlet-portlet-drop.sql,v 1.1 2007/01/31 10:52:47 gustafn 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 +-- +-- PostGreSQL port samir@symphinity.com 11 July 2002 +-- + + + +create function inline_1() +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + + select datasource_id into ds_id + from portal_datasources + where name = ''xowiki_portlet''; + + if not found then + RAISE EXCEPTION '' No datasource id found '', ds_id; + ds_id := null; + end if; + + if ds_id is NOT null then + perform portal_datasource__delete(ds_id); + end if; + + -- drop the hooks + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''GetMyName'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''GetPrettyName'' + ); + + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''Link'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''AddSelfToPage'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''Show'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''Edit'' + ); + + perform acs_sc_impl_alias__delete ( + ''portal_datasource'', + ''xowiki_portlet'', + ''RemoveSelfFromPage'' + ); + + -- Drop the binding + perform acs_sc_binding__delete ( + ''portal_datasource'', + ''xowiki_portlet'' + ); + + -- drop the impl + perform acs_sc_impl__delete ( + ''portal_datasource'', + ''xowiki_portlet'' + ); + + return 0; +end;' language 'plpgsql'; + +select inline_1(); +drop function inline_1(); + + + + + Index: openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/sql/postgresql/Attic/xowiki-portlet-portlet.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/sql/postgresql/xowiki-portlet-portlet.sql 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1,201 @@ +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- 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. +-- + +-- +-- xowiki-portlet-portlet.sql +-- + +-- Creates a portal datasource for the xowiki portlet factory + +-- Copyright (C) 2001 MIT +-- @author Arjun Sanyal (arjun@openforce.net) + +-- $Id: xowiki-portlet-portlet.sql,v 1.1 2007/01/31 10:52:48 gustafn 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 +-- +-- PostGreSQL port samir@symphinity.com 11 July 2002 +-- + + +create function inline_0() +returns integer as ' +declare + ds_id portal_datasources.datasource_id%TYPE; +begin + ds_id := portal_datasource__new( + ''xowiki_portlet'', -- name + ''Displays an xowiki page as a portlet'' -- description + ); + + -- 4 defaults procs + + -- shadeable_p + perform portal_datasource__set_def_param ( + ds_id, -- datasource_id + ''t'', -- config_required_p + ''t'', -- configured_p + ''shadeable_p'', -- key + ''t'' -- value + ); + + -- shaded_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''shaded_p'', + ''f'' + ); + + -- hideable_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''hideable_p'', + ''t'' + ); + + -- user_editable_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''user_editable_p'', + ''f'' +); + + -- link_hideable_p + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''t'', + ''link_hideable_p'', + ''t'' +); + + + -- xowiki-specific procs + + -- package_id must be configured + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''package_id'', + '''' +); + + perform portal_datasource__set_def_param ( + ds_id, + ''t'', + ''f'', + ''page_name'', + '''' +); + + return 0; +end;' language 'plpgsql'; + +select inline_0(); + +drop function inline_0(); + + +create function inline_1() +returns integer as ' +begin + + -- create the implementation + perform acs_sc_impl__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''xowiki_portlet'' + ); + + -- add all the hooks + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''GetMyName'', + ''xowiki_portlet::get_my_name'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''GetPrettyName'', + ''xowiki_portlet::get_pretty_name'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''Link'', + ''xowiki_portlet::link'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''AddSelfToPage'', + ''xowiki_portlet::add_self_to_page'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''Show'', + ''xowiki_portlet::show'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''Edit'', + ''xowiki_portlet::edit'', + ''TCL'' + ); + + perform acs_sc_impl_alias__new ( + ''portal_datasource'', + ''xowiki_portlet'', + ''RemoveSelfFromPage'', + ''xowiki_portlet::remove_self_from_page'', + ''TCL'' + ); + + -- Add the binding + perform acs_sc_binding__new ( + ''portal_datasource'', -- contract_name + ''xowiki_portlet'' -- impl_name + ); + + + return 0; +end;' language 'plpgsql'; + +select inline_1(); + +drop function inline_1(); Index: openacs-4/packages/xowiki-portlet/tcl/xowiki-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/tcl/xowiki-admin-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/tcl/xowiki-admin-portlet-procs.tcl 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1,85 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# 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. +# +ad_library { + + Procedures to support the xowiki ADMIN portlet + + @author arjun@openforce.net + @cvs-id $Id: xowiki-admin-portlet-procs.tcl,v 1.1 2007/01/31 10:52:48 gustafn Exp $ +} + +namespace eval xowiki_admin_portlet { + + ad_proc -private get_my_name { + } { + return "xowiki_admin_portlet" + } + + ad_proc -public get_pretty_name { + } { + return [parameter::get_from_package_key \ + -package_key [my_package_key] \ + -parameter xowiki_admin_portlet_pretty_name] + } + + ad_proc -private my_package_key { + } { + return "xowiki-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a xowiki admin PE to the given portal + } { + return [portal::add_element_parameters \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value $package_id + ] + ns_log notice "end of add_self_to_page" + } + + ad_proc -public remove_self_from_page { + {-portal_id:required} + } { + Removes xowiki PE from the given page + } { + # This is easy since there's one and only one instace_id + portal::remove_element \ + -portal_id $portal_id \ + -portlet_name [get_my_name] + } + + ad_proc -public show { + cf + } { + Display the PE + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "xowiki-admin-portlet" + } + +} Index: openacs-4/packages/xowiki-portlet/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/tcl/xowiki-portlet-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/tcl/xowiki-portlet-procs.tcl 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1,73 @@ +# +# Copyright (C) 2001, 2002 MIT +# +# 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. +# + +ad_library { + + Procedures to supports xowiki portlets. +} + +namespace eval xowiki_portlet { + + ad_proc -private get_my_name { + } { + return "xowiki_portlet" + } + + ad_proc -public get_pretty_name { + } { + return "" + } + + ad_proc -private my_package_key { + } { + return "xowiki-portlet" + } + + ad_proc -public link { + } { + return "" + } + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} + } { + Adds a static PE to the given page + } { + ns_log notice "xowiki_portlet::add_self_to_page - Don't call me. Use static_portal_content:: instead" + error + } + + ad_proc -public remove_self_from_page { + portal_id + element_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 show { + cf + } { + } { + portal::show_proc_helper \ + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "xowiki-portlet" + } +} Index: openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.adp 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1,15 @@ + +Manage Pages of XoWiki + + No community specified + + + +@form;noquote@ + Index: openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1,79 @@ +ad_page_contract { + The display logic for the xowiki admin portlet + + @author Michael Totschnig + @author Gustaf Neumann + @cvs_id $Id: xowiki-admin-portlet.tcl,v 1.1 2007/01/31 10:52:48 gustafn Exp $ +} { + package_id:optional + template_portal_id:optional + referer:optional + return_url:optional +} + +if {![exists_and_not_null package_id]} { + set package_id [dotlrn_community::get_community_id] +} + +if { $package_id ne "" } { + + if {![exists_and_not_null template_portal_id]} { + set template_portal_id [dotlrn_community::get_portal_id] + } + + if {[exists_and_not_null return_url]} { + set referer $return_url + } + + if {![exists_and_not_null referer]} { + set referer [ad_conn url] + } + + set element_pretty_name [parameter::get \ + -parameter xowiki_admin_portlet_element_pretty_name \ + -default [_ xowiki-portlet.admin_portlet_element_pretty_name]] + + db_multirow content select_content \ + "select m.element_id, m.pretty_name, pep.value as name + from portal_element_map m, portal_pages p, portal_element_parameters pep + where m.page_id = p.page_id + and p.portal_id = $template_portal_id + and m.datasource_id = [portal::get_datasource_id [xowiki_portlet::get_my_name]] + and pep.element_id = m.element_id and pep.key = 'page_name'" {} + + # don't ask to insert same page twice + template::multirow foreach content {set used_page_id($name) 1} + + array set config $cf + set options "" + ::xowiki::Package initialize -package_id $config(package_id) + db_foreach instance_select \ + [::xowiki::Page instance_select_query \ + -folder_id [::$package_id folder_id] \ + -with_subtypes true \ + -from_clause ", xowiki_page P" \ + -where_clause "P.page_id = cr.revision_id" \ + -order_clause "order by ci.name" \ + ] { + if {[regexp {^::[0-9]} $name]} continue + if {[info exists used_page_id($name)]} continue + append options "" + } + + if {$options ne ""} { + set form [subst { +
+ + + Add #xowiki-portlet.new_xowiki_admin_portlet# + +
+ }] + } else { + set form "All pages already used" + } + + set applet_url [$package_id package_url] +} Index: openacs-4/packages/xowiki-portlet/www/xowiki-portlet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/www/xowiki-portlet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/www/xowiki-portlet.adp 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1 @@ + Index: openacs-4/packages/xowiki-portlet/www/xowiki-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/www/xowiki-portlet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-portlet/www/xowiki-portlet.tcl 31 Jan 2007 10:52:48 -0000 1.1 @@ -0,0 +1,2 @@ +array set config $cf +regsub {/[^/]+$} [ad_conn url] "/xowiki/$config(page_name)" url