Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.15 -r1.16 --- openacs-4/packages/xowiki/xowiki.info 30 Apr 2006 23:53:34 -0000 1.15 +++ openacs-4/packages/xowiki/xowiki.info 3 May 2006 12:03:23 -0000 1.16 @@ -8,33 +8,33 @@ f xowiki - + Gustaf Neumann A more generic xotcl-based wikis example with object types and subtypes based on the content repository (with category support) - 2006-05-01 + 2006-05-03 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 with oacs (e.g categories, general comments, adp-includes). XoWiki combines aspects of wikis (ease of page-creation) with aspects of a content management system (revisions, re-usable items, multiple languages). Furthermore, XoWiki allows to define different types of links such -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.18 supports text/enhanced, nice page names, import/export. Support for search (::xowiki::Page and ::xowiki::PlainPage); 0.20 support ::xowiki::Object, directory object, rss generation into syndication table, improved admin pages; 0.21: ajax-ased chat added, new attributes creator and page_title for all xowiki::Pages; 0.22 improved permission checking. 0.24 provides link-types, more includeletes (most-recently viewed, most frequently accessed pages). 0.26 provides Weblog support. +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.18 supports text/enhanced, nice page names, import/export. Support for search (::xowiki::Page and ::xowiki::PlainPage); 0.20 support ::xowiki::Object, directory object, rss generation into syndication table, improved admin pages; 0.21: ajax-ased chat added, new attributes creator and page_title for all xowiki::Pages; 0.22 improved permission checking. 0.24 provides link-types, more includeletes (most-recently viewed, most frequently accessed pages). 0.26 provides Weblog support. 0.27: alignment with xotcl-core 0.38 (use cr_item.name instead of cr_revisions.title), change page_title to title (potential incompatibility) to rely more strictly to the CR data model (most files are effected). 0 - + - + - - + + Index: openacs-4/packages/xowiki/tcl/category-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/category-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/xowiki/tcl/category-procs.tcl 30 Apr 2006 23:53:34 -0000 1.6 +++ openacs-4/packages/xowiki/tcl/category-procs.tcl 3 May 2006 12:03:23 -0000 1.7 @@ -61,8 +61,8 @@ set content "" if {[my isobject [self]::items]} { foreach i [[self]::items children] { - $i instvar title page_title prefix suffix - set entry "$prefix$page_title$suffix" + $i instvar name title prefix suffix + set entry "$prefix$title$suffix" append cat_content [my render_item -highlight [$i exists open_item] $entry] } foreach c [my children] {append cat_content [$c render] \n} 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.3 -r1.4 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 24 Apr 2006 08:24:04 -0000 1.3 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 3 May 2006 12:03:23 -0000 1.4 @@ -12,13 +12,13 @@ # generic links # - Class create Link -parameter {type title lang stripped_name label folder_id package_id} + Class create Link -parameter {type name lang stripped_name label folder_id package_id} Link instproc init {} { set class [self class]::[my type] if {[my isclass $class]} {my class $class} } Link instproc resolve {} { - ::Generic::CrItem lookup -title [my title] -parent_id [my folder_id] + ::Generic::CrItem lookup -name [my name] -parent_id [my folder_id] } Link instproc render_found {href label} { return "$label" @@ -37,8 +37,8 @@ } else { $page incr unresolved_references set object_type [[$page info class] set object_type] - set title [my label] - set href [export_vars -base [::xowiki::Page url_prefix -package_id [my package_id]]edit {object_type title}] + set name [my label] + set href [export_vars -base [::xowiki::Page url_prefix -package_id [my package_id]]edit {object_type name}] my render_not_found $href [my label] } } @@ -74,7 +74,7 @@ set css_class "undefined" set last_page_id [$page set item_id] set object_type [[$page info class] set object_type] - set link [export_vars -base [::xowiki::Page url_prefix]edit {object_type title last_page_id}] + set link [export_vars -base [::xowiki::Page url_prefix]edit {object_type name last_page_id}] } $page lappend lang_links \ " -1} { + ns_log notice "-- upgrading to 0.27" + db_dml copy_page_title_into_title \ + "update cr_revisions set title = p.page_title from xowiki_page p \ + where page_title != '' and revision_id = p.page_id" + db_dml delete_deprecated_types_from_ancient_versions \ + "select content_item__delete(i.item_id) from cr_items i \ + where content_type in ('CrWikiPage', 'CrWikiPlainPage', \ + 'PageInstance', 'PageTemplate','CrNote', 'CrSubNote')" + } } # # Page definitions @@ -274,7 +287,7 @@ } { Report content of xowiki folder in rss 2.0 format. The reporting order is descending by date. The title of the feed - is taken from the page_title, the description + is taken from the title, the description is taken from the description field of the folder object. @param maxentries maximum number of entries retrieved @@ -292,36 +305,36 @@ set xmlMap { & & < < > > \" " ' ' } set content [my rss_head \ - -channel_title [string map $xmlMap [::$folder_id set page_title ]] \ + -channel_title [string map $xmlMap [::$folder_id set title ]] \ -description [string map $xmlMap [::$folder_id set description]] \ -link [ad_url][site_node::get_url_from_object_id -object_id $package_id] \ ] db_foreach get_pages \ - "select s.body, p.title, p.creator, p.page_title, p.page_id,\ + "select s.body, p.name, p.creator, p.title, p.page_id,\ p.object_type as content_type, p.last_modified, p.description \ from xowiki_pagex p, syndication s, cr_items i \ where i.parent_id = $folder_id and i.live_revision = s.object_id \ and s.object_id = p.page_id $timerange_clause \ order by p.last_modified desc $limit_clause \ " { - if {[string match "::*" $title]} continue + if {[string match "::*" $name]} continue if {$content_type eq "::xowiki::PageTemplate::"} continue set description [string trim $description] if {$description eq ""} {set description $body} regexp {^([^.]+)[.][0-9]+(.*)$} $last_modified _ time tz - if {$page_title eq ""} {set page_title $title} - #append page_title " ($content_type)" + if {$title eq ""} {set title $name} + #append title " ($content_type)" set time "[clock format [clock scan $time] -format {%a, %d %b %Y %T}] ${tz}00" append content [my rss_item \ -creator [string map $xmlMap $creator] \ - -title [string map $xmlMap $page_title] \ + -title [string map $xmlMap $title] \ -link [::xowiki::Page pretty_link \ -package_id $package_id \ - -fully_qualified true $title] \ + -fully_qualified true $name] \ -guid [ad_url]/$page_id \ -description [string map $xmlMap $description] \ -pubdate $time \ @@ -352,7 +365,7 @@ return $url_prefix($package_id) } - Page proc pretty_link {{-fully_qualified:boolean false} -lang -package_id title} { + Page proc pretty_link {{-fully_qualified:boolean false} -lang -package_id name} { my instvar url_prefix folder_id if {![info exists package_id]} {set package_id [$folder_id set package_id]} @@ -361,19 +374,19 @@ } if {![info exists lang]} { - regexp {^(..):(.*)$} $title _ lang title + regexp {^(..):(.*)$} $name _ lang name } set host [expr {$fully_qualified ? [ad_url] : ""}] if {[info exists lang]} { - return $host$url_prefix($package_id)pages/$lang/[ad_urlencode $title] + return $host$url_prefix($package_id)pages/$lang/[ad_urlencode $name] } else { - return $host$url_prefix($package_id)pages/[ad_urlencode $title] + return $host$url_prefix($package_id)pages/[ad_urlencode $name] } } Page instproc initialize_loaded_object {} { - my instvar page_title creator - if {[info exists page_title] && $page_title eq ""} {set page_title [my set title]} + my instvar title creator + if {[info exists title] && $title eq ""} {set title [my set name]} #if {$creator eq ""} {set creator [my get_name [my set creation_user]]} next } @@ -387,7 +400,7 @@ if {![::xotcl::Object isobject ::$folder_id]} { while {1} { set item_id [ns_cache eval xotcl_object_type_cache item_id-of-$folder_id { - set id [CrItem lookup -title ::$folder_id -parent_id $folder_id] + set id [CrItem lookup -name ::$folder_id -parent_id $folder_id] if {$id == 0} break; # don't cache return $id }] @@ -402,6 +415,7 @@ set o [::xowiki::Object create ::$folder_id] $o set text "# this is the payload of the folder object\n\nset index_page \"\"\n" $o set parent_id $folder_id + $o set name ::$folder_id $o set title ::$folder_id $o save_new $o initialize_loaded_object @@ -438,7 +452,7 @@ $o set creation_user $user_id # page instances have references to page templates, add these first if {[$o istype ::xowiki::PageInstance]} continue - set item [CrItem lookup -title [$o set title] -parent_id $folder_id] + set item [CrItem lookup -name [$o set name] -parent_id $folder_id] if {$item != 0 && $replace} { ;# we delete the original ::Generic::CrItem delete -item_id $item set item 0 @@ -453,7 +467,7 @@ foreach o $objects { if {[$o istype ::xowiki::PageInstance]} { db_transaction { - set item [CrItem lookup -title [$o set title] -parent_id $folder_id] + set item [CrItem lookup -name [$o set name] -parent_id $folder_id] if {$item != 0 && $replace} { ;# we delete the original ::Generic::CrItem delete -item_id $item set item 0 @@ -462,7 +476,7 @@ if {$item == 0} { ;# the item does not exist -> update reference and save set old_template_id [$o set page_template] set template [CrItem lookup \ - -title [$old_template_id set title] \ + -name [$old_template_id set name] \ -parent_id $folder_id] $o set page_template $template $o save_new @@ -499,7 +513,7 @@ my instvar object_type_key if {![info exists folder_id]} {my instvar folder_id} - set attributes [list ci.item_id p.page_id] + set attributes [list ci.item_id ci.name p.page_id] foreach a $select_attributes { if {$a eq "title"} {set a p.title} lappend attributes $a @@ -578,7 +592,7 @@ if {[regexp {^adp (.*)$} $arg _ adp]} { if {[catch {lindex $adp 0} errMsg]} { # there is something syntactically wrong - return "${ch}Error in '{{$arg}}' in [my set title]
\n\ + return "${ch}Error in '{{$arg}}' in [my set name]
\n\ Syntax: adp <name of adp-file> {<argument list>}
\n Invalid argument list: '$adp_args'; must be attribute value pairs (even number of elements)" } @@ -593,7 +607,7 @@ } lappend adp_args __including_page [self] if {[catch {set page [template::adp_include $adp_fn $adp_args]} errorMsg]} { - error "${ch}Error during evaluation of '{{$arg}}' in [my set title]
\n\ + return "${ch}Error during evaluation of '{{$arg}}' in [my set name]
\n\ adp_include returned error message: $errorMsg
\n" } @@ -641,7 +655,7 @@ if {$label eq $arg} {set label $stripped_name} #my log "--LINK lang=$lang type=$link_type stripped_name=$stripped_name" Link create [self]::link \ - -type $link_type -title $lang:$stripped_name -lang $lang \ + -type $link_type -name $lang:$stripped_name -lang $lang \ -stripped_name $stripped_name -label $label \ -folder_id $parent_id -package_id [$parent_id set package_id] return $ch[[self]::link render] @@ -705,7 +719,7 @@ regsub -all [template::adp_variable_regexp] $content {\1@\2;noquote@} content set template_code [template::adp_compile -string $content] if {[catch {set template_value [template::adp_eval template_code]} errmsg]} { - return "Error in Page $title: $errmsg
$content

Possible values are$__template_variables__" + return "Error in Page $name: $errmsg
$content

Possible values are$__template_variables__" } return $template_value } @@ -730,8 +744,8 @@ my instvar item_id references lang render_adp unresolved_references parent_id #my log "-- my class=[my info class]" - set title [my set title] - regexp {^(..):(.*)$} $title _ lang title + set name [my set name] + regexp {^(..):(.*)$} $name _ lang name set references [list] set unresolved_references 0 set content [my get_content] @@ -798,8 +812,8 @@ set spec $default_spec foreach {s widget} [[my set parent_id] get_payload widget_specs] { foreach {template_name var_name} [split $s ,] break - #ns_log notice "--w T.title = '[$template set title]' var=$name" - if {[string match $template_name [$template set title]] && + #ns_log notice "--w T.title = '[$template set name]' var=$name" + if {[string match $template_name [$template set name]] && [string match $var_name $name]} { set spec $widget #ns_log notice "--w using $widget for $name" Index: openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 30 Apr 2006 23:53:34 -0000 1.8 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 3 May 2006 12:03:23 -0000 1.9 @@ -29,11 +29,11 @@ #$page set unresolved_references 0 $page instvar item_id - return [list object_id $revision_id title [$page set page_title] \ + return [list object_id $revision_id title [$page set title] \ content $text keywords {} \ storage_type text mime text/plain \ syndication [list \ - link [::xowiki::Page pretty_link -fully_qualified 1 [$page set title]] \ + link [::xowiki::Page pretty_link -fully_qualified 1 [$page set name]] \ description $text \ author [$page set creator] \ category "" \ @@ -52,12 +52,12 @@ set folder_id [$page set parent_id] set pid [db_string get_pid "select package_id from cr_folders where folder_id = $folder_id"] if {$pid > 0} { - return [::xowiki::Page pretty_link -package_id $pid [$page set title]] + return [::xowiki::Page pretty_link -package_id $pid [$page set name]] } else { # cannot determine package_id; one page from the directory should be viewed to update # package id for the content folder... return "cannot determine package_id, view a page from the folder containing page \ - [$page set title]" + [$page set name]" } } Index: openacs-4/packages/xowiki/www/delete-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/delete-revision.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/delete-revision.tcl 25 Apr 2006 23:05:36 -0000 1.4 +++ openacs-4/packages/xowiki/www/delete-revision.tcl 3 May 2006 12:03:23 -0000 1.5 @@ -7,11 +7,11 @@ } { page_id:integer,notnull revision_id:integer,notnull - title + name } db_exec_plsql delete_revision { select content_revision__del(:revision_id) } ns_cache flush xotcl_object_cache ::$page_id -ad_returnredirect [export_vars -base revisions {page_id title}] \ No newline at end of file +ad_returnredirect [export_vars -base revisions {page_id name}] \ No newline at end of file Index: openacs-4/packages/xowiki/www/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/edit.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/xowiki/www/edit.tcl 13 Apr 2006 19:19:37 -0000 1.11 +++ openacs-4/packages/xowiki/www/edit.tcl 3 May 2006 12:03:23 -0000 1.12 @@ -6,11 +6,11 @@ @cvs-id $Id$ @param item_id If present, item to be edited - @param title Name of the item + @param name Name of the item @param object_type the source class providing the data source for filling the form } -query { item_id:integer,optional - title:optional + name:optional last_page_id:integer,optional folder_id:integer,optional {object_type:optional ::xowiki::Page} @@ -26,7 +26,7 @@ set page [CrItem instantiate -item_id $item_id] ;# no revision_id yet set folder_id [$page set parent_id] set object_type [$page info class] - if {$object_type eq "::xowiki::Object" && [$page set title] eq "::$folder_id"} { + if {$object_type eq "::xowiki::Object" && [$page set name] eq "::$folder_id"} { # if we edit the folder object, we have to do some extra magic here, since # the folder object has slightly different naming conventions. #ns_log notice "--editing folder object ::$folder_id" @@ -63,9 +63,9 @@ ::xowiki::f1 instvar edit_form_page_title context formTemplate if {[info exists item_id]} { - set rev_link [export_vars -base revisions {{page_id $item_id} title}] + set rev_link [export_vars -base revisions {{page_id $item_id} name}] } set view_link [export_vars -base view {item_id}] if {[info exists last_page_id]} { - set back_link [export_vars -base view {{item_id $last_page_id} title}] + set back_link [export_vars -base view {{item_id $last_page_id} name}] } 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.4 -r1.5 --- openacs-4/packages/xowiki/www/index.adp 24 Apr 2006 08:24:05 -0000 1.4 +++ openacs-4/packages/xowiki/www/index.adp 3 May 2006 12:03:23 -0000 1.5 @@ -1,5 +1,5 @@ - @page_title;noquote@ + @title;noquote@ @context;noquote@