Index: openacs-4/packages/xowiki/xowiki.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v
diff -u -r1.121 -r1.122
--- openacs-4/packages/xowiki/xowiki.info 5 Nov 2009 12:34:16 -0000 1.121
+++ openacs-4/packages/xowiki/xowiki.info 6 Nov 2009 12:26:18 -0000 1.122
@@ -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)
- 2009-11-05
+ 2009-11-06
Gustaf Neumann, WU Wien
<pre>
XoWiki is a Wiki implementation for OpenACS in XOTcl. Instead of
@@ -56,18 +56,18 @@
BSD-Style
0
-
+
-
+
-
-
+
+
@@ -86,7 +86,6 @@
-
Index: openacs-4/packages/xowiki/tcl/link-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v
diff -u -r1.69 -r1.70
--- openacs-4/packages/xowiki/tcl/link-procs.tcl 5 Nov 2009 12:34:16 -0000 1.69
+++ openacs-4/packages/xowiki/tcl/link-procs.tcl 6 Nov 2009 12:26:18 -0000 1.70
@@ -63,7 +63,7 @@
if {![my exists label]} {my label $name}
if {![my exists parent_id]} {my parent_id [$page parent_id]}
if {![my exists package_id]} {my package_id [$page package_id]}
- #my msg "--L link has class [my info class] // $class"
+ #my msg "--L link has class [my info class] // $class // [my type] // [my parent_id]"
}
Link instproc link_name {-lang -stripped_name} {
return $lang:$stripped_name
@@ -104,16 +104,7 @@
set object_type ::xowiki::Page
}
}
- set parent_id [$package_id get_parent_and_name -path [my stripped_name] \
- -lang [my lang] -folder_id [$package_id folder_id] \
- parent local_name]
- if {$parent eq ""} {
- set parent_id ""
- set name [my name]
- } else {
- set name [my lang]:$local_name
- }
- return [$page new_link -name $name -title [my label] -parent_id $parent_id \
+ return [$page new_link -name [my name] -title [my label] -parent_id [my parent_id] \
-nls_language [$page nls_language] $package_id]
}
@@ -160,28 +151,17 @@
}
::xowiki::Link::folder instproc pretty_link {item_id} {
my instvar package_id
- set folder [::xo::db::CrFolder get_instance_from_db -item_id $item_id]
return [::$package_id pretty_link \
- -anchor [my anchor] -parent_id [$folder parent_id] -query [my query] [$folder name] ]
+ -anchor [my anchor] -parent_id [my parent_id] -query [my query] [my name] ]
}
::xowiki::Link::folder instproc new_link {} {
my instvar package_id
- set page [my page]
- set parent_id [$package_id get_parent_and_name \
- -path [my name] -folder_id [$page parent_id] -lang [my lang] \
- parent local_name]
- if {$parent eq ""} {
- set parent_id [my parent_id]
- set name [my name]
- } else {
- set name $local_name
- }
return [$package_id make_link -with_entities 0 \
$package_id \
edit-new \
[list object_type ::xo::db::CrFolder] \
- [list name $local_name] \
- [list parent_id $parent_id] \
+ [list name [my name]] \
+ [list parent_id [my parent_id]] \
[list return_url [::xo::cc url]] \
autoname]
}
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.184 -r1.185
--- openacs-4/packages/xowiki/tcl/package-procs.tcl 5 Nov 2009 12:34:16 -0000 1.184
+++ openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Nov 2009 12:26:18 -0000 1.185
@@ -956,16 +956,11 @@
Package instproc require_folder_object { } {
my instvar id folder_id
- #my msg "--f [my isobject ::$folder_id] folder_id=$folder_id"
+ # TODO: we should make a parameter allowed_page_types (see content_types),
+ # but the package admin should not have necessarily the rights to change it
+ set folder_id [my require_root_folder -name "xowiki: $id" \
+ -content_types ::xowiki::Page* ]
- if {$folder_id == 0} {
- # TODO: we should make a parameter allowed_page_types (see content_types),
- # but the package admin should not have necessarily the rights to change it
- set folder_id [::xowiki::Page require_folder \
- -name xowiki -package_id $id \
- -content_types ::xowiki::Page* ]
- }
-
if {![::xotcl::Object isobject ::$folder_id]} {
# if we can't get the folder from the cache, create it
if {[catch {eval [nsv_get xotcl_object_cache ::$folder_id]}]} {
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.368 -r1.369
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 5 Nov 2009 12:34:16 -0000 1.368
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 6 Nov 2009 12:26:18 -0000 1.369
@@ -1440,8 +1440,8 @@
# set name file:$stripped_name
# }
-
array set "" [my get_anchor_and_query $link]
+ if {$label eq $arg} {set label $(link)}
if {[regexp {^:(..):(.+)$} $(link) _ lang stripped_name]} {
# language link (it starts with a ':')
@@ -1450,9 +1450,8 @@
} else {
array set "" [my item_ref -default_lang [my lang] -parent_id [my parent_id] $(link)]
}
-
+ #my msg [array get ""]
set item_name [string trimleft $(prefix):$(stripped_name) :]
- if {$label eq $arg} {set label $item_name}
Link create [self]::link \
-page [self] \
Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v
diff -u -r1.239 -r1.240
--- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 5 Nov 2009 12:34:16 -0000 1.239
+++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 6 Nov 2009 12:26:19 -0000 1.240
@@ -275,7 +275,7 @@
Page instproc new_link {-name -title -nls_language -parent_id page_package_id} {
if {[info exists parent_id] && $parent_id eq ""} {unset parent_id}
return [$page_package_id make_link -with_entities 0 $page_package_id \
- edit-new object_type name title nls_language return_url autoname]
+ edit-new object_type name title nls_language return_url parent_id autoname]
}
Page instproc edit_set_default_values {} {
Index: openacs-4/packages/xowiki/www/admin/test.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/Attic/test.tcl,v
diff -u -r1.21 -r1.22
--- openacs-4/packages/xowiki/www/admin/test.tcl 5 Nov 2009 13:09:57 -0000 1.21
+++ openacs-4/packages/xowiki/www/admin/test.tcl 6 Nov 2009 12:26:19 -0000 1.22
@@ -1030,27 +1030,27 @@
set l "parentpage"
set test [label "link" "existing simple page" $l]
set link [p create_link $l]
- ? {$link render} "de:parentpage" "\n$test\n "
+ ? {$link render} "parentpage" "\n$test\n "
set l "parentpage1"
set test [label "link" "not existing simple page" $l]
set link [p create_link $l]
-? {$link render} [subst -nocommands { [ de:parentpage1 ] }] "\n$test\n "
+? {$link render} [subst -nocommands { [ parentpage1 ] }] "\n$test\n "
set l "parentpage#a"
set test [label "link" "existing simple with anchor" $l]
set link [p create_link $l]
-? {$link render} [subst -nocommands {de:parentpage}] "\n$test\n "
+? {$link render} [subst -nocommands {parentpage}] "\n$test\n "
set l "image:image.png"
set test [label "link" "existing image" $l]
set link [p create_link $l]
-? {$link render} [subst -nocommands {}] "\n$test\n "
+? {$link render} [subst -nocommands {}] "\n$test\n "
set l "image.png"
set test [label "link" "existing image short" $l]
set link [p create_link $l]
-? {$link render} [subst -nocommands {}] "\n$test\n "
+? {$link render} [subst -nocommands {}] "\n$test\n "
set l ":de:parentpage"
set test [label "link" "existing language link" $l]