Index: openacs-4/packages/xowiki/xowiki.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v
diff -u -r1.82 -r1.83
--- openacs-4/packages/xowiki/xowiki.info 5 May 2008 12:29:17 -0000 1.82
+++ openacs-4/packages/xowiki/xowiki.info 12 Jun 2008 11:38:39 -0000 1.83
@@ -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)
- 2008-04-10
+ 2008-06-10
Gustaf Neumann, WU Wien
<pre>
XoWiki is a Wiki implementation for OpenACS in XOTcl. Instead of
@@ -54,16 +54,16 @@
BSD-Style
0
-
+
-
+
Index: openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml,v
diff -u -r1.38 -r1.39
--- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 13 Apr 2008 16:32:56 -0000 1.38
+++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 12 Jun 2008 11:38:40 -0000 1.39
@@ -47,6 +47,8 @@
OK
Template
%errorMsg%
+ Assignee
+ State
Index
New Page
Source
@@ -69,6 +71,7 @@
Instance Attributes
Page Instance
Unnamed Entries
+ Value is not a valid party_id
Duration
E.g. 9:16 means 9 minutes 16 seconds (if ffmpeg is installed and configured, it will get the value automatically)
Keywords
Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v
diff -u -r1.78 -r1.79
--- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 9 Jun 2008 11:25:59 -0000 1.78
+++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 12 Jun 2008 11:38:40 -0000 1.79
@@ -80,7 +80,7 @@
set success 1
set validator_method check=$validator
set proc_info [my procsearch $validator_method]
- #my msg "++ [my name]: field-level validator exists ? [expr {$proc_info ne {}}]"
+ #my msg "++ [my name]: field-level validator exists '$validator_method' ? [expr {$proc_info ne {}}]"
if {$proc_info ne ""} {
# we have a slot checker, call it
#my msg "++ call-field level validator $validator_method '$value'"
@@ -221,14 +221,19 @@
}
FormField instproc config_from_spec {spec} {
+ #my log "spec=$spec [my info class] [[my info class] exists abstract]"
my instvar type
if {[[my info class] exists abstract]} {
# had earlier here: [my info class] eq [self class]
# Check, wether the actual class is a concrete class (mapped to
# concrete field type) or an abstact class. Since
# config_from_spec can be called multiple times, we want to do
# the reclassing only once.
- my class ::xowiki::formfield::$type
+ if {[my isclass ::xowiki::formfield::$type]} {
+ my class ::xowiki::formfield::$type
+ } else {
+ my class ::xowiki::formfield::text
+ }
# TODO: reset_parameter? needed?
::xotcl::Class::Parameter searchDefaults [self]; # TODO: will be different in xotcl 1.6.*
}
@@ -528,7 +533,20 @@
return [::xo::get_user_name $v]
}
+ ###########################################################
+ #
+ # ::xowiki::formfield::party_id
+ #
###########################################################
+
+ Class party_id -superclass user_id \
+ -extend_slot validator party_id_check
+ party_id instproc check=party_id_check {value} {
+ if {$value eq ""} {return 1}
+ return [db_0or1row dbq..check_party "select 1 from parties where party_id = :value"]
+ }
+
+ ###########################################################
#
# ::xowiki::formfield::url
#
@@ -659,6 +677,8 @@
#my msg "[my get_attributes id style {CSSclass class}]"
::html::div [my get_attributes id style {CSSclass class}] {
if {[my wiki]} {
+ [my object] set unresolved_references 0
+ [my object] set __unresolved_references [list]
::html::t -disableOutputEscaping [[my object] substitute_markup [list [my value] text/html]]
} else {
::html::t -disableOutputEscaping [my value]
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.250 -r1.251
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 9 Jun 2008 11:25:59 -0000 1.250
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 12 Jun 2008 11:38:40 -0000 1.251
@@ -129,13 +129,17 @@
::xo::db::CrClass create FormPage -superclass PageInstance \
-pretty_name "XoWiki FormPage" -pretty_plural "XoWiki FormPages" \
- -table_name "xowiki_form_page" -id_column "xowiki_form_page_id"
+ -table_name "xowiki_form_page" -id_column "xowiki_form_page_id" \
+ -slots {
+ ::xo::db::CrAttribute create assignee \
+ -datatype integer \
+ -references parties(party_id) \
+ -spec "party_id"
+ ::xo::db::CrAttribute create state -default ""
+ }
- #::xo::db::CrClass create FormInstance -superclass PageInstance \
- # -pretty_name "XoWiki FormInstance" -pretty_plural "XoWiki FormInstances" \
- # -table_name "xowiki_form_instance" -id_column "xowiki_form_instance_id"
+ ::xo::db::require index -table xowiki_form_page -col assignee
- #
# create various extra tables, indices and views
#
::xo::db::require table xowiki_references \
@@ -363,11 +367,15 @@
my set instance_attributes $ia
#my msg "setting instance_attributes $ia"
}
- next
+ set old_assignee [my assignee]
+ my set assignee [my map_party $old_assignee]
+ set r [next]
+ my set assignee $old_assignee
+ return $r
}
Page instproc map_party {party_id} {
- my log "+++ $party_id"
+ #my log "+++ $party_id"
# So far, we just handle users, but we should support parties in
# the future as well.
if {$party_id eq ""} {
@@ -405,7 +413,7 @@
}
- Page instproc reverse_map_party_attribute {-attribute -default_party} {
+ Page instproc reverse_map_party_attribute {-attribute {-default_party 0}} {
if {![my exists $attribute]} {
my set $attribute $default_party
} elseif {[llength [my set $attribute]] < 2} {
@@ -462,6 +470,7 @@
FormPage instproc demarshall {-parent_id -package_id -creation_user} {
my instvar page_template
#
+ my reverse_map_party_attribute -attribute assignee
#
# FormPages must be demarshalled after Form, since Form builds
# the reverse category map.
Index: openacs-4/packages/xowiki/www/admin/export.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/export.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/xowiki/www/admin/export.tcl 9 Jun 2008 11:26:00 -0000 1.10
+++ openacs-4/packages/xowiki/www/admin/export.tcl 12 Jun 2008 11:38:40 -0000 1.11
@@ -40,8 +40,9 @@
while {1} {
if {[lsearch $item_ids $template_id] == -1 &&
![info exists included($template_id)]} {
- ::xo::db::CrClass get_instance_from_db -item_id $template_id
+ set x [::xo::db::CrClass get_instance_from_db -item_id $template_id]
$template_id volatile
+ ns_log notice "--exporting needed [$item_id name] ($template_id) //$x [$x info class], m=[$template_id marshall] "
#append content [$template_id marshall] \n
ns_write "[$template_id marshall] \n"
set included($template_id) 1
@@ -54,7 +55,7 @@
}
}
$item_id volatile
- #ns_log notice "exporting $item_id [$item_id name]"
+ ns_log notice "--exporting $item_id [$item_id name]"
#append content [$item_id marshall] \n
ns_write "[$item_id marshall] \n"
}