Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.50 -r1.51 --- openacs-4/packages/xowiki/xowiki.info 16 Apr 2007 11:15:09 -0000 1.50 +++ openacs-4/packages/xowiki/xowiki.info 2 May 2007 10:13:38 -0000 1.51 @@ -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) - 2007-04-11 + 2007-05-02 <pre> XoWiki is a wiki implementation for OpenACS in XOTcl. Instead of trying to implement the full set of wiki markup commands of systems @@ -94,23 +94,36 @@ 0.47: podcast support -0.48: policy management moved to xotcl-core, more detailed form field specification for page instances, flash support, yndication status in www/admin/list, file import/export, style information in css files +0.48: policy management moved to xotcl-core, more detailed +form field specification for page instances, flash support, +syndication status in www/admin/list, file import/export, +style information in css files -0.49: adp-generator, make tags/categories/social software buttons per item in a weblog, oacs-view2 and oacs-view3 +0.49: adp-generator, make tags/categories/social software +buttons per item in a weblog, oacs-view2 and oacs-view3 -0.50: timeline support, new includelets activity-graph, collab-graph, timeline, and user-timeline +0.50: timeline support, new includelets activity-graph, +collab-graph, timeline, and user-timeline -0.51: minimal zen support, using new oo interface form xotcl-core, more silent on db-operations in error log +0.51: minimal zen support, using new oo interface form +xotcl-core, more silent on db-operations in error log + +0.52: added full set of padding-* and margin-* flags to +control image rendering, added allow_edit and allow_delete +to includelet "recent", new includelet "get" to obtain +variable binding from different pages, new includelets +creation-date to get dates nicer formatted, simplified +development of derived packages (s5) </pre> BSD-Style 0 - + - + 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.22 -r1.23 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 4 Mar 2007 21:32:40 -0000 1.22 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 2 May 2007 10:13:39 -0000 1.23 @@ -117,8 +117,10 @@ Class create ::xowiki::Link::image -superclass ::xowiki::Link \ -parameter { href cssclass - float width height padding margin border border-width - position top botton left right + float width height + padding padding-right padding-left padding-top padding-bottom + margin margin-left margin-right margin-top margin-bottom + border border-width position top botton left right } ::xowiki::Link::image instproc render {} { my instvar name package_id label @@ -145,8 +147,10 @@ ::xowiki::Link::image instproc render_found {link label} { set style "" foreach a { - float width height padding margin border border-width - position top botton left right + float width height + padding padding-right padding-left padding-top padding-bottom + margin margin-left margin-right margin-top margin-bottom + border border-width position top botton left right } { if {[my exists $a]} {append style "$a: [my set $a];"} } 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.52 -r1.53 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 11 Apr 2007 12:36:28 -0000 1.52 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 2 May 2007 10:13:39 -0000 1.53 @@ -314,9 +314,8 @@ } } - - #my log "--W object='$stripped_object'" - set fn [get_server_root]/packages/xowiki/www/prototypes/$stripped_object.page + set fn [get_server_root]/packages/[my package_key]/www/prototypes/$stripped_object.page + #my log "--W check $fn" if {[file readable $fn]} { # create from default page my log "--sourcing page definition $fn, using name '$standard_page'" Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.42 -r1.43 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 16 Apr 2007 11:15:10 -0000 1.42 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 2 May 2007 10:13:39 -0000 1.43 @@ -115,7 +115,19 @@ #my log "--cnames $category_spec -> $cnames" return [list $cnames $extra_where_clause] } - + ::xowiki::Portlet instproc get_source {source} { + if {$source ne ""} { + my instvar package_id + set page [$package_id resolve_page $source __m] + if {$page eq ""} { + error "Cannot find page '$source'" + } + $page destroy_on_cleanup + } else { + set page [my set __including_page] + } + return $page + } } namespace eval ::xowiki::portlet { @@ -166,6 +178,41 @@ } namespace eval ::xowiki::portlet { + + Class create get \ + -superclass ::xowiki::Portlet \ + -parameter { + {__decoration none} + {parameter_declaration { + {-variable:required } + {-source ""} + }} + } -instproc render {} { + my get_parameters + set page [my get_source $source] + if {[$page exists $variable]} { + return [$page set $variable] + } else { + return "no such variable $variable in page [$page set name]" + } + } + + Class create creation-date \ + -superclass ::xowiki::Portlet \ + -parameter { + {__decoration none} + {parameter_declaration { + {-source ""} + {-format "%m-%d-%Y"} + }} + } -instproc render {} { + my get_parameters + set page [my get_source $source] + set time [$page set creation_date] + regexp {^([^.]+)[.]} $time _ time + return [clock format [clock scan $time] -format $format] + } + ############################################################################# # rss button # @@ -410,21 +457,30 @@ {title "Recently Changed Pages"} {parameter_declaration { {-max_entries:integer 10} + {-allow_edit:boolean false} + {-allow_delete:boolean false} }} } recent instproc render {} { my get_parameters ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" - TableWidget t1 -volatile \ + -set allow_edit $allow_edit \ + -set allow_delete $allow_delete \ -columns { Field date -label "Modification Date" + if {[[my info parent] set allow_edit]} { + ImageField_EditIcon edit -label "" -html {style "padding-right: 2px;"} + } AnchorField title -label [_ xowiki.page_title] + if {[[my info parent] set allow_delete]} { + ImageField_DeleteIcon delete -label "" + } } db_foreach [my qn get_pages] \ - "select i.name, r.title, \ + "select i.name, r.title, p.page_id, \ to_char(r.publish_date,'YYYY-MM-DD HH24:MI:SS') as publish_date \ from cr_items i, cr_revisions r, xowiki_page p \ where i.parent_id = [$package_id folder_id] \ @@ -437,6 +493,26 @@ -title $title \ -title.href [$package_id pretty_link $name] \ -date $publish_date + + if {$allow_edit} { + #set page_link [$package_id pretty_link $name] + #set edit_link [$package_id make_link $page_link edit return_url] + set p [::Generic::CrItem instantiate -item_id 0 -revision_id $page_id] + $p destroy_on_cleanup + set page_link [$package_id pretty_link $name] + set edit_link [$package_id make_link -link $page_link $p edit return_url] + my log "page_link=$page_link, edit=$edit_link" + [t1 last_child] set edit.href $edit_link + } + if {$allow_delete} { + if {![info exists p]} { + set p [::Generic::CrItem instantiate -item_id 0 -revision_id $page_id] + $p destroy_on_cleanup + } + set page_link [$package_id pretty_link $name] + set delete_link [$package_id make_link -link $page_link $p delete return_url] + [t1 last_child] set delete.href $delete_link + } } return [t1 asHTML] } 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.90 -r1.91 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 17 Apr 2007 10:48:06 -0000 1.90 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 2 May 2007 10:13:39 -0000 1.91 @@ -140,12 +140,13 @@ {lang en} {render_adp 1} {absolute_links 0} + page_order } Page set recursion_count 0 Page array set RE { - include {([^\\]){{([^<]+)}}[ \n\r]*} - anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} - div {()([^\\])>>([^&<]*)<<()([ \n]*
)?} + include {([^\\]){{([^<]+?)}}[ \n\r]*} + anchor {([^\\])\\\[\\\[([^\]]+?)\\\]\\\]} + div {()([^\\])>>([^&<]*?)<<()([ \n]*
)?} clean {[\\](\{\{|>>|\[\[)} clean2 {
*(

Error in includelet '$page_name' $errorMsg\n" + set html "

Error in includelet '$page_name' $errorMsg\ +

$::errorInfo
\n" } + return $html } else { return "

Error: includelet '$page_name' unknown

\n" @@ -626,8 +630,9 @@ } Page instproc get_rich_text_spec {field_name default} { + my instvar package_id set spec "" - foreach {s widget_spec} [[my set parent_id] get_payload widget_specs] { + foreach {s widget_spec} [$package_id get_parameter widget_specs] { foreach {page_name var_name} [split $s ,] break # in case we have no name (edit new page) we use the first value or the default. set name [expr {[my exists name] ? [my set name] : $page_name}] @@ -703,9 +708,9 @@ {render_adp 0} } PlainPage array set RE { - include {([^\\]){{(.+)}}[ \n\r]} - anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} - div {()([^\\])>>([^<]*)<<} + include {([^\\]){{(.+?)}}[ \n\r]} + anchor {([^\\])\\\[\\\[([^\]]+?)\\\]\\\]} + div {()([^\\])>>([^<]*?)<<} clean {[\\](\{\{|>>|\[\[)} clean2 {(--DUMMY NOT USED--)} } 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.47 -r1.48 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 16 Apr 2007 11:15:10 -0000 1.47 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 2 May 2007 10:13:39 -0000 1.48 @@ -186,6 +186,9 @@ } else { # use adp file foreach css [$package_id get_parameter extra_css ""] {::xowiki::Page requireCSS $css} + # refetch it, since it might have been changed via set-parameter + set template_file [my query_parameter "template_file" \ + [::$package_id get_parameter template_file view-default]] if {![regexp {^[./]} $template_file]} { set template_file /packages/xowiki/www/$template_file Index: openacs-4/packages/xowiki/www/oacs-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view.adp,v diff -u -r1.33 -r1.34 --- openacs-4/packages/xowiki/www/oacs-view.adp 23 Apr 2007 11:55:21 -0000 1.33 +++ openacs-4/packages/xowiki/www/oacs-view.adp 2 May 2007 10:13:40 -0000 1.34 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/oacs-view2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view2.adp,v diff -u -r1.12 -r1.13 --- openacs-4/packages/xowiki/www/oacs-view2.adp 23 Apr 2007 11:55:21 -0000 1.12 +++ openacs-4/packages/xowiki/www/oacs-view2.adp 2 May 2007 10:13:40 -0000 1.13 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/oacs-view3.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view3.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/xowiki/www/oacs-view3.adp 23 Apr 2007 11:55:21 -0000 1.7 +++ openacs-4/packages/xowiki/www/oacs-view3.adp 2 May 2007 10:13:40 -0000 1.8 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/view-default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-default.adp,v diff -u -r1.29 -r1.30 --- openacs-4/packages/xowiki/www/view-default.adp 23 Apr 2007 11:55:21 -0000 1.29 +++ openacs-4/packages/xowiki/www/view-default.adp 2 May 2007 10:13:40 -0000 1.30 @@ -1,4 +1,4 @@ - + @title;noquote@ @context;noquote@ Index: openacs-4/packages/xowiki/www/view-links.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-links.adp,v diff -u -r1.19 -r1.20 --- openacs-4/packages/xowiki/www/view-links.adp 23 Apr 2007 11:55:21 -0000 1.19 +++ openacs-4/packages/xowiki/www/view-links.adp 2 May 2007 10:13:40 -0000 1.20 @@ -1,4 +1,4 @@ - +
Index: openacs-4/packages/xowiki/www/view-plain.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-plain.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/xowiki/www/view-plain.adp 23 Apr 2007 11:55:21 -0000 1.15 +++ openacs-4/packages/xowiki/www/view-plain.adp 2 May 2007 10:13:40 -0000 1.16 @@ -1,4 +1,4 @@ - +