Index: openacs-4/packages/xowiki-includelet/COPYRIGHT =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/COPYRIGHT,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/COPYRIGHT 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,23 @@ + * xowiki-portlet + * + * Copyright (C) 2005-2008 Gustaf Neumann, neumann@wu-wien.ac.at + * + * Vienna University of Economics and Business Administration + * Institute of Information Systems and New Media + * A-1090, Augasse 2-6 + * Vienna, Austria + * + * This is a BSD-Style license applicable for the files in this + * directory and below, except when stated explicitly different. + * + * Permission to use, copy, modify, distribute, and sell this + * software and its documentation for any purpose is hereby granted + * without fee, provided that the above copyright notice appear in + * all copies and that both that copyright notice and this permission + * notice appear in supporting documentation. We make no + * representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied + * warranty. + * + + Index: openacs-4/packages/xowiki-includelet/xowiki-includelet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/xowiki-includelet.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/xowiki-includelet.info 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,32 @@ + + + + + Xowiki Includelet + Xowiki Includelets + f + f + + + Don Baccus + 2008-07-30 + OpenACS + GPL + 0 + + + + + + + + + + + + + + + + + Index: openacs-4/packages/xowiki-includelet/catalog/xowiki-includelet.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/catalog/xowiki-includelet.de_DE.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/catalog/xowiki-includelet.de_DE.ISO-8859-1.xml 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,14 @@ + + + + Xowiki Portlet + Xowiki Portlets verwalten + Alle Wiki-Seiten bereits als Portlets in Verwendung + Gruppen-Wiki + + Zum + Name + Neu + Neue Seite hinzuf�gen + Entferne Portlet + Index: openacs-4/packages/xowiki-includelet/catalog/xowiki-includelet.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/catalog/xowiki-includelet.en_US.ISO-8859-1.xml,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/catalog/xowiki-includelet.en_US.ISO-8859-1.xml 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,14 @@ + + + + Xowiki Portlet + Xowiki Portlet Administration + All pages are used, no unused pages available + Community Wiki + + Manage Pages of + Name + New + New %element_pretty_name% + Remove Portlet + Index: openacs-4/packages/xowiki-includelet/lib/xowiki-admin-includelet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/lib/xowiki-admin-includelet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/lib/xowiki-admin-includelet.adp 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,15 @@ + +#xowiki-includelet.manage-pages# #xowiki-includelet.community-wiki# + + No community specified + + + +@form;noquote@ + Index: openacs-4/packages/xowiki-includelet/lib/xowiki-admin-includelet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/lib/xowiki-admin-includelet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/lib/xowiki-admin-includelet.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,64 @@ +ad_page_contract { The display logic for the xowiki admin portlet + + @author Michael Totschnig + @author Gustaf Neumann + @cvs_id $Id: xowiki-admin-includelet.tcl,v 1.1 2008/08/02 12:48:57 donb Exp $ +} + +set base_url [site_node::get_url_from_object_id -object_id $package_id] +::xowiki::Package initialize -package_id $package_id + +if {![info exists referer] && [exists_and_not_null return_url]} { + set referer $return_url +} + +if {![info exists referer]} { + set referer [ad_conn url] +} + +set pageset_id [layout::page::get_column_value \ + -page_id [layout::element::get_column_value \ + -element_id $element_id \ + -column page_id] \ + -column pageset_id] + +db_multirow content select_content { + select m.element_id, m.title as pretty_name, lep.value as name + from layout_elements m, layout_element_parameters lep + where m.package_id = :package_id + and lep.element_id = m.element_id and lep.key = 'page_name' +} {} + +# don't ask to insert same page twice +template::multirow foreach content {set used_page_id($name) 1} + +set options "" +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 = bt.revision_id" \ + -orderby "ci.name" \ + ] { + if {[regexp {^::[0-9]} $name]} continue + if {[info exists used_page_id($name)]} continue + append options "" + } + + +if {$options ne ""} { + set form [subst { +
+ + + + #xowiki-portlet.new_xowiki_admin_portlet# + +
+ }] +} else { + set form "All pages already used" +} Index: openacs-4/packages/xowiki-includelet/lib/xowiki-element-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/lib/xowiki-element-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/lib/xowiki-element-add.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + + Add an xowiki portlet with the given page name. This is intended to be included + by the layout manager's execute include helper. + + @author Don Baccus (dhogaza@pacifier.com) + @creation-date 2008-07-31 + @cvs-id $Id: xowiki-element-add.tcl,v 1.1 2008/08/02 12:48:57 donb Exp $ +} { + pageset_id:integer,notnull + package_id:integer,notnull + page_name:notnull +} + +layout::element::new \ + -pageset_id $pageset_id \ + -package_id:required \ + -includelet_name xowiki-includelet \ + -title $page_name \ + -parameters [list page_name $page_name] + Index: openacs-4/packages/xowiki-includelet/lib/xowiki-includelet.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/lib/xowiki-includelet.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/lib/xowiki-includelet.adp 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,2 @@ + + Index: openacs-4/packages/xowiki-includelet/lib/xowiki-includelet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/lib/xowiki-includelet.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/lib/xowiki-includelet.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1 @@ +set url [site_node::get_url_from_object_id -object_id $package_id]$page_name Index: openacs-4/packages/xowiki-includelet/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/tcl/apm-callback-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/tcl/apm-callback-procs.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,45 @@ +ad_library { + + Xowiki includelet for use with the layout manager + + @creation-date 2008-07-16 + @author Don Baccus + @version $Id: apm-callback-procs.tcl,v 1.1 2008/08/02 12:48:57 donb Exp $ +} + +namespace eval xowiki_includelet::install {} + +ad_proc -private xowiki_includelet::install::package_install {} { + Package installation callback proc +} { + + db_transaction { + + # Admin includelet + layout::includelet::new \ + -name xowiki_admin_includelet \ + -description "Displays xowiki admin includelet" \ + -title #xowiki-includelet.admin_includelet_pretty_name# \ + -application xowiki \ + -template /packages/xowiki-includelet/lib/xowiki-admin-includelet \ + -required_privilege admin \ + -initializer xowiki_includelet_utilities::configure_admin_includelet + + # User includelet + layout::includelet::new \ + -name xowiki_includelet \ + -description "Displays the xowiki includelet" \ + -title #xowiki-includelet.admin_includelet_element_pretty_name# \ + -application xowiki \ + -template /packages/xowiki-includelet/lib/xowiki-includelet \ + -internally_managed_p t + } +} + +ad_proc -private xowiki_includelet::install::package_uninstall {} { + Package uninstallation callback proc +} { + layout::includelet::delete -name xowiki_includelet + layout::includelet::delete -name xowiki_admin_includelet +} + Index: openacs-4/packages/xowiki-includelet/tcl/xowiki-includelet-utility-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/tcl/xowiki-includelet-utility-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/tcl/xowiki-includelet-utility-procs.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,27 @@ +ad_library { + + Initialize an instance of the xowiki includelet + + @author Don Baccus (dhogaza@pacifier.com) + @cvs-id $Id: xowiki-includelet-utility-procs.tcl,v 1.1 2008/08/02 12:48:57 donb Exp $ + +} + +namespace eval xowiki_includelet_utilities {} + +ad_proc xowiki_includelet_utilities::configure_admin_includelet { + element_id +} { + Mount the friggin' package if necessary. Called by the admin includelet. + + @param element_id The xowiki includelet + +} { + set node_id [site_node::get_node_id_from_object_id \ + -object_id [layout::element::get_column_value \ + -element_id $element_id \ + -column package_id]] + if { [site_node::get_children -node_id $node_id -package_key xowiki-includelet] eq "" } { + subsite::auto_mount_application -node_id $node_id xowiki-includelet + } +} Index: openacs-4/packages/xowiki-includelet/www/admin/layout-element-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/www/admin/layout-element-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/www/admin/layout-element-add.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,49 @@ +ad_page_contract { + Add an element to a given pageset + + @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) + @author Don Baccus + @creation-date 2008-07-31 + @cvs-id $Id: layout-element-add.tcl,v 1.1 2008/08/02 12:48:57 donb Exp $ + + @param object_type show objects of this class and its subclasses + +} { + pageset_id:integer,notnull + package_id:integer,notnull + page_name:notnull + referer:notnull +} + +set xowiki_package_id $package_id +::xowiki::Package initialize -package_id $xowiki_package_id + +set page_id [$package_id resolve_request -path $page_name method] + +if {$page_id eq ""} { + # + # If a page with the given name does not exist, return an error. + # + ad_return_error \ + [_ xowiki.portlet_page_does_not_exist_error_short] \ + [_ xowiki.portlet_page_does_not_exist_error_long $page_name] +} else { + # + # The page exists, get the title of the page... + # + set page_title [$page_id title] + + db_transaction { + layout::element::new \ + -pageset_id $pageset_id \ + -package_id $xowiki_package_id \ + -includelet_name xowiki_includelet \ + -title $page_title \ + -parameters [list page_name $page_name] \ + -initialize + } + ad_returnredirect $referer + } +} +ad_script_abort + Index: openacs-4/packages/xowiki-includelet/www/admin/layout-element-remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-includelet/www/admin/layout-element-remove.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki-includelet/www/admin/layout-element-remove.tcl 2 Aug 2008 12:48:57 -0000 1.1 @@ -0,0 +1,19 @@ +ad_page_contract { + + Remove an element from a given pageset + + @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) + @author Don Baccus + @creation-date 2008-07-31 + @cvs-id $Id: layout-element-remove.tcl,v 1.1 2008/08/02 12:48:57 donb Exp $ + +} { + element_id:integer,notnull + referer:notnull +} + +layout::element::delete -element_id $element_id +# redirect and abort +ad_returnredirect $referer +ad_script_abort +