Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.17 -r1.18 --- openacs-4/packages/xowiki/xowiki.info 19 Jun 2006 00:40:03 -0000 1.17 +++ openacs-4/packages/xowiki/xowiki.info 26 Jul 2006 22:56:45 -0000 1.18 @@ -8,36 +8,41 @@ 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-06-19 + 2006-07-27 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 +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 - + - + - + - + + + + + + Index: openacs-4/packages/xowiki/lib/view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/lib/view.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/lib/view.adp 12 Jun 2006 17:33:07 -0000 1.1 +++ openacs-4/packages/xowiki/lib/view.adp 26 Jul 2006 22:56:45 -0000 1.2 @@ -1,2 +1 @@ - -@content;noquote@ +@html;noquote@ Index: openacs-4/packages/xowiki/lib/view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/lib/view.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/lib/view.tcl 12 Jun 2006 17:33:07 -0000 1.1 +++ openacs-4/packages/xowiki/lib/view.tcl 26 Jul 2006 22:56:45 -0000 1.2 @@ -1,78 +1,31 @@ -ad_page_contract { - view a wiki item - @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) - @creation-date Oct 23, 2005 - @cvs-id $Id$ - - @param item_id Item to be viewed - @param revision_id optional revision of the item - @param object_type the source class providing the data source -} -query { - {item_id:integer 0} - {revision_id:integer 0} - {folder_id:optional} - {object_type:optional} - {master 1} +if {[info exists url]} { + # new style, the url is sufficient + regexp {^(/[^/]+)/?(.*)$} $url _ instance path + array set node_info [site_node::get -url $instance] + ns_log notice "--package_id = $node_info(package_id) instance=$instance path=$path" + set package_id $node_info(package_id) + set Package [::xowiki::Package create ::$package_id -folder_id 0 -use_ns_conn false] + $Package set_url -url $url +} else { + # old style, use item_id + set m view + set page [::xowiki::Package instantiate_from_page -item_id $item_id] + $page instvar package_id + set Package ::$package_id } +::xowiki::Package process_query \ + -defaults [list m view \ + edit_return_url [ns_conn url] \ + template_file "view-links" \ + folder_id 0 \ + package_id $package_id] -set package_id [ad_conn package_id] -permission::require_permission -object_id $package_id -privilege "read" -set write_p [permission::permission_p -object_id $package_id -privilege "write"] -set admin_p [permission::permission_p -object_id $package_id -privilege "admin"] +set html [$Package invoke -method $m] -::xowiki::Page set recursion_count 0 -set page [::Generic::CrItem instantiate \ - -item_id $item_id \ - -revision_id $revision_id] +set fn [get_server_root]/packages/xowiki/www/resources/xowiki.css +set F [open $fn]; set css [read $F]; close $F +set css "" +set html $css$html -if {![info exists folder_id]} {set folder_id [$page set parent_id]} -::xowiki::Page require_folder_object -folder_id $folder_id -package_id $package_id - -set content [$page render] - -if {[ad_parameter "user_tracking" -package_id $package_id] } { - $page record_last_visited -} -set references [$page references] -set header_stuff [::xowiki::Page header_stuff] -#ns_log notice "--HEADER-Stuff = <$header_stuff>" - -if {[$page exists master] && $master == 1} {set master [$page set master]} - -# export title, text, and lang_links to current scope -$page instvar title name text lang_links -if {$master} { - set context [list $title] - - set base [apm_package_url_from_id $package_id] - set rev_link [export_vars -base ${base}revisions {{page_id $item_id} name}] - set edit_link [export_vars -base ${base}edit {item_id}] - set delete_link [export_vars -base ${base}delete {item_id}] - set new_link [export_vars -base ${base}edit {object_type}] - set admin_link [export_vars -base ${base}admin/ {}] - set index_link [export_vars -base ${base} {}] - - set return_url [::xowiki::Page pretty_link $name] - set gc_link [general_comments_create_link $item_id $return_url] - set gc_comments [general_comments_get_comments $item_id $return_url] - - set template [$folder_id get_payload template] - if {$template ne ""} { - set __including_page $page - set template_code [template::adp_compile -string $template] - if {[catch {set content [template::adp_eval template_code]} errmsg]} { - set content "Error in Page $name: $errmsg
$content" - } else { - ns_return 200 text/html $content - } - } else { - # use adp file - set template_file [$folder_id get_payload template_file] - if {$template_file ne ""} {template::set_file "[file dir $__adp_stub]/$template_file"} - } -} else { - ns_return 200 text/html $content - ad_script_abort -} 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.5 -r1.6 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 27 May 2006 12:05:16 -0000 1.5 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 26 Jul 2006 22:56:46 -0000 1.6 @@ -29,16 +29,18 @@ Link instproc render {} { set page [my info parent] set item_id [my resolve] + #my log "--u resolve returns $item_id" if {$item_id} { $page lappend references [list $item_id [my type]] set href [::xowiki::Page pretty_link -package_id [my package_id] -lang [my lang] \ [my stripped_name]] my render_found $href [my label] } else { + my instvar package_id $page incr unresolved_references set object_type [[$page info class] set object_type] set name [my label] - set href [export_vars -base [::xowiki::Page url_prefix -package_id [my package_id]]edit {object_type name}] + set href [export_vars -base [$package_id package_url] {{edit-new 1} object_type name}] my render_not_found $href [my label] } } @@ -49,12 +51,15 @@ set package_id [site_node::get_children -node_id $a -package_key xowiki \ -filters [list name $name] -element package_id] if {$package_id ne ""} { - set folder_id [::xowiki::Page require_folder -package_id $package_id \ - -name xowiki -store_folder_id false] - return [list package_id $package_id folder_id $folder_id] + my log "--LINK found package_id=$package_id [my isobject ::$package_id]" + if {![my isobject ::$package_id]} { + my log "--LINK creating package object" + ::xowiki::Package create ::$package_id + } + return $package_id } } - return [list] + return 0 } @@ -65,7 +70,7 @@ Class create ::xowiki::Link::language -superclass ::xowiki::Link ::xowiki::Link::language instproc render {} { set page [my info parent] - my instvar lang + my instvar lang name package_id set item_id [my resolve] if {$item_id} { set css_class "found" @@ -74,7 +79,7 @@ set css_class "undefined" set last_page_id [$page set item_id] set object_type [[$page info class] set object_type] - set link [export_vars -base [::xowiki::Page url_prefix]edit {object_type name last_page_id}] + set link [export_vars -base [$package_id package_url] {{edit-new 1} object_type name last_page_id}] } $page lappend lang_links \ " $item_id" + + if {$item_id == 0} { + if {[regexp {^pages/(..)/(.*)$} $path _ lang local_name]} { + } elseif {[regexp {^(..)/(.*)$} $path _ lang local_name]} { + } elseif {[regexp {^(..):(.*)$} $path _ lang local_name]} { + } else { + set key queryparm(lang) + set lang [expr {[info exists $key] ? [set $key] : \ + [string range [lang::conn::locale] 0 1]}] + set local_name $path + } + set name ${lang}:$local_name + if {[info exists name]} { + set item_id [::Generic::CrItem lookup -name $name -parent_id $folder_id] + my log "--try $name -> $item_id" + } + if {$item_id == 0} { + set nname [Page normalize_name -package_id [my set id] $name] + set item_id [::Generic::CrItem lookup -name $nname -parent_id $folder_id] + my log "--try $nname -> $item_id" + } + } + } + if {$item_id != 0} { + set key queryparm(revision_id) + if {[info exists $key]} {set revision_id [set $key]} + if {[info exists revision_id]} { + set item_id 0 + } else { + set revision_id 0 + } + my log "--instantiate item_id $item_id revision_id $revision_id" + set r [::Generic::CrItem instantiate -item_id $item_id -revision_id $revision_id] + my log "--instantiate done " + $r set package_id [namespace tail [self]] + return $r + } else { + return "" + } + } + + Package instproc require_folder_object { + {-store_folder_id:boolean true} + } { + my instvar id folder_id + # the flag store_folder_id should not be necessary, when the id is + # always stored in the package TODO + + if {$folder_id == 0} { + set folder_id [::xowiki::Page require_folder -name xowiki -package_id $id] + } + + if {![::xotcl::Object isobject ::$folder_id]} { + # if we can't get the folder from the cache, create it + if {[catch {eval [nsv_get xotcl_object_cache ::$folder_id]}]} { + while {1} { + set item_id [ns_cache eval xotcl_object_type_cache item_id-of-$folder_id { + set myid [CrItem lookup -name ::$folder_id -parent_id $folder_id] + if {$myid == 0} break; # don't cache ID + return $myid + }] + break + } + if {[info exists item_id]} { + # we have a valid item_id and get the folder object + #my log "--f fetch folder object -object ::$folder_id -item_id $item_id" + ::xowiki::Object fetch_object -object ::$folder_id -item_id $item_id + } else { + # 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\nset index_page \"\"\n" + ::$folder_id set parent_id $folder_id + ::$folder_id set name ::$folder_id + ::$folder_id set title ::$folder_id + ::$folder_id save_new + ::$folder_id initialize_loaded_object + } + } + + #$o proc destroy {} {my log "--f "; next} + ::$folder_id set package_id $id + uplevel #0 [list ::$folder_id volatile] + } else { + #my log "--f reuse folder object $folder_id [::Serializer deepSerialize ::$folder_id]" + } + if {$store_folder_id} { + Page set folder_id $folder_id + } + + my set folder_id $folder_id + } + + Package instproc return_page {-adp -variables -form} { + my log "--vars=[self args]" + set __vars [list] + foreach _var $variables { + if {[llength $_var] == 2} { + lappend __vars [lindex $_var 0] [uplevel subst [lindex $_var 1]] + } else { + set localvar local.$_var + upvar $_var $localvar + if {[info exists $localvar]} { + # ignore undefined variables + lappend __vars $_var [set $localvar] + } + } + } + + if {[info exists form]} { + set level [template::adp_level] + foreach f [uplevel #$level info vars ${form}:*] { + lappend __vars &$f $f + upvar #$level $f $f + } + } + my log "--before adp" ;#$__vars + set text [template::adp_include $adp $__vars] + my log "--after adp" + return $text + } + + Package instproc query_parameter {name {default ""}} { + [self class] instvar queryparm + return [expr {[info exists queryparm($name)] ? $queryparm($name) : $default}] + } + Package instproc exists_query_parameter {name} { + [self class] exists queryparm($name) + } + + Package instproc form_parameter {name {default ""}} { + [self class] instvar form_parameter + if {![info exists form_parameter]} {array set form_parameter [ns_set array [ns_getform]]} + return [expr {[info exists form_parameter($name)] ? $form_parameter($name) : $default}] + } + Package instproc exists_form_parameter {name} { + [self class] instvar form_parameter + if {![info exists form_parameter]} {array set form_parameter [ns_set array [ns_getform]]} + [self class] exists form_parameter($name) + } + + + Package ad_instproc reindex {} { + reindex all items of this package + } { + my instvar folder_id + db_foreach get_pages "select page_id from xowiki_page, cr_revisions r, cr_items i \ + where page_id = r.revision_id and i.item_id = r.item_id and i.parent_id = $folder_id " { + search::queue -object_id $page_id -event DELETE + search::queue -object_id $page_id -event INSERT + } + } + + Package instproc rss {} { + my instvar id + set cmd [list ::xowiki::Page rss -package_id $id] + set rss [my query_parameter rss] + if {[regexp {[^0-9]*([0-9]+)d} $rss _ days]} {lappend cmd -days $days} + eval $cmd + } + + Package instproc edit-new {} { + my instvar folder_id id + set object_type [my query_parameter object_type "::xowiki::Page"] + set page [$object_type new -volatile -parent_id $folder_id -package_id $id] + set html [$page edit -new true] + my log "--e html length [string length $html]" + return $html + } + Package instproc condition {method attr value} { + switch $attr { + has_class {set result [expr {[my query_parameter object_type ""] eq $value}]} + default {set result 0} + } + my log "--c [self args] returns $result" + return $result + } + + + Class Policy + Policy instproc defined_methods {class} { + set c [self]::$class + expr {[my isclass $c] ? [$c array names require_permission] : [list]} + } + Policy instproc permission_p {object method} { + foreach class [concat [$object info class] [[$object info class] info heritage]] { + set c [self]::[namespace tail $class] + if {![my isclass $c]} continue + set key require_permission($method) + if {[$c exists $key]} { + set permission [$c set $key] + if {$permission eq "login" || $permission eq "none"} { + return 1 + } + foreach cond_permission $permission { + my log "--cond_permission = $cond_permission" + switch [llength $cond_permission] { + 3 {foreach {condition attribute privilege} $cond_permission break + if {[eval $object condition $method $condition]} break + } + 2 {foreach {attribute privilege} $cond_permission break + break + } + } + } + my log "--p checking permission::permission_p -object_id [$object set $attribute] -privilege $privilege" + return [permission::permission_p -object_id [$object set $attribute] -privilege $privilege] + } + } + return 0 + } + + Policy instproc check_permissions {object method} { + set allowed 0 + foreach class [concat [$object info class] [[$object info class] info heritage]] { + set c [self]::[namespace tail $class] + if {![my isclass $c]} continue + set key require_permission($method) + if {[$c exists $key]} { + set permission [$c set $key] + puts "checking $permission for $c $key" + switch $permission { + none {set allowed 1; break} + login {auth::require_login; set allowed 1; break} + default { + foreach cond_permission $permission { + my log "--c check $cond_permission" + switch [llength $cond_permission] { + 3 {foreach {condition attribute privilege} $cond_permission break + if {[eval $object condition $method $condition]} break + } + 2 {foreach {attribute privilege} $cond_permission break + break + } + } + } + my log "--c require_permission -object_id [$object set $attribute] -privilege $privilege" + permission::require_permission -object_id [$object set $attribute] -privilege $privilege + set allowed 1 + break + } + } + } + } + return $allowed + } + + + + Policy policy1 -contains { + + Class Package -array set require_permission { + reindex {{id admin}} + rss none + edit-new {{{has_class ::xowiki::Object} id admin} {id create}} + } + + Class Page -array set require_permission { + view {{package_id read}} + revisions {{package_id write}} + edit {{package_id write}} + make-live-revision {{package_id write}} + delete-revision {{package_id admin}} + delete {{package_id admin}} + save-tags login + popular-tags login + } + + Class Object -array set require_permission { + edit {{package_id admin}} + } + } + +} 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.9 -r1.10 --- openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 8 Jul 2006 11:52:17 -0000 1.9 +++ openacs-4/packages/xowiki/tcl/xowiki-form-procs.tcl 26 Jul 2006 22:56:46 -0000 1.10 @@ -113,10 +113,10 @@ if {$nls_language eq ""} {set nls_language [lang::conn::locale]} set name [string range $nls_language 0 1]:$name } - set subst_blank_in_name [$folder_id get_payload subst_blank_in_name] - if {$subst_blank_in_name == 1} { - regsub -all " " $name "_" name - } + set name [::xowiki::Page normalize_name -package_id [ad_conn package_id] $name] + + #my log "--form vars = [ns_set array [ns_getform] ]" + #my log "--form comparing '[ns_set get [ns_getform] __object_name]' w '$name'" if {[ns_set get [ns_getform] __new_p] || [ns_set get [ns_getform] __object_name] ne $name } { @@ -164,15 +164,14 @@ WikiForm instproc new_request {} { my instvar data - $data set creator [$data get_name [ad_conn user_id]] - my log "--F setting creator to [$data get_name [ad_conn user_id]]" + $data set creator [$data get_user_name [ad_conn user_id]] next } WikiForm instproc edit_request args { my instvar data if {[$data set creator] eq ""} { - $data set creator [$data get_name [ad_conn user_id]] + $data set creator [$data get_user_name [ad_conn user_id]] } next } @@ -274,8 +273,13 @@ set item_id [$data set item_id] set page_template [ns_set get [ns_getform] page_template] set f [ns_getform] - if {[ns_set find $f return_url]} {set return_url [ns_set get $f return_url]} - my submit_link [export_vars -base edit {folder_id object_type item_id page_template return_url}] + if {[$data exists_query_parameter return_url]} { + set return_url [$data query_parameter return_url] + } + #if {[ns_set find $f return_url]} {set return_url [ns_set get $f return_url]} + set link [::xowiki::Page pretty_link -package_id [$data set package_id] [$data set name]] + #my submit_link [export_vars -base edit {folder_id object_type item_id page_template return_url}] + my submit_link [export_vars -base $link {{m edit} page_template return_url item_id}] my log "-- submit_link = [my submit_link]" } @@ -303,12 +307,16 @@ } PageInstanceEditForm instproc new_data {} { + my instvar data set __vars {folder_id item_id page_template return_url} - set object_type [[[my set data] info class] object_type] + set object_type [[$data info class] object_type] #my log "-- cl=[[my set data] info class] ot=$object_type $__vars" foreach __v $__vars {set $__v [ns_queryget $__v]} set item_id [next] - my submit_link [export_vars -base edit $__vars] + + set link [::xowiki::Page pretty_link -package_id [$data set package_id] [$data set name]] + my submit_link [export_vars -base $link {{m edit} $__vars}] + #my submit_link [export_vars -base 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.42 -r1.43 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 23 Jun 2006 08:18:23 -0000 1.42 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 26 Jul 2006 22:56:46 -0000 1.43 @@ -52,10 +52,6 @@ -mime_type text/xotcl \ -form ::xowiki::ObjectForm - Object instproc save_new {} { - #my set text [::Serializer deepSerialize [self]] - next - } # # create reference table and table for user tracking @@ -222,11 +218,59 @@ where content_type in ('CrWikiPage', 'CrWikiPlainPage', \ 'PageInstance', 'PageTemplate','CrNote', 'CrSubNote')" {;} } + + if {[apm_version_names_compare $from_version_name "0.30"] == -1 && + [apm_version_names_compare $to_version_name "0.30"] > -1} { + ns_log notice "-- upgrading to 0.30" + # delete orphan cr revisions, created automatically by content_item + # new, when e.g. a title is specified.... + foreach class {::xowiki::Page ::xowiki::PlainPage ::xowiki::Object + ::xowiki::PageTemplate ::xowiki::PageInstance} { + db_dml delete_orphan_revisions " + delete from cr_revisions where revision_id in ( + select r.revision_id from cr_items i,cr_revisions r + where i.content_type = '$class' and r.item_id = i.item_id + and not r.revision_id in (select [$class id_column] from [$class table_name])) + " + db_dml delete_orphan_items " + delete from acs_objects where object_type = '$class' + and not object_id in (select item_id from cr_items where content_type = '$class') + and not object_id in (select [$class id_column] from [$class table_name]) + " + } + } } + # # Page definitions # + + Page parameter { + page_id + {revision_id 0} + object_type + parent_id + package_id + name + title + text + {folder_id -100} + {lang_links ""} + {lang en} + {render_adp 1} + } + Page set recursion_count 0 + Page array set RE { + include {([^\\]){{(.+)}}[ \n\r]*} + anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} + div {()([^\\])>>([^&]*)<<} + clean {[\\](\{\{|>>|\[\[)} + } + # + # templating and CSS + # + Page proc requireCSS name {set ::need_css($name) 1} Page proc requireJS name {set ::need_js($name) 1} Page proc header_stuff {} { @@ -240,22 +284,64 @@ } return $result } + Page proc quoted_html_content text { + list [ad_text_to_html $text] text/html + } + # + # Operations on the whole instance + # + Class create Folder - Page ad_proc reindex {-package_id} { - reindex all items of a package + + Page ad_proc select_query { + {-select_attributes ""} + {-order_clause ""} + {-where_clause ""} + {-count:boolean false} + {-folder_id} + {-page_size 20} + {-page_number ""} + {-extra_where_clause ""} + {-extra_from_clause ""} } { - if {![info exists package_id]} {set package_id [ad_conn package_id]} - set folder_id [::xowiki::Page require_folder \ - -package_id $package_id \ - -name xowiki] - db_foreach get_pages "select page_id from xowiki_page" { - search::queue -object_id $page_id -event DELETE - search::queue -object_id $page_id -event INSERT + returns the SQL-query to select the xowiki pages of the specified folder + @select_attributes attributes for the sql query to be retrieved, in addion + to ci.item_id acs_objects.object_type, which are always returned + @param order_clause clause for ordering the solution set + @param where_clause clause for restricting the answer set + @param count return the query for counting the solutions + @param folder_id parent_id + @return sql query + } { + my instvar object_type_key + if {![info exists folder_id]} {my instvar folder_id} + + set attributes [list ci.item_id ci.name p.page_id] + foreach a $select_attributes { + if {$a eq "title"} {set a p.title} + lappend attributes $a } + if {$count} { + set attribute_selection "count(*)" + set order_clause "" ;# no need to order when we count + set page_number "" ;# no pagination when count is used + } else { + set attribute_selection [join $attributes ,] + } + + if {$where_clause ne ""} {set where_clause "and $where_clause "} + if {$page_number ne ""} { + set pagination "offset [expr {$page_size*($page_number-1)}] limit $page_size" + } else { + set pagination "" + } + return "select $attribute_selection from xowiki_pagei p, cr_items ci $extra_from_clause \ + where ci.parent_id = $folder_id and ci.item_id = p.item_id and \ + ci.live_revision = p.page_id $where_clause $extra_where_clause $order_clause $pagination" } - + Page proc rss_head { -channel_title -link @@ -275,14 +361,7 @@ xowiki" } - Page proc rss_item { - -creator - -title - -link - -guid - -description - -pubdate - } { + Page proc rss_item {-creator -title -link -guid -description -pubdate } { append result \n\ $creator \n\ $title \n\ @@ -364,127 +443,7 @@ ns_return 200 $t $content } - Page instproc get_name {uid} { - if {$uid ne "" && $uid != 0} { - acs_user::get -user_id $uid -array user - return "$user(first_names) $user(last_name)" - } else { - return nobody - } - } - - Page proc url_prefix {-package_id} { - my instvar url_prefix folder_id - if {![info exists package_id]} {set package_id [$folder_id set package_id]} - if {![info exists url_prefix($package_id)]} { - set url_prefix($package_id) [site_node::get_url_from_object_id -object_id $package_id] - } - return $url_prefix($package_id) - } - - Page proc pretty_link {{-fully_qualified:boolean false} -lang -package_id name} { - my instvar url_prefix folder_id - - if {![info exists package_id]} {set package_id [$folder_id set package_id]} - if {![info exists url_prefix($package_id)]} { - set url_prefix($package_id) [site_node::get_url_from_object_id -object_id $package_id] - } - - if {![info exists lang]} { - regexp {^(..):(.*)$} $name _ lang name - } - set host [expr {$fully_qualified ? [ad_url] : ""}] - if {[info exists lang]} { - return $host$url_prefix($package_id)pages/$lang/[ad_urlencode $name] - } else { - return $host$url_prefix($package_id)pages/[ad_urlencode $name] - } - } - - Page proc save_tags {-package_id:required -item_id:required -user_id:required tags} { - db_dml delete_tags \ - "delete from xowiki_tags where item_id = $item_id and user_id = $user_id" - foreach tag $tags { - db_dml insert_tag \ - "insert into xowiki_tags (item_id,package_id, user_id, tag, time) \ - values ($item_id, $package_id, $user_id, :tag, current_timestamp)" - } - } - Page proc get_tags {-package_id:required -item_id -user_id} { - if {[info exists item_id]} { - if {[info exists user_id]} { - # tags for item and user - set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where user_id=$user_id and item_id=$item_id and package_id=$package_id"] - } else { - # all tags for this item - set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where item_id=$item_id and package_id=$package_id"] - } - } else { - if {[info exists user_id]} { - # all tags for this user - set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where user_id=$user_id and package_id=$package_id"] - } else { - # all tags for the package - set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where package_id=$package_id"] - } - } - join $tags " " - } - - - Page instproc initialize_loaded_object {} { - my instvar title creator - if {[info exists title] && $title eq ""} {set title [my set name]} - #if {$creator eq ""} {set creator [my get_name [my set creation_user]]} - next - } - - Page ad_proc require_folder_object { - -folder_id:required - -package_id - {-store_folder_id:boolean true} - } { - } { - if {![::xotcl::Object isobject ::$folder_id]} { - while {1} { - set item_id [ns_cache eval xotcl_object_type_cache item_id-of-$folder_id { - set id [CrItem lookup -name ::$folder_id -parent_id $folder_id] - if {$id == 0} break; # don't cache - return $id - }] - break - } - if {[info exists item_id]} { - # we have a valid item_id and get the folder object - #my log "--f fetch folder object -object ::$folder_id -item_id $item_id" - set o [::xowiki::Object fetch_object -object ::$folder_id -item_id $item_id] - } else { - # we have no folder object yet. so we create one... - set o [::xowiki::Object create ::$folder_id] - $o set text "# this is the payload of the folder object\n\nset index_page \"\"\n" - $o set parent_id $folder_id - $o set name ::$folder_id - $o set title ::$folder_id - $o save_new - $o initialize_loaded_object - } - if {![info exists package_id]} { - # get package_id from folder_id - set package_id [db_string get_package_id "select f.package_id from cr_folders f \ - where $folder_id = f.folder_id"] - } - #$o proc destroy {} {my log "--f "; next} - $o set package_id $package_id - uplevel #0 [list $o volatile] - } else { - #my log "--f reuse folder object $folder_id [::Serializer deepSerialize ::$folder_id]" - } - if {$store_folder_id} { - Page set folder_id $folder_id - } - } - - Page proc import {-user_id -package-id -folder-id {-replace 0} -objects} { + Page proc import {-user_id -package_id -folder_id {-replace 0} -objects} { set object_type [self] if {![info exists folder_id]} {set folder_id [$object_type require_folder -name xowiki]} if {![info exists package_id]} {set package_id [ad_conn package_id]} @@ -537,99 +496,141 @@ append msg "$added objects inserted, $replaced objects replaced

" } - Page ad_proc select_query { - {-select_attributes ""} - {-order_clause ""} - {-where_clause ""} - {-count:boolean false} - {-folder_id} - {-page_size 20} - {-page_number ""} - {-syndication:boolean false} - {-extra_where_clause ""} - {-extra_from_clause ""} - } { - returns the SQL-query to select the xowiki pages of the specified folder - @select_attributes attributes for the sql query to be retrieved, in addion - to ci.item_id acs_objects.object_type, which are always returned - @param order_clause clause for ordering the solution set - @param where_clause clause for restricting the answer set - @param count return the query for counting the solutions - @param folder_id parent_id - @return sql query - } { - my instvar object_type_key - if {![info exists folder_id]} {my instvar folder_id} + # + # URL and naming management + # + Page proc pretty_link {{-fully_qualified:boolean false} -lang -package_id name} { + my instvar folder_id + my log "--u name=<$name>" - set attributes [list ci.item_id ci.name p.page_id] - foreach a $select_attributes { - if {$a eq "title"} {set a p.title} - lappend attributes $a + if {![info exists package_id]} {set package_id [$folder_id set package_id]} + if {![my isobject ::$package_id]} { + my log "--u we create package ::xowiki::Package create ::$package_id -folder_id $folder_id" + ::xowiki::Package create ::$package_id -folder_id $folder_id } - if {$count} { - set attribute_selection "count(*)" - set order_clause "" ;# no need to order when we count - set page_number "" ;# no pagination when count is used + set url [::$package_id package_url] + + if {![info exists lang]} { + regexp {^(..):(.*)$} $name _ lang name + } + if {![info exists lang] && ![string match :* $name]} { + set lang [string range [lang::conn::locale] 0 1] + } + set host [expr {$fully_qualified ? [ad_url] : ""}] + if {[info exists lang]} { + return $host${url}$lang/[ad_urlencode $name] } else { - set attribute_selection [join $attributes ,] + return $host${url}[ad_urlencode $name] } + } - if {$where_clause ne ""} {set where_clause "and $where_clause "} -# if {$syndication} { -# append where_clause "and syndication.object_id = p.page_id" -# set extra_tables ", syndication " -# } else { -# set extra_tables "" -# } - if {$page_number ne ""} { - set pagination "offset [expr {$page_size*($page_number-1)}] limit $page_size" - } else { - set pagination "" + Page proc normalize_name {-package_id string} { + set string [string trim $string] + # if subst_blank_in_name is turned on, turn spaces into _ + if {[$package_id get_parameter subst_blank_in_name 1] != 0} { + regsub -all { } $string "_" string } - return "select $attribute_selection from xowiki_pagei p, cr_items ci $extra_from_clause \ - where ci.parent_id = $folder_id and ci.item_id = p.item_id and \ - ci.live_revision = p.page_id $where_clause $extra_where_clause $order_clause $pagination" + return $string } + Page instproc make_link {-privilege -url object method args} { + my instvar package_id + + if {[info exists privilege]} { + set granted [expr {$privilege eq "public" ? 1 : + [permission::permission_p -object_id $package_id -privilege $privilege] + }] + } else { + # determine privilege from policy + set granted [$package_id permission_p $object $method] + my log "--p $package_id permission_p $object $method ==> $granted" + } + if {$granted} { + if {[$object istype ::xowiki::Package]} { + set base [$package_id package_url] + if {[info exists url]} { + return [uplevel export_vars -base $base$url [list $args]] + } else { + lappend args [list $method 1] + return [uplevel export_vars -base $base [list $args]] + } + } elseif {[$object istype ::xowiki::Page]} { + set base [$package_id url] + lappend args [list m $method] + return [uplevel export_vars -base $base [list $args]] + } + } + return "" + } + # - # data definitions + # tag management, get_tags works on instance or gobally # - Page parameter { - page_id - {revision_id 0} - object_type - {folder_id -100} - {lang_links ""} - {lang en} - {render_adp 1} + Page proc save_tags {-package_id:required -item_id:required -user_id:required tags} { + db_dml delete_tags \ + "delete from xowiki_tags where item_id = $item_id and user_id = $user_id" + foreach tag $tags { + db_dml insert_tag \ + "insert into xowiki_tags (item_id,package_id, user_id, tag, time) \ + values ($item_id, $package_id, $user_id, :tag, current_timestamp)" + } + } + Page proc get_tags {-package_id:required -item_id -user_id} { + if {[info exists item_id]} { + if {[info exists user_id]} { + # tags for item and user + set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where user_id=$user_id and item_id=$item_id and package_id=$package_id"] + } else { + # all tags for this item + set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where item_id=$item_id and package_id=$package_id"] + } + } else { + if {[info exists user_id]} { + # all tags for this user + set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where user_id=$user_id and package_id=$package_id"] + } else { + # all tags for the package + set tags [db_list get_tags "SELECT distinct tag from xowiki_tags where package_id=$package_id"] + } + } + join $tags " " } - Page set recursion_count 0 - Page array set RE { - include {([^\\]){{(.+)}}[ \n\r]*} - anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} - div {()([^\\])>>([^&]*)<<} - clean {[\\](\{\{|>>|\[\[)} - } - PlainPage parameter { - {render_adp 0} - } - PlainPage array set RE { - include {([^\\]){{(.+)}}[ \n\r]} - anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} - div {()([^\\])>>([^<]*)<<} - clean {[\\](\{\{|>>|\[\[)} - } - PageTemplate parameter { - {render_adp 0} - } - # # Methods of ::xowiki::Page # + Page instforward query_parameter {%my set package_id} %proc + Page instforward exists_query_parameter {%my set package_id} %proc + Page instforward form_parameter {%my set package_id} %proc + Page instforward exists_form_parameter {%my set package_id} %proc + + Page instproc condition {method attr value} { + switch $attr { + has_class {return [expr {[my set object_type] eq $value}]} + } + return 0 + } + + Page instproc get_user_name {uid} { + if {$uid ne "" && $uid != 0} { + acs_user::get -user_id $uid -array user + return "$user(first_names) $user(last_name)" + } else { + return nobody + } + } + + + Page instproc initialize_loaded_object {} { + my instvar title creator + if {[info exists title] && $title eq ""} {set title [my set name]} + #if {$creator eq ""} {set creator [my get_user_name [my set creation_user]]} + next + } + Page instproc regsub-eval {re string cmd} { subst [regsub -all $re [string map {\[ \\[ \] \\] \$ \\$ \\ \\\\} $string] \ "\[$cmd\]"] @@ -688,7 +689,7 @@ return "$ch$label" } - my instvar parent_id + my instvar parent_id package_id # do we have a language link (it starts with a ':') if {[regexp {^:(..):(.*)$} $link _ lang stripped_name]} { set link_type language @@ -702,20 +703,14 @@ regexp {^(..):(.+)$} $link _ lang stripped_name } } - set stripped_name [string trim $stripped_name] - if {$lang eq ""} {set lang [my lang]} + set stripped_name [Page normalize_name -package_id $package_id $stripped_name] + if {$lang eq ""} {set lang [my lang]} if {$label eq $arg} {set label $stripped_name} - # if subst_blank_in_name is turned on, turn spaces into _ - if {[$parent_id get_payload subst_blank_in_name] == 1} { - regsub -all { } $stripped_name "_" stripped_name - } - - #my log "--LINK lang=$lang type=$link_type stripped_name=$stripped_name" Link create [self]::link \ -type $link_type -name $lang:$stripped_name -lang $lang \ -stripped_name $stripped_name -label $label \ - -folder_id $parent_id -package_id [$parent_id set package_id] + -folder_id $parent_id -package_id $package_id return $ch[[self]::link render] } @@ -754,7 +749,7 @@ } Page instproc adp_subst {content} { - set __ignorelist [list RE __defaults name_method object_type_key url_prefix] + set __ignorelist [list RE __defaults name_method object_type_key] foreach __v [my info vars] { if {[info exists $__v]} continue my instvar $__v @@ -783,7 +778,7 @@ } Page instproc get_content {} { - my log "--" + #my log "--" set content [my substitute_markup [my set text]] } @@ -838,11 +833,10 @@ Page instproc record_last_visited {-user_id} { - my instvar parent_id item_id + my instvar item_id package_id if {![info exists user_id]} {set user_id [ad_conn user_id]} if {$user_id > 0} { # only record information for authenticated users - set package_id [$parent_id set package_id] db_dml update_last_visisted \ "update xowiki_last_visited set time = current_timestamp, count = count + 1 \ where page_id = $item_id and user_id = $user_id" @@ -858,6 +852,16 @@ # Methods of ::xowiki::PlainPage # + PlainPage parameter { + {render_adp 0} + } + PlainPage array set RE { + include {([^\\]){{(.+)}}[ \n\r]} + anchor {([^\\])\\\[\\\[([^\]]+)\\\]\\\]} + div {()([^\\])>>([^<]*)<<} + clean {[\\](\{\{|>>|\[\[)} + } + PlainPage instproc get_content {} { #my log "-- my class=[my info class]" return [my substitute_markup [my set text]] @@ -878,9 +882,15 @@ } # - # PageInstance methods + # PageTemplate specifics # + PageTemplate parameter { + {render_adp 0} + } + # + # PageInstance methods + # PageInstance instproc get_field_type {name template default_spec} { # get the widget field specifications from the payload of the folder object # for a field with a specified name in a specified page template @@ -932,6 +942,11 @@ # Methods of ::xowiki::Object # + #Object instproc save_new {} { + #my set text [::Serializer deepSerialize [self]] + #next + #} + Object instproc get_content {} { if {[[self]::payload info procs content] ne ""} { return [my substitute_markup [[self]::payload content]] @@ -946,15 +961,18 @@ } Object instproc set_payload {cmd} { set payload [self]::payload - if {![my isobject $payload]} {::xotcl::Object create $payload -requireNamespace} + if {[my isobject $payload]} {$payload destroy} + ::xotcl::Object create $payload -requireNamespace if {[catch {$payload eval $cmd} error ]} { ns_log error "XoWiki folder object: content lead to error: $error" } } - Object instproc get_payload {var} { + Object instproc get_payload {var {default ""}} { set payload [self]::payload if {![my isobject $payload]} {::xotcl::Object create $payload -requireNamespace} - expr {[$payload exists $var] ? [$payload set $var] : ""} + expr {[$payload exists $var] ? [$payload set $var] : $default} } -} \ No newline at end of file +} + +source [file dirname [info script]]/xowiki-www-procs.tcl \ No newline at end of file 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.10 -r1.11 --- openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 7 Jun 2006 17:08:24 -0000 1.10 +++ openacs-4/packages/xowiki/tcl/xowiki-sc-procs.tcl 26 Jul 2006 22:56:46 -0000 1.11 @@ -15,13 +15,9 @@ } { ns_log notice "--datasource called with revision_id = $revision_id" - set page [::Generic::CrItem instantiate -item_id 0 -revision_id $revision_id] + set page [::xowiki::Package instantiate_from_page -revision_id $revision_id] $page volatile - # ensure context for dependencies of folder object - set folder_id [$page set parent_id] - ::xowiki::Page require_folder_object -folder_id $folder_id - set html [$page render] set text [ad_html_text_convert -from text/html -to text/plain -- $html] #set text [ad_text_to_html $html]; #this could be used for entity encoded html text in rss entries @@ -30,15 +26,15 @@ #$page set unresolved_references 0 $page instvar item_id - return [list object_id $revision_id title [$page set title] \ + return [list object_id $revision_id title [$page title] \ content $text keywords {} \ storage_type text mime text/plain \ syndication [list \ link [::xowiki::Page pretty_link -fully_qualified 1 [$page set name]] \ description $text \ author [$page set creator] \ category "" \ - guid "[ad_url]/o/$item_id" \ + guid "$item_id" \ pubDate [$page set last_modified]] \ ] } @@ -48,18 +44,9 @@ returns a url for a message to the search package } { - set page [::Generic::CrItem instantiate -item_id 0 -revision_id $revision_id] + set page [::xowiki::Package instantiate_from_page -revision_id $revision_id] $page volatile - set folder_id [$page set parent_id] - set pid [db_string get_pid "select package_id from cr_folders where folder_id = $folder_id"] - if {$pid > 0} { - return [::xowiki::Page pretty_link -package_id $pid [$page set name]] - } else { - # cannot determine package_id; one page from the directory should be viewed to update - # package id for the content folder... - return "cannot determine package_id, view a page from the folder containing page \ - [$page set name]" - } + return [::[$page package_id] url] } 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,291 @@ +# different template testing DONE +# orphan creation DONE +# orphan deletions completion DONE +# link resolver DONE +# edit-new parameter name DONE +# cgi package_id missing DONE +# delete all DONE +# $parent_id set package_id DONE +# lang link DONE +# unknown link DONE +# weblog DONE +# tag edit DONE +# tag new DONE +# weblog on the fly creation DONE +# behavior without index page DONE +# renaming objects DONE +# handling of sc DONE +# make subst_blank_in_name default DONE +# package parameters and payload of folder object DONE +# permissions management DONE +# permissions admin DONE +# include DONE +# edit page template DONE +# edit page instance DONE +# delete folder object DONE +# the flag store_folder_id should not be necessary +# move require folder object code +# edit-new last_page_id (needed?) +# edit last_page_id (needed?) + + +namespace eval ::xowiki { + + Page instproc view {} { + # view is used only for the toplevel call, when the xowiki page is viewed + # this is not inteded for embedded wiki pages + my instvar package_id item_id + $package_id instvar folder_id ;# this is the root folder + ::xowiki::Page set recursion_count 0 + + set content [my render] + my log "--after render" + + if {[$package_id get_parameter "use_user_tracking" 1]} { + my record_last_visited + } + + my log "--after user_tracking" + set references [my references] + my log "--after references" + + # export title, text, and lang_links to current scope + my instvar title name text lang_links + + set tags "" + set no_tags 1 + if {[$package_id get_parameter "use_tags" 1] && + ![my exists_query_parameter no_tags]} { + # only activate tags when the user is logged in + set no_tags [expr {[ad_conn user_id] == 0}] + set tags "" + if {!$no_tags} { + ::xowiki::Page requireJS "/resources/xowiki/get-http-object.js" + set entries [list] + set tags [lsort [::xowiki::Page get_tags -user_id [ad_conn user_id] \ + -item_id $item_id -package_id $package_id]] + set href [site_node::get_url_from_object_id -object_id $package_id]weblog?summary=1 + foreach tag $tags {lappend entries "$tag"} + set tags_with_links [join $entries {, }] + } + } + + my log "--after tags" + set return_url [$package_id url] ;# for the time being + + if {[$package_id get_parameter "use_gc"] && + ![my exists_query_parameter no_gc]} { + set gc_link [general_comments_create_link -object_name $title $item_id $return_url] + set gc_comments [general_comments_get_comments $item_id $return_url] + } else { + set gc_link "" + set gc_comments "" + } + + 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"] + } + + my log "--after gc title=$title" + if {$master} { + set context [list $title] + set object_type [my info class] + set rev_link [my make_link [self] revisions] + set edit_link [my make_link [self] edit return_url] + set delete_link [my make_link [self] delete] + set new_link [my make_link $package_id edit-new object_type] + set admin_link [my make_link -privilege admin -url admin/ $package_id {} {}] + set index_link [my make_link -privilege public -url "" $package_id {} {}] + set save_tag_link [my make_link [self] save-tags] + set popular_tags_link [my make_link [self] popular-tags] + + my log "--after context delete_link=$delete_link " + set template [$folder_id get_payload template] + + if {$template ne ""} { + set __including_page $page + set template_code [template::adp_compile -string $template] + if {[catch {set content [template::adp_eval template_code]} errmsg]} { + set content "Error in Page $name: $errmsg
$content" + } else { + ns_return 200 text/html $content + } + } else { + # use adp file + set template_file [my query_parameter "template_file" \ + [$folder_id get_payload template_file view-default]] + if {![regexp {^[./]} $template_file]} { + set template_file /packages/xowiki/www/$template_file + } + set page [self] + $package_id return_page -adp $template_file -variables { + references name title item_id page context header_stuff return_url + content references lang_links + rev_link edit_link delete_link new_link admin_link index_link + tags no_tags tags_with_links save_tag_link popular_tags_link + gc_link gc_comments + } + } + } else { + ns_return 200 text/html $content + } + } + + Page instproc edit {{-new:boolean false}} { + my instvar package_id item_id revision_id + $package_id instvar folder_id ;# this is the root folder + + #-query { + # item_id:integer,optional + # name:optional + # last_page_id:integer,optional + # folder_id:integer,optional + # {object_type:optional ::xowiki::Page} + # page_template:integer,optional + # return_url:optional + #} + + # set some default values if they are provided + foreach key {name} { + if {[$package_id exists_query_parameter $key]} {my set $key [$package_id query_parameter $key]} + } + + set object_type [my info class] + if {!$new && $object_type eq "::xowiki::Object" && [my set name] eq "::$folder_id"} { + # if we edit the folder object, we have to do some extra magic here, + # since the folder object has slightly different naming conventions. + # ns_log notice "--editing folder object ::$folder_id, FLUSH $page" + ns_cache flush xotcl_object_cache [self] + ns_cache flush xotcl_object_cache ::$folder_id + my move ::$folder_id + set page ::$folder_id + #ns_log notice "--move page=$page" + } + + # + # setting up folder id for file selector (use community folder if available) + # + set fs_folder_id "" + if {[info commands dotlrn_fs::get_community_shared_folder] ne ""} { + set fs_folder_id [dotlrn_fs::get_community_shared_folder \ + -community_id [dotlrn_community::get_community_id]] + } + + # the following line is like [$package_id url], but works as well with renames of the object + set myurl [expr {$new ? [$package_id url] : + [Page pretty_link -package_id $package_id [my form_parameter name]]}] + if {[my exists_query_parameter "return_url"]} { + set submit_link [my query_parameter "return_url" $myurl] + set return_url $submit_link + } else { + set submit_link $myurl + } + my log "--u sumit_link=$submit_link qp=[my query_parameter return_url]" + + # we have to do template mangling here; ad_form_template writes form variables into the + # actual parselevel, so we have to be in our own level in order to access an pass these + variable ::template::parse_level + lappend parse_level [info level] + set action_vars [expr {$new ? "{edit-new 1} object_type return_url" : "{m edit} return_url"}] + [$object_type getFormClass -data [self]] create ::xowiki::f1 -volatile \ + -action [export_vars -base [$package_id url] $action_vars] \ + -data [self] \ + -folderspec [expr {$fs_folder_id ne "" ?"folder_id $fs_folder_id":""}] \ + -submit_link $submit_link + + if {[info exists return_url]} { + ::xowiki::f1 generate -export [list [list return_url $return_url]] + } else { + ::xowiki::f1 generate + } + ::xowiki::f1 instvar edit_form_page_title context formTemplate + + if {[info exists item_id]} { + set rev_link [my make_link [self] revisions] + set view_link [my make_link [self] view] + } + if {[info exists last_page_id]} { + set back_link [$package_id url] + } + + set index_link [my make_link -privilege public -url "" $package_id {} {}] + set html [$package_id return_page -adp /packages/xowiki/www/edit \ + -form f1 \ + -variables {item_id edit_form_page_title context formTemplate + view_link back_link rev_link index_link}] + template::util::lpop parse_level + my log "--e html length [string length $html]" + return $html + } + + + + Page instproc revisions {} { + my instvar package_id name item_id + set context [list [list [$package_id url] $name ] [_ xotcl-core.revisions]] + set title "[_ xotcl-core.revision_title] '$name'" + set content [next] + $package_id return_page -adp /packages/xowiki/www/revisions -variables { + content context {page_id $item_id} title + } + } + + + Page instproc make-live-revision {} { + my instvar revision_id item_id package_id + my log "--M set_live_revision($revision_id)" + db_exec_plsql make_live {select content_item__set_live_revision(:revision_id)} + set page_id [my query_parameter "page_id"] + ns_cache flush xotcl_object_cache ::$item_id + ad_returnredirect [my query_parameter "return_url" \ + [export_vars -base [$package_id url] {{m revisions}}]] + } + + + Page instproc delete-revision {} { + my instvar revision_id package_id item_id + my log "--M delete revision($revision_id)" + db_exec_plsql delete_revision {select content_revision__del(:revision_id)} + ns_cache flush xotcl_object_cache ::$item_id + ns_cache flush xotcl_object_cache ::$revision_id + ad_returnredirect [my query_parameter "return_url" \ + [export_vars -base [$package_id url] {{m revisions}}]] + } + + Page instproc delete {} { + my instvar package_id item_id name parent_id + my log "--D trying to delete $item_id" + ::Generic::CrItem delete -item_id $item_id + ns_cache flush xotcl_object_cache ::$item_id + # we should probably flush as well cached revisions + if {$name eq "::$parent_id"} { + my log "--D deleting folder object ::$parent_id" + ns_cache flush xotcl_object_cache ::$parent_id + ns_cache flush xotcl_object_type_cache item_id-of-$parent_id + ::$parent_id destroy + } + ad_returnredirect [my query_parameter "return_url" [$package_id package_url]] + } + + Page instproc save-tags {} { + my instvar package_id item_id + ::xowiki::Page save_tags -user_id [ad_conn user_id] -item_id $item_id \ + -package_id $package_id [my form_parameter tags] + ad_returnredirect [my query_parameter "return_url" [$package_id url]] + } + + Page instproc popular-tags {} { + my instvar package_id item_id parent_id + set limit [my query_parameter "limit" 20] + set href [$package_id package_url]weblog?summary=1 + set entries [list] + db_foreach get_popular_tags \ + "select count(*) as nr,tag from xowiki_tags \ + where item_id=$item_id group by tag order by nr limit $limit" { + lappend entries "$tag ($nr)" + } + ns_return 200 text/html "[_ xowiki.popular_tags_label]: [join $entries {, }]" + } +} \ No newline at end of file Index: openacs-4/packages/xowiki/www/edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/edit.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/edit.adp 9 Feb 2006 22:53:03 -0000 1.2 +++ openacs-4/packages/xowiki/www/edit.adp 26 Jul 2006 22:56:46 -0000 1.3 @@ -12,14 +12,12 @@

- - #xowiki.back# · - + #xowiki.back# · - #xowiki.view# · - #xowiki.revisions# · + #xowiki.view# · + #xotcl-core.revisions# · - #xowiki.index# + #xowiki.index#
Fisheye: Tag 1.15 refers to a dead (removed) revision in file `openacs-4/packages/xowiki/www/edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6 refers to a dead (removed) revision in file `openacs-4/packages/xowiki/www/index.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.15 refers to a dead (removed) revision in file `openacs-4/packages/xowiki/www/index.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/xowiki/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/index.vuh 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,18 @@ +ad_page_contract { + This is the resolver for this package. It turns a request into + an object and executes the object with the computed method + + @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) + @creation-date July, 2006 + @cvs-id $Id: index.vuh,v 1.1 2006/07/26 22:56:46 gustafn Exp $ + +} +::xowiki::Package process_query \ + -defaults [list m view \ + folder_id 0 \ + package_id [ad_conn package_id]] + +set Package [::xowiki::Package create ::$package_id -folder_id $folder_id] +$Package log "--starting... [ns_conn url] [ns_conn query] form vars = [ns_set array [ns_getform]]" +ns_return 200 text/html [$Package invoke -method $m] +ad_script_abort Index: openacs-4/packages/xowiki/www/make-live-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/make-live-revision.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/xowiki/www/make-live-revision.tcl 3 May 2006 12:03:23 -0000 1.5 +++ openacs-4/packages/xowiki/www/make-live-revision.tcl 26 Jul 2006 22:56:46 -0000 1.6 @@ -4,10 +4,6 @@ @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) @creation-date Oct 23, 2005 @cvs-id $Id$ -} { - page_id:integer,notnull - revision_id:integer,notnull - name } db_exec_plsql make_live { Index: openacs-4/packages/xowiki/www/oacs-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/oacs-view.adp 23 Jun 2006 09:25:18 -0000 1.4 +++ openacs-4/packages/xowiki/www/oacs-view.adp 26 Jul 2006 22:56:46 -0000 1.5 @@ -4,105 +4,7 @@ @header_stuff;noquote@ - + + + + + + +
+ #xowiki.edit# · + #xotcl-core.revisions# · + #xowiki.new# · + #xowiki.delete# · + #xowiki.admin# · + #xowiki.index# +
+ +@content;noquote@ +
+ + +

 


#xowiki.references_label# @references;noquote@ +@lang_links;noquote@ +
+
+ +#xowiki.your_tags_label#: @tags_with_links;noquote@ +(#xowiki.edit_link#, +#xowiki.popular_tags_link#) + + + +

+ +

#general-comments.Comments# +

+
+ +

@gc_link;noquote@

+
Index: openacs-4/packages/xowiki/www/view-links.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-links.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/view-links.adp 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,9 @@ +
+ #xowiki.edit# · + #xotcl-core.revisions# · + #xowiki.new# · + #xowiki.delete# · + #xowiki.admin# · + #xowiki.index# +
+@content;noquote@ Index: openacs-4/packages/xowiki/www/view-plain.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/view-plain.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/view-plain.adp 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,2 @@ + +@content;noquote@ Index: openacs-4/packages/xowiki/www/weblog.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/weblog.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/xowiki/www/weblog.tcl 19 Jun 2006 00:40:04 -0000 1.1 +++ openacs-4/packages/xowiki/www/weblog.tcl 26 Jul 2006 22:56:46 -0000 1.2 @@ -1,36 +1,27 @@ +set package_id [ad_conn package_id] +set Package [::xowiki::Package create ::$package_id] +$Package instvar folder_id +set weblog_page [$Package get_parameter weblog_page "en:weblog"] +set page [$Package resolve_request -path $weblog_page] +#$Package log "weblog-page = $page" -set package_id [ad_conn package_id] -set folder_id [::xowiki::Page require_folder -package_id $package_id -name xowiki] -set weblog_page [$folder_id get_payload weblog_page] -if {$weblog_page eq ""} {set weblog_page "en:weblog"} -set item_id [Generic::CrItem lookup -name $weblog_page -parent_id $folder_id] - -if {$item_id == 0} { - set page [::xowiki::Page create new -volatile -noinit \ - -set creator {Gustaf Neumann} \ - -set name $weblog_page \ - -set title {Weblog} \ - -set creation_date {2006-06-18 00:32:30.674009+02} \ - -set creation_user 0 \ - -set item_id 0 \ - -set parent_id $folder_id \ - -set mime_type text/html \ - -set description {} \ - -set text {{

>>content<< -
{{adp portlets/weblog {name Weblog}}} -
>><< -
>>sidebar<< -
{{adp portlets/weblog-mini-calendar}} -
{{adp portlets/categories {count 1 skin plain-include}}} -
{{adp portlets/tags {skin plain-include}}} -
>><< -

} text/html}] +if {$page eq ""} { + set page [::xowiki::Page create new -volatile -name $weblog_page \ + -title Weblog -parent_id $folder_id -package_id $package_id \ + -text [::xowiki::Page quoted_html_content {>>content<< +{{adp portlets/weblog {name Weblog}}} +>><< +>>sidebar<< +{{adp portlets/weblog-mini-calendar}} +{{adp portlets/tags {skin plain-include}}} +{{adp portlets/tags {skin plain-include popular 1 limit 30}}} +{{adp portlets/categories {count 1 skin plain-include}}} +>><<}]] set item_id [$page save_new] } +$Package url [::xowiki::Page pretty_link -package_id $package_id $weblog_page] +ns_return 200 text/html [$page view] -#if {[ns_queryget page] eq ""} {rp_form_put page $page} -if {[ns_queryget item_id] eq ""} {rp_form_put item_id $item_id} -if {[ns_queryget folder_id] eq ""} {rp_form_put folder_id $folder_id} -rp_internal_redirect "/packages/xowiki/www/view" + Index: openacs-4/packages/xowiki/www/admin/delete-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/delete-type.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/admin/delete-type.tcl 30 Jan 2006 02:04:51 -0000 1.4 +++ openacs-4/packages/xowiki/www/admin/delete-type.tcl 26 Jul 2006 22:56:46 -0000 1.5 @@ -15,8 +15,7 @@ $object_type delete -item_id $item_id } -foreach type [$object_type object_types -subtypes_first true] { - $type drop_object_type -} +# drop type requires that all pages of all xowiki instances are deleted +#foreach type [$object_type object_types -subtypes_first true] {$type drop_object_type} ad_returnredirect $query Index: openacs-4/packages/xowiki/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/index.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/xowiki/www/admin/index.tcl 3 May 2006 12:03:23 -0000 1.9 +++ openacs-4/packages/xowiki/www/admin/index.tcl 26 Jul 2006 22:56:46 -0000 1.10 @@ -8,28 +8,33 @@ object_type:optional } +set package_id [ad_conn package_id] +set Package [::xowiki::Package create ::$package_id] +$Package instvar folder_id + set context [list] set supertype ::xowiki::Page set title "Administer all kind of [$supertype set pretty_plural]" set object_type_key [$supertype set object_type_key] -set folder_id [$supertype require_folder -name xowiki] set object_types [$supertype object_types] - TableWidget t1 -volatile \ -actions [subst { + Action new -label all -url list Action new -label export -url export Action new -label import -url import - Action new -label permissions -url /admin/applications/permissions?package_id=[ad_conn package_id] + Action new -label permissions -url /admin/applications/permissions?package_id=$package_id }] \ -columns { Field object_type -label [_ xowiki.page_type] AnchorField instances -label Instances -html {align center} ImageField_AddIcon edit -label "Add" -html {align center} - ImageField_DeleteIcon delete -label "Delete" -html {align center} + ImageField_DeleteIcon delete -label "Delete All" \ + -html {align center onClick "return(confirm('Delete really all?'));"} } +set base [$Package package_url] db_foreach type_select \ "select object_type from acs_object_types where tree_sortkey between :object_type_key and tree_right(:object_type_key) @@ -38,17 +43,16 @@ -object_type $object_type \ -instances [db_list count [$object_type instance_select_query \ -folder_id $folder_id -count 1 -with_subtypes false]] \ - -instances.href [export_vars -base ../index {object_type}] \ - -edit.href [export_vars -base ../edit {object_type folder_id}] \ + -instances.href [export_vars -base ./list {object_type}] \ + -edit.href [export_vars -base $base {{edit-new 1} object_type}] \ -delete.href [export_vars -base delete-type {object_type}] \ -edit.title [_ xotcl-core.add [list type [$object_type pretty_name]]] \ - -delete.title "Delete Type [$object_type pretty_name]" + -delete.title "Delete all [$object_type pretty_plural] of this instance" } set t1 [t1 asHTML] # set up categories -set package_id [ad_conn package_id] set category_map_url [export_vars -base \ [site_node::get_package_url -package_key categories]cadmin/one-object \ { { object_id $package_id } }] \ No newline at end of file Index: openacs-4/packages/xowiki/www/admin/list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/admin/list.adp 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,24 @@ + + @title;noquote@ + @context;noquote@ + + + + +Site-Wide Categories... +RSS +@t1;noquote@ + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/admin/list.tcl 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,88 @@ +ad_page_contract { + This is the admin page for the package. It displays all entries + provides links to create, edit and delete these + + @author Gustaf Neumann (gustaf.neumann@wu-wien.ac.at) + @creation-date Oct 23, 2005 + @cvs-id $Id: list.tcl,v 1.1 2006/07/26 22:56:46 gustafn Exp $ + + @param object_type show objects of this class and its subclasses +} -query { + object_type:optional + {orderby:optional "last_modified,desc"} +} + +set package_id [ad_conn package_id] +set Package [::xowiki::Package create ::$package_id] +$Package instvar folder_id + +set context [list index] + +# if object_type is specified, only list entries of this type; +# otherwise show types and subtypes of $supertype +if {![info exists object_type]} { + set per_type 0 + set supertype ::xowiki::Page + set object_types [$supertype object_types] + set title "List of all kind of [$supertype set pretty_plural]" + set with_subtypes true + set object_type $supertype +} else { + set per_type 1 + set object_types [list $object_type] + set title "Index of [$object_type set pretty_plural]" + set with_subtypes false +} +#ns_log notice "-- folder_id = $folder_id" + +# set up categories +set category_map_url [export_vars -base \ + [site_node::get_package_url -package_key categories]cadmin/one-object \ + { { object_id $package_id } }] + +set actions "" +foreach type $object_types { + append actions [subst { + Action new \ + -label "[_ xotcl-core.add [list type [$type pretty_name]]]" \ + -url [export_vars -base [$Package package_url] {{edit-new 1} {object_type $type}}] \ + -tooltip "[_ xotcl-core.add_long [list type [$type pretty_name]]]" + }] +} + +TableWidget t1 -volatile \ + -actions $actions \ + -columns { + ImageField_EditIcon edit -label "" + AnchorField name -label [_ xowiki.name] -orderby name + Field object_type -label [_ xowiki.page_type] -orderby object_type + Field last_modified -label "Last Modified" -orderby last_modified + ImageField_DeleteIcon delete -label "" ;#-html {onClick "return(confirm('Confirm delete?'));"} + } + +foreach {att order} [split $orderby ,] break +t1 orderby -order [expr {$order eq "asc" ? "increasing" : "decreasing"}] $att + +set order_clause "order by ci.name" +# -page_size 10 +# -page_number 1 +db_foreach instance_select \ + [$object_type instance_select_query \ + -folder_id $folder_id \ + -with_subtypes $with_subtypes \ + -select_attributes [list "to_char(last_modified,'YYYY-MM-DD HH24:MI:SS') as last_modified"] \ + -order_clause $order_clause \ + ] { + set page_link [::xowiki::Page pretty_link $name] + set return_url [expr {$per_type ? [export_vars -base [$Package url] object_type] : + [$Package url]}] + t1 add \ + -name $name \ + -object_type $object_type \ + -name.href $page_link \ + -last_modified $last_modified \ + -edit.href [export_vars -base $page_link {{m edit}}] \ + -delete.href [export_vars -base $page_link {{m delete} return_url}] + } + +set t1 [t1 asHTML] Index: openacs-4/packages/xowiki/www/portlets/weblog.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/weblog.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xowiki/www/portlets/weblog.tcl 28 Jun 2006 00:32:17 -0000 1.4 +++ openacs-4/packages/xowiki/www/portlets/weblog.tcl 26 Jul 2006 22:56:46 -0000 1.5 @@ -79,7 +79,7 @@ set query \ [list -folder_id $folder_id \ - -select_attributes [list p.publish_date] \ + -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 \ @@ -91,6 +91,7 @@ db_foreach instance_select [eval ::xowiki::Page select_query $query] { set p [::Generic::CrItem instantiate -item_id 0 -revision_id $page_id] + $p set package_id [$including_page set package_id] regexp {^([^.]+)[.][0-9]+(.*)$} $publish_date _ publish_date tz set pretty_date [util::age_pretty -timestamp_ansi $publish_date \ @@ -105,7 +106,7 @@ ns_log notice "--Render Error ($errorMsg) $page_id $name $title" continue } - #ns_log notice "--Render DONE $page_id $name $title" + ns_log notice "--W Render DONE $page_id $name $title" $items add $p } 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.6 -r1.7 --- openacs-4/packages/xowiki/www/portlets/wiki.tcl 19 Jun 2006 00:40:04 -0000 1.6 +++ openacs-4/packages/xowiki/www/portlets/wiki.tcl 26 Jul 2006 22:56:46 -0000 1.7 @@ -7,9 +7,8 @@ # skin: name of adp-file to render content -set folder_id [$__including_page set parent_id] -set item_id [::Generic::CrItem lookup -name $name -parent_id $folder_id] -set page [::Generic::CrItem instantiate -item_id $item_id] +$__including_page instvar package_id +set page [$package_id resolve_request -path $name] $page volatile if {[::xowiki::Page incr recursion_count]<3} { 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/resources/xowiki.css 26 Jul 2006 22:56:46 -0000 1.1 @@ -0,0 +1,97 @@ +#at-a-glance :active {background: #999999;} +#at-a-glance td.inactive {color: #999999;} +#at-a-glance td.active {color: #003b53;} +#at-a-glance td.today {color: #FFFFFF;} + +#wikicmds {position: relative; top: -24px; right: 0px; height: 0px; + text-align: right; font-family: sans-serif; font-size: 85%;color: #7A7A78;} +#portal #wikicmds {top: -90px} +#wikicmds a, #wikicmds a:visited { color: #7A7A78; text-decoration: none;} +#wikicmds a:hover {text-decoration: underline;} +#wikicmds a:active {color: rgb(255,153,51);} +#cmdbar { + background: transparent repeat-x url(/resources/xowiki/aqua.png); + border-bottom: solid 1px rgb(221,221,221); + font-family: sans-serif; font-size: 85%; + padding: 0.25em 0.5em 0.25em 0 .5em; + color: #7A7A78; + margin-bottom: 2px; +} +a.external { + color: #002bb8; + background: url(/resources/xowiki/external.png) right center no-repeat; + padding-right: 12px; +} +h1 { + border-bottom: solid silver 1px; color: #222222; + margin-top: 0.5em; margin-bottom: 0.5em; + text-align: left; font-weight: normal; +} + +h2 { + border-bottom: 1px solid silver; color: #222222; + margin-top: 1em; margin-bottom: 0.25em; + text-align: left; font-weight: normal; +} + +h3 { + text-indent: 0em; margin-top: 0.75em; margin-bottom: 0.0em; + letter-spacing: 0px; color: #222222; + text-align: left; font-weight: bold; +} + +hr { + height: 1px; border: none; + color: silver; background-color: silver; +} +#page-body {background: #fff; font: 10pt Arial, Helvetica, sans-serif;} +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: 68%} +#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 .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; width: 29%; font: 10px 'Lucida Grande', Geneva, Verdana, Arial, sans-serif;} +#sidebar h2 {font-size: 12px; margin: 0;} +#sidebar h3 {font-size: 11px; margin: 0;} +#sidebar h4 {font-size: 10px; margin: 0;} +#sidebar .sidebox li {font-size: 10px; margin: 0;} +img.found {border: 0; height: 12px} +img.undefined {border: 10; color: yellow; height: 12px} + +#left-col {float: left; width: 40%; top: 0px;} +#right-col {float: right; width: 59%; top: 0px;} + +#left-col20 {float: left; width: 14%; top: 0px; margin-right: 10px;} +#left-col25 {float: left; width: 24%; top: 0px; margin-right: 10px;} +#left-col30 {float: left; width: 29%; top: 0px; margin-right: 10px;} +#left-col70 {float: left; width: 69%; top: 0px;} +#left-col75 {float: left; width: 74%; top: 0px;} +#left-col80 {float: left; width: 79%; top: 0px;} + +#right-col20 {float: right; width: 14%; top: 0px; margin-right: 10px;} +#right-col25 {float: right; width: 24%; top: 0px; margin-right: 10px;} +#right-col30 {float: right; width: 29%; top: 0px; margin-right: 10px;} +#right-col70 {float: right; width: 69%; top: 0px;} +#right-col75 {float: right; width: 74%; top: 0px;} +#right-col80 {float: right; width: 79%; top: 0px;} + +#messages .timestamp {font-size: 80%; color: grey} +#messages .user {font-size: 80%; font-weight: bold; color: grey} +#messages .message {vertical-align: top} + +.rss {border:1px solid; + border-color:#FC9 #630 #330 #F96; + padding: 2px; + font: 9px verdana,sans-serif; + color: #FFF; + background: #F60; + text-decoration:none; + margin:0; + margin-right:10px;} +a:hover.rss {color:#dddddd;} +a:visited.rss {color: #FFF} +a:link.rss {color: #FFF}