Index: openacs-4/packages/xowiki/xowiki.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v
diff -u -r1.135 -r1.136
--- openacs-4/packages/xowiki/xowiki.info 15 Nov 2010 13:49:07 -0000 1.135
+++ openacs-4/packages/xowiki/xowiki.info 22 Nov 2010 12:19:19 -0000 1.136
@@ -10,11 +10,11 @@
t
xowiki
-
+
Gustaf Neumann
A more generic xotcl-based wikis example with object types
and subtypes based on the content repository (with category support)
- 2010-11-15
+ 2010-11-22
Gustaf Neumann, WU Wien
<pre>
XoWiki is a Wiki implementation for OpenACS in XOTcl. Instead of
@@ -56,7 +56,7 @@
BSD-Style
0
-
+
Index: openacs-4/packages/xowiki/tcl/package-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v
diff -u -r1.237 -r1.238
--- openacs-4/packages/xowiki/tcl/package-procs.tcl 17 Nov 2010 08:46:34 -0000 1.237
+++ openacs-4/packages/xowiki/tcl/package-procs.tcl 22 Nov 2010 12:19:19 -0000 1.238
@@ -1518,6 +1518,9 @@
$f save_new
set folder_id [$f item_id]
+ ::xo::db::sql::acs_object set_attribute -object_id_in $folder_id \
+ -attribute_name_in context_id -value_in $id
+
my log "CREATED folder '$name' and parent $parent_id ==> $folder_id"
}
Index: openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl,v
diff -u -r1.66 -r1.67
--- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 15 Jul 2010 23:55:31 -0000 1.66
+++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 22 Nov 2010 12:19:19 -0000 1.67
@@ -36,6 +36,8 @@
} {
ns_log notice "Executing before-uninstantiate"
::xowiki::delete_gc_messages -package_id $package_id
+ ::xo::db::sql::content_item delete \
+ -item_id [::xo::db::CrClass lookup -name "xowiki: $package_id" -parent_id -100]
ns_log notice " before-uninstantiate DONE"
}
Index: openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl,v
diff -u -r1.16 -r1.17
--- openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 17 Nov 2010 08:46:34 -0000 1.16
+++ openacs-4/packages/xowiki/tcl/xowiki-utility-procs.tcl 22 Nov 2010 12:19:19 -0000 1.17
@@ -283,7 +283,8 @@
db_dml chg3 "insert into xowiki_form_page (xowiki_form_page_id) values ($revision_id)"
db_dml chg4 "update acs_objects set object_type = 'content_item' where object_id = $item_id"
- db_dml chg5 "update cr_items set content_type = '::xowiki::FormPage', publish_status = 'ready', live_revision = $revision_id, latest_revision = $revision_id where item_id = $item_id"
+ db_dml chg5 "update acs_objects set object_type = '::xowiki::FormPage' where object_id = $revision_id"
+ db_dml chg6 "update cr_items set content_type = '::xowiki::FormPage', publish_status = 'ready', live_revision = $revision_id, latest_revision = $revision_id where item_id = $item_id"
}
ad_proc -public -callback subsite::url -impl apm_package {
@@ -308,7 +309,7 @@
# Some Date utilities
#
-::xo::Module ::xowiki::utility -eval {
+::xo::Module create ::xowiki::utility -eval {
my set age \
[list \
[expr {3600*24*365}] year years \
Index: openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl 15 Nov 2010 13:49:07 -0000 1.3
+++ openacs-4/packages/xowiki/tcl/upgrade/upgrade.tcl 22 Nov 2010 12:19:19 -0000 1.4
@@ -537,5 +537,26 @@
::xowiki::Package initialize -package_id [::xowiki::Package first_instance]
::xowiki::Package require_site_wide_pages -refetch true
}
+
+ set v 0.135
+ if {[apm_version_names_compare $from_version_name $v] == -1 &&
+ [apm_version_names_compare $to_version_name $v] > -1} {
+ ns_log notice "-- upgrading to $v"
+
+ db_dml fix_transformed_folders \
+ "update acs_objects set object_type = '::xowiki::FormPage' where object_id in (select object_id from acs_objects,cr_revisions cr,cr_items ci where ci.item_id = cr.item_id and revision_id = object_id and object_type = 'content_folder' and content_type = '::xowiki::FormPage')"
+
+ # Reset potentially wrong context-ids
+ # (the context id of the root folder should be the package id)
+ foreach p [::xowiki::Package instances -closure true] {
+ ::xowiki::Package initialize -package_id $p
+ set folder_id [$p folder_id]
+ set c [db_string get_ctx "select context_id from acs_objects where object_id = $folder_id" ]
+ if {$c == -100} {
+ ::xo::db::sql::acs_object set_attribute -object_id_in $folder_id \
+ -attribute_name_in context_id -value_in $p
+ }
+ }
+ }
}
}