Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.79 -r1.80 --- openacs-4/packages/xowiki/xowiki.info 10 Apr 2008 07:52:57 -0000 1.79 +++ openacs-4/packages/xowiki/xowiki.info 25 Apr 2008 10:02:49 -0000 1.80 @@ -8,7 +8,7 @@ f xowiki - + Gustaf Neumann A more generic xotcl-based wikis example with object types and subtypes based on the content repository (with category support) @@ -54,7 +54,7 @@ BSD-Style 0 - + Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 17 Apr 2008 11:45:55 -0000 1.27 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 25 Apr 2008 10:02:49 -0000 1.28 @@ -197,7 +197,7 @@ foreach cid_and [split $cid_or ,] { lappend and_names [::category::get_name $cid_and] lappend ands "exists (select 1 from category_object_map \ - where object_id = p.item_id and category_id = $cid_and)" + where object_id = $item_ref and category_id = $cid_and)" } lappend or_names "[join $and_names { and }]" lappend ors "([join $ands { and }])" @@ -495,12 +495,28 @@ [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] break set have_locale [expr {[lsearch [info args category_tree::get_mapped_trees] locale] > -1}] - set trees [expr {$have_locale ? + set mapped_trees [expr {$have_locale ? [category_tree::get_mapped_trees $package_id $locale] : [category_tree::get_mapped_trees $package_id]}] - foreach tree $trees { + + set trees [list] + foreach tree $mapped_trees { foreach {tree_id my_tree_name ...} $tree {break} if {$tree_name ne "" && ![string match $tree_name $my_tree_name]} continue + lappend trees [list $tree_id $my_tree_name] + } + + if {[llength $trees] == 0 && $tree_name ne ""} { + # we have nothing left from mapped trees, maybe the tree_names are not mapped; + # try to get these + foreach name $tree_name { + #lappend trees [list [lindex [category_tree::get_id $tree_name $locale] 0] $name] + lappend trees [list [lindex [category_tree::get_id $tree_name] 0] $name] + } + } + + foreach tree $trees { + foreach {tree_id my_tree_name ...} $tree {break} if {!$no_tree_name} { append content "

$my_tree_name

" } @@ -2625,6 +2641,7 @@ {-orderby "_last_modified,desc"} {-publish_status "ready"} {-field_names} + {-category_id} {-unless} {-where} {-csv true} @@ -2710,16 +2727,21 @@ # # build SQL query and iterate over the results # + my log "exists category_id [info exists category_id]" + set extra_where_clause "" + if {[info exists category_id]} { + foreach {cnames extra_where_clause} [my category_clause $category_id bt.item_id] break + } set items [::xowiki::FormPage get_children \ -base_item_id $form_item_id \ -form_fields $form_fields \ -publish_status $publish_status \ -always_queried_attributes [list _name _last_modified _creation_user] \ + -extra_where_clause $extra_where_clause \ -h_where $wc(h) \ -folder_id [$package_id folder_id]] my log "query done" - my log "insert into table" foreach p [$items children] { $p set package_id $package_id array set __ia $init_vars @@ -2744,7 +2766,6 @@ $__c set $__fn [$__ff($__fn) pretty_value [$p property $__fn]] } } - my log "insert into table done" my instvar name set includelet_key "" 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.41 -r1.42 --- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 10 Apr 2008 07:52:57 -0000 1.41 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 25 Apr 2008 10:02:49 -0000 1.42 @@ -389,12 +389,24 @@ } copy_parameter top_portlet top_includelet } + set v 0.83 if {[apm_version_names_compare $from_version_name $v] == -1 && [apm_version_names_compare $to_version_name $v] > -1} { ns_log notice "-- upgrading to $v" ::xowiki::add_ltree_order_column } + + set v 0.86 + if {[apm_version_names_compare $from_version_name $v] == -1 && + [apm_version_names_compare $to_version_name $v] > -1} { + ns_log notice "-- upgrading to $v" + foreach package_id [::xowiki::Package instances] { + ::xowiki::Package initialize -package_id $package_id -init_url false + $package_id import_prototype_page weblog + $package_id import_prototype_page weblog-portlet + } + } } proc copy_parameter {from to} { 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.235 -r1.236 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 22 Apr 2008 11:09:25 -0000 1.235 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 25 Apr 2008 10:02:49 -0000 1.236 @@ -1652,6 +1652,7 @@ -folder_id -form_fields {-publish_status ready} + {-extra_where_clause ""} {-h_where} {-always_queried_attributes {_name _last_modified _creation_user}} } { @@ -1699,16 +1700,16 @@ set publish_status_clause " and ([join $clauses { or }])" } set filter_clause "" - if {[info exists h_where] && [::xo::db::has_hstore]} { - #set filter_clause " and '$h_where' <@ bt.hkey" + if {[info exists h_where] && $h_where ne "" && [::xo::db::has_hstore]} { + set filter_clause " and '$h_where' <@ bt.hkey" } set orderby ""; set page_size 20; set page_number ""; set base_table "cr_revisions" set sql [::xowiki::FormPage instance_select_query \ -select_attributes $sql_atts \ -from_clause "" \ -where_clause " bt.page_template = $base_item_id \ - $publish_status_clause $filter_clause" \ + $publish_status_clause $filter_clause $extra_where_clause" \ -orderby $orderby \ -with_subtypes false \ -folder_id $folder_id \ Index: openacs-4/packages/xowiki/www/prototypes/weblog-portlet.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/Attic/weblog-portlet.page,v diff -u -r1.13 -r1.14 --- openacs-4/packages/xowiki/www/prototypes/weblog-portlet.page 26 Mar 2008 00:47:34 -0000 1.13 +++ openacs-4/packages/xowiki/www/prototypes/weblog-portlet.page 25 Apr 2008 10:03:08 -0000 1.14 @@ -41,6 +41,12 @@ "$pretty_date

" \ $description $more $my_footer \n\ "" + if {[my do_substitutions] == 0} { + # the including weblog will do otherwise the substitutions + set content [string map [list "\{\{" "\\\{\{"] $content] + } + #my log "--W entry done [self] [my info class] subst=[my do_substitutions] [my name]" + return $content } # Index: openacs-4/packages/xowiki/www/prototypes/weblog.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/Attic/weblog.page,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/prototypes/weblog.page 12 Mar 2007 08:03:39 -0000 1.4 +++ openacs-4/packages/xowiki/www/prototypes/weblog.page 25 Apr 2008 10:03:08 -0000 1.5 @@ -1,13 +1,13 @@ ::xowiki::Page new -title "Weblog Page" -set publish_status production -text { >>content<< -{{weblog-portlet}} +{{weblog-portlet -decoration plain}} >><< >>sidebar<< {{adp portlets/weblog-mini-calendar}} {{tags -decoration plain}} {{tags -popular 1 -limit 30 -decoration plain}} -{{categories-portlet -count 1 -decoration plain}} +{{categories -count 1 -decoration plain}} >><< }