[my set title]
" \ + "[my title]
" \ "Created by [my set creator], " \ "last modfified by [::xo::get_user_name [my set creation_user]] " \ "[my set pretty_date]
" \ @@ -55,7 +55,7 @@ #append extra_from_clause ",category_object_map c " foreach cid [split $category_id ,] { append extra_where_clause "and exists (select * from category_object_map \ - where object_id = ci.item_id and category_id = $cid)" + where object_id = ci.item_id and category_id = $cid)" lappend cnames [::category::get_name $cid] } append extra_from_clause "" @@ -66,7 +66,7 @@ set my_filter_msg "Filtered by your tag $tag" append extra_from_clause ",xowiki_tags tags " append extra_where_clause "and tags.item_id = ci.item_id and tags.tag = :tag and \ - tags.user_id = [ad_conn user_id]" + tags.user_id = [ad_conn user_id]" set query_parm "&tag=[ad_urlencode $tag]" } if {$ptag ne ""} { @@ -88,13 +88,13 @@ set query \ [list -folder_id $folder_id \ - -select_attributes [list p.publish_date p.title] \ - -order_clause "order by p.publish_date desc" \ - -page_number $page_number -page_size $page_size \ - -extra_from_clause $extra_from_clause \ - -extra_where_clause "and ci.item_id != [$including_page set item_id] \ - and ci.name != '::$folder_id' $date_clause \ - and ci.content_type not in ('::xowiki::PageTemplate') $extra_where_clause" ] + -select_attributes [list p.publish_date p.title] \ + -order_clause "order by p.publish_date desc" \ + -page_number $page_number -page_size $page_size \ + -extra_from_clause $extra_from_clause \ + -extra_where_clause "and ci.item_id != [$including_page set item_id] \ + and ci.name != '::$folder_id' $date_clause \ + and ci.content_type not in ('::xowiki::PageTemplate') $extra_where_clause" ] set my_nr_items [db_string count [eval ::xowiki::Page select_query $query -count true]] @@ -104,8 +104,8 @@ regexp {^([^.]+)[.][0-9]+(.*)$} $publish_date _ publish_date tz set pretty_date [util::age_pretty -timestamp_ansi $publish_date \ - -sysdate_ansi [clock_to_ansi [clock seconds]] \ - -mode_3_fmt "%d %b %Y, at %X"] + -sysdate_ansi [clock_to_ansi [clock seconds]] \ + -mode_3_fmt "%d %b %Y, at %X"] #$p proc destroy {} {my log "--Render temporal object destroyed"; next} $p set pretty_date $pretty_date @@ -124,7 +124,7 @@ if {$my_filter_msg eq ""} { append my_filter_msg "Showing [llength [$items children]] of $my_nr_items Postings " \ - "($flink)" + "($flink)" } else { append my_filter_msg " (all, $flink)" } @@ -150,17 +150,17 @@ set page_number [ns_queryget page_number 1] set summary [ns_queryget summary 0] set content [::xowiki::Page __render_html \ - -folder_id [$__including_page set parent_id] \ - -including_page $__including_page \ - -page_size $page_size \ - -page_number $page_number \ - -summary $summary \ - -date [ns_queryget date] \ - -category_id [ns_queryget category_id] \ - -tag [ns_queryget tag] \ - -ptag [ns_queryget ptag] \ - -filter_msg filter_msg \ - -nr_items nr_items] + -folder_id [$__including_page set parent_id] \ + -including_page $__including_page \ + -page_size $page_size \ + -page_number $page_number \ + -summary $summary \ + -date [ns_queryget date] \ + -category_id [ns_queryget category_id] \ + -tag [ns_queryget tag] \ + -ptag [ns_queryget ptag] \ + -filter_msg filter_msg \ + -nr_items nr_items] set next_p [expr {$nr_items > $page_number*$page_size}] set prev_p [expr {$page_number > 1}] Index: openacs-4/packages/xowiki/www/portlets/wiki.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/wiki.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/xowiki/www/portlets/wiki.tcl 26 Jul 2006 22:56:46 -0000 1.7 +++ openacs-4/packages/xowiki/www/portlets/wiki.tcl 17 Aug 2006 01:44:26 -0000 1.8 @@ -13,7 +13,7 @@ if {[::xowiki::Page incr recursion_count]<3} { set content [$page render] - set link [::xowiki::Page pretty_link $name] + set link [::[$page package_id] pretty_link $name] } else { set content "Recursion Limit exceeded, items are nested to deep!" } Index: openacs-4/packages/xowiki/www/prototypes/CGI.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/CGI.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/CGI.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,11 @@ +# -*- tcl-*- +# $Id: CGI.page,v 1.1 2006/08/17 01:44:27 gustafn Exp $ +::xowiki::Object new -title "CGI" -text { + proc content {} { + return "Hello \[\[Wiki\]\]-World. It is now [clock format [clock seconds]]." + } + +} + + + Index: openacs-4/packages/xowiki/www/prototypes/CGI2.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/CGI2.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/CGI2.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,22 @@ +# -*- tcl-*- +# $Id: CGI2.page,v 1.1 2006/08/17 01:44:27 gustafn Exp $ +::xowiki::Object new -title "CGI2" -text { + # + # The classes and objects here are all local to the object, + # as long a no absolulte addresses are used (no leading colons) + # + Class CGI + CGI instproc content {} { + set somevar 100 + return "Hello \[\[Wiki\]\]-World. It is now \ + [clock format [clock seconds]]. Somevar=$somevar" + } + + # mixin the Class CGI into the payload object of the ::xowiki::Object + # since the object renderer queries the method content, it picks up the + # above behavior + my mixin add CGI +} + + + Index: openacs-4/packages/xowiki/www/prototypes/CGI3.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/CGI3.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/CGI3.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,40 @@ +# -*- tcl-*- +# $Id: CGI3.page,v 1.1 2006/08/17 01:44:27 gustafn Exp $ +::xowiki::Object new -title "CGI3" -text { + # + # The parameter declaration sets the context for the + # evaluation. It combines the provided values from an + # includelet with the values provided via the url with + # the specified default values. + # + my initialize -parameter { + {-object_type ::xowiki::Page} + {-text "Hello World"} + {-x:integer} + {-z:integer 100} + } + + # + # The classes and objects here are all local to the object, + # as long a no absolulte addresses are used (no leading colons) + # + + Class CGI + CGI instproc content {} { + my get_parameters + + set vars [info vars] + set somevar 100 + return "Hello \[\[Wiki\]\]-World. It is now \ + [clock format [clock seconds]]. Somevar=$somevar, vars=$vars, + package_id=$package_id, z=3. $text" + } + + # mixin the Class CGI into the payload object of the ::xowiki::Object + # since the object renderer queries the method content, it picks up the + # above behavior + my mixin add CGI +} + + + Index: openacs-4/packages/xowiki/www/prototypes/ajax-chat.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/ajax-chat.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/ajax-chat.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,13 @@ +# -*- tcl-*- +# $Id: ajax-chat.page,v 1.1 2006/08/17 01:44:27 gustafn Exp $ +::xowiki::Object new -title "Ajax Chat" -text { + + proc content {} { + #::xowiki::Chat login -chat_id 22 -mode polling + ::xowiki::Chat login -chat_id 22 + } + +} + + + Index: openacs-4/packages/xowiki/www/prototypes/categories-portlet.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/categories-portlet.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/categories-portlet.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,111 @@ +# -*- tcl-*- +# $Id: categories-portlet.page,v 1.1 2006/08/17 01:44:27 gustafn Exp $ +::xowiki::Object new -title "Categories" -text { + + # display the category tree with associated pages + # -gustaf neumann + # + # valid parameters from the adp include are + # tree_name: match pattern, if specified displays only the trees + # with matching names + # no_tree_name: if specified, tree names are not displayed + # open_page: name (e.g. en:iMacs) of the page to be opened initially + # tree_style: boolean, default: true, display based on mktree + + my initialize -parameter { + {-tree_name ""} + {-tree_style:boolean 1} + {-no_tree_name:boolean 0} + {-count:boolean 0} + {-summary:boolean 0} + {-open_page ""} + {-category_ids ""} + {-except_category_ids ""} + } + + #if {![info exists name]} {set name "Categories"} + + my proc content {} { + my get_parameters + set folder_id [$package_id folder_id] + + set open_item_id [expr {$open_page ne "" ? + [CrItem lookup -name $open_page -parent_id $folder_id] : 0}] + + set content "" + foreach tree [category_tree::get_mapped_trees $package_id] { + foreach {tree_id my_tree_name ...} $tree {break} + if {$tree_name ne "" && ![string match $tree_name $my_tree_name]} continue + if {!$no_tree_name} { + append content "$my_tree_name
" + } + set categories [list] + set pos 0 + set cattree(0) [::xowiki::CatTree new -volatile -orderby pos -name $my_tree_name] + foreach category_info [category_tree::get_tree $tree_id] { + foreach {cid category_label deprecated_p level} $category_info {break} + set c [::xowiki::Category new -orderby pos -category_id $cid -package_id $package_id \ + -level $level -label $category_label -pos [incr pos]] + set cattree($level) $c + set plevel [expr {$level -1}] + $cattree($plevel) add $c + set category($cid) $c + lappend categories $cid + #set itemobj [Object new -set name en:index -set title MyTitle -set prefix "" -set suffix ""] + #$cattree(0) add_to_category -category $c -itemobj $itemobj -orderby title + } + + set sql "category_object_map c, cr_items ci, cr_revisions r, xowiki_page p \ + where c.object_id = ci.item_id and ci.parent_id = $folder_id \ + and ci.content_type not in ('::xowiki::PageTemplate') \ + and category_id in ([join $categories ,]) \ + and r.revision_id = ci.live_revision \ + and p.page_id = r.revision_id" + + if {$except_category_ids ne ""} { + append sql \ + " and not exists (select * from category_object_map c2 \ + where ci.item_id = c2.object_id \ + and c2.category_id in ($except_category_ids))" + } + ns_log notice "--c category_ids=$category_ids" + if {$category_ids ne ""} { + foreach cid [split $category_ids ,] { + append sql " and exists (select * from category_object_map \ + where object_id = ci.item_id and category_id = $cid)" + } + } + + if {$count} { + db_foreach get_counts \ + "select count(*) as nr,category_id from $sql group by category_id" { + $category($category_id) set count $nr + set s [expr {$summary ? "&summary=$summary" : ""}] + $category($category_id) href [ad_conn url]?category_id=$category_id$s + $category($category_id) open_tree + } + append content [$cattree(0) render -tree_style $tree_style] + } else { + db_foreach get_pages \ + "select ci.item_id, ci.name, ci.content_type, r.title, category_id from $sql" { + if {$title eq ""} {set title $name} + set itemobj [Object new] + set prefix "" + set suffix "" + foreach var {name title prefix suffix} {$itemobj set $var [set $var]} + $cattree(0) add_to_category \ + -category $category($category_id) \ + -itemobj $itemobj \ + -orderby title \ + -open_item [expr {$item_id == $open_item_id}] + } + append content [$cattree(0) render -tree_style $tree_style] + } + } + return $content + } + +} + + + Index: openacs-4/packages/xowiki/www/prototypes/index.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/Attic/index.page,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/index.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,27 @@ +::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. +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]]. +
++A user can define notifications +for the whole XoWiki instance (by clicking on the notifications button +in the menu bar or for categories (by clicking on the letter symbol +next to the category entries at the bottom of the page) +
+>>left-col<< +{{recent -max_entries 25}} +>><< +>>right-col<< +{{last-visited -title "Last Visited" -max_entries 10 }} ++{{most-popular -title "Most Popular" -max_entries 10 }} +>><< + +} + + + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/prototypes/weblog-portlet.page 17 Aug 2006 01:44:27 -0000 1.1 @@ -0,0 +1,100 @@ +# -*- tcl-*- +# $Id: weblog-portlet.page,v 1.1 2006/08/17 01:44:27 gustafn Exp $ +::xowiki::Object new -title "Weblog" -text { + # + # A sample Weblog object. + # + my initialize -parameter { + {-page_size:integer 10} + {-page_number:integer 1} + {-summary:boolean 0} + {-date ""} + {-tag ""} + {-ptag ""} + } + + # + # The following definition is the default rendering per + # weblog entry. This is executed in the context of every displayed page. + # + Class create EntryRenderer -instproc render {} { + my instvar package_id name title creator creation_user pretty_date description + append content "
$title
" \ + "Created by $creator, " \ + "last modfified by [::xo::get_user_name $creation_user] " \ + "$pretty_date
" \ + $description \n\ + "