Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.130 -r1.131 --- openacs-4/packages/xowiki/xowiki.info 14 Jun 2010 11:29:44 -0000 1.130 +++ openacs-4/packages/xowiki/xowiki.info 17 Jun 2010 10:45:12 -0000 1.131 @@ -10,11 +10,11 @@ t xowiki - + Gustaf Neumann A more generic xotcl-based wikis example with object types and subtypes based on the content repository (with category support) - 2010-06-14 + 2010-06-17 Gustaf Neumann, WU Wien <pre> XoWiki is a Wiki implementation for OpenACS in XOTcl. Instead of @@ -56,7 +56,7 @@ BSD-Style 0 - + Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -r1.176 -r1.177 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 14 Jun 2010 11:29:44 -0000 1.176 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 17 Jun 2010 10:45:12 -0000 1.177 @@ -681,18 +681,17 @@ set value [::file tail $value] [my object] set_property [my name] $value - set folder_id [[my object] set parent_id] + set package_id [[my object] package_id] array set entry_info [my entry_name $value] set content_type [my set content-type] if {$content_type eq "application/octetstream"} { set content_type [::xowiki::guesstype $value] } #my msg "mime_type of $entry_name = [::xowiki::guesstype $value] // [my set content-type] ==> $content_type" - - if {[set id [::xo::db::CrClass lookup -name $entry_info(name) -parent_id $entry_info(parent_id)]]} { + set file_object [$package_id get_page_from_name -name $entry_info(name) -parent_id $entry_info(parent_id)] + if {$file_object ne ""} { # file entry exists already, create a new revision - set file_object [::xo::db::CrClass get_instance_from_db -item_id $id] $file_object set import_file [my set tmpfile] $file_object set mime_type $content_type $file_object set title $value @@ -1585,11 +1584,13 @@ abstract_page instproc pretty_value {v} { my instvar package_id + set object [my object] + set parent_id [$object parent_id] my set options [my get_labels $v] if {[my multiple]} { foreach o [my set options] { foreach {label value} $o break - set href [$package_id pretty_link $value] + set href [$package_id pretty_link -parent_id $parent_id $value] set labels($value) "$label" } set hrefs [list] @@ -1598,7 +1599,7 @@ #my msg "can't determine label for value '$i' (values=$v, l=[array names labels])" set labels($i) $i } - set href [$package_id pretty_link $i] + set href [$package_id pretty_link -parent_id $parent_id $i] lappend hrefs "$labels($i)" } if {[my multiple_style] eq "list"} { @@ -1612,9 +1613,9 @@ #my log "comparing '$value' with '$v'" if {$value eq $v} { if {[my as_box]} { - return [[my object] include [list $value -decoration rightbox]] + return [$object include [list $value -decoration rightbox]] } - set href [$package_id pretty_link $value] + set href [$package_id pretty_link -parent_id $parent_id $value] return "$label" } } Index: openacs-4/packages/xowiki/tcl/import-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/import-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/xowiki/tcl/import-procs.tcl 1 Jun 2010 13:22:12 -0000 1.12 +++ openacs-4/packages/xowiki/tcl/import-procs.tcl 17 Jun 2010 10:45:12 -0000 1.13 @@ -21,7 +21,7 @@ return "[my set log]
" } Importer instproc report_line {obj operation} { - set href [[$obj package_id] pretty_link [$obj name]] + set href [$obj pretty_link] my append log "$operation[$obj name]\n" } Importer instproc report {} { 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.151 -r1.152 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 17 Jun 2010 10:23:51 -0000 1.151 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 17 Jun 2010 10:45:12 -0000 1.152 @@ -125,21 +125,6 @@ return $name } - ::xowiki::Includelet proc detail_link { - {-absolute:boolean false} - -package_id - -name - -instance_attributes - } { - array set __ia $instance_attributes - if {[info exists __ia(detail_link)] && $__ia(detail_link) ne ""} { - set link $__ia(detail_link) - } else { - set link [::$package_id pretty_link $name] - } - return $link - } - ::xowiki::Includelet proc publish_status_clause {{-base_table ci} value} { if {$value eq "all"} { # legacy @@ -283,7 +268,7 @@ -limit $limit -offset $offset] if {$count} { - return [db_string [my qn presence_count_users] $sql] + return [db_string [my qn count_listing] $sql] } else { set s [::xowiki::Page instantiate_objects -sql $sql] return $s @@ -555,7 +540,8 @@ bookmarklet-button instproc render {} { my get_parameters - set url [$package_id pretty_link -absolute 1 -siteurl $siteurl news-item] + set parent_id [[my set __including_page] parent_id] + set url [$package_id pretty_link -absolute 1 -siteurl $siteurl -parent_id $parent_id news-item] if {$label eq ""} {set label "Add to [$package_id instance_name]"} set href [subst -nocommands -nobackslash { javascript:d=document;w=window;t=''; @@ -805,13 +791,13 @@ set order_column ", p.page_order" db_foreach [my qn get_pages] \ - "select ci.item_id, ci.name, r.title, category_id $order_column from $sql" { + "select ci.item_id, ci.name, ci.parent_id, r.title, category_id $order_column from $sql" { if {$title eq ""} {set title $name} set itemobj [Object new] set prefix "" set suffix "" foreach var {name title prefix suffix page_order} {$itemobj set $var [set $var]} - $itemobj set href [::$package_id pretty_link $name] + $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name] $cattree(0) add_item \ -category $category($category_id) \ -itemobj $itemobj \ @@ -884,7 +870,7 @@ set tree_select_clause "" } set sql [::xo::db::sql select \ - -vars "c.category_id, ci.name, r.title, r.publish_date, \ + -vars "c.category_id, ci.name, ci.parent_id, r.title, r.publish_date, \ to_char(r.publish_date,'YYYY-MM-DD HH24:MI:SS') as formatted_date" \ -from "category_object_map_tree c, cr_items ci, cr_revisions r, xowiki_page p" \ -where "c.object_id = ci.item_id and ci.parent_id = [$package_id folder_id] \ @@ -906,7 +892,7 @@ if {$prefix ne ""} {set prefix "$prefix";$itemobj set encoded(prefix) 1} if {$suffix ne ""} {set suffix "$suffix";$itemobj set encoded(suffix) 1} foreach var {name title prefix suffix} {$itemobj set $var [set $var]} - $itemobj set href [::$package_id pretty_link $name] + $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name] if {![info exists categories($category_id)]} { set categories($category_id) [::xowiki::TreeNode new \ @@ -1341,15 +1327,13 @@ set entries [list] if {![info exists page]} {set page [$package_id get_parameter weblog_page]} - set base_url [$package_id pretty_link $page] set href [$package_id package_url]tag/ db_foreach [my qn get_counts] $sql { set q [list] if {$summary} {lappend q "summary=$summary"} if {$popular} {lappend q "popular=$popular"} set link $href$tag?[join $q &] - #set href $base_url?$tag_type=[ad_urlencode $tag]$s #lappend entries "$tag ($nr)" lappend entries "$tag " } @@ -1373,7 +1357,7 @@ my instvar __including_page tags ::xo::Page requireJS "/resources/xowiki/get-http-object.js" - set p_link [$package_id pretty_link [$__including_page name]] + set p_link [$__including_page pretty_link] set return_url "[::xo::cc url]?[::xo::cc actual_query]" set weblog_page [$package_id get_parameter weblog_page weblog] set save_tag_link [$package_id make_link -link $p_link $__including_page \ @@ -1914,11 +1898,11 @@ } toc instproc href {book_mode name} { - my instvar package_id + my instvar package_id __including_page if {$book_mode} { set href [$package_id url]#[toc anchor $name] } else { - set href [$package_id pretty_link $name] + set href [$package_id pretty_link -parent_id [$__including_page parent_id] $name] } return $href } @@ -2405,7 +2389,7 @@ set inner_html [$root asHTML] set id ID[$__including_page item_id] - set base [$package_id pretty_link [$__including_page name]] + set base [$__including_page pretty_link] #set id ID$item_id #$root setAttribute id $id set as_att_value [::xowiki::Includelet html_encode $inner_html] @@ -2610,7 +2594,7 @@ set link [$package_id make_link $package_id edit-new object_type \ return_url page_order source_item_id] } else { - set p_link [$package_id pretty_link -parent_id [$page parent_id] [$page name]] + set p_link [$page pretty_link] set link [$package_id make_link -link $p_link $page $method \ return_url page_order source_item_id] } @@ -3204,7 +3188,7 @@ set form_package_id [$form package_id] ::xowiki::Package require $form_package_id set obj [form-menu-button-$button new -volatile -package_id $package_id \ - -base [$form_package_id pretty_link -parent_id [$form parent_id] [$form name]] \ + -base [$form pretty_link] \ -form $form -parent_id $parent_id] if {[info exists return_url]} {$obj return_url $return_url} lappend button_objs $obj @@ -3489,7 +3473,7 @@ } #my log "queries done" if {[info exists wf]} { - set wf_link [$package_id pretty_link $wf] + set wf_link [$package_id pretty_link -parent_id $parent_id $wf] } foreach p [$items children] { @@ -3499,7 +3483,7 @@ if {[expr $uc(tcl)]} continue #if {![expr $wc(tcl)]} continue ;# already handled in get_form_entries - set page_link [$package_id pretty_link -parent_id [$p parent_id] [$p name]] + set page_link [$p pretty_link] if {[info exists wf]} { set view_link $wf_link?m=create-or-use&p.form=[$p name] @@ -3581,7 +3565,7 @@ } set links [list] - set base [$package_id pretty_link -parent_id [$form_item parent_id] [$form_item name]] + set base [$form_item pretty_link] set label [$form_item name] if {$with_form_link} { @@ -3675,6 +3659,7 @@ @table:[join $table_field_names ,]" } $f save_new + set form_href [$f pretty_link] $f destroy set action created } else { @@ -3685,9 +3670,10 @@ $item_id set_property form $form } $item_id save + set form_href [$item_id pretty_link] set action updated } - return "#xowiki.form-$action# $form_name" + return "#xowiki.form-$action# $form_name" } } @@ -3793,7 +3779,7 @@ foreach entry [$listing children] { $entry instvar mime_type name if {[string match image/* $mime_type]} { - set link [$package_id pretty_link -download true $name] + set link [$entry pretty_link -download true] append content "
  • \n" #append content "
  • \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.77 -r1.78 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 23 Apr 2010 18:59:59 -0000 1.77 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 17 Jun 2010 10:45:12 -0000 1.78 @@ -185,7 +185,7 @@ set item_id [my resolve] if {$item_id} { set image_css_class "found" - set link [$package_id pretty_link -lang $lang [my stripped_name]] + set link [$package_id pretty_link -lang $lang -parent_id [my parent_id] [my stripped_name]] } else { set image_css_class "undefined" set last_page_id [$page set item_id] 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 -r1.13 -r1.14 --- openacs-4/packages/xowiki/tcl/notification-procs.tcl 20 Apr 2009 14:05:32 -0000 1.13 +++ openacs-4/packages/xowiki/tcl/notification-procs.tcl 17 Jun 2010 10:45:12 -0000 1.14 @@ -114,7 +114,7 @@ #ns_log notice "--n xowiki::notification::do_notifications called for item_id [$page set revision_id] publish_status=[$page set publish_status] XXX" $page instvar package_id - set link [::$package_id pretty_link -absolute 1 [$page name]] + set link [$page pretty_link -absolute 1] append html "

    For more details, see [$page set title]

    " append text "\nFor more details, see $link ...
    \n" 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.218 -r1.219 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 14 Jun 2010 11:29:44 -0000 1.218 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 17 Jun 2010 10:45:12 -0000 1.219 @@ -44,7 +44,7 @@ ::xowiki::Package initialize \ -package_id $package_id -user_id $user_id \ -parameter $parameter -init_url false -actual_query "" - ::$package_id set_url -url [::$package_id pretty_link -parent_id [$page parent_id] [$page name]] + ::$package_id set_url -url [$page pretty_link] return $page } @@ -173,10 +173,10 @@ return $folder_id } - Package instproc get_page_from_name {-name:required} { + Package instproc get_page_from_name {{-parent_id ""} -name:required} { # Check if an instance with this name exists in the current package. my get_lang_and_name -name $name lang stripped_name - set item_id [my lookup -name $lang:$stripped_name] + set item_id [my lookup -parent_id $parent_id -name $lang:$stripped_name] if {$item_id != 0} { return [::xo::db::CrClass get_instance_from_db -item_id $item_id] } @@ -603,8 +603,7 @@ set form_id [lindex [::xowiki::Weblog instantiate_forms -parent_id $parent_id -forms $form -package_id $id] 0] if {$form_id ne ""} { if {$parent_id eq ""} {unset parent_id} - ::xo::db::CrClass get_instance_from_db -item_id $form_id - set form_link [my pretty_link -parent_id [$form_id parent_id] [$form_id name]] + set form_link [$form_id pretty_link] #my msg "$form -> $form_id -> $form_link -> [my make_link -with_entities 0 -link $form_link $form_id \ # create-new return_url title parent_id name nls_language]" return [my make_link -with_entities 0 -link $form_link $form_id \ @@ -825,7 +824,7 @@ {-use_package_path true} {-default_lang ""} -name:required - -parent_id + {-parent_id ""} } { # Lookup of names from a given parent_id or from the list of # configured instances (obtained via package_path). @@ -836,7 +835,7 @@ return 0 } - if {![info exists parent_id]} {set parent_id [$(package_id) folder_id]} + if {$parent_id eq ""} {set parent_id [$(package_id) folder_id]} set item_id [::xo::db::CrClass lookup -name $(page_name) -parent_id $parent_id] #my msg "lookup $(page_name) $parent_id in package $(package_id) returns $item_id" if {$item_id == 0 && $use_package_path} { @@ -1195,14 +1194,15 @@ $page destroy_on_cleanup $page set_content [string trim [$page text] " \n"] $page initialize_loaded_object - set item_id [::xo::db::CrClass lookup -name $fullName -parent_id $parent_id] - if {$item_id == 0} { + set p [$package_id get_page_from_name -name $fullName -parent_id $parent_id] + if {$p eq ""} { + # We have to create the page new. The page is completed with + # missing vars on save_new. $page save_new } else { - # get the page from the CR with all variables - set p [::xo::db::CrClass get_instance_from_db -item_id $item_id] - # copy all scalar variables from the prototype page - # into the instantiated page + # An old page exists already, make a revision. Update the + # existing page with all scalar variables from the prototype + # page (which is just partial) foreach v [$page info vars] { if {[$page array exists $v]} continue ;# don't copy arrays $p set $v [$page set $v] @@ -1606,7 +1606,7 @@ } set sql [::xo::db::sql select \ - -vars "s.body, p.name, p.creator, p.title, p.page_id,\ + -vars "ci.parent_id, 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 ci" \ -where "ci.parent_id = $folder_id and ci.live_revision = s.object_id \ @@ -1623,7 +1623,7 @@ set time "[clock format [clock scan $time] -format {%Y-%m-%dT%T}]${tz}:00" append content \n\ - [::$package_id pretty_link -absolute true $name] \n\ + [::$package_id pretty_link -absolute true -parent_id $parent_id $name] \n\ $time \n\ $changefreq \n\ $priority \n\ Index: openacs-4/packages/xowiki/tcl/syndicate-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/syndicate-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 1 Jun 2010 13:22:12 -0000 1.36 +++ openacs-4/packages/xowiki/tcl/syndicate-procs.tcl 17 Jun 2010 10:45:12 -0000 1.37 @@ -247,7 +247,8 @@ db_foreach [my qn get_pages] $sql { if {$content_type ne "::xowiki::PodcastItem"} continue if {$title eq ""} {set title $name} - set link [::$package_id pretty_link -download true -absolute true -siteurl $siteurl $name] + set link [::$package_id pretty_link -download true -absolute true -siteurl $siteurl \ + -parent_id $parent_id $name] append content [my item \ -author $creator -title $title -subtitle $subtitle \ -description $description \ @@ -285,8 +286,8 @@ ::xo::OrderedComposite items -destroy_on_cleanup set sql [::xo::db::sql select \ - -vars "ci.name, o.creation_user, cr.publish_date, o2.creation_date, \ - cr.item_id, ci.parent_id, cr.title" \ + -vars "ci.name, ci.parent_id, o.creation_user, cr.publish_date, o2.creation_date, \ + cr.item_id, cr.title" \ -from "cr_items ci, cr_revisions cr, acs_objects o, acs_objects o2" \ -where "cr.item_id = ci.item_id and o.object_id = cr.revision_id and o2.object_id = cr.item_id @@ -307,7 +308,7 @@ } } set o [Object new] - foreach att {item_id creation_user item_id clock name publish_date parent_id title} { + foreach att {item_id creation_user clock name publish_date parent_id title} { $o set $att [set $att] } $o set operation [expr {$creation_date eq $publish_date ? "created" : "modified"}] @@ -359,7 +360,9 @@ append result [my tag -atts [list \ start $stamp \ title $title \ - link [$package_id pretty_link [$i set name]]] \ + link [$package_id pretty_link \ + -parent_id [$i set parent_id] \ + [$i set name]]] \ event $event] \n } append result \n 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.51 -r1.52 --- openacs-4/packages/xowiki/tcl/weblog-procs.tcl 14 Jun 2010 11:29:44 -0000 1.51 +++ openacs-4/packages/xowiki/tcl/weblog-procs.tcl 17 Jun 2010 10:45:12 -0000 1.52 @@ -293,7 +293,7 @@ my instvar package_id name title creator creation_user pretty_date description [my set __parent] instvar weblog_obj - set link [::$package_id pretty_link $name] + set link [my pretty_link] regsub -all & $link "&" link set more [expr {[$weblog_obj summary] ? " \[#xowiki.weblog-more#\]" : ""}] 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.61 -r1.62 --- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 10 Jun 2010 06:37:38 -0000 1.61 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 17 Jun 2010 10:45:12 -0000 1.62 @@ -539,7 +539,19 @@ } } } - + set v 0.130 + 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" + + # load for all xowiki package instances the weblog-portlet prototype page + foreach package_id [::xowiki::Package instances] { + ::xowiki::Package initialize -package_id $package_id -init_url false + $package_id import-prototype-page weblog-portlet + $package_id import-prototype-page news + } + } + } } 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.120 -r1.121 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 26 Nov 2009 12:02:52 -0000 1.120 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 17 Jun 2010 10:45:12 -0000 1.121 @@ -415,7 +415,7 @@ my instvar data # we can determine submit link only after nls_langauge # is returned from the user - my submit_link [[$data package_id] pretty_link [$data name]] + my submit_link [$data pretty_link] } next } @@ -651,7 +651,7 @@ if {[$data exists_query_parameter return_url]} { set return_url [$data query_parameter return_url] } - set link [::[$data set package_id] pretty_link [$data set name]] + set link [$data pretty_link] my submit_link [export_vars -base $link {{m edit} page_template return_url item_id}] # my log "-- submit_link = [my submit_link]" } @@ -689,7 +689,7 @@ foreach __v $__vars {set $__v [$data from_parameter $__v] ""} set item_id [next] - set link [::[$data set package_id] pretty_link [$data set name]] + set link [$data pretty_link] my submit_link [export_vars -base $link {{m edit} $__vars}] # my log "-- submit_link = [my submit_link]" return $item_id 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.400 -r1.401 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 17 Jun 2010 07:59:43 -0000 1.400 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 17 Jun 2010 10:45:12 -0000 1.401 @@ -1296,6 +1296,30 @@ return [$referenced_package_id item_ref -default_lang $default_lang -parent_id $parent_id $link] } + Page instproc pretty_link { + {-anchor ""} + {-query ""} + {-absolute:boolean false} + {-siteurl ""} + {-lang ""} + {-download false} + } { + # return the pretty_link for the current page + [my package_id] pretty_link -parent_id [my parent_id] \ + -anchor $anchor -query $query -absolute $absolute -siteurl $siteurl \ + -lang $lang -download $download [my name] + } + + Page instproc detail_link {} { + if {[my exists instance_attributes]} { + array set __ia [my set instance_attributes] + if {[info exists __ia(detail_link)] && $__ia(detail_link) ne ""} { + return $__ia(detail_link) + } + } + return [my pretty_link] + } + Page instproc create_link {arg} { #my msg [self args] set label $arg @@ -1858,7 +1882,7 @@ set revision_id [[$package_id context] query_parameter revision_id] set query [expr {$revision_id ne "" ? "revision_id=$revision_id" : ""}] - set page_link [$package_id pretty_link -download true -parent_id [my parent_id] -query $query [my name]] + set page_link [my pretty_link -download true -query $query] #my log "--F page_link=$page_link ---- " set t [TableWidget new -volatile \ 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.28 -r1.29 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 20 Apr 2009 14:05:32 -0000 1.28 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 17 Jun 2010 10:45:12 -0000 1.29 @@ -76,10 +76,7 @@ #ns_log notice "--sc keywords $revision_id -> [array names word]" set pubDate [::xo::db::tcl_date [$page set publish_date] tz] - set link [::xowiki::Includelet detail_link \ - -package_id $package_id -name [$page set name] \ - -absolute true \ - -instance_attributes [$page get_instance_attributes]] + set link [$page detail_link] return [list object_id $revision_id title [$page title] \ content $html keywords [array names word] \ 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.270 -r1.271 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 14 Jun 2010 11:29:44 -0000 1.270 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 17 Jun 2010 10:45:12 -0000 1.271 @@ -410,7 +410,7 @@ # before we used "." as default submit link (resulting in a "ad_returnredirect ."). # However, this does not seem to work in case we have folders in use.... #set submit_link "." - set submit_link [$package_id pretty_link -parent_id [my parent_id] [my name]] + set submit_link [my pretty_link] } #my log "--u submit_link=$submit_link qp=[my query_parameter return_url]" set object_type [my info class] @@ -1262,14 +1262,14 @@ [::xo::cc form_parameter __object_name ""] $category_ids } $package_id returnredirect \ - [my query_parameter "return_url" [$package_id pretty_link [my name]]] + [my query_parameter "return_url" [my pretty_link]] return } else { # todo: handle errors in a user friendly way my log "we have $validation_errors validation_errors" } $package_id returnredirect \ - [my query_parameter "return_url" [$package_id pretty_link [my name]]] + [my query_parameter "return_url" [my pretty_link]] } @@ -1440,7 +1440,7 @@ return } else { if {$redirect_method ne "view"} {set qp "?m=$redirect_method"} {set qp ""} - set url [$package_id pretty_link -parent_id [my parent_id] -lang en [my name]]$qp + set url [my pretty_link -lang en]$qp set return_url [$package_id get_parameter return_url $url] # We had query_parameter here. however, to be able to # process the output of ::xo::cc set_parameter ...., we @@ -1591,7 +1591,7 @@ if {[my exists_query_parameter "return_url"]} { set return_url [my query_parameter "return_url"] } - set url [export_vars -base [$package_id pretty_link -parent_id [my parent_id] [my name]] {{m "edit"} return_url}] + set url [export_vars -base [my pretty_link] {{m "edit"} return_url}] $form setAttribute action $url method POST if {$has_file} {$form setAttribute enctype multipart/form-data} Form add_dom_attribute_value $form class [$page_template css_class_name] @@ -2079,7 +2079,7 @@ set form_redirect [my form_parameter "__form_redirect" ""] if {$form_redirect eq ""} { - set form_redirect [export_vars -base [$package_id pretty_link -parent_id [$f parent_id] [$f name]] \ + set form_redirect [export_vars -base [$f pretty_link] \ [list [list m $view_method] return_url template_file title detail_link text]] } $package_id returnredirect $form_redirect Index: openacs-4/packages/xowiki/www/view-book-no-ajax.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-book-no-ajax.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/view-book-no-ajax.tcl 3 May 2010 17:44:16 -0000 1.3 +++ openacs-4/packages/xowiki/www/view-book-no-ajax.tcl 17 Jun 2010 10:45:12 -0000 1.4 @@ -11,8 +11,8 @@ if {$count > 0} { 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}]]]} + if {$p>1} {set book_prev_link [$package_id pretty_link -parent_id [$i parent_id] [$i page_name [expr {$p - 1}]]]} + if {$p<$count} {set book_next_link [$package_id pretty_link [$i -parent_id [$i parent_id] page_name [expr {$p + 1}]]]} set page_title "

    [$i current] $title

    " } else { set book_relpos 0.0% 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 -r1.9 -r1.10 --- openacs-4/packages/xowiki/www/view-book.tcl 3 May 2010 17:44:16 -0000 1.9 +++ openacs-4/packages/xowiki/www/view-book.tcl 17 Jun 2010 10:45:12 -0000 1.10 @@ -10,8 +10,8 @@ if {$count > 0} { 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}]]]} + if {$p>1} {set book_prev_link [$package_id pretty_link -parent_id [$i parent_id] [$i page_name [expr {$p - 1}]]]} + if {$p<$count} {set book_next_link [$package_id pretty_link -parent_id [$i parent_id] [$i page_name [expr {$p + 1}]]]} set page_title "

    [$i current] $title

    " } else { set book_relpos 0.0% Index: openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/weblog-mini-calendar.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl 14 Sep 2008 17:31:38 -0000 1.14 +++ openacs-4/packages/xowiki/www/portlets/weblog-mini-calendar.tcl 17 Jun 2010 10:45:12 -0000 1.15 @@ -1,12 +1,12 @@ ::xo::Page requireCSS "/resources/calendar/calendar.css" set package_id [::xo::cc package_id] -set folder_id [$__including_page set parent_id] +set parent_id [$__including_page set parent_id] set including_item_id [$__including_page set item_id] if {![exists_and_not_null base_url]} { if {![info exists page]} {set page [$package_id get_parameter weblog_page]} - set base_url [$package_id pretty_link $page] + set base_url [$package_id pretty_link -parent_id $parent_id $page] } set date [ns_queryget date] @@ -50,7 +50,7 @@ } set innersql "from xowiki_pagei p, cr_items ci \ - where ci.parent_id = $folder_id \ + where ci.parent_id = $parent_id \ and ci.item_id = p.item_id and ci.live_revision = p.page_id \ and ci.content_type not in ('::xowiki::PageTemplate', '::xowiki::Form') \ and ci.item_id != $including_item_id \