Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.22 -r1.23 --- openacs-4/packages/xowiki/xowiki.info 6 Aug 2006 19:57:08 -0000 1.22 +++ openacs-4/packages/xowiki/xowiki.info 9 Aug 2006 00:37:52 -0000 1.23 @@ -8,40 +8,40 @@ 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-08-06 + 2006-08-09 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. 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.28: tag and improved weblog support. 0.30: symbolic oo interface, nicer links, permission management. 0.31: per package search. 0.32: new class ::xowiki::File for [[file:readme.pdf]] and [[image:picture.jpg]] 0.33: direct inclusion of xowiki pages via {{en:mypage}}, simpler default pages (see xowiki/www/default-pages). +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.28: tag and improved weblog support. 0.30: symbolic oo interface, nicer links, permission management. 0.31: per package search. 0.32: new class ::xowiki::File for [[file:readme.pdf]] and [[image:picture.jpg]] 0.33: direct inclusion of xowiki pages via {{en:mypage}}, simpler default pages (see xowiki/www/default-pages). 0.34: notifications BSD-Style 0 - + - + - + - + - + Index: openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml,v diff -u -r1.9 -r1.10 --- openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 31 Jul 2006 21:24:12 -0000 1.9 +++ openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 9 Aug 2006 00:37:52 -0000 1.10 @@ -1,5 +1,5 @@ - + Zur�ck Inhalt @@ -11,6 +11,7 @@ Sprache Name Neue Seite + Verst�ndigungen Titel der Seite Typ der Seite H�ufig verwendete Schlagworte 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.9 -r1.10 --- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 31 Jul 2006 21:24:12 -0000 1.9 +++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 9 Aug 2006 00:37:52 -0000 1.10 @@ -1,5 +1,5 @@ - + Admin Back @@ -13,6 +13,7 @@ Language Name New Page + Notifications Page Title Page Type Popular tags Index: openacs-4/packages/xowiki/lib/view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/lib/view.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/lib/view.tcl 26 Jul 2006 22:56:45 -0000 1.2 +++ openacs-4/packages/xowiki/lib/view.tcl 9 Aug 2006 00:37:52 -0000 1.3 @@ -1,5 +1,4 @@ - if {[info exists url]} { # new style, the url is sufficient regexp {^(/[^/]+)/?(.*)$} $url _ instance path @@ -11,7 +10,7 @@ } else { # old style, use item_id set m view - set page [::xowiki::Package instantiate_from_page -item_id $item_id] + set page [::xowiki::Package instantiate_page_from_id -item_id $item_id] $page instvar package_id set Package ::$package_id } 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.8 -r1.9 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 6 Aug 2006 19:57:09 -0000 1.8 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 9 Aug 2006 00:37:52 -0000 1.9 @@ -13,7 +13,7 @@ # Class create Link -parameter { - type name lang stripped_name label + type name lang stripped_name label page folder_id package_id } Link instproc init {} { @@ -32,7 +32,7 @@ return " \[ $label \] " } Link instproc render {} { - set page [my info parent] + set page [my page] set item_id [my resolve] #my log "--u resolve returns $item_id" if {$item_id} { @@ -79,7 +79,7 @@ Class create ::xowiki::Link::language -superclass ::xowiki::Link ::xowiki::Link::language instproc render {} { - set page [my info parent] + set page [my page] my instvar lang name package_id set item_id [my resolve] if {$item_id} { @@ -105,10 +105,12 @@ Class create ::xowiki::Link::image -superclass ::xowiki::Link ::xowiki::Link::image instproc render {} { my instvar name package_id label - set page [my info parent] + set page [my page] set item_id [my resolve] if {$item_id} { - set link [export_vars -base [::xowiki::Page pretty_link $name] {{m download}} ] + set base [::xowiki::Page pretty_link -absolute [$page absolute_links] $name] +my log "--l fully quali [$page absolute_links], base=$base" + set link [export_vars -base $base {{m download}} ] $page lappend references [list $item_id [my type]] my render_found $link $label } else { @@ -184,4 +186,4 @@ } Link instmixin add LinkCache -} \ No newline at end of file +} Index: openacs-4/packages/xowiki/tcl/notification-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/notification-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/tcl/notification-procs.tcl 9 Aug 2006 00:37:52 -0000 1.1 @@ -0,0 +1,118 @@ +ad_library { + XoWiki - Notification procs + + @creation-date 2006-08-08 + @author Gustaf Neumann + @cvs-id $Id: notification-procs.tcl,v 1.1 2006/08/09 00:37:52 gustafn Exp $ +} + +namespace eval ::xowiki { + + ad_proc -private ::xowiki::notifications-install {} { + + set impl_id [acs_sc::impl::new_from_spec -spec { + name xowiki_notif_type + contract_name NotificationType + owner xowiki + aliases { + GetURL xowiki::notification::get_url + ProcessReply xowiki::notification::process_reply + } + }] + + set type_id [notification::type::new \ + -sc_impl_id $impl_id \ + -short_name xowiki_notif \ + -pretty_name "XoWiki Notification" \ + -description "Notification of a new XoWiki page"] + + foreach delivery {email} { + notification::type::delivery_method_enable -type_id $type_id \ + -delivery_method_id [notification::delivery::get_id -short_name $delivery] + } + + foreach interval {instant hourly daily} { + notification::type::interval_enable -type_id $type_id \ + -interval_id [notification::interval::get_id_from_name -name $interval] + } + } + + + ad_proc -private ::xowiki::notifications-uninstall {} { + + set type_id [notification::type::get_type_id -short_name xowiki_notif] + + foreach delivery {email} { + notification::type::delivery_method_disable -type_id $type_id \ + -delivery_method_id [notification::delivery::get_id -short_name $delivery] + } + foreach interval {instant hourly daily} { + notification::type::interval_disable -type_id $type_id \ + -interval_id [notification::interval::get_id_from_name -name $interval] + } + + notification::type::delete -short_name xowiki_notif + + acs_sc::impl::delete \ + -contract_name "NotificationType" \ + -impl_name xowiki_notif_type + } +} + +namespace eval ::xowiki::notification { + + ad_proc -private get_url {revision_id} { + return [::xowiki::url $revision_id] + } + + + ad_proc -public do_notifications { + {-revision_id} + {-page} + {-html} + {-text} + {-new:boolean true} + } { + generate a notification + @param revision_id + @param new new or modified item + } { + + if {![info exists page]} { + set page [::xowiki::Package instantiate_page_from_id -revision_id $revision_id] + $page volatile + $page absolute_links 1 + set html [$page render] + set text [ad_html_text_convert -from text/html -to text/plain -- $html] + } + ns_log notice "xowiki::notification::do_notifications called for item_id [$page set revision_id]" + set link [::xowiki::Page pretty_link -absolute 1 [$page name]] + append html "

For more details, see [$page set title]

" + append text "\nFor more details, see $link\n" + + set state [expr {[$page set last_modified] eq [$page set creation_date] ? "New" : "Updated"}] + + notification::new \ + -type_id [notification::type::get_type_id -short_name xowiki_notif] \ + -object_id [$page set package_id] \ + -response_id [$page set revision_id] \ + -notif_subject "[$page set title] ($state)" \ + -notif_text $text \ + -notif_html $html \ + -notif_user [$page set creation_user] + } + + + ad_proc -private process_reply { reply_id} { + handles a reply to an xowiki notif + + @author Deds Castillo (deds@i-manila.com.ph) + @creation-date 2006-06-08 + + } { + # DEDS: need to decide on what to do with this + # do we publish it as comment? + # for now, drop it + return "f" + } +} 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.4 -r1.5 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Aug 2006 19:57:09 -0000 1.4 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 9 Aug 2006 00:37:52 -0000 1.5 @@ -5,11 +5,12 @@ #Package instproc create {name args} {if {![my isobject $name]} {next}} Package proc process_query {{-defaults ""}} { - my instvar queryparm formvars - if {![info exists query]} {set query [ns_conn query]} + my instvar queryparm form_parameter array unset queryparm array unset form_parameter array set queryparm $defaults + + set query [ns_conn query] foreach querypart [split $query &] { set att_val [split $querypart =] if {[llength $att_val] == 1} { @@ -22,16 +23,22 @@ foreach key [array names queryparm] {uplevel [list set $key $queryparm($key)]} } - Package proc instantiate_from_page {{-revision_id 0} {-item_id 0}} { + Package proc instantiate_page_from_id {{-revision_id 0} {-item_id 0}} { set page [::Generic::CrItem instantiate -item_id $item_id -revision_id $revision_id] set folder_id [$page set parent_id] set package_id [db_string get_pid "select package_id from cr_folders where folder_id = $folder_id"] $page set package_id $package_id - [self] create ::$package_id -folder_id $folder_id -use_ns_conn false + my create ::$package_id -folder_id $folder_id -use_ns_conn false ::$package_id set_url -url [Page pretty_link -package_id $package_id [$page name]] return $page } + Package proc get_url_from_id {{-item_id 0} {-revision_id 0}} { + set page [::xowiki::Package instantiate_page_from_id -item_id $item_id -revision_id $revision_id] + $page volatile + return [::[$page package_id] url] + } + Package instproc init args { my instvar id set id [namespace tail [self]] @@ -93,10 +100,11 @@ # create from default page set fn [get_server_root]/packages/xowiki/www/default-pages/$object.page my log "--sourcing page definition /packages/xowiki/www/default-pages/$object" - set F [open $fn]; set source [read $F]; close $F - set page [::xowiki::Page new -volatile -name $standard_page \ - -title $object -parent_id $folder_id -package_id $id \ - -text [list [string map [list >> ">>" << "<<"] $source] text/html]] + set page [source $fn] + $page configure -volatile -name $standard_page \ + -title $object -parent_id $folder_id -package_id $id \ + -text [list [string map [list >> "\n
>>" << "<<\n"] \ + [string trim [$page text] " \n"]] text/html] $page save_new return [my call $policy $page $method] } else { 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 9 Aug 2006 00:37:52 -0000 1.1 @@ -0,0 +1,195 @@ +ad_library { + XoWiki - Notification procs + + @creation-date 2006-08-08 + @author Gustaf Neumann + @cvs-id $Id: xowiki-callback-procs.tcl,v 1.1 2006/08/09 00:37:52 gustafn Exp $ +} + +namespace eval ::xowiki { + + ad_proc -private ::xowiki::after-install {} { + ::xowiki::sc::register_implementations + ::xowiki::notifications-install + } + + ad_proc -private ::xowiki::before-uninstall {} { + ::xowiki::sc::unregister_implementations + ::xowiki::notifications-uninstall + } + + + # + # upgrade logic + # + + ad_proc ::xowiki::upgrade_callback { + {-from_version_name:required} + {-to_version_name:required} + } { + + Callback for upgrading + + @author Gustaf Neumann (neumann@wu-wien.ac.at) + } { + ns_log notice "-- UPGRADE $from_version_name -> $to_version_name" + + if {$to_version_name eq "0.13"} { + ns_log notice "-- upgrading to 0.13" + set package_id [::Generic::package_id_from_package_key xowiki] + set folder_id [::xowiki::Page require_folder \ + -package_id $package_id \ + -name xowiki] + set r [::CrWikiPage instantiate_all -folder_id $folder_id] + db_transaction { + array set map { + ::CrWikiPage ::xowiki::Page + ::CrWikiPlainPage ::xowiki::PlainPage + ::PageTemplate ::xowiki::PageTemplate + ::PageInstance ::xowiki::PageInstance + } + foreach e [$r children] { + set oldClass [$e info class] + if {[info exists map($oldClass)]} { + set newClass $map($oldClass) + ns_log notice "-- old class [$e info class] -> $newClass, \ + fetching [$e set item_id] " + [$e info class] fetch_object -object $e -item_id [$e set item_id] + set oldtitle [$e set title] + $e append title " (old)" + $e save + $e class $newClass + $e set title $oldtitle + $e set name $oldtitle + $e save_new + } else { + ns_log notice "-- no new class for $oldClass" + } + } + } + } + + if {[apm_version_names_compare $from_version_name "0.19"] == -1 && + [apm_version_names_compare $to_version_name "0.19"] > -1} { + ns_log notice "-- upgrading to 0.19" + ::xowiki::sc::register_implementations + } + + if {[apm_version_names_compare $from_version_name "0.21"] == -1 && + [apm_version_names_compare $to_version_name "0.21"] > -1} { + ns_log notice "-- upgrading to 0.21" + db_1row create_att { + select content_type__create_attribute( + '::xowiki::Page','page_title','text', + 'Page Title',null,null,null,'text' )} + db_1row create_att { + select content_type__create_attribute( + '::xowiki::Page','creator','text', + 'Creator',null,null,null,'text' )} + db_1row refresh "select content_type__refresh_view('::xowiki::PlainPage') from dual" + db_1row refresh "select content_type__refresh_view('::xowiki::PageTemplate') from dual" + db_1row refresh "select content_type__refresh_view('::xowiki::PageInstance') from dual" + db_1row refresh "select content_type__refresh_view('::xowiki::Object') from dual" + } + + if {[apm_version_names_compare $from_version_name "0.22"] == -1 && + [apm_version_names_compare $to_version_name "0.22"] > -1} { + ns_log notice "-- upgrading to 0.22" + set folder_ids [list] + set package_ids [list] + db_foreach get_xowiki_packages {select * from apm_packages where package_key = 'xowiki'} { + set folder_id [db_string get_folder_id "select f.folder_id from cr_items c, cr_folders f \ + where c.name = 'xowiki: $package_id' and c.item_id = f.folder_id"] + if {$folder_id ne ""} { + db_dml update_package_id {update cr_folders set package_id = :package_id + where folder_id = :folder_id} + lappend folder_ids $folder_id + lappend package_ids $package_id + } + } + foreach f $folder_ids p $package_ids { + db_dml update_context_ids "update acs_objects set context_id = $p where object_id = $f" + } + } + + if {[apm_version_names_compare $from_version_name "0.25"] == -1 && + [apm_version_names_compare $to_version_name "0.25"] > -1} { + ns_log notice "-- upgrading to 0.25" + acs_sc::impl::new_from_spec -spec { + name "::xowiki::PageInstance" + aliases { + datasource ::xowiki::datasource + url ::xowiki::url + } + contract_name FtsContentProvider + owner xowiki + } +# foreach pkgid [site_node::get_children -package_key xowiki -all \ +# -node_id 0 -element package_id] { +# ::xowiki::Page reindex -package_id $pkgid +# } + } + + if {[apm_version_names_compare $from_version_name "0.27"] == -1 && + [apm_version_names_compare $to_version_name "0.27"] > -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_foreach 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')" {;} + } + + if {[apm_version_names_compare $from_version_name "0.30"] == -1 && + [apm_version_names_compare $to_version_name "0.30"] > -1} { + ns_log notice "-- upgrading to 0.30" + # delete orphan cr revisions, created automatically by content_item + # new, when e.g. a title is specified.... + foreach class {::xowiki::Page ::xowiki::PlainPage ::xowiki::Object + ::xowiki::PageTemplate ::xowiki::PageInstance} { + db_dml delete_orphan_revisions " + delete from cr_revisions where revision_id in ( + select r.revision_id from cr_items i,cr_revisions r + where i.content_type = '$class' and r.item_id = i.item_id + and not r.revision_id in (select [$class id_column] from [$class table_name])) + " + db_dml delete_orphan_items " + delete from acs_objects where object_type = '$class' + and not object_id in (select item_id from cr_items where content_type = '$class') + and not object_id in (select [$class id_column] from [$class table_name]) + " + } + } + + if {[apm_version_names_compare $from_version_name "0.31"] == -1 && + [apm_version_names_compare $to_version_name "0.31"] > -1} { + ns_log notice "-- upgrading to 0.31" + set folder_ids [list] + set package_ids [list] + db_foreach get_xowiki_packages {select * from apm_packages where package_key = 'xowiki'} { + set folder_id [db_string get_folder_id "select f.folder_id from cr_items c, cr_folders f \ + where c.name = 'xowiki: $package_id' and c.item_id = f.folder_id"] + if {$folder_id ne ""} { + db_dml update_package_id {update acs_objects set package_id = :package_id where object_id in + (select item_id as object_id from cr_items where parent_id = :folder_id)} + db_dml update_package_id {update acs_objects set package_id = :package_id where object_id in + (select r.revision_id as object_id from cr_revisions r, cr_items i where + i.item_id = r.item_id and i.parent_id = :folder_id)} + Package create ::$package_id -volatile -folder_id $folder_id -use_ns_conn false + ::$package_id reindex + } + } + } + + + if {[apm_version_names_compare $from_version_name "0.34"] == -1 && + [apm_version_names_compare $to_version_name "0.34"] > -1} { + ns_log notice "-- upgrading to 0.34" + ::xowiki::notifications-install + } + } + + +} \ No newline at end of file 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.47 -r1.48 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 6 Aug 2006 19:57:09 -0000 1.47 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 9 Aug 2006 00:37:52 -0000 1.48 @@ -100,174 +100,7 @@ "create index xowiki_tags_index_tag ON xowiki_tags(tag, package_id)" } - - # - # upgrade logic - # - - ad_proc ::xowiki::upgrade_callback { - {-from_version_name:required} - {-to_version_name:required} - } { - - Callback for upgrading - - @author Gustaf Neumann (neumann@wu-wien.ac.at) - } { - ns_log notice "-- UPGRADE $from_version_name -> $to_version_name" - - if {$to_version_name eq "0.13"} { - ns_log notice "-- upgrading to 0.13" - set package_id [::Generic::package_id_from_package_key xowiki] - set folder_id [::xowiki::Page require_folder \ - -package_id $package_id \ - -name xowiki] - set r [::CrWikiPage instantiate_all -folder_id $folder_id] - db_transaction { - array set map { - ::CrWikiPage ::xowiki::Page - ::CrWikiPlainPage ::xowiki::PlainPage - ::PageTemplate ::xowiki::PageTemplate - ::PageInstance ::xowiki::PageInstance - } - foreach e [$r children] { - set oldClass [$e info class] - if {[info exists map($oldClass)]} { - set newClass $map($oldClass) - ns_log notice "-- old class [$e info class] -> $newClass, \ - fetching [$e set item_id] " - [$e info class] fetch_object -object $e -item_id [$e set item_id] - set oldtitle [$e set title] - $e append title " (old)" - $e save - $e class $newClass - $e set title $oldtitle - $e set name $oldtitle - $e save_new - } else { - ns_log notice "-- no new class for $oldClass" - } - } - } - } - - if {[apm_version_names_compare $from_version_name "0.19"] == -1 && - [apm_version_names_compare $to_version_name "0.19"] > -1} { - ns_log notice "-- upgrading to 0.19" - ::xowiki::sc::register_implementations - } - - if {[apm_version_names_compare $from_version_name "0.21"] == -1 && - [apm_version_names_compare $to_version_name "0.21"] > -1} { - ns_log notice "-- upgrading to 0.21" - db_1row create_att { - select content_type__create_attribute( - '::xowiki::Page','page_title','text', - 'Page Title',null,null,null,'text' )} - db_1row create_att { - select content_type__create_attribute( - '::xowiki::Page','creator','text', - 'Creator',null,null,null,'text' )} - db_1row refresh "select content_type__refresh_view('::xowiki::PlainPage') from dual" - db_1row refresh "select content_type__refresh_view('::xowiki::PageTemplate') from dual" - db_1row refresh "select content_type__refresh_view('::xowiki::PageInstance') from dual" - db_1row refresh "select content_type__refresh_view('::xowiki::Object') from dual" - } - - if {[apm_version_names_compare $from_version_name "0.22"] == -1 && - [apm_version_names_compare $to_version_name "0.22"] > -1} { - ns_log notice "-- upgrading to 0.22" - set folder_ids [list] - set package_ids [list] - db_foreach get_xowiki_packages {select * from apm_packages where package_key = 'xowiki'} { - set folder_id [db_string get_folder_id "select f.folder_id from cr_items c, cr_folders f \ - where c.name = 'xowiki: $package_id' and c.item_id = f.folder_id"] - if {$folder_id ne ""} { - db_dml update_package_id {update cr_folders set package_id = :package_id - where folder_id = :folder_id} - lappend folder_ids $folder_id - lappend package_ids $package_id - } - } - foreach f $folder_ids p $package_ids { - db_dml update_context_ids "update acs_objects set context_id = $p where object_id = $f" - } - } - - if {[apm_version_names_compare $from_version_name "0.25"] == -1 && - [apm_version_names_compare $to_version_name "0.25"] > -1} { - ns_log notice "-- upgrading to 0.25" - acs_sc::impl::new_from_spec -spec { - name "::xowiki::PageInstance" - aliases { - datasource ::xowiki::datasource - url ::xowiki::url - } - contract_name FtsContentProvider - owner xowiki - } -# foreach pkgid [site_node::get_children -package_key xowiki -all \ -# -node_id 0 -element package_id] { -# ::xowiki::Page reindex -package_id $pkgid -# } - } - - if {[apm_version_names_compare $from_version_name "0.27"] == -1 && - [apm_version_names_compare $to_version_name "0.27"] > -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_foreach 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')" {;} - } - - if {[apm_version_names_compare $from_version_name "0.30"] == -1 && - [apm_version_names_compare $to_version_name "0.30"] > -1} { - ns_log notice "-- upgrading to 0.30" - # delete orphan cr revisions, created automatically by content_item - # new, when e.g. a title is specified.... - foreach class {::xowiki::Page ::xowiki::PlainPage ::xowiki::Object - ::xowiki::PageTemplate ::xowiki::PageInstance} { - db_dml delete_orphan_revisions " - delete from cr_revisions where revision_id in ( - select r.revision_id from cr_items i,cr_revisions r - where i.content_type = '$class' and r.item_id = i.item_id - and not r.revision_id in (select [$class id_column] from [$class table_name])) - " - db_dml delete_orphan_items " - delete from acs_objects where object_type = '$class' - and not object_id in (select item_id from cr_items where content_type = '$class') - and not object_id in (select [$class id_column] from [$class table_name]) - " - } - } - - if {[apm_version_names_compare $from_version_name "0.31"] == -1 && - [apm_version_names_compare $to_version_name "0.31"] > -1} { - ns_log notice "-- upgrading to 0.31" - set folder_ids [list] - set package_ids [list] - db_foreach get_xowiki_packages {select * from apm_packages where package_key = 'xowiki'} { - set folder_id [db_string get_folder_id "select f.folder_id from cr_items c, cr_folders f \ - where c.name = 'xowiki: $package_id' and c.item_id = f.folder_id"] - if {$folder_id ne ""} { - db_dml update_package_id {update acs_objects set package_id = :package_id where object_id in - (select item_id as object_id from cr_items where parent_id = :folder_id)} - db_dml update_package_id {update acs_objects set package_id = :package_id where object_id in - (select r.revision_id as object_id from cr_revisions r, cr_items i where - i.item_id = r.item_id and i.parent_id = :folder_id)} - Package create ::$package_id -volatile -folder_id $folder_id -use_ns_conn false - ::$package_id reindex - } - } - } - } - - # # Page definitions # @@ -284,13 +117,15 @@ {lang_links ""} {lang en} {render_adp 1} + {absolute_links 0} } Page set recursion_count 0 Page array set RE { include {([^\\]){{(.+)}}[ \n\r]*} anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} - div {()([^\\])>>([^&]*)<<} + div {()([^\\])>>([^&]*)<<()([ \n]*
)?} clean {[\\](\{\{|>>|\[\[)} + clean2 {
*(" @@ -544,7 +379,7 @@ if {![info exists lang] && ![regexp {^(:|(file|image))} $name]} { set lang [string range [lang::conn::locale] 0 1] } - set host [expr {$fully_qualified ? [ad_url] : ""}] + set host [expr {$absolute ? [ad_url] : ""}] if {[info exists lang]} { return $host${url}$lang/[ad_urlencode $name] } else { @@ -589,7 +424,7 @@ } return "" } - + # # tag management, get_tags works on instance or gobally # @@ -746,6 +581,7 @@ if {$label eq $arg} {set label $stripped_name} Link create [self]::link \ + -page [self] \ -type $link_type -name $name -lang $lang \ -stripped_name $normalized_name -label $label \ -folder_id $parent_id -package_id $package_id @@ -780,6 +616,7 @@ set l [my regsub-eval $RE(div) $l {my div "\2" "\3"}] set l [my regsub-eval $RE(include) $l {my include "\1" "\2"}] regsub -all $RE(clean) $l {\1} l + regsub -all $RE(clean2) $l { \1} l append content [string range $l 1 end] \n set l " " } @@ -902,6 +739,7 @@ anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} div {()([^\\])>>([^<]*)<<} clean {[\\](\{\{|>>|\[\[)} + clean2 {(--DUMMY NOT USED--)} } PlainPage instproc get_content {} { @@ -971,6 +809,7 @@ if {$link_type eq "image"} { set l [Link new -volatile \ + -page [self] \ -type $link_type -name $name -lang "" \ -stripped_name $stripped_name -label $label \ -folder_id $parent_id -package_id $package_id] @@ -1075,4 +914,4 @@ } -source [file dirname [info script]]/xowiki-www-procs.tcl \ No newline at end of file +source [file dirname [info script]]/xowiki-www-procs.tcl 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.13 -r1.14 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 5 Aug 2006 22:22:54 -0000 1.13 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 9 Aug 2006 00:37:52 -0000 1.14 @@ -15,13 +15,17 @@ } { ns_log notice "--sc datasource called with revision_id = $revision_id" - set page [::xowiki::Package instantiate_from_page -revision_id $revision_id] + set page [::xowiki::Package instantiate_page_from_id -revision_id $revision_id] $page volatile + $page absolute_links 1 + ns_log notice "--sc setting absolute link for page = $page" set html [$page render] set text [ad_html_text_convert -from text/html -to text/plain -- $html] #set text [ad_text_to_html $html]; #this could be used for entity encoded html text in rss entries + ::xowiki::notification::do_notifications -page $page -html $html -text $text + #ns_log notice "--sc INDEXING $revision_id -> $text" #$page set unresolved_references 0 $page instvar item_id @@ -42,7 +46,7 @@ content $text keywords [array names word] \ storage_type text mime text/html \ syndication [list \ - link [::xowiki::Page pretty_link -fully_qualified 1 [$page set name]] \ + link [::xowiki::Page pretty_link -absolute 1 [$page set name]] \ description $text \ author [$page set creator] \ category "" \ @@ -51,24 +55,19 @@ ] } -ad_proc -private ::xowiki::url { revision_id } { - @param revision_id - +ad_proc -private ::xowiki::url { revision_id} { returns a url for a message to the search package } { - set page [::xowiki::Package instantiate_from_page -revision_id $revision_id] - $page volatile - return [::[$page package_id] url] + return [::xowiki::Package get_url_from_id -revision_id $revision_id] } +namespace eval ::xowiki::sc { -namespace eval ::xowiki::sc {} - -ad_proc -private ::xowiki::sc::register_implementations {} { + ad_proc -private ::xowiki::sc::register_implementations {} { Register the content type fts contract -} { - acs_sc::impl::new_from_spec -spec { + } { + acs_sc::impl::new_from_spec -spec { name "::xowiki::Page" aliases { datasource ::xowiki::datasource @@ -106,11 +105,11 @@ } } -ad_proc -private ::xowiki::sc::unregister_implementations {} { - acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::Page - acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::PlainPage - acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::PageInstance - acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::File + ad_proc -private ::xowiki::sc::unregister_implementations {} { + acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::Page + acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::PlainPage + acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::PageInstance + acs_sc::impl::delete -contract_name FtsContentProvider -impl_name ::xowiki::File + } } - 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.6 -r1.7 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 7 Aug 2006 20:58:41 -0000 1.6 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 9 Aug 2006 00:37:52 -0000 1.7 @@ -27,8 +27,8 @@ # move require folder object code # edit-new last_page_id (needed?) # edit last_page_id (needed?) +# nicer title + content for notification; my-wiki, - namespace eval ::xowiki { Page instproc view {} { @@ -88,6 +88,11 @@ set return_url [my query_parameter "edit_return_url"] } + if {[$package_id get_parameter "use_notifications" 1]} { + set notification_type [notification::type::get_type_id -short_name xowiki_notif] + set notification_link /notifications/request-new?return_url=/xowiki&type_id=$notification_type&object_id=$package_id + } + my log "--after gc title=$title" if {$master} { set context [list $title] @@ -126,7 +131,7 @@ content references lang_links package_id rev_link edit_link delete_link new_link admin_link index_link tags no_tags tags_with_links save_tag_link popular_tags_link - gc_link gc_comments + gc_link gc_comments notification_link } } } else { @@ -305,4 +310,4 @@ [my title]\
[next]
" } -} \ No newline at end of file +} 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.4 -r1.5 --- openacs-4/packages/xowiki/www/view-default.adp 5 Aug 2006 20:55:08 -0000 1.4 +++ openacs-4/packages/xowiki/www/view-default.adp 9 Aug 2006 00:37:53 -0000 1.5 @@ -31,6 +31,7 @@ #xotcl-core.revisions# · #xowiki.new# · #xowiki.delete# · + #xowiki.notifications# · #xowiki.admin# · #xowiki.search# · #xowiki.index# 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.2 -r1.3 --- openacs-4/packages/xowiki/www/view-links.adp 31 Jul 2006 21:37:05 -0000 1.2 +++ openacs-4/packages/xowiki/www/view-links.adp 9 Aug 2006 00:37:53 -0000 1.3 @@ -3,6 +3,7 @@ #xotcl-core.revisions# · #xowiki.new# · #xowiki.delete# · + #xowiki.notifications# · #xowiki.admin# · #xowiki.search# · #xowiki.index# Fisheye: Tag 1.23 refers to a dead (removed) revision in file `openacs-4/packages/xowiki/www/view.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/xowiki/www/default-pages/index.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/default-pages/Attic/index.page,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/default-pages/index.page 6 Aug 2006 19:57:09 -0000 1.1 +++ openacs-4/packages/xowiki/www/default-pages/index.page 9 Aug 2006 00:37:53 -0000 1.2 @@ -1,5 +1,9 @@ +::xowiki::Page new -title "Index Page" -text { +

-This is the default start page of XoWiki. You can edit this page and save it to provide a personalized look of the XoWiki instance. You can as well provide a different index page through configuration. For more details, consult the [[http://media.wu-wien.ac.at/download/xowiki-doc/|XoWiki documentation]]. +This is the default start page of XoWiki. You can edit this page and save it to provide a personalized look of the XoWiki instance. You can as well provide a different index page through configuration. +You can also view the contents of the Wiki in a weblog style. +For more details, consult the [[http://media.wu-wien.ac.at/download/xowiki-doc/|XoWiki documentation]].

>>left-col<< {{adp portlets/recent {name {Recently Changed Pages} max_entries 25} }} @@ -10,6 +14,8 @@ {{adp portlets/most-popular {name {Most Popular} max_entries 10 }}} >><< +} + Index: openacs-4/packages/xowiki/www/default-pages/weblog.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/default-pages/Attic/weblog.page,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/default-pages/weblog.page 6 Aug 2006 19:57:09 -0000 1.1 +++ openacs-4/packages/xowiki/www/default-pages/weblog.page 9 Aug 2006 00:37:53 -0000 1.2 @@ -1,3 +1,4 @@ +::xowiki::Page new -title "Index Page" -text { >>content<< {{adp portlets/weblog {name Weblog}}} >><< @@ -7,7 +8,7 @@ {{adp portlets/tags {skin plain-include popular 1 limit 30}}} {{adp portlets/categories {count 1 skin plain-include}}} >><< +} - Index: openacs-4/packages/xowiki/www/resources/xowiki.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/xowiki.css,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/resources/xowiki.css 6 Aug 2006 19:57:09 -0000 1.2 +++ openacs-4/packages/xowiki/www/resources/xowiki.css 9 Aug 2006 00:37:53 -0000 1.3 @@ -6,6 +6,7 @@ #wikicmds {position: relative; top: -24px; right: 0px; height: 0px; text-align: right; font-family: sans-serif; font-size: 85%;color: #7A7A78;} #portal #wikicmds {top: -90px} +#page-body #wikicmds {top: -30px} #wikicmds a, #wikicmds a:visited { color: #7A7A78; text-decoration: none;} #wikicmds a:hover {text-decoration: underline;} #wikicmds a:active {color: rgb(255,153,51);}