Index: openacs-4/packages/xowiki/COPYRIGHT =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/COPYRIGHT,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/COPYRIGHT 30 Dec 2005 00:09:53 -0000 1.1 @@ -0,0 +1,23 @@ + * xowiki + * + * Copyright (C) 2005 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/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/xowiki.info 15 Dec 2005 12:39:24 -0000 1.2 +++ openacs-4/packages/xowiki/xowiki.info 30 Dec 2005 00:09:53 -0000 1.3 @@ -8,11 +8,11 @@ f xowiki - + Gustaf Neumann A more generic xotcl-based wikis example with object types and subtypes based on the content repository (with category support) - 2005-12-14 + 2005-12-29 XoWiki is a wiki implementation for OpenACS in xotcl. Instead of trying to implement the full set of wiki markup commands of systems like MediaWiki, XoWiki is based on a rich text editor and focuses more on integration @@ -23,11 +23,11 @@ one could define book-structures (where a navigation structure could be built on the fly) or glossaries with differnt kind of word relationships (like synonyms, etc.). XoWiki supports pages in multiple languages and is localized (currently only for English and German). Currently, richtext and plaintext type entries are supported. Included support for adp-substitution in wiki pages and a file-selector. 0.13 supports page templates and uses the new generic form interface. Use of the oo layer for the content repository, reduced number of database interactions. 0 - + - + Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 15 Dec 2005 12:39:24 -0000 1.2 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 30 Dec 2005 00:09:57 -0000 1.3 @@ -9,23 +9,36 @@ -pretty_name "XoWiki Plain Page" -pretty_plural "XoWiki Plain Pages" \ -table_name "xowiki_plain_page" -id_column "ppage_id" \ -form ::xowiki::PlainWikiForm + + + # attribute support works only in 5.2.0 or newer. Since PageTemplate + # does not make much sense without PageInstance, we disable it as well. - ::Generic::CrClass create PageTemplate -superclass Page \ - -pretty_name "XoWiki Page Template" -pretty_plural "XoWiki Page Templates" \ - -table_name "xowiki_page_template" -id_column "page_template_id" \ - -form ::xowiki::WikiForm - - ::Generic::CrClass create PageInstance -superclass Page \ - -pretty_name "XoWiki Page Instance" -pretty_plural "XoWiki Page Instances" \ - -table_name "xowiki_page_instance" -id_column "page_instance_id" \ - -cr_attributes { - ::Generic::Attribute new -attribute_name page_template -datatype integer \ - -pretty_name "Page Template" - ::Generic::Attribute new -attribute_name instance_attributes -datatype text \ - -pretty_name "Instance Attributes" - } \ - -form ::xowiki::PageInstanceForm \ - -edit_form ::xowiki::PageInstanceEditForm + apm_version_get -package_key acs-kernel -array vi + if {[apm_version_names_compare $vi(version_name) 5.2.0] > -1} { + + ::Generic::CrClass create PageTemplate -superclass Page \ + -pretty_name "XoWiki Page Template" -pretty_plural "XoWiki Page Templates" \ + -table_name "xowiki_page_template" -id_column "page_template_id" \ + -form ::xowiki::WikiForm + + ::Generic::CrClass create PageInstance -superclass Page \ + -pretty_name "XoWiki Page Instance" -pretty_plural "XoWiki Page Instances" \ + -table_name "xowiki_page_instance" -id_column "page_instance_id" \ + -cr_attributes { + ::Generic::Attribute new -attribute_name page_template -datatype integer \ + -pretty_name "Page Template" + ::Generic::Attribute new -attribute_name instance_attributes -datatype text \ + -pretty_name "Instance Attributes" + } \ + -form ::xowiki::PageInstanceForm \ + -edit_form ::xowiki::PageInstanceEditForm + } else { + # create dummy classes + Class create PageTemplate + Class create PageInstance + } + } # the following block is legacy code @@ -170,7 +183,7 @@ ::xowiki::f1 instvar data folder_id ;# form has to be named ::xowiki::f1 # transitional code begin set object_type [[$data info class] object_type] - if {[string match ::xowiki::* $object_type]} { + if {[string match "::xowiki::*" $object_type]} { set templateclass ::xowiki::PageTemplate } else { set templateclass ::PageTemplate @@ -372,7 +385,7 @@ [self class] instvar recursion_depth if {[regexp {^adp (.*)$} $arg _ adp]} { set adp_fn [lindex $adp 0] - if {![string match /* $adp_fn]} {set adp_fn /packages/xowiki/www/$adp_fn} + if {![string match "/*" $adp_fn]} {set adp_fn /packages/xowiki/www/$adp_fn} set adp_args [concat [lindex $adp 1] [list __including_page [self]]] return [template::adp_include $adp_fn $adp_args] } @@ -396,7 +409,7 @@ set label $arg set link $arg regexp {^(.*)[|](.*)$} $arg _ link label - if {[string match http*//* $link]} { + if {[string match "http*//*" $link]} { return "$label" } else { my instvar parent_id Index: openacs-4/packages/xowiki/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/index.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/index.adp 14 Dec 2005 16:12:59 -0000 1.1 +++ openacs-4/packages/xowiki/www/index.adp 30 Dec 2005 00:09:58 -0000 1.2 @@ -5,5 +5,5 @@ Site-Wide Categories - +@t1;noquote@ Index: openacs-4/packages/xowiki/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/index.tcl 15 Dec 2005 12:39:25 -0000 1.2 +++ openacs-4/packages/xowiki/www/index.tcl 30 Dec 2005 00:09:58 -0000 1.3 @@ -13,7 +13,6 @@ } set context [list] -#set supertype CrWikiPage set supertype ::xowiki::Page # if object_type is specified, only list entries of this type; @@ -39,18 +38,41 @@ "[site_node::get_package_url -package_key categories]cadmin/one-object" \ { { object_id $package_id } }] -::Generic::List index \ - -object_type $object_type \ - -folder_id $folder_id \ - -with_subtypes $with_subtypes \ - -object_types $object_types \ - -fields { - EDIT {} - VIEW {} - title {label "Name"} - object_type {label "Object Type"} - DELETE {} +set actions "" +foreach type $object_types { + if {[$type info class] eq "::xotcl::Class"} {continue; #5.1 compatibility hack} + append actions [subst {Action new -label "Add [$type pretty_name]" \ + -url [export_vars -base edit {{object_type $type} folder_id}] \ + -tooltip "Add a new item of kind [$type pretty_name]" + }] +} + +TableWidget t1 -volatile \ + -actions $actions \ + -columns { + ImageField_EditIcon edit -label "" + ImageField_ViewIcon view -label "" + Field title -label "Name" + Field object_type -label "Object Type" + ImageField_DeleteIcon delete -label "" } -index generate -order_by cr.title +set order_clause "order by cr.title" +# -page_size 10 +# -page_number 1 +db_foreach instance_select \ + [$object_type instance_select_query \ + -folder_id $folder_id \ + -select_attributes title \ + -with_subtypes $with_subtypes \ + -order_clause $order_clause \ + ] { + t1 add \ + -title $title \ + -object_type $object_type \ + -view.href [export_vars -base view {item_id}] \ + -edit.href [export_vars -base edit {item_id}] \ + -delete.href [export_vars -base delete {item_id}] + } +set t1 [t1 asHTML] \ No newline at end of file Index: openacs-4/packages/xowiki/www/portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlet.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/portlet.tcl 14 Dec 2005 16:12:59 -0000 1.1 +++ openacs-4/packages/xowiki/www/portlet.tcl 30 Dec 2005 00:09:58 -0000 1.2 @@ -1,4 +1,4 @@ # -if {![string match /* $portlet]} { +if {![string match "/*" $portlet]} { set portlet /packages/xowiki/www/portlets/$portlet } Index: openacs-4/packages/xowiki/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/admin/index.tcl 15 Dec 2005 12:39:25 -0000 1.2 +++ openacs-4/packages/xowiki/www/admin/index.tcl 30 Dec 2005 00:09:58 -0000 1.3 @@ -9,7 +9,7 @@ } set context [list] -set supertype CrWikiPage +set supertype ::xowiki::Page set object_type_key [$supertype set object_type_key] set page_title "Administer all kind of [$supertype set pretty_plural]" @@ -45,10 +45,18 @@ select object_type from acs_object_types where tree_sortkey between :object_type_key and tree_right(:object_type_key) " { + set delete_url [export_vars -base delete-type {object_type}] - set nr_instances [db_list count [$object_type instance_select_query \ - -count 1 \ - -with_subtypes false]] + if {[$object_type info class] eq "::xotcl::Class"} { + # for backward comatibility with 5.1, since we define PageTemplate as plain xotcl class; + # only necessary to avoid crash, when entries are already in the database + continue + #set nr_instances 0 + } else { + set nr_instances [db_list count [$object_type instance_select_query \ + -count 1 \ + -with_subtypes false]] + } set instances_url [export_vars -base ../index {object_type}] } Index: openacs-4/packages/xowiki/www/xinha/file-selector.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/file-selector.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/xinha/file-selector.tcl 15 Dec 2005 12:39:25 -0000 1.2 +++ openacs-4/packages/xowiki/www/xinha/file-selector.tcl 30 Dec 2005 00:09:58 -0000 1.3 @@ -101,7 +101,7 @@ set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] set mime_type [template::util::file::get_property mime_type $upload_file] - if {$selector_type eq "image" && ![string match image/* $mime_type]} { + if {$selector_type eq "image" && ![string match "image/*" $mime_type]} { template::form::set_error upload_form upload_file \ [_ acs-templating.HTMLArea_SelectImageUploadNoImage] break @@ -249,7 +249,7 @@ set file_upload_name [fs::remove_special_file_system_characters \ -string $file_upload_name] - if { ![empty_string_p $content_size] } { + if { $content_size ne "" } { incr content_size_total $content_size }