+ MS 04/06: not used anymore but still potentially interesting to look at +
+ The browser state is saved as a tree, where each node in format + {id list_of_child_nodes } + The ids for top-level nodes are mount point keys. +
+ All other information is cashed in the nsv shared memory, in format + { mount_point pretty_name folder_id children_ids expandable symlink update_time } + children_ids is a list of the ids of this folder's children. +
+ In order to build the tree, the state is traversed in the depth-first order, + and each folder id is mapped to the appropriate folder in the cache, which contains + all the presentation information neccessary to display it on the tree. + +} +# ad_proc -public initFolderTree { user_id } { - Initialize the workspace for the first time, - by building a state consisting only of the top-level mount points - Return the state +# Initialize the workspace for the first time, +# by building a state consisting only of the top-level mount points +# Return the state -} { +# } { - set state [list] - foreach mount_point [buildMountPoints $user_id] { - lappend state [stateNodeCreate [folderAccess mount_point $mount_point] [list]] - } - return $state +# set state [list] +# foreach mount_point [buildMountPoints $user_id] { +# lappend state [stateNodeCreate [folderAccess mount_point $mount_point] [list]] +# } +# return $state -} +# } -ad_proc -public updateTreeStateChildren { - user_id children - mount_point target_mount_point target_id - action level stateRef update_time payload -} { +# ad_proc -public updateTreeStateChildren { +# user_id children +# mount_point target_mount_point target_id +# action level stateRef update_time payload +# } { - Recursively rebuild the tree state based on the requested expand or collapse - action. Rebuild the children of each folder and return them - Payload is any extra data that needs to be passed in +# Recursively rebuild the tree state based on the requested expand or collapse +# action. Rebuild the children of each folder and return them +# Payload is any extra data that needs to be passed in -} { +# } { - set new_children [list] - upvar $stateRef state +# set new_children [list] +# upvar $stateRef state - foreach child $children { +# foreach child $children { - # If we are at the top level, retreive the mount point. - # Otherwise, retreive the folder id and use the passed in mount point - if { $level == 0 } { - set child_id "" - set mount_point [stateNodeAccess id $child] - set new_id $mount_point - } else { - set child_id [stateNodeAccess id $child] - set new_id $child_id - } +# # If we are at the top level, retreive the mount point. +# # Otherwise, retreive the folder id and use the passed in mount point +# if { $level == 0 } { +# set child_id "" +# set mount_point [stateNodeAccess id $child] +# set new_id $mount_point +# } else { +# set child_id [stateNodeAccess id $child] +# set new_id $child_id +# } - set child_children [stateNodeAccess children $child] +# set child_children [stateNodeAccess children $child] - # Set up the flags that determine what we do later on +# # Set up the flags that determine what we do later on - # Do we need to recache the folder ? - set folder_exists 1 - # Do we need to merge in new children ? - set use_new_children 0 - # Do we get the new children from the database ? - set get_db_children 1 +# # Do we need to recache the folder ? +# set folder_exists 1 +# # Do we need to merge in new children ? +# set use_new_children 0 +# # Do we get the new children from the database ? +# set get_db_children 1 - set the_folder [getFolder $user_id $mount_point $child_id state] - set folder_children [folderAccess children $the_folder] +# set the_folder [getFolder $user_id $mount_point $child_id state] +# set folder_children [folderAccess children $the_folder] - # If the folder in the db is newer than the update, retreive it from the db - if { [folderAccess update_time $the_folder] > $update_time } { - set folder_exists 0 - set use_new_children 1 - } +# # If the folder in the db is newer than the update, retreive it from the db +# if { [folderAccess update_time $the_folder] > $update_time } { +# set folder_exists 0 +# set use_new_children 1 +# } - # Perform the action if we found the target - if { [string equal $mount_point $target_mount_point] && - ([string equal $child_id $target_id] || \ - [string equal $target_id _all_]) } { - switch $action { +# # Perform the action if we found the target +# if { [string equal $mount_point $target_mount_point] && +# ([string equal $child_id $target_id] || \ +# [string equal $target_id _all_]) } { +# switch $action { - collapse { - # Collapse: empty the children list - ns_log debug "updateTreeStateChildren: COLLAPSING: [folderPath $user_id $mount_point $target_id]" - set child_children [list] - } +# collapse { +# # Collapse: empty the children list +# ns_log debug "updateTreeStateChildren: COLLAPSING: [folderPath $user_id $mount_point $target_id]" +# set child_children [list] +# } - expand { +# expand { - # Expand: fetch the new children list, unless the node is already expanded - if { [llength $child_children] == 0 } { +# # Expand: fetch the new children list, unless the node is already expanded +# if { [llength $child_children] == 0 } { - # Prevent infinite recursion: clear the target - set target_id "" - set target_mount_point "" +# # Prevent infinite recursion: clear the target +# set target_id "" +# set target_mount_point "" - ns_log debug "updateTreeStateChildren: EXPANDING: [folderPath $user_id $mount_point $target_id]" +# ns_log debug "updateTreeStateChildren: EXPANDING: [folderPath $user_id $mount_point $target_id]" - # If the list is empty, retreive children from the database and recache the folder later - if { [llength [folderAccess children $the_folder]] == 0 } { - set folder_exists 0 - } - } else { - # If the folder is expanded, and we are trying to expand it again, - # reload the folder just to make sure - set folder_exists 0 - } - set use_new_children 1 - } +# # If the list is empty, retreive children from the database and recache the folder later +# if { [llength [folderAccess children $the_folder]] == 0 } { +# set folder_exists 0 +# } +# } else { +# # If the folder is expanded, and we are trying to expand it again, +# # reload the folder just to make sure +# set folder_exists 0 +# } +# set use_new_children 1 +# } - reload { - # Reload the folder if it has changed in the db - ns_log debug "updateTreeStateChildren: RELOADING: [folderPath $user_id $mount_point $target_id]" - set folder_exists 0 - set use_new_children 1 - } +# reload { +# # Reload the folder if it has changed in the db +# ns_log debug "updateTreeStateChildren: RELOADING: [folderPath $user_id $mount_point $target_id]" +# set folder_exists 0 +# set use_new_children 1 +# } - set_children { - # Manually set the children of a folder - ns_log debug "updateTreeStateChildren: SYNCHRONIZING: [folderPath $user_id $mount_point $target_id]" - set folder_children $payload - set folder_exists 0 - set use_new_children 1 - set get_db_children 0 - } - } - } +# set_children { +# # Manually set the children of a folder +# ns_log debug "updateTreeStateChildren: SYNCHRONIZING: [folderPath $user_id $mount_point $target_id]" +# set folder_children $payload +# set folder_exists 0 +# set use_new_children 1 +# set get_db_children 0 +# } +# } +# } - # Cache the new list of children for the folder if it was updated on the server - if { !$folder_exists } { +# # Cache the new list of children for the folder if it was updated on the server +# if { !$folder_exists } { - # Hit the database for the new children - if { $get_db_children } { - set folder_children [folderChildIDs \ - [folderAccess db_children $the_folder $user_id] $user_id] - } +# # Hit the database for the new children +# if { $get_db_children } { +# set folder_children [folderChildIDs \ +# [folderAccess db_children $the_folder $user_id] $user_id] +# } - # Figure out if the folder is expandable now - if { [llength $folder_children] > 0 } { - set expandable "t" - } else { - set expandable "f" - } +# # Figure out if the folder is expandable now +# if { [llength $folder_children] > 0 } { +# set expandable "t" +# } else { +# set expandable "f" +# } - # Update the cache - set the_folder [folderMutate children $the_folder $folder_children] - set the_folder [folderMutate expandable $the_folder $expandable] - cacheOneFolder $user_id $the_folder 1 +# # Update the cache +# set the_folder [folderMutate children $the_folder $folder_children] +# set the_folder [folderMutate expandable $the_folder $expandable] +# cacheOneFolder $user_id $the_folder 1 - # Use the new children if the folder is already expanded - if { [llength $child_children] > 0 } { - set use_new_children 1 - } +# # Use the new children if the folder is already expanded +# if { [llength $child_children] > 0 } { +# set use_new_children 1 +# } - } +# } - # Merge the children in the state with the children in the folder, if - # neccessary. This ensures that, if a folder was already expanded, along - # with its subfloders, their expanded status is preserved - if { $use_new_children } { +# # Merge the children in the state with the children in the folder, if +# # neccessary. This ensures that, if a folder was already expanded, along +# # with its subfloders, their expanded status is preserved +# if { $use_new_children } { - # Stuff all the children into a hashtable for easier searching - foreach old_child $child_children { - set hash([stateNodeAccess id $old_child]) $old_child - } +# # Stuff all the children into a hashtable for easier searching +# foreach old_child $child_children { +# set hash([stateNodeAccess id $old_child]) $old_child +# } - # Merge the new children, preserving the sorted order - set child_children [list] - foreach new_child $folder_children { - set old_child_id [stateNodeAccess id $new_child] - # If the old child exists, use it instead of the new one - if { ![info exists hash($old_child_id)] } { - lappend child_children $new_child - } else { - lappend child_children $hash($old_child_id) - } - } - } +# # Merge the new children, preserving the sorted order +# set child_children [list] +# foreach new_child $folder_children { +# set old_child_id [stateNodeAccess id $new_child] +# # If the old child exists, use it instead of the new one +# if { ![info exists hash($old_child_id)] } { +# lappend child_children $new_child +# } else { +# lappend child_children $hash($old_child_id) +# } +# } +# } - # recursively evaluate the children's children - if { [llength $child_children] > 0 } { - set sub_children [updateTreeStateChildren $user_id $child_children \ - $mount_point $target_mount_point $target_id $action \ - [expr $level + 1] state $update_time $payload] - lappend new_children [stateNodeCreate $new_id $sub_children] - } else { - lappend new_children [stateNodeCreate $new_id [list]] - } - } +# # recursively evaluate the children's children +# if { [llength $child_children] > 0 } { +# set sub_children [updateTreeStateChildren $user_id $child_children \ +# $mount_point $target_mount_point $target_id $action \ +# [expr $level + 1] state $update_time $payload] +# lappend new_children [stateNodeCreate $new_id $sub_children] +# } else { +# lappend new_children [stateNodeCreate $new_id [list]] +# } +# } - return $new_children +# return $new_children -} +# } -ad_proc -public updateTreeState { - user_id state target_mount_point - target_id action update_time {payload ""} -} { +# ad_proc -public updateTreeState { +# user_id state target_mount_point +# target_id action update_time {payload ""} +# } { - Rebuild the tree state based on user's action and return the new state +# Rebuild the tree state based on user's action and return the new state -} { - return [updateTreeStateChildren $user_id $state "" $target_mount_point \ - $target_id $action 0 state $update_time $payload] -} +# } { +# return [updateTreeStateChildren $user_id $state "" $target_mount_point \ +# $target_id $action 0 state $update_time $payload] +# } -ad_proc -public fetchStateFolders { user_id stateRef } { +# ad_proc -public fetchStateFolders { user_id stateRef } { - Get a linear rendition of the folder tree suitable for presentation +# Get a linear rendition of the folder tree suitable for presentation -} { +# } { - # Reference the state - upvar $stateRef state +# # Reference the state +# upvar $stateRef state - set folderList [list] +# set folderList [list] - foreach node $state { +# foreach node $state { - set mount_point [stateNodeAccess id $node] - set mount_children [stateNodeAccess children $node] +# set mount_point [stateNodeAccess id $node] +# set mount_children [stateNodeAccess children $node] - # Fetch the information for the mount point itself - set mount_folder [getFolder $user_id $mount_point "" stateRef] - lappend mount_folder 0 - lappend mount_folder [llength $mount_children] - lappend mount_folder "" - lappend folderList $mount_folder +# # Fetch the information for the mount point itself +# set mount_folder [getFolder $user_id $mount_point "" stateRef] +# lappend mount_folder 0 +# lappend mount_folder [llength $mount_children] +# lappend mount_folder "" +# lappend folderList $mount_folder - # Fetch all the children of the mount point - fetchStateChildFolders $user_id $mount_point $mount_children folderList state 1 "" +# # Fetch all the children of the mount point +# fetchStateChildFolders $user_id $mount_point $mount_children folderList state 1 "" - } +# } - return $folderList -} +# return $folderList +# } -ad_proc -public fetchStateChildFolders { user_id mount_point children folderListRef stateRef level parent_id } { +# ad_proc -public fetchStateChildFolders { user_id mount_point children folderListRef stateRef level parent_id } { - Recursive procedure to fetch a folder's children and add them to the linear - list of folders +# Recursive procedure to fetch a folder's children and add them to the linear +# list of folders -} { +# } { - # access the growing folder list by reference - upvar $folderListRef folderList - upvar $stateRef state +# # access the growing folder list by reference +# upvar $folderListRef folderList +# upvar $stateRef state - # increment the level for the children of each folder - set nextLevel [expr $level + 1] +# # increment the level for the children of each folder +# set nextLevel [expr $level + 1] - foreach node $children { +# foreach node $children { - set node_id [stateNodeAccess id $node] - set node_children [stateNodeAccess children $node] +# set node_id [stateNodeAccess id $node] +# set node_children [stateNodeAccess children $node] - # Fetch the folder - set folder [getFolder $user_id $mount_point $node_id state] +# # Fetch the folder +# set folder [getFolder $user_id $mount_point $node_id state] - # set the folder level for proper indenting - lappend folder $level +# # set the folder level for proper indenting +# lappend folder $level - # set the number of children in this folder - lappend folder [llength $node_children] +# # set the number of children in this folder +# lappend folder [llength $node_children] - # Set the parent id of this folder - lappend folder $parent_id +# # Set the parent id of this folder +# lappend folder $parent_id - # add the folder itself - lappend folderList $folder +# # add the folder itself +# lappend folderList $folder - # add child folders - fetchStateChildFolders $user_id $mount_point $node_children folderList state $nextLevel $node_id - } -} +# # add child folders +# fetchStateChildFolders $user_id $mount_point $node_children folderList state $nextLevel $node_id +# } +# } -ad_proc -public folderPath { user_id mount_point folder_id } { +# ad_proc -public folderPath { user_id mount_point folder_id } { - Retreive a "path" to the particular folder - in fact, this is a unique hash - key used to reference the folder in the AOLServer cache +# Retreive a "path" to the particular folder - in fact, this is a unique hash +# key used to reference the folder in the AOLServer cache -} { - return "${user_id}.${mount_point}.$folder_id" -} +# } { +# return "${user_id}.${mount_point}.$folder_id" +# } -ad_proc -public folderChildrenDB { mount_point folder_id } { +# ad_proc -public folderChildrenDB { mount_point folder_id } { - Hit the database to retreive the list of children for the folder - Recache the child folders if specified +# Hit the database to retreive the list of children for the folder +# Recache the child folders if specified -} { - ns_log debug "folderChildrenDB: DATABASE HIT: $mount_point.$folder_id" - return [cm::modules::${mount_point}::getChildFolders $folder_id] -} +# } { +# ns_log debug "folderChildrenDB: DATABASE HIT: $mount_point.$folder_id" +# return [cm::modules::${mount_point}::getChildFolders $folder_id] +# } -ad_proc -public folderCreate { - mount_point name id child_ids - expandable {symlink f} {update_time 0}} { +# ad_proc -public folderCreate { +# mount_point name id child_ids +# expandable {symlink f} {update_time 0}} { - A constructtor procedure to implement the folder abstraction +# A constructtor procedure to implement the folder abstraction - } { - return [list $mount_point $name $id $child_ids $expandable $symlink $update_time] -} +# } { +# return [list $mount_point $name $id $child_ids $expandable $symlink $update_time] +# } -ad_proc -public folderAccess { op folder {user_id {}} } { +# ad_proc -public folderAccess { op folder {user_id {}} } { - An accessor procedure to implement the folder abstraction +# An accessor procedure to implement the folder abstraction -} { +# } { - switch $op { - mount_point { return [lindex $folder 0] } - name { return [lindex $folder 1] } - id { return [lindex $folder 2] } - children { return [lindex $folder 3] } - expandable { return [lindex $folder 4] } - symlink { return [lindex $folder 5] } - update_time { return [lindex $folder 6] } - level { return [lindex $folder 7] } - child_count { return [lindex $folder 8] } - parent_id { return [lindex $folder 9] } - path { - return [folderPath $user_id [lindex $folder 0] [lindex $folder 2]] - } - db_children { return [folderChildrenDB [lindex $folder 0] [lindex $folder 2]] } - default { - error "Unknown folder attribute \"$op\" in folderAccess" - } - } -} +# switch $op { +# mount_point { return [lindex $folder 0] } +# name { return [lindex $folder 1] } +# id { return [lindex $folder 2] } +# children { return [lindex $folder 3] } +# expandable { return [lindex $folder 4] } +# symlink { return [lindex $folder 5] } +# update_time { return [lindex $folder 6] } +# level { return [lindex $folder 7] } +# child_count { return [lindex $folder 8] } +# parent_id { return [lindex $folder 9] } +# path { +# return [folderPath $user_id [lindex $folder 0] [lindex $folder 2]] +# } +# db_children { return [folderChildrenDB [lindex $folder 0] [lindex $folder 2]] } +# default { +# error "Unknown folder attribute \"$op\" in folderAccess" +# } +# } +# } -ad_proc -public folderMutate { op folder new_value } { +# ad_proc -public folderMutate { op folder new_value } { - A "mutator" procedure for folders; actually, just returns the new folder +# A "mutator" procedure for folders; actually, just returns the new folder -} { +# } { - switch $op { - mount_point { return [lreplace $folder 0 0 $new_value] } - name { return [lreplace $folder 1 1 $new_value] } - id { return [lreplace $folder 2 2 $new_value] } - children { return [lreplace $folder 3 3 $new_value] } - expandable { return [lreplace $folder 4 4 $new_value] } - symlink { return [lreplace $folder 5 5 $new_value] } - update_time { return [lreplace $folder 6 6 $new_value] } - default { - error "Unknown folder attribute \"$op\" in folderMutate" - } - } -} +# switch $op { +# mount_point { return [lreplace $folder 0 0 $new_value] } +# name { return [lreplace $folder 1 1 $new_value] } +# id { return [lreplace $folder 2 2 $new_value] } +# children { return [lreplace $folder 3 3 $new_value] } +# expandable { return [lreplace $folder 4 4 $new_value] } +# symlink { return [lreplace $folder 5 5 $new_value] } +# update_time { return [lreplace $folder 6 6 $new_value] } +# default { +# error "Unknown folder attribute \"$op\" in folderMutate" +# } +# } +# } -ad_proc -public folderChildIDs { subfolder_list { user_id {}}} { +# ad_proc -public folderChildIDs { subfolder_list { user_id {}}} { - Convert a list of folders into a list of folder IDs, caching - the folders in the process +# Convert a list of folders into a list of folder IDs, caching +# the folders in the process -} { - set child_ids [list] - foreach subfolder $subfolder_list { - if { ![template::util::is_nil user_id] } { - cacheOneFolder $user_id $subfolder 1 - } - lappend child_ids [stateNodeCreate [folderAccess id $subfolder] [list]] - } +# } { +# set child_ids [list] +# foreach subfolder $subfolder_list { +# if { ![template::util::is_nil user_id] } { +# cacheOneFolder $user_id $subfolder 1 +# } +# lappend child_ids [stateNodeCreate [folderAccess id $subfolder] [list]] +# } - return $child_ids -} +# return $child_ids +# } -ad_proc -public stateNodeCreate { id children {selected ""}} { +# ad_proc -public stateNodeCreate { id children {selected ""}} { - A constructor procedure to implement the state node abstraction +# A constructor procedure to implement the state node abstraction -} { +# } { - set ret [list $id $children] +# set ret [list $id $children] - # Only append the "selected" field if neccessary - if { [string equal $selected "t"] } { - lappend ret "t" - } +# # Only append the "selected" field if neccessary +# if { [string equal $selected "t"] } { +# lappend ret "t" +# } - return $ret -} +# return $ret +# } -ad_proc -public stateNodeAccess { op node } { +# ad_proc -public stateNodeAccess { op node } { - An accessor procedure to implement the state node abstraction +# An accessor procedure to implement the state node abstraction -} { - switch $op { - id { return [lindex $node 0] } - children { return [lindex $node 1] } - selected { return [lindex $node 2] } - } -} +# } { +# switch $op { +# id { return [lindex $node 0] } +# children { return [lindex $node 1] } +# selected { return [lindex $node 2] } +# } +# } -ad_proc -public getFolder { user_id mount_point folder_id stateRef } { +# ad_proc -public getFolder { user_id mount_point folder_id stateRef } { - Retreive folder information for a particular id. If that id does not exist - in the cache, cache it. if id is the empty string, retreives the top-level - mount point +# Retreive folder information for a particular id. If that id does not exist +# in the cache, cache it. if id is the empty string, retreives the top-level +# mount point -} { +# } { - set folder_path [folderPath $user_id $mount_point $folder_id] +# set folder_path [folderPath $user_id $mount_point $folder_id] - if { ![folderIsCached $user_id $mount_point $folder_id] } { - ns_log debug "getFolder: CACHE MISS: $folder_path" +# if { ![folderIsCached $user_id $mount_point $folder_id] } { +# ns_log debug "getFolder: CACHE MISS: $folder_path" - # Traverse the state to determine the path to the current folder, caching all the folders - # on the path - upvar $stateRef state - cacheStateFolders $user_id $mount_point $folder_id state +# # Traverse the state to determine the path to the current folder, caching all the folders +# # on the path +# upvar $stateRef state +# cacheStateFolders $user_id $mount_point $folder_id state - # Most of the time, the above code will cache the correct folders. However, very rarely, - # the correct parent folder will not exist in the state. For example, this will happen - # if the server is restarted after a folder deep in the hierarchy was put on the clipboard. - # Now, we have no choice but to go through all the folders along with their children. - # This might do redundant work, but it should be able to cache the correct folder. +# # Most of the time, the above code will cache the correct folders. However, very rarely, +# # the correct parent folder will not exist in the state. For example, this will happen +# # if the server is restarted after a folder deep in the hierarchy was put on the clipboard. +# # Now, we have no choice but to go through all the folders along with their children. +# # This might do redundant work, but it should be able to cache the correct folder. - # Cache the mount point itself, along with it peers - buildMountPoints $user_id +# # Cache the mount point itself, along with it peers +# buildMountPoints $user_id - if { ![folderIsCached $user_id $mount_point $folder_id] } { - cacheMountPointFolders $user_id $mount_point $folder_id - } +# if { ![folderIsCached $user_id $mount_point $folder_id] } { +# cacheMountPointFolders $user_id $mount_point $folder_id +# } - # Now, if THAT failed, then the folder was probably deleted... Give up - if { ![folderIsCached $user_id $mount_point $folder_id] } { - ns_log debug "getFolder: CACHE FAILED for: [folderPath $user_id $mount_point $folder_id]" - return [list] - } - } +# # Now, if THAT failed, then the folder was probably deleted... Give up +# if { ![folderIsCached $user_id $mount_point $folder_id] } { +# ns_log debug "getFolder: CACHE FAILED for: [folderPath $user_id $mount_point $folder_id]" +# return [list] +# } +# } - return [nsv_get browser_state $folder_path] -} +# return [nsv_get browser_state $folder_path] +# } -ad_proc -public buildMountPoints { user_id } { +# ad_proc -public buildMountPoints { user_id } { - Build a list of all the top-level mount points, caching them in the process +# Build a list of all the top-level mount points, caching them in the process -} { +# } { - set mount_point_list [cm::modules::getMountPoints] +# set mount_point_list [cm::modules::getMountPoints] - # Cache the mount points - foreach mount_folder $mount_point_list { - if { ![folderIsCached $user_id [folderAccess mount_point $mount_folder] ""] } { - set child_ids [folderChildIDs \ - [folderAccess db_children $mount_folder] \ - $user_id ] - cacheOneFolder $user_id [folderMutate children $mount_folder $child_ids] - } - } +# # Cache the mount points +# foreach mount_folder $mount_point_list { +# if { ![folderIsCached $user_id [folderAccess mount_point $mount_folder] ""] } { +# set child_ids [folderChildIDs \ +# [folderAccess db_children $mount_folder] \ +# $user_id ] +# cacheOneFolder $user_id [folderMutate children $mount_folder $child_ids] +# } +# } - return $mount_point_list -} +# return $mount_point_list +# } -ad_proc -public cacheOneFolder { user_id folder { override 0 }} { +# ad_proc -public cacheOneFolder { user_id folder { override 0 }} { - Cache an individual folder +# Cache an individual folder -} { - set path [folderAccess path $folder $user_id] - if { $override || ![nsv_exists browser_state $path] } { - ns_log debug "cacheOneFolder: CACHING: $path $folder , override = $override" - nsv_set browser_state $path $folder - } -} +# } { +# set path [folderAccess path $folder $user_id] +# if { $override || ![nsv_exists browser_state $path] } { +# ns_log debug "cacheOneFolder: CACHING: $path $folder , override = $override" +# nsv_set browser_state $path $folder +# } +# } -ad_proc -public refreshCachedFolder { user_id mount_point folder_id } { +# ad_proc -public refreshCachedFolder { user_id mount_point folder_id } { - Change the cached update time in a folder - If thr folder is not cached, do nothing +# Change the cached update time in a folder +# If thr folder is not cached, do nothing -} { +# } { - if { [folderIsCached $user_id $mount_point $folder_id] } { - cacheOneFolder $user_id [folderMutate update_time \ - [getFolder $user_id $mount_point $folder_id ""] \ - [clock seconds]] 1 - } -} +# if { [folderIsCached $user_id $mount_point $folder_id] } { +# cacheOneFolder $user_id [folderMutate update_time \ +# [getFolder $user_id $mount_point $folder_id ""] \ +# [clock seconds]] 1 +# } +# } -ad_proc -public folderIsCached { user_id mount_point folder_id } { +# ad_proc -public folderIsCached { user_id mount_point folder_id } { - Return 1 if the folder is in the cache, 0 otherwise +# Return 1 if the folder is in the cache, 0 otherwise -} { - return [nsv_exists browser_state [folderPath $user_id $mount_point $folder_id]] -} +# } { +# return [nsv_exists browser_state [folderPath $user_id $mount_point $folder_id]] +# } -ad_proc -public uncacheFolder { user_id mount_point folder_id } { +# ad_proc -public uncacheFolder { user_id mount_point folder_id } { - Uncache a folder so that it will be reloaded from the db +# Uncache a folder so that it will be reloaded from the db -} { - set path [folderPath $user_id $mount_point $folder_id] - # Catch in case the cached state does not exist (which could happen if - # the server was restarted) - catch " nsv_unset browser_state $path " dummy -} +# } { +# set path [folderPath $user_id $mount_point $folder_id] +# # Catch in case the cached state does not exist (which could happen if +# # the server was restarted) +# catch " nsv_unset browser_state $path " dummy +# } -ad_proc -public getStateFolderPath { user_id folder_id children target_folder_id } { +# ad_proc -public getStateFolderPath { user_id folder_id children target_folder_id } { - Recursively traverse the path to some folder in a particular mount - point, which is in the form - mount_point_id parent_id_1 parent_id_2 ... folder_id - Return the new path if the folder was found, an empty string otherwise +# Recursively traverse the path to some folder in a particular mount +# point, which is in the form +# mount_point_id parent_id_1 parent_id_2 ... folder_id +# Return the new path if the folder was found, an empty string otherwise -} { +# } { - # if the folder is found, return it as the last element of the path - if { [string equal $folder_id $target_folder_id] } { - return [list $folder_id] - } +# # if the folder is found, return it as the last element of the path +# if { [string equal $folder_id $target_folder_id] } { +# return [list $folder_id] +# } - foreach child $children { - set child_id [stateNodeAccess id $child] - set child_children [stateNodeAccess children $child] - set new_path [getStateFolderPath $user_id $child_id $child_children $target_folder_id] - if { ![template::util::is_nil new_path] } { - return [concat [list $folder_id] $new_path] - } - } +# foreach child $children { +# set child_id [stateNodeAccess id $child] +# set child_children [stateNodeAccess children $child] +# set new_path [getStateFolderPath $user_id $child_id $child_children $target_folder_id] +# if { ![template::util::is_nil new_path] } { +# return [concat [list $folder_id] $new_path] +# } +# } - return "" -} +# return "" +# } -ad_proc -public cacheStateFolders { user_id target_mount_point target_folder_id stateRef } { +# ad_proc -public cacheStateFolders { user_id target_mount_point target_folder_id stateRef } { - Traverse the state tree to discover the path to a particular folder. Then, - cache all the folders on the path +# Traverse the state tree to discover the path to a particular folder. Then, +# cache all the folders on the path -} { +# } { - upvar $stateRef state +# upvar $stateRef state - # Find the mount point - foreach mount_point $state { +# # Find the mount point +# foreach mount_point $state { - if { [string equal [stateNodeAccess id $mount_point] $target_mount_point] } { - # cache the folders along the path - set mount_point_children [stateNodeAccess children $mount_point] +# if { [string equal [stateNodeAccess id $mount_point] $target_mount_point] } { +# # cache the folders along the path +# set mount_point_children [stateNodeAccess children $mount_point] - foreach id \ - [getStateFolderPath $user_id "" \ - $mount_point_children $target_folder_id] { - # Cache child folders of the current folder - set mount_point_id [stateNodeAccess id $mount_point] - foreach child_folder [folderChildrenDB $mount_point_id $id] { - # Retreive the children of this folder from the db in case another - # user has added some chilren - set new_children [folderChildIDs [folderChildrenDB $mount_point_id \ - [folderAccess id $child_folder]]] +# foreach id \ +# [getStateFolderPath $user_id "" \ +# $mount_point_children $target_folder_id] { +# # Cache child folders of the current folder +# set mount_point_id [stateNodeAccess id $mount_point] +# foreach child_folder [folderChildrenDB $mount_point_id $id] { +# # Retreive the children of this folder from the db in case another +# # user has added some chilren +# set new_children [folderChildIDs [folderChildrenDB $mount_point_id \ +# [folderAccess id $child_folder]]] - cacheOneFolder $user_id \ - [folderMutate children $child_folder $new_children] - } +# cacheOneFolder $user_id \ +# [folderMutate children $child_folder $new_children] +# } - } - } - } -} +# } +# } +# } +# } -ad_proc -public cacheMountPointFolders { user_id mount_point target_folder_id } { +# ad_proc -public cacheMountPointFolders { user_id mount_point target_folder_id } { - Go through ALL children of the mount point and cache them, one by one, - until the target folder is found. This will do a lot of redundant work, - so be careful. This procedure will execute breadth-first search, in hope of - finding the target folder quicker. +# Go through ALL children of the mount point and cache them, one by one, +# until the target folder is found. This will do a lot of redundant work, +# so be careful. This procedure will execute breadth-first search, in hope of +# finding the target folder quicker. -} { +# } { - ns_log debug "cacheMountPointFolders: CRITICAL MISS: [folderPath $user_id $mount_point $target_folder_id]" +# ns_log debug "cacheMountPointFolders: CRITICAL MISS: [folderPath $user_id $mount_point $target_folder_id]" - set queue [folderChildrenDB $mount_point ""] +# set queue [folderChildrenDB $mount_point ""] - while { [llength $queue] > 0 } { +# while { [llength $queue] > 0 } { - # Pop the front folder - set cur_folder [lindex $queue 0] - set queue [lrange $queue 1 end] +# # Pop the front folder +# set cur_folder [lindex $queue 0] +# set queue [lrange $queue 1 end] - # Process it - set cur_id [folderAccess id $cur_folder] - set child_folders [folderChildrenDB $mount_point $cur_id] - set new_children [folderChildIDs $child_folders] - cacheOneFolder $user_id [folderMutate children $cur_folder $new_children] +# # Process it +# set cur_id [folderAccess id $cur_folder] +# set child_folders [folderChildrenDB $mount_point $cur_id] +# set new_children [folderChildIDs $child_folders] +# cacheOneFolder $user_id [folderMutate children $cur_folder $new_children] - # End the process if the target folder is found - if { [string equal $cur_id $target_folder_id] } { - return - } +# # End the process if the target folder is found +# if { [string equal $cur_id $target_folder_id] } { +# return +# } - # Append its children to the queue - set queue [concat $queue $child_folders] - } +# # Append its children to the queue +# set queue [concat $queue $child_folders] +# } -} +# } Index: openacs-4/packages/cms/tcl/clipboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/clipboard-procs.tcl,v diff -u -N -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/cms/tcl/clipboard-procs.tcl 31 May 2005 05:04:14 -0000 1.5.2.1 +++ openacs-4/packages/cms/tcl/clipboard-procs.tcl 31 Aug 2006 19:59:04 -0000 1.5.2.2 @@ -1,29 +1,26 @@ -########################## -# -# Procedures to manipulate the clipboard -# -################ +ad_library { -namespace eval clipboard { - # See clipboard-ui-procs.tcl - namespace eval ui {} + Procedures to manipulate the clipboard data structure and cookies + } + +namespace eval cms::clipboard {} -ad_proc -public clipboard::parse_cookie {} { +ad_proc -public cms::clipboard::parse_cookie {} { Get the clipboard from a cookie and return it } { set clipboard_cookie [template::util::get_cookie content_marks] - ns_log debug "clipboard::parse_cookie: cookie $clipboard_cookie" + ns_log debug "cms::clipboard::parse_cookie: cookie $clipboard_cookie" set clip [ns_set create] set mount_branches [split $clipboard_cookie "|"] set mount_points [list] set total_items 0 foreach branch $mount_branches { if { [regexp {([a-zA-Z0-9]+):(.*)} $branch match mount_point items] } { - ns_log debug "clipboard::parse_cookie: branch: $branch" + ns_log debug "cms::clipboard::parse_cookie: branch: $branch, mount_point: $mount_point, items: $items" set items_list [split $items ","] set items_size [llength $items_list] incr total_items $items_size @@ -39,23 +36,42 @@ return $clip } -ad_proc -public clipboard::get_items { clip mount_point } { +ad_proc -public cms::clipboard::reassemble_cookie { clip } { + Reassemble the cookie from clip + + @return A string suitable for use with ad_set_cookie + +} { + + set cookie "" + set mount_point_names [ns_set get $clip __mount_points__] + set pipe "" + foreach mount_point $mount_point_names { + append cookie "$pipe${mount_point}:[join [ns_set get $clip $mount_point] ,]" + set pipe "|" + } + + return $cookie +} + +ad_proc -public cms::clipboard::get_items { clip mount_point } { + Retreive all marked items as a list } { return [ns_set get $clip $mount_point] } -ad_proc -public clipboard::get_total_items { clip } { +ad_proc -public cms::clipboard::get_total_items { clip } { Get the number of total items on the clipboard } { return [ns_set get $clip __total_items__] } -ad_proc -public clipboard::map_code { clip mount_point code } { +ad_proc -public cms::clipboard::map_code { clip mount_point code } { Execute a piece of code for each item under the specified mount point, creating an item_id @@ -68,7 +84,7 @@ } } -ad_proc -public clipboard::is_marked { clip mount_point item_id } { +ad_proc -public cms::clipboard::is_marked { clip mount_point item_id } { Determine if an item is marked @@ -82,15 +98,15 @@ } } -ad_proc -public clipboard::get_bookmark_icon { clip mount_point item_id {row_ref row} } { +ad_proc -public cms::clipboard::get_bookmark_icon { clip mount_point item_id {row_ref row} } { Use this function as part of the multirow query to set up the bookmark icon } { upvar $row_ref row - if { [clipboard::is_marked $clip $mount_point $item_id] } { + if { [cms::clipboard::is_marked $clip $mount_point $item_id] } { set row(bookmark) Bookmarked } else { set row(bookmark) Bookmarks @@ -99,9 +115,10 @@ return $row(bookmark) } -ad_proc -public clipboard::add_item { clip mount_point item_id } { +ad_proc -public cms::clipboard::add_item { clip mount_point item_id } { - Add an item to the clipboard: BROKEN + Add an item to the clipboard + @return Updated clip } { set old_items [ns_set get $clip $mount_point] @@ -122,71 +139,46 @@ ns_set update $clip __mount_points__ $old_mount_points } } + + return $clip } -ad_proc -public clipboard::remove_item { clip mount_point item_id } { +ad_proc -public cms::clipboard::remove_item { clip mount_point item } { - Remove an item from the clipboard: BROKEN + Remove an item from the clipboard + @return Updated clip } { - set old_items [ns_set get $clip $mount_point] - set index [lsearch $old_items $item_id] + set items [ns_set get $clip $mount_point] + set index [lsearch $items $item] if { $index != -1 } { - # Remove the item - set old_items [lreplace $old_items $index $index ""] - ns_set update $clip $mount_point $old_items - ns_set update $clip ${mount_point}_size \ - [expr [ns_set get $clip ${mount_point}_size] - 1] - ns_set update $clip __total_items__ \ - [expr [ns_set get $clip __total_items__] - 1] + ns_log debug "cms::clipboard::remove_item: removing $item from $mount_point" + set items [lreplace $items $index $index] + if { [llength $items] > 0 } { + ns_set update $clip $mount_point $items + ns_set update $clip ${mount_point}_size \ + [expr [ns_set get $clip ${mount_point}_size] - 1] + ns_set update $clip __total_items__ \ + [expr [ns_set get $clip __total_items__] - 1] + } else { + set mount_points [ns_set get $clip __mount_points__] + set mp_index [lsearch $mount_points $mount_point] + set mount_points [lreplace $mount_points $mp_index $mp_index] + ns_set update $clip __mount_points__ $mount_points + ns_set delkey $clip ${mount_point}_size + ns_set update $clip __total_items__ \ + [expr [ns_set get $clip __total_items__] - 1] + } } -} -ad_proc -public clipboard::set_cookie { clip } { - - Actually set the new cookie: BROKEN - -} { - set the_cookie "" - set mount_point_names [ns_set get $clip __mount_points__] - set pipe "" - foreach mount_point $mount_point_names { - append the_cookie "$pipe${mount_point}:[join [ns_set get $clip $mount_point] ,]" - set pipe "|" - } - - template::util::set_cookie session content_marks $the_cookie + return $clip } -ad_proc -public clipboard::clear_cookie {} { +ad_proc -public cms::clipboard::free { clip } { - Clear the clipboard: BROKEN - -} { - template::util::clear_cookie content_marks -} - -ad_proc -public clipboard::free { clip } { - Release the resources associated with the clipboard } { ns_set free $clip } - -ad_proc -public clipboard::floats_p {} { - - determines whether clipboard should float or not - currently incomplete, should be checking user prefs - -} { - return [ad_parameter ClipboardFloatsP] - -} - - - - - - Index: openacs-4/packages/cms/tcl/clipboard-ui-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/clipboard-ui-procs.tcl,v diff -u -N -r1.3.8.1 -r1.3.8.2 --- openacs-4/packages/cms/tcl/clipboard-ui-procs.tcl 31 May 2005 05:04:14 -0000 1.3.8.1 +++ openacs-4/packages/cms/tcl/clipboard-ui-procs.tcl 31 Aug 2006 19:59:04 -0000 1.3.8.2 @@ -1,9 +1,13 @@ -######################################### -# Procedures to manipulate clipped items -######################################### +ad_library { -ad_proc -public clipboard::ui::form_create { form_name args } { + Procedures to manipulate clipboard UI +} + +namespace eval cms::clipboard::ui {} + +ad_proc -public cms::clipboard::ui::form_create { form_name args } { + Create a form for representing clipped items, also start a multirow datasource for the items The columns created for the multirow datasource by default are @@ -39,7 +43,7 @@ set form_properties(row_elements) $elements } -ad_proc -public clipboard::ui::add_row { form_name mount_point item_id title args} { +ad_proc -public cms::clipboard::ui::add_row { form_name mount_point item_id title args} { Append a row to the multirow datasource If the -checked switch is specified, checks the box by default @@ -84,28 +88,28 @@ uplevel " upvar 0 \"${form_name}_data:$rowcount\" row - clipboard::ui::element_create $form_name $element_code + cms::clipboard::ui::element_create $form_name $element_code " set row(checked) [template::util::nvl $row(checked) 0] # Create the title inform widget set element_code [list title -datatype text -widget inform -label Title \ -value $title] - uplevel "clipboard::ui::element_create $form_name $element_code" + uplevel "cms::clipboard::ui::element_create $form_name $element_code" # Create the mount point, item_id hidden vars, remember their values # in the datasource. other hidden vars ? foreach varname {mount_point item_id} { set element_code [list $varname -datatype keyword -widget hidden \ -label $varname -value [set $varname]] set row($varname) [set $varname] - uplevel "clipboard::ui::element_create $form_name $element_code" + uplevel "cms::clipboard::ui::element_create $form_name $element_code" } } -ad_proc -public clipboard::ui::element_create { form_name element_name args } { +ad_proc -public cms::clipboard::ui::element_create { form_name element_name args } { A wrapper for element create which maintains the naming convention for the element. Appends the element to the multirow datasource @@ -141,7 +145,7 @@ } -ad_proc -public clipboard::ui::process_row { form_name row_index row_dml } { +ad_proc -public cms::clipboard::ui::process_row { form_name row_index row_dml } { Process a row of the table, executing whatever TCL code the user has passed in. @@ -170,7 +174,7 @@ uplevel $code } -ad_proc -public clipboard::ui::generate_form { form_name clip mount_point } { +ad_proc -public cms::clipboard::ui::generate_form { form_name clip mount_point } { Assemble the entire datasource based on all items under some mount point @@ -184,23 +188,23 @@ " uplevel { - set items [clipboard::get_items $__clip $__mount_point] + set items [cms::clipboard::get_items $__clip $__mount_point] cm::modules::${__mount_point}::getSortedPaths clip_rows $items for { set i 1 } { $i <= [template::multirow size clip_rows] } { incr i } { # Start the row template::multirow get clip_rows $i - clipboard::ui::add_row $__form_name $__mount_point \ + cms::clipboard::ui::add_row $__form_name $__mount_point \ $clip_rows(item_id) $clip_rows(item_path) # Append all elements upvar 0 ${__form_name}:$i row foreach element $form_properties(row_elements) { - eval clipboard::ui::element_create $__form_name $element + eval cms::clipboard::ui::element_create $__form_name $element } } } } -ad_proc -public clipboard::ui::generate_form_header { form_name {row_index 1}} { +ad_proc -public cms::clipboard::ui::generate_form_header { form_name {row_index 1}} { Generate the extra
-# Specifically, the content, child and -# relation tags are defined here. -# -# @see namespace item item.html +ad_library { -namespace eval publish { + The procs in this namespace are useful for publishing items, + including items inside other items, and writing items to the + filesystem.
+ Specifically, the content, child and
+ relation tags are defined here.
+ @namespace publish
+ @author Stanislav Freidin
+ @see namespace item item.html
+
+}
+
+namespace eval cms::publish {
variable item_id_stack
variable revision_html
}
@@ -93,32 +92,32 @@
-ad_proc -public publish::get_template_root {} {
+# ad_proc -public publish::get_template_root {} {
- @public get_template_root
+# @public get_template_root
- Get the template root. All templates are assumed to exist
- in the filesystem with their URLs relative to this root.
- The page root is controlled by the TemplateRoot parameter in CMS.
- The default is /web/yourserver/templates
+# Get the template root. All templates are assumed to exist
+# in the filesystem with their URLs relative to this root.
+# The page root is controlled by the TemplateRoot parameter in CMS.
+# The default is /web/yourserver/templates
- @return The template root
+# @return The template root
- @see content::get_template_root
- @see publish::get_page_root
+# @see content::get_template_root
+# @see publish::get_page_root
-} {
- return [content::get_template_root]
-}
+# } {
+# return [content::get_template_root]
+# }
-ad_proc -public content::get_template_path {} {
+# ad_proc -public content::get_template_path {} {
- Legacy compatibility
+# Legacy compatibility
-} {
- return [publish::get_template_root]
-}
+# } {
+# return [publish::get_template_root]
+# }
# ad_proc -public publish::mkdirs { path } {
@@ -141,27 +140,33 @@
-ad_proc -private publish::delete_multiple_files { url {root_path ""}} {
+ad_proc -private cms::publish::delete_multiple_files {
+ url
+ {root_path ""}
+} {
@private delete_multiple_files
Delete the specified URL from the filesystem, for all revisions
@param url Relative URL of the file to write
- @see publish::get_publish_roots
- @see publish::write_multiple_files
- @see publish::write_multiple_blobs
+ @see cms::publish::get_publish_roots
+ @see cms::publish::write_multiple_files
+ @see cms::publish::write_multiple_blobs
} {
foreach_publish_path $url {
ns_unlink -nocomplain $filename
- ns_log debug "publish::delete_multiple_files: Delete file $filename"
+ ns_log debug "cms::cms::publish::delete_multiple_files: Delete file $filename"
} $root_path
}
-ad_proc -public publish::publish_revision { revision_id args} {
+ad_proc -public cms::publish::publish_revision {
+ revision_id
+ args
+} {
@public publish_revision
@@ -175,8 +180,8 @@
Write the content to this path only.
@see item::get_extended_url
- @see publish::get_publish_roots
- @see publish::handle_item
+ @see cms::publish::get_publish_roots
+ @see cms::publish::handle_item
} {
@@ -187,9 +192,9 @@
} else {
set root_path $opts(root_path)
}
- ns_log debug "publish::publish_revision: root_path = $root_path"
+ ns_log debug "cms::publish::publish_revision: root_path = $root_path"
# Get tem id
- set item_id [item::get_item_from_revision $revision_id]
+ set item_id [cms::item::get_id_from_revision $revision_id]
# Render the item
set item_content [handle_item $item_id -revision_id $revision_id -embed]
@@ -203,7 +208,7 @@
}
-ad_proc -public publish::unpublish_item { item_id args } {
+ad_proc -public cms::publish::unpublish_item { item_id args } {
@public unpublish_item
@@ -217,7 +222,7 @@
@option root_path {default All paths in the PublishPaths parameter}
Write the content to this path only.
- @see publish::publish_revision
+ @see cms::publish::publish_revision
} {
@@ -231,7 +236,7 @@
# Get revision id
if { [template::util::is_nil opts(revision_id)] } {
- set revision_id [item::get_live_revision $item_id]
+ set revision_id [content::item::get_live_revision -item_id $item_id]
} else {
set revision_id $opts(revision_id)
}
@@ -277,7 +282,7 @@
# Scheduled proc stuff
-ad_proc -public publish::set_publish_status { item_id new_status {revision_id ""} } {
+ad_proc -public cms::publish::set_publish_status { item_id new_status {revision_id ""} } {
@public set_publish_status
@@ -292,17 +297,17 @@
@param revision_id {default The live revision}
The revision id to be used when publishing the item to the filesystem.
- @see publish::publish_revision
- @see publish::unpublish_item
+ @see cms::publish::publish_revision
+ @see cms::publish::unpublish_item
} {
- ns_log debug "publish::set_publish_status: Setting publish status for item_id $item_id to $new_status"
+ ns_log debug "cms::publish::set_publish_status: Setting publish status for item_id $item_id to $new_status"
switch $new_status {
production - expired {
# Delete the published files
- publish::unpublish_item $item_id
+ cms::publish::unpublish_item $item_id
}
ready {
@@ -318,7 +323,7 @@
set new_status [list [list publish_status production]]
content::item::update -item_id $item_id -attributes $new_status
# Delete the published files
- #publish::unpublish_item $item_id
+ #cms::publish::unpublish_item $item_id
} else {
set new_status [list [list publish_status ready]]
content::item::update -item_id $item_id -attributes $new_status
@@ -339,13 +344,13 @@
set new_status [list [list publish_status live]]
ns_log notice "MS: got a revision, setting status to $new_status"
content::item::update -item_id $item_id -attributes $new_status
- #publish_revision $revision_id -root_path [publish::get_publish_roots]
+ #publish_revision $revision_id -root_path [cms::publish::get_publish_roots]
} else {
# Delete the published files
set new_status [list [list publish_status production]]
ns_log notice "MS: no revision, setting status to $new_status"
content::item::update -item_id $item_id -attributes $new_status
- #publish::unpublish_item $item_id
+ #cms::publish::unpublish_item $item_id
#set new_status "production"
}
}
@@ -357,17 +362,17 @@
}
-ad_proc -private publish::track_publish_status {} {
+ad_proc -private cms::publish::track_publish_status {} {
@private track_publish_status
Scheduled proc which keeps the publish status updated
- @see publish::schedule_status_sweep
+ @see cms::publish::schedule_status_sweep
} {
- ns_log debug "publish::track_publish_status: Tracking publish status"
+ ns_log debug "cms::publish::track_publish_status: Tracking publish status"
db_transaction {
# if { [catch {
@@ -380,26 +385,27 @@
foreach pair $items {
set item_id [lindex $pair 0]
set live_revision [lindex $pair 1]
- publish::set_publish_status $item_id live $live_revision
+ cms::publish::set_publish_status $item_id live $live_revision
}
# Get all live but expired items, make them nonlive
set items [db_list tps_get_items_onelist ""]
foreach item_id $items {
- publish::set_publish_status $item_id expired
+ cms::publish::set_publish_status $item_id expired
+ # MS: update workflow state here
}
# } errmsg] } {
-# ns_log Warning "publish::track_publish_status: error: $errmsg"
+# ns_log Warning "cms::publish::track_publish_status: error: $errmsg"
# }
}
}
-# ad_proc -public publish::schedule_status_sweep { {interval ""} } {
+# ad_proc -public cms::publish::schedule_status_sweep { {interval ""} } {
# @public schedule_status_sweep
@@ -417,9 +423,9 @@
# StatusSweepInterval parameter in the server's INI file is used
# (if it exists).
-# @see publish::set_publish_status
-# @see publish::unschedule_status_sweep
-# @see publish::track_publish_status
+# @see cms::publish::set_publish_status
+# @see cms::publish::unschedule_status_sweep
+# @see cms::publish::track_publish_status
# } {
@@ -431,25 +437,25 @@
# # if cms is installed but not mounted, return reasonable default
# if { $interval == "" } {
# set interval 3600
-# ns_log Warning "publish::schedule_status_sweep: unable to lookup package_id for cms defaulting to interval 3600"
+# ns_log Warning "cms::publish::schedule_status_sweep: unable to lookup package_id for cms defaulting to interval 3600"
# }
-# ns_log notice "publish::schedule_status_sweep: Scheduling status sweep every $interval seconds for package_id $package_id"
-# set proc_id ns_schedule_proc -thread $interval publish::track_publish_status
+# ns_log notice "cms::publish::schedule_status_sweep: Scheduling status sweep every $interval seconds for package_id $package_id"
+# set proc_id ns_schedule_proc -thread $interval cms::publish::track_publish_status
# cache set status_sweep_proc_id_${package_id} $proc_id
# }
# }
# }
-ad_proc -public publish::unschedule_status_sweep {} {
+ad_proc -public cms::publish::unschedule_status_sweep {} {
@public unschedule_status_sweep
Unschedule the proc which keeps track of the publish status.
- @see publish::schedule_status_sweep
+ @see cms::publish::schedule_status_sweep
} {
@@ -459,8 +465,3 @@
}
}
-
-# Actually schedule the status sweep
-
-#publish::schedule_status_sweep
-
Index: openacs-4/packages/cms/tcl/publish-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs.xql,v
diff -u -N -r1.3.2.1 -r1.3.2.2
--- openacs-4/packages/cms/tcl/publish-procs.xql 6 Jun 2005 17:05:58 -0000 1.3.2.1
+++ openacs-4/packages/cms/tcl/publish-procs.xql 31 Aug 2006 19:59:05 -0000 1.3.2.2
@@ -1,14 +1,14 @@
Error
-
-
Index: openacs-4/packages/cms/www/error.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/error.tcl,v
diff -u -N
--- openacs-4/packages/cms/www/error.tcl 20 Apr 2001 20:51:09 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-# A generic error page
-
-request create
-request set_param message -datatype text
-request set_param return_url -datatype text -value [ns_conn url]
-request set_param passthrough -datatype text
-
-# Create the vars datasource
-set vars:rowcount 0
-upvar 0 vars:rowcount rowcount
-
-foreach pair $passthrough {
- incr vars:rowcount
- upvar 0 vars:$rowcount row
- set row(name) [lindex $pair 0]
- set row(value) [lindex $pair 1]
- set row(rownum) ${vars:rowcount}
-}
-
-
Index: openacs-4/packages/cms/www/head.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/head.adp,v
diff -u -N
--- openacs-4/packages/cms/www/head.adp 17 May 2003 10:24:03 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,32 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
Index: openacs-4/packages/cms/www/head.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/head.tcl,v
diff -u -N
--- openacs-4/packages/cms/www/head.tcl 16 Aug 2002 00:20:17 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,10 +0,0 @@
-# Get the name for the current user
-
-set user_id [User::getID]
-
-ns_log Notice $user_id
-
-set name [db_string get_name ""]
-
-
-
Index: openacs-4/packages/cms/www/head.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/head.xql,v
diff -u -N
--- openacs-4/packages/cms/www/head.xql 25 May 2001 02:28:33 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-
-
-
-
-
-My Workspace: @name@
-
-
- Sign Out
-
-
-@footer;noquote@
-
-
-
-
-@title;noquote@
-
-
-
-
Index: openacs-4/packages/cms/www/table-header.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/table-header.tcl,v
diff -u -N
--- openacs-4/packages/cms/www/table-header.tcl 20 Apr 2001 20:51:09 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,4 +0,0 @@
-request create
-request set_param title -datatype text -value ""
-request set_param header -datatype text -value ""
-
Index: openacs-4/packages/cms/www/modules/categories/delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/categories/delete.tcl,v
diff -u -N -r1.6 -r1.6.2.1
--- openacs-4/packages/cms/www/modules/categories/delete.tcl 12 Apr 2005 21:45:42 -0000 1.6
+++ openacs-4/packages/cms/www/modules/categories/delete.tcl 31 Aug 2006 19:59:05 -0000 1.6.2.1
@@ -21,10 +21,10 @@
}
# Remove it from the clipboard, if it exists
- set clip [clipboard::parse_cookie]
- clipboard::remove_item $clip $mount_point $id
- clipboard::set_cookie $clip
- clipboard::free $clip
+ set clip [cms::clipboard::parse_cookie]
+ cms::clipboard::remove_item $clip $mount_point $id
+ cms::clipboard::set_cookie $clip
+ cms::clipboard::free $clip
ad_returnredirect "index?id=$parent_id&mount_point=$mount_point"
}
Index: openacs-4/packages/cms/www/modules/categories/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/categories/index.adp,v
diff -u -N -r1.4 -r1.4.2.1
--- openacs-4/packages/cms/www/modules/categories/index.adp 12 Apr 2005 21:45:42 -0000 1.4
+++ openacs-4/packages/cms/www/modules/categories/index.adp 31 Aug 2006 19:59:05 -0000 1.4.2.1
@@ -3,7 +3,7 @@
-