Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.36 -r1.37 --- openacs-4/packages/xowiki/xowiki.info 26 Dec 2006 11:31:37 -0000 1.36 +++ openacs-4/packages/xowiki/xowiki.info 29 Dec 2006 11:01:35 -0000 1.37 @@ -8,30 +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-12-26 + 2006-12-29 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). 0.34: notifications; 0.36: prototypes, direct includes, context handling; 0.37: initial reqression testing (118 tests); 0.38: production_mode, virtual presence, google-sitemap. 0.39: version diff, provide image properties in xowiki-pages, specify how links can be generated; 0.41: digg and delicious buttons +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; 0.36: prototypes, direct includes, context handling; 0.37: initial reqression testing (118 tests); +0.38: production_mode, virtual presence, google-sitemap. +0.39: version diff, provide image properties in xowiki-pages, specify how links can be generated; +0.41: book-style (toc and book portlet, based on yui treeview), use language prefix to avoid clashes, ltree (for ordering) 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.10 -r1.11 --- openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 9 Aug 2006 00:37:52 -0000 1.10 +++ openacs-4/packages/xowiki/catalog/xowiki.de_DE.ISO-8859-1.xml 29 Dec 2006 11:01:36 -0000 1.11 @@ -1,6 +1,7 @@ - + + Administrator Zur�ck Inhalt L�schen @@ -12,10 +13,13 @@ Name Neue Seite Verst�ndigungen + Abschnitt + Titel der Seite Typ der Seite H�ufig verwendete Schlagworte h�ufige Schlagworte + Freigegeben Verweise auf diese Seite: Verlauf Suche 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.12 -r1.13 --- openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 2 Dec 2006 19:08:23 -0000 1.12 +++ openacs-4/packages/xowiki/catalog/xowiki.en_US.ISO-8859-1.xml 29 Dec 2006 11:01:36 -0000 1.13 @@ -1,5 +1,5 @@ - + Admin Back @@ -14,6 +14,7 @@ Name New Page Notifications + Section Page Title Page Type Popular tags 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.27 -r1.28 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 21 Dec 2006 11:55:29 -0000 1.27 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 29 Dec 2006 11:01:36 -0000 1.28 @@ -79,7 +79,18 @@ Package instproc default_language {} { return [string range [my default_locale] 0 1] } - + Package array set www-file { + admin 1 + diff 1 + doc 1 + edit 1 + error-template 1 + portlet 1 portlet-ajax 1 portlets 1 + prototypes 1 + ressources 1 + revisions 1 + view-default view-links view-plain oacs-view + } Package instproc pretty_link { {-anchor ""} {-absolute:boolean false} {-lang ""} name } { @@ -101,7 +112,7 @@ # don't compact the the path for images etc. to avoid conflicts with e.g. //../image/* set package_prefix [my package_url] } - if {$lang ne $default_lang} { + if {$lang ne $default_lang || [[self class] exists www-file($name)]} { return ${host}${package_prefix}${lang}/[ad_urlencode $name]$anchor } else { return ${host}${package_prefix}[ad_urlencode $name]$anchor @@ -173,7 +184,9 @@ # we have no object, but as well no method callable on the package set object [$id get_parameter index_page "index"] } + #my log "--o try index '$object'" set page [my resolve_request -path $object] + #my log "--o page is '$page'" if {$page ne ""} { return $page } @@ -184,7 +197,7 @@ # try standard page set standard_page [$id get_parameter ${object}_page] - #my log "--o standard_page == $standard_page" + #my log "--o standard_page '$standard_page'" if {$standard_page ne ""} { set page [my resolve_request -path $standard_page] if {$page ne ""} { @@ -316,7 +329,7 @@ # we have no folder object yet. so we create one... ::xowiki::Object create ::$folder_id ::$folder_id set text "# this is the payload of the folder object\n\n\ - set index_page \"en:index\"\n" + #set index_page \"index\"\n" ::$folder_id set parent_id $folder_id ::$folder_id set name ::$folder_id ::$folder_id set title ::$folder_id Index: openacs-4/packages/xowiki/tcl/weblog-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/weblog-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 17 Nov 2006 21:26:23 -0000 1.2 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 29 Dec 2006 11:01:36 -0000 1.3 @@ -73,6 +73,7 @@ } return $content }] + foreach i [split [my exclude_item_ids] ,] {lappend ::xowiki_page_item_id_rendered $i} set sql \ [list -folder_id $folder_id \ @@ -82,6 +83,7 @@ -extra_from_clause $extra_from_clause \ -extra_where_clause "and ci.item_id not in ([my exclude_item_ids]) \ and ci.name != '::$folder_id' and ci.name not like '%weblog%' $date_clause \ + [::xowiki::Page container_already_rendered ci.item_id] \ and ci.content_type not in ('::xowiki::PageTemplate','::xowiki::Object') \ and ci.publish_status <> 'production' \ $extra_where_clause" ] 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 -r1.5 -r1.6 --- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 10 Dec 2006 16:56:52 -0000 1.5 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 29 Dec 2006 11:01:36 -0000 1.6 @@ -206,7 +206,30 @@ "create index xowiki_last_visited_time_idx on xowiki_last_visited(time)" } } - + + if {[apm_version_names_compare $from_version_name "0.42"] == -1 && + [apm_version_names_compare $to_version_name "0.42"] > -1} { + ns_log notice "-- upgrading to 0.42" + ::xowiki::add_ltree_order_column + # get rid of obsolete column + catch {db_1row delete_att { + select content_type__drop_attribute('::xowiki::Page','page_title', 't'::boolean)} + } + db_dml create_view "create or replace view xowiki_page_live_revision as select p.*, \ + cr.*,ci.parent_id, ci.name, ci.locale, ci.live_revision, ci.latest_revision, ci.publish_status, \ + ci.content_type, ci.storage_type, ci.storage_area_key, ci.tree_sortkey, ci.max_child_sortkey \ + from xowiki_page p, cr_items ci, cr_revisions cr \ + where p.page_id = ci.live_revision \ + and p.page_id = cr.revision_id \ + and ci.publish_status <> 'production'" + # drop old non-conformant indices + foreach index { xowiki_ref_index + xowiki_last_visited_index_unique xowiki_last_visited_index + xowiki_tags_index_tag xowiki_tags_index_user + } { + catch {db_dml drop_index "drop index $index"} + } + } } ad_proc fix_all_package_ids {} { @@ -236,4 +259,29 @@ } } + ad_proc add_ltree_order_column {} { + add ltree order column, if ltree is configured + } { + if {[::xo::has_ltree]} { + set object_type ::xowiki::Page + set attribute_name page_order + set datatype text + set pretty_name Order + set sqltype ltree + # catch sql statement to allow multiple runs + catch {db_1row create_att {select content_type__create_attribute( + :object_type,:attribute_name,:datatype, + :pretty_name,null,null,null,:sqltype)}} + db_dml create_index "create index xowiki_page_page_order_idx \ + on xowiki_page using gist (page_order)" + foreach type [db_list get_xowiki_types \ + "select object_type from acs_object_types \ + where supertype like '::xowiki::%'"] { + db_1row refresh "select content_type__refresh_view('$type') from dual" + } + return 1 + } + return 0 + } + } \ No newline at end of file Index: openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 5 Dec 2006 17:52:44 -0000 1.22 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 29 Dec 2006 11:01:36 -0000 1.23 @@ -15,6 +15,8 @@ Class create WikiForm -superclass ::Generic::Form \ -parameter { {field_list {item_id name title creator text description nls_language}} + {f.page_order + {page_order:text,optional {label #xowiki.order#} {html {align right}} }} {f.item_id {item_id:key}} {f.name @@ -51,7 +53,9 @@ WikiForm instproc mkFields {} { my instvar data set __fields "" - foreach __field [my field_list] { + set field_list [my field_list] + if {[::xo::has_ltree]} {set field_list [linsert $field_list 2 page_order]} + foreach __field $field_list { set __spec [my set f.$__field] if {[string first "richtext" [lindex $__spec 0]] > -1} { # we have a richtext widget; get special configuration is specified 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.7 -r1.8 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 25 Dec 2006 21:26:21 -0000 1.7 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 29 Dec 2006 11:01:36 -0000 1.8 @@ -32,7 +32,9 @@ return [list $locale $locale_clause] } +} +namespace eval ::xowiki::portlet { ############################################################################# # dotlrn style portlet decoration for includelets # @@ -47,7 +49,6 @@ ############################################################################# # rss button # - Class create rss-button \ -superclass ::xowiki::Portlet \ -parameter {{__decoration plain}} @@ -60,9 +61,11 @@ my get_parameters return "RSS" } +} +namespace eval ::xowiki::portlet { ############################################################################# - # valid parameters from the adp include are + # valid parameters for he categories portlet are # tree_name: match pattern, if specified displays only the trees # with matching names # no_tree_name: if specified, tree names are not displayed @@ -177,7 +180,10 @@ } return $content } +} + +namespace eval ::xowiki::portlet { ############################################################################# # $Id$ # display recent entries by categories @@ -246,7 +252,10 @@ } return [$cattree render] } +} + +namespace eval ::xowiki::portlet { ############################################################################# # # display recent entries @@ -287,8 +296,9 @@ } return [t1 asHTML] } +} - +namespace eval ::xowiki::portlet { ############################################################################# # $Id$ # display last visited entries @@ -329,7 +339,10 @@ } return [t1 asHTML] } +} + +namespace eval ::xowiki::portlet { ############################################################################# # # list the most popular pages @@ -368,7 +381,9 @@ } return [t1 asHTML] } +} +namespace eval ::xowiki::portlet { ############################################################################# # # Show the tags @@ -410,11 +425,12 @@ return $content } +} +namespace eval ::xowiki::portlet { ############################################################################# # presence # - Class create presence \ -superclass ::xowiki::Portlet \ -parameter {{__decoration plain}} @@ -468,28 +484,157 @@ set users [expr {$count == 0 ? "No users" : "$count users"}] return "

$users $what

$output
" } +} + +namespace eval ::xowiki::portlet { ############################################################################# - # this might become some usful stuff for digg + # portlets based on order # - - Class create digg \ + Class create toc \ -superclass ::xowiki::Portlet \ -parameter {{__decoration plain}} - digg instproc render {} { - # use "span" to specify parameters to the rss call - my initialize -parameter {} +#"select page_id, page_order, name, title, \ +# (select count(*)-1 from xowiki_page_live_revision where page_order <@ p.page_order) as count \ +# from xowiki_page_live_revision p where not page_order is NULL order by page_order asc" + + toc instproc count {} {return [my set navigation(count)]} + toc instproc current {} {return [my set navigation(current)]} + toc instproc position {} {return [my set navigation(position)]} + toc instproc page_name {p} {return [my set page_name($p)]} + + toc instproc get_nodes {open_page package_id expand_all} { + my instvar navigation page_name book_mode + array set navigation {parent "" position 0 current ""} + + set js "" + set node() root + set node_cnt 0 + set folder_id [$package_id set folder_id] + db_foreach get_nodes "select page_id, page_order, name, title \ + from xowiki_page_live_revision p \ + where parent_id = $folder_id \ + and not page_order is NULL order by page_order asc" { + set label "$page_order $title" + set jsobj obj[set node($page_order) tmpNode[incr node_cnt]] + set page_name($node_cnt) $name + if {![regexp {^(.*)[.]([^.]+)} $page_order _ parent]} {set parent ""} + + if {$book_mode} { + regexp {^.*:([^:]+)$} $name _ anchor + set href [$package_id url]#$anchor + } else { + set href [$package_id pretty_link $name] + } + + if {$expand_all} { + set expand "true" + } else { + set expand [expr {$open_page eq $name} ? "true" : "false"] + if {$expand} { + set navigation(parent) $parent + set navigation(position) $node_cnt + set navigation(current) $page_order + for {set p $parent} {$p ne ""} {} { + append js "$node($p).expand();\n" + if {![regexp {^(.*)[.]([^.]+)} $p _ p]} {set p ""} + } + } + } + set parent_node [expr {[info exists node($parent)] ? $node($parent) : "root"}] + append js \ + "var $jsobj = {label: '$label', href:\"$href\"};" \ + "var $node($page_order) = new YAHOO.widget.TextNode($jsobj, $parent_node, $expand);\n" + } + set navigation(count) $node_cnt + my log "--COUNT=$node_cnt" + return $js + } + + toc instproc render {} { + my initialize -parameter { + {-style ""} + {-open_page ""} + {-book_mode false} + {-expand_all false} + } my get_parameters - my instvar __including_page - set description [$__including_page set description] - if {$description eq ""} { - set description [ad_html_text_convert -from text/html -to text/plain -- \ - [$__including_page set text]] + switch -- $style { + "menu" {set s "menu/"} + "folders" {set s "folders/"} + "default" {set s ""} } - return "
\ - $description
" + ::xowiki::Page requireCSS "/resources/ajaxhelper/yui/treeview/assets/${s}tree.css" + ::xowiki::Page requireJS "/resources/ajaxhelper/yui/yahoo/yahoo.js" + ::xowiki::Page requireJS "/resources/ajaxhelper/yui/event/event.js" + ::xowiki::Page requireJS "/resources/ajaxhelper/yui/treeview/treeview.js" + + my set book_mode $book_mode + if {!$book_mode} { + my set book_mode [[my set __including_page] exists __is_book_page] + } + set js_tree_cmds [my get_nodes $open_page $package_id $expand_all] + + return "
+ +
" } + ############################################################################# + # book style + # + Class create book \ + -superclass ::xowiki::Portlet \ + -parameter {{__decoration plain}} + book instproc render {} { + my initialize -parameter { } + my get_parameters + + my instvar __including_page + lappend ::xowiki_page_item_id_rendered [$__including_page item_id] + $__including_page set __is_book_page 1 + + set folder_id [$package_id set folder_id] + set page_infos [db_list_of_lists get_page_infos \ + "select page_id, page_order, name, title, nlevel(page_order)+1, item_id \ + from xowiki_page_live_revision p \ + where parent_id = $folder_id \ + and not page_order is NULL \ + [::xowiki::Page container_already_rendered item_id] \ + order by page_order asc"] + + set output "" + set return_url [::xo::cc url] + foreach page_info $page_infos { + foreach {page_id page_order name title level item_id} $page_info break + set p [::Generic::CrItem instantiate -item_id 0 -revision_id $page_id] + $p destroy_on_cleanup + set p_link [$package_id pretty_link $name] + set edit_link [$p make_link -url $p_link $p edit return_url] + if {$edit_link ne ""} { + set edit_markup "
" + } else { + set edit_markup "" + } + + $p set render_adp 0 + regexp {^.*:([^:]+)$} $name _ anchor + append output "" \ + $edit_markup \ + "$page_order $title" \ + [$p render] + } + return $output + } } 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.62 -r1.63 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 22 Dec 2006 11:57:53 -0000 1.62 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 29 Dec 2006 11:01:36 -0000 1.63 @@ -16,8 +16,10 @@ -table_name "xowiki_page" -id_column "page_id" \ -mime_type text/html \ -cr_attributes { - ::Generic::Attribute new -attribute_name page_title -datatype text \ - -pretty_name "Page Title" + if {[::xo::has_ltree]} { + ::Generic::Attribute new -attribute_name page_order -datatype text \ + -pretty_name "Order" -sqltype ltree + } ::Generic::Attribute new -attribute_name creator -datatype text \ -pretty_name "Creator" } \ @@ -60,48 +62,49 @@ # - # create reference table and table for user tracking + # create various extra tables, indices and views # - - if {![db_0or1row check-xowiki-references-table \ - "select tablename from pg_tables where tablename = 'xowiki_references'"]} { - db_dml create-xowiki-references-table "create table xowiki_references( - reference integer references cr_items(item_id) on delete cascade, - link_type text, - page integer references cr_items(item_id) on delete cascade)" - db_dml create-xowiki-references-index \ - "create index xowiki_ref_index ON xowiki_references(reference)" - } - if {![db_0or1row check-xowiki-last-visited-table \ - "select tablename from pg_tables where tablename = 'xowiki_last_visited'"]} { - db_dml create-xowiki-last-visited-table "create table xowiki_last_visited( - page_id integer references cr_items(item_id) on delete cascade, + ::xo::db::require table xowiki_references \ + "reference integer references cr_items(item_id) on delete cascade, + link_type text, + page integer references cr_items(item_id) on delete cascade" + ::xo::db::require index -table xowiki_references -col reference + + + ::xo::db::require table xowiki_last_visited \ + "page_id integer references cr_items(item_id) on delete cascade, package_id integer, user_id integer, count integer, - time timestamp)" - db_dml create-xowiki-last-visited-update-index \ - "create unique index xowiki_last_visited_index_unique ON xowiki_last_visited(user_id, page_id)" - db_dml create-xowiki-last-visited-index \ - "create index xowiki_last_visited_index ON xowiki_last_visited(user_id, package_id)" - db_dml create-xowiki-last-visited-time-idx \ - "create index xowiki_last_visited_time_idx on xowiki_last_visited(time)" - } + time timestamp" + ::xo::db::require index -table xowiki_last_visited -col user_id,page_id -unique true + ::xo::db::require index -table xowiki_last_visited -col user_id,package_id + ::xo::db::require index -table xowiki_last_visited -col time - if {![db_0or1row check-tag-table \ - "select tablename from pg_tables where tablename = 'xowiki_tags'"]} { - db_dml create-xowiki-tag-table "create table xowiki_tags( - item_id integer references cr_items(item_id) on delete cascade, + + ::xo::db::require table xowiki_tags \ + "item_id integer references cr_items(item_id) on delete cascade, package_id integer, user_id integer references users(user_id), tag text, - time timestamp)" - db_dml create-xowiki-tags-index-user \ - "create index xowiki_tags_index_user ON xowiki_tags(user_id, item_id)" - db_dml create-xowiki-tags-index-tag \ - "create index xowiki_tags_index_tag ON xowiki_tags(tag, package_id)" + time timestamp" + ::xo::db::require index -table xowiki_tags -col user_id,item_id + ::xo::db::require index -table xowiki_tags -col tag,package_id + + + if {[::xo::has_ltree]} { + ::xo::db::require index -table xowiki_page -col page_order -using gist } + ::xo::db::require view xowiki_page_live_revision \ + "select p.*, cr.*,ci.parent_id, ci.name, ci.locale, ci.live_revision, \ + ci.latest_revision, ci.publish_status, ci.content_type, ci.storage_type, \ + ci.storage_area_key, ci.tree_sortkey, ci.max_child_sortkey \ + from xowiki_page p, cr_items ci, cr_revisions cr \ + where p.page_id = ci.live_revision \ + and p.page_id = cr.revision_id \ + and ci.publish_status <> 'production'" + # # Page definitions # @@ -127,7 +130,7 @@ Page array set RE { include {([^\\]){{([^<]+)}}[ \n\r]*} anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} - div {()([^\\])>>([^&]*)<<()([ \n]*
)?} + div {()([^\\])>>([^&<]*)<<()([ \n]*
)?} clean {[\\](\{\{|>>|\[\[)} clean2 {
*(\n" } - foreach file [array names ::need_js] { - append result "" + } } return $result } @@ -479,7 +487,11 @@ return [uplevel export_vars -base [list $base] [list $args]] } } elseif {[$object istype ::xowiki::Page]} { - set base [$package_id url] + if {[info exists url]} { + set base $url + } else { + set base [$package_id url] + } lappend args [list m $method] return [uplevel export_vars -base [list $base] [list $args]] } @@ -585,6 +597,7 @@ set page [$package_id resolve_page $page_name __m] catch {$page set __decoration portlet} } + my set __last_includelet $page if {$page ne ""} { $page destroy_on_cleanup $page set __including_page [self] @@ -811,10 +824,17 @@ } } + Page proc container_already_rendered {field} { + if {![info exists ::xowiki_page_item_id_rendered]} { + return "" + } + my log "--OMIT and not $field in ([join $::xowiki_page_item_id_rendered ,])" + return "and not $field in ([join $::xowiki_page_item_id_rendered ,])" + } + Page instproc render {-update_references:switch} { - my instvar item_id references lang render_adp unresolved_references parent_id + my instvar item_id revision_id references lang render_adp unresolved_references parent_id #my log "-- my class=[my info class]" - set name [my set name] regexp {^(..):(.*)$} $name _ lang name set references [list] 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.25 -r1.26 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 26 Dec 2006 11:31:37 -0000 1.25 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 29 Dec 2006 11:01:36 -0000 1.26 @@ -153,8 +153,8 @@ } set digg_link [export_vars -base "http://digg.com/submit" { {phase 2} - {url "[ns_conn location][::xo::cc url]"} - {title "[string range $title 0 74]"} + {url "[ns_conn location][::xo::cc url]"} + {title "[string range $title 0 74]"} {body_text "[string range $digg_description 0 349]"} }] } @@ -170,15 +170,14 @@ # http://farm.tucows.com/blog/_archives/2005/3/24/462869.html#adding set delicious_link [export_vars -base "http://del.icio.us/post" { {v 4} - {url "[ns_conn location][::xo::cc url]"} + {url "[ns_conn location][::xo::cc url]"} {title "[string range $title 0 79]"} {notes "[string range $delicious_description 0 199]"} tags }] } #my log "--after delicious" - set header_stuff [::xowiki::Page header_stuff] set master [my query_parameter "master" 1] #if {[my exists_query_parameter "edit_return_url"]} { # set return_url [my query_parameter "edit_return_url"] @@ -218,14 +217,15 @@ if {![regexp {^[./]} $template_file]} { set template_file /packages/xowiki/www/$template_file } + set header_stuff [::xowiki::Page header_stuff] $package_id return_page -adp $template_file -variables { references name title item_id page context header_stuff return_url 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 per_object_categories_with_links digg_link delicious_link gc_link gc_comments notification_subscribe_link notification_image - top_portlets + top_portlets page } } } else { Index: openacs-4/packages/xowiki/www/view-book.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-book.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/view-book.adp 29 Dec 2006 11:01:36 -0000 1.1 @@ -0,0 +1,125 @@ + + @title;noquote@ + @context;noquote@ + @header_stuff;noquote@ + + + + + + + + + +
+ +
+
+@toc;noquote@ +
+
@top_portlets;noquote@ + + +
+ + + + + + + + +
+ + + Previous + + No Previous + + + + +
@book_relpos@
+
+
+ + + Next + + No Next +
+
+ +@page_title;noquote@ + + +@content;noquote@ + +
+
+
+ +
Digg!
+
+ + + +
+ +#xowiki.references_label# @references;noquote@ @lang_links;noquote@ + +
+ +#xowiki.your_tags_label#: @tags_with_links;noquote@ +(#xowiki.edit_link#, +#xowiki.popular_tags_link#) + +
+
+ +Categories: @per_object_categories_with_links;noquote@ + +

+ +

#general-comments.Comments# +

    @gc_comments;noquote@

+
+ +

@gc_link;noquote@

+
Index: openacs-4/packages/xowiki/www/view-book.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-book.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/view-book.tcl 29 Dec 2006 11:01:36 -0000 1.1 @@ -0,0 +1,15 @@ + +#ns_log notice "--including_page= $__including_page, portlet=$portlet" +set toc [$page include_portlet [list toc -open_page $name -decoration plain]] +set i [$page set __last_includelet] +my log "--last includelet = [$page set __last_includelet] [$page exists __is_book_page]" +if {$i ne "" && ![$page exists __is_book_page]} { + set p [$i position] + set count [$i count] + set book_relpos [format %.2f%% [expr {100.0 * $p / $count}]] + if {$p>1} {set book_prev_link [$package_id pretty_link [$i page_name [expr {$p - 1}]]]} + if {$p<$count} {set book_next_link [$package_id pretty_link [$i page_name [expr {$p + 1}]]]} + ns_log notice "--p=$p, count=$count, relpos=$book_relpos, {100.0 * $p / $count} next=[info exists next_link], prev=[info exists prev_link]" + set page_title "

[$i current] $title

" +} +set header_stuff [::xowiki::Page header_stuff] Index: openacs-4/packages/xowiki/www/admin/list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/list.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/xowiki/www/admin/list.tcl 17 Nov 2006 21:26:24 -0000 1.6 +++ openacs-4/packages/xowiki/www/admin/list.tcl 29 Dec 2006 11:01:36 -0000 1.7 @@ -64,6 +64,9 @@ -height 8 -border 0 -title "Toggle Publish Status" \ -alt "publish status" -label [_ xowiki.publish_status] -html {style "padding: 2px;"} } + if {[::xo::has_ltree]} { + AnchorField page_order -label [_ xowiki.order] -orderby page_order + } AnchorField name -label [_ xowiki.name] -orderby name Field object_type -label [_ xowiki.page_type] -orderby object_type Field size -label "Size" -orderby size -html {align right} @@ -83,7 +86,9 @@ [$object_type instance_select_query \ -folder_id [::$package_id folder_id] \ -with_subtypes $with_subtypes \ - -select_attributes [list revision_id content_length creation_user \ + -from_clause ", xowiki_page P" \ + -where_clause "P.page_id = cr.revision_id" \ + -select_attributes [list revision_id content_length creation_user page_order \ "to_char(last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified"] \ -order_clause $order_clause \ ] { @@ -99,8 +104,7 @@ -mod_user [::xo::get_user_name $creation_user] \ -delete.href [export_vars -base [$package_id package_url] {{delete 1} item_id name return_url}] if {$::individual_permissions} { - # TODO: this should get some architectural support - [lindex [t1 set __children] end] set permissions.href \ + [t1 last_child] set permissions.href \ [export_vars -base permissions {item_id return_url}] } if {$::with_publish_status} { @@ -112,11 +116,14 @@ set image inactive.png set state "ready" } - [lindex [t1 set __children] end] set publish_status.src /resources/xowiki/$image - [lindex [t1 set __children] end] set publish_status.href \ + [t1 last_child] set publish_status.src /resources/xowiki/$image + [t1 last_child] set publish_status.href \ [export_vars -base [$package_id package_url]admin/set-publish-state \ {state revision_id return_url}] } + if {[::xo::has_ltree]} { + [t1 last_child] set page_order $page_order + } } set t1 [t1 asHTML] Index: openacs-4/packages/xowiki/www/portlets/include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/include.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/portlets/include.tcl 25 Dec 2006 21:26:21 -0000 1.2 +++ openacs-4/packages/xowiki/www/portlets/include.tcl 29 Dec 2006 11:01:36 -0000 1.3 @@ -1,3 +1,4 @@ #ns_log notice "--including_page= $__including_page, portlet=$portlet" set content [$__including_page include_portlet $portlet] +set header_stuff [::xowiki::Page header_stuff] template::set_file [file dir $__adp_stub]/plain-include Index: openacs-4/packages/xowiki/www/prototypes/book.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/book.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/book.page 29 Dec 2006 11:01:37 -0000 1.1 @@ -0,0 +1,13 @@ +::xowiki::Page new -title "Book" -text { +

+>>left-col25<< +{{toc -decoration plain -book_mode 1 -expand_all 1}} +>><< + +>>right-col75<< +

@title@

+

Creator: @creator@

+

{{book}}

+>><< + +} Index: openacs-4/packages/xowiki/www/resources/next-end.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/next-end.png,v diff -u Binary files differ Index: openacs-4/packages/xowiki/www/resources/next.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/next.png,v diff -u Binary files differ Index: openacs-4/packages/xowiki/www/resources/previous-end.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/previous-end.png,v diff -u Binary files differ Index: openacs-4/packages/xowiki/www/resources/previous.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/previous.png,v diff -u Binary files differ 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.7 -r1.8 --- openacs-4/packages/xowiki/www/resources/xowiki.css 2 Dec 2006 14:09:35 -0000 1.7 +++ openacs-4/packages/xowiki/www/resources/xowiki.css 29 Dec 2006 11:01:37 -0000 1.8 @@ -49,10 +49,10 @@ /* table, td {font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; color: #000;}*/ #main div.column {text-align: left; margin-bottom: 1em;} #content {float: left; width: 70%} -#page-body h1 {font-size: 24px; margin: 0 0 .5em 0;} -#page-body h2 {font-size: 16px} -#page-body h3 {font-size: 12px} -#page-body h4 {font-size: 10px; margin: 0;} +#page-body h1 {font-size: 24px; margin: 0 0 .5em 0; clear: both;} +#page-body h2 {font-size: 16px; clear: both;} +#page-body h3 {font-size: 14px} +#page-body h4 {font-size: 12px; margin: 0;} #page-body .box {border: 1px solid #a1a5a9; padding: 0 5px 5px 5px; margin: 0 0 1.25em 0;} #content .box h2 {border-bottom: 1px solid #a1a5a9; padding: 5px; background: #f2f2f2; margin: 0 -5px 5px -5px; font-size: 12px;} #sidebar {float: right; top: 0px; width: 29%; font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;}