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.136 -r1.137 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 4 Oct 2008 18:42:25 -0000 1.136 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 6 Oct 2008 12:06:53 -0000 1.137 @@ -126,7 +126,19 @@ } } } + + Package instproc get_parent_and_name {-path -folder_id vparent vlocal_name} { + my upvar $vparent parent $vlocal_name local_name + if {[regexp {^([^/]+)/(.*)$} $path _ parent local_name]} { + return [::xo::db::CrClass lookup -name $parent -parent_id $folder_id] + } else { + set parent "" + set local_name $path + return $folder_id + } + } + Package instproc folder_path {{-parent_id ""}} { # # handle different parent_ids @@ -665,11 +677,9 @@ if {$lang eq "download/file" || $lang eq "file"} { # handle subitems, currently only for files - if {[regexp {^([^/]+)/(.*)$} $local_name _ parent local_name]} { - set parent_id [::xo::db::CrClass lookup -name $parent -parent_id $folder_id] - } else { - set parent_id $folder_id - } + set parent_id [my get_parent_and_name \ + -path $local_name -folder_id $folder_id \ + parent local_name] set item_id [::xo::db::CrClass lookup -name file:$local_name -parent_id $parent_id] if {$item_id != 0 && $lang eq "download/file"} { @@ -679,7 +689,10 @@ } if {$item_id == 0} { - set item_id [::xo::db::CrClass lookup -name $name -parent_id $folder_id] + set parent_id [my get_parent_and_name \ + -path $local_name -folder_id $folder_id \ + parent local_name] + set item_id [::xo::db::CrClass lookup -name $local_name -parent_id $parent_id] #my msg "--try $name -> $item_id // ::xo::db::CrClass lookup -name $name -parent_id $folder_id" } @@ -1003,16 +1016,17 @@ return [$page edit -new true -autoname $autoname] } - Package instproc flush_references {-item_id:integer,required -name:required} { + Package instproc flush_references {-item_id:integer,required -name:required -parent_id} { my instvar folder_id id + if {![info exists parent_id]} {set parent_id $folder_id} if {$name eq "::$folder_id"} { #my log "--D deleting folder object ::$folder_id" ::xo::clusterwide ns_cache flush xotcl_object_cache ::$folder_id ::xo::clusterwide ns_cache flush xotcl_object_type_cache item_id-of-$folder_id ::xo::clusterwide ns_cache flush xotcl_object_type_cache root_folder-$id ::$folder_id destroy } - my flush_name_cache -name $name -parent_id $folder_id + my flush_name_cache -name $name -parent_id $parent_id } Package instproc flush_name_cache {-name:required -parent_id:required} { Index: openacs-4/packages/xowiki/tcl/xowiki-cache-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-cache-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/tcl/xowiki-cache-init.tcl 15 Apr 2006 23:01:09 -0000 1.1 +++ openacs-4/packages/xowiki/tcl/xowiki-cache-init.tcl 6 Oct 2008 12:06:55 -0000 1.2 @@ -1,3 +1,5 @@ - -ns_cache create xowiki_cache -size 200000 -# [ad_parameter -package_id [ad_acs_kernel_id] MaxSize memoize 200000] +# +# moved to xowiki-procs.tcl +# +#ns_cache create xowiki_cache -size 200000 +# \ 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.106 -r1.107 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 1 Oct 2008 22:14:28 -0000 1.106 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 6 Oct 2008 12:06:56 -0000 1.107 @@ -132,9 +132,15 @@ proc ::xowiki::locales {} { set locales [lang::system::get_locales] - set defpos [lsearch $locales [lang::conn::locale]] - set locales [linsert [lreplace $locales $defpos $defpos] 0 \ - [lang::conn::locale]] + if {[ns_conn isconnected]} { + # + # Reorder the locales and put the connection locale to the front + # in case we have a connection + # + set defpos [lsearch $locales [lang::conn::locale]] + set locales [linsert [lreplace $locales $defpos $defpos] 0 \ + [lang::conn::locale]] + } foreach l $locales {lappend lpairs [list $l $l]} return $lpairs } 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.291 -r1.292 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 4 Oct 2008 19:15:45 -0000 1.291 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 6 Oct 2008 12:06:56 -0000 1.292 @@ -182,10 +182,20 @@ and ci.publish_status <> 'production'" # - # Page definitions + # We do here the same as in xotcl-core/tcl/05-db-procs.tcl + # Read there for the reasons, why the cache is not created in + # a -init file..... # + if {[catch {ns_cache flush xowiki_cache NOTHING}]} { + ns_log notice "xotcl-core: creating xowiki cache" + ns_cache create xowiki_cache -size 200000 + } + # + # Page definitions + # + Page set recursion_count 0 Page array set RE { include {{{([^<]+?)}}([&<\s]|$)} 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.24 -r1.25 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 26 Nov 2007 09:14:43 -0000 1.24 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 6 Oct 2008 12:06:57 -0000 1.25 @@ -41,7 +41,7 @@ #set text [ad_text_to_html $html]; #this could be used for entity encoded html text in rss entries set found [string first {[1]} $text] - $page log "search=$found,html=$html,text=$text" + $page log "--sc search=$found,html=$html,text=$text" if {$found > -1} { append description {} } else {