Index: openacs-4/packages/cms/cms.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/cms.info,v diff -u -r1.15.2.2 -r1.15.2.3 --- openacs-4/packages/cms/cms.info 4 Oct 2005 22:17:26 -0000 1.15.2.2 +++ openacs-4/packages/cms/cms.info 31 Aug 2006 19:59:04 -0000 1.15.2.3 @@ -7,17 +7,17 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="5.1d" url="http://www.arsdigita.com/acs-repository/download/apm/cms-5.1d.apm"> - <owner url="mailto:lutter@arsdigita.com">David Lutterkort</owner> - <owner url="mailto:karlg@arsdigita.com">Karl Goldstein</owner> + <version name="5.0d2" url="http://openacs.org/download/apm/cms-5.0d2.apm"> <owner url="mailto:michael@steigman.net">Michael Steigman</owner> + <owner url="mailto:karlg@arsdigita.com">Karl Goldstein</owner> + <owner url="mailto:lutter@arsdigita.com">David Lutterkort</owner> <summary>A CMS implemented on top of the Content Repository</summary> - <release-date>2005-10-04</release-date> + <release-date>2006-08-31</release-date> <vendor url="http://www.openacs.org">OpenACS</vendor> <description format="text/html">CMS is a full featured content management system implemented on top of the content repository which supports composite objects, dynamicly created attributes, publishing to the filesystem and categorization. CMS remains the best place to look to find examples of how the content repository should be used.</description> - <maturity>0</maturity> + <maturity>1</maturity> - <provides url="cms" version="5.1d"/> + <provides url="cms" version="5.0d2"/> <requires url="acs-content-repository" version="5.1.5"/> <requires url="acs-kernel" version="5.1.5"/> <requires url="acs-mail" version="5.1.5"/> @@ -27,6 +27,8 @@ <callbacks> <callback type="after-instantiate" proc="cms::install::package_instantiate"/> <callback type="before-uninstantiate" proc="cms::install::package_uninstantiate"/> + <callback type="after-install" proc="cms::install::package_install"/> + <callback type="before-uninstall" proc="cms::install::package_uninstall"/> </callbacks> <parameters> <parameter datatype="number" min_n_values="1" max_n_values="1" name="ClipboardFloatsP" default="1" description="Determine whether the clipboard should be in its own floating window."/> Index: openacs-4/packages/cms/todo =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/todo,v diff -u -r1.7.2.4 -r1.7.2.5 --- openacs-4/packages/cms/todo 10 Jun 2005 22:32:42 -0000 1.7.2.4 +++ openacs-4/packages/cms/todo 31 Aug 2006 19:59:04 -0000 1.7.2.5 @@ -1,35 +1,134 @@ tasks ===== -top priority ------------- -names for templates (steal from xcms-ui, bcms) +can rename template folders? how? +root template/content folder procs returning correct info? +clean up www/modules/items/relate-items (convert old table/grid format to listbuilder ala perm-include from acs-subsite) +finish moving the content_method stuff to tcl api (then delete many of the xql files under types) + - [content::revision::delete], content method stuff using package_plsql broken? +make content_method stuff make sense (ok for now, if developer sets up the type information [content_method, mime_type] correctly?) +when you view a symlink in CMS should the path show up as the path of the linked item or the symlink (latter methinks)? +show symlinks to an item (extra tab, if they exist) or folder (where in UI?) +junk move/copy/symlink stuff in sitemap, revisions in items/templates +continue cleanup/removal of xql files add interface to allow admin to map subsite to cms instance - should copy index.vuh to /www/subsite and add entry to subsite_package_map -add track_publish_status, update_publish_status to CR, add param for sched interval - - yank plsql exec stuff there now and junk in cms +printer friendly template (steal from xcms-ui? add ad_page_contract to index.vuh with preview/printer-friendly option?) +new icon for "clipping" items - competing with new listbuilder checkboxes, confuses UI a bit +go through various listbuilder lists and remove "un-xxx" links in favor of bulk actions + unregister item templates - types/content methods & templates +redo tab files - just cycle through list of tabs to create the tab html? +floating clipboard working? +hide data model for users creating/editing items: + - for new items, if: + -> if has_text_mime_types_p, forward to create-2 with content_method=text_entry + -> if !has_text_mime_types_p & has_mime_types, forward with cm=file_upload + -> else, forward with cm=no_content + - for revisions, if: + -> if storage_type is text and content eq "", forward to revision-add-2 with content_method=no_content "Author new revision" + -> if storage_type is text and content ne "", forward to revision-add-2 with content_method=text_entry "Author new revision" + -> if storage_type is files, use content_method=file_upload "Upload new revision" -basic/cosmetic ---------- -add preview functionality (add ad_properties to index.vuh with preview/printer-friendly option?) -printer friendly template (steal from xcms-ui) -clean up www/modules/items/relate-items (remove old table format) -new icon for "clipping" items - competing with new listbuilder checkboxes, confuse UI a bit -fix "clear the clipboard" functionality -floatclipboard_p working? - plumbing -------- +dav for templates root +internationalization integrate categories and workflow packages fix search module (will try when i have tsearch2, ie upgrade to rhel4) -select from cm_modules to build tabs? questions/ideas --------- how do we get extlinks and other types (if any?) which do not sub-class content_revision into the system? comment integration? + +wf-notes +-------- + + states/roles/actions + ------------------- + +states + +- authored +- edited +- ready +- live +- expired + +roles + +- author +- editor +- publisher + +actions + +- request (initiated) +- author - cms::form::new_item (initiated) +- edit - cms::form::add_revision? +- approve/publish | reject +- comment + +[initiate] -> (initiated) + -> [author] -> (authored*) + -> [edit] -> (edited) + -> [publish] -> (ready*) ... (live) + -> (expired) + -> [revise] -> (authored) + -> [edit] -> (edited) + -> [reject] -> (authored*) + +* affects cr_items.publish_status + + lifecycles (see http://www.redhat.com/docs/manuals/cms/rhea-ag-cms-en-6.1/s1-concepts-lifecycles.html among other sites) + ------------------------ + +- simple (always live) +- expiring (content is deleted?) +- archiving? +- recurring +- migrating + +must define delay and duration, can have multiple phases (i.e., migrating) + - hidden during authoring phase + + UI and API + ----------------------- +tasks UI + - show directly assigned tasks (actions for which user is assigned) + - show all available tasks (actions user can accept) + - show tasks user has created (editable, for example to change content type or object) + - user can save changes without kicking workflow to next state (have separate option to pass on to...) + - allow editor or publisher to create new tasks + - new workflow with target user for author + - ability to select existing page as object or new items + - on item publishing tab, allow for kicking back to production state + - how to allow senior staff to request edits? (simple task overview based on object permissions?) + +api integration + - when adding new content, kick off new case execute [initiate] + - allow content creation from workspace + -> drop down for content type + -> populate second list for folders the type is registered to and writable + - new item api should accept workflow_id for when case has been initiated + - select widget - use which workflow? (if enabled... if not, then what?) + - when adding new task, kick off new case, executing [initiate] + - user will accept task and create new item or revision + -> api will update workflow with object_id once content is created + - when revising existing content, execute [initiate] on existing case + - manager can initiate update with target user (or default) + + random notes + ------------------------ +develop rss feed for workflow ala (http://www.cmswatch.com/Trends/453-Workflow-via-RSS/Atom)? + + + + + -- to drop old workflow from production: +-- ------------------------------------- drop function content_workflow__is_overdue (integer,varchar); drop function content_workflow__get_holding_user_name (integer); drop function content_workflow__get_first_place(); @@ -79,4 +178,4 @@ -- select acs_privilege__drop_privilege('cm_read'); -- select acs_privilege__drop_privilege('cm_item_workflow'); -- select acs_privilege__drop_privilege('cm_perm_admin'); --- select acs_privilege__drop_privilege('cm_perm'); \ No newline at end of file +-- select acs_privilege__drop_privilege('cm_perm'); Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/ancestors-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/ancestors-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/ancestors.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/ancestors.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/clip.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/clip.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/lib/folder-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/lib/folder-items.tcl,v diff -u -r1.1.2.3 -r1.1.2.4 --- openacs-4/packages/cms/lib/folder-items.tcl 31 May 2005 05:04:14 -0000 1.1.2.3 +++ openacs-4/packages/cms/lib/folder-items.tcl 31 Aug 2006 19:59:04 -0000 1.1.2.4 @@ -62,10 +62,10 @@ } if { ![ template::util::is_nil content_length ] } { - set file_size [lc_numeric [expr $content_length / 1000.00] "%.2f"] + set file_size "[lc_numeric [expr $content_length / 1000.00] "%.2f"] Kb" } else { set file_size "-" } - set copy [clipboard::ui::render_bookmark $mount_point $item_id [ad_conn package_url]] + set copy [cms::clipboard::ui::render_bookmark $mount_point $item_id [ad_conn package_url]] } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/revisions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/revisions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/lib/revisions.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/sql/postgresql/cms-content-methods.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/postgresql/cms-content-methods.sql,v diff -u -r1.5 -r1.5.8.1 --- openacs-4/packages/cms/sql/postgresql/cms-content-methods.sql 17 May 2003 10:22:35 -0000 1.5 +++ openacs-4/packages/cms/sql/postgresql/cms-content-methods.sql 31 Aug 2006 19:59:04 -0000 1.5.8.1 @@ -125,6 +125,7 @@ -- create or replace package body content_method as -- function get_method +select define_function_args('content_method__get_method','content_type'); create or replace function content_method__get_method (varchar) returns varchar as ' declare @@ -173,6 +174,7 @@ -- function is_mapped +select define_function_args('content_method__is_mapped','content_type,content_method'); create or replace function content_method__is_mapped (varchar,varchar) returns boolean as ' declare @@ -193,6 +195,7 @@ -- procedure add_method +select define_function_args('content_method__add_method','content_type,content_method,is_default'); create or replace function content_method__add_method (varchar,varchar,boolean) returns integer as ' declare @@ -234,6 +237,7 @@ -- procedure add_all_methods +select define_function_args('content_method__add_all_methods','content_type'); create or replace function content_method__add_all_methods (varchar) returns integer as ' declare @@ -262,6 +266,7 @@ -- procedure set_default_method +select define_function_args('content_method__set_default_method','content_type,content_method'); create or replace function content_method__set_default_method (varchar,varchar) returns integer as ' declare @@ -284,6 +289,7 @@ -- procedure unset_default_method +select define_function_args('content_method__unset_default_method','content_type'); create or replace function content_method__unset_default_method (varchar) returns integer as ' declare @@ -299,6 +305,7 @@ -- procedure remove_method +select define_function_args('content_method__remove_method','content_type,content_method'); create or replace function content_method__remove_method (varchar,varchar) returns integer as ' declare Index: openacs-4/packages/cms/sql/postgresql/upgrade/upgrade-5.0d-5.1d.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/postgresql/upgrade/upgrade-5.0d-5.1d.sql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/cms/sql/postgresql/upgrade/upgrade-5.0d-5.1d.sql 4 Oct 2005 22:16:49 -0000 1.1.2.2 +++ openacs-4/packages/cms/sql/postgresql/upgrade/upgrade-5.0d-5.1d.sql 31 Aug 2006 19:59:04 -0000 1.1.2.3 @@ -51,3 +51,11 @@ return v_module_id; end;' language 'plpgsql'; + +select define_function_args('content_method__set_default_method','content_type,content_method'); +select define_function_args('content_method__unset_default_method','content_type'); +select define_function_args('content_method__remove_method','content_type,content_method'); +select define_function_args('content_method__add_all_methods','content_type'); +select define_function_args('content_method__add_method','content_type,content_method,is_default'); +select define_function_args('content_method__is_mapped','content_type,content_method'); +select define_function_args('content_method__get_method','content_type'); \ No newline at end of file Index: openacs-4/packages/cms/tcl/browser-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/browser-procs.tcl,v diff -u -r1.3 -r1.3.8.1 --- openacs-4/packages/cms/tcl/browser-procs.tcl 1 Nov 2003 08:45:38 -0000 1.3 +++ openacs-4/packages/cms/tcl/browser-procs.tcl 31 Aug 2006 19:59:04 -0000 1.3.8.1 @@ -1,622 +1,623 @@ -################################################ -# -# Procedures responsible for maintaining and updating the browser state. -# -# 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_library { -ad_proc -public initFolderTree { user_id } { + Procedures responsible for maintaining and updating the browser state. + <p> + <em>MS 04/06: not used anymore but still potentially interesting to look at</em> + <p> + 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. + <p> + 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. + <p> + 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 -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 -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 <th>...</th> tags based on the elements in some row @@ -210,7 +214,7 @@ upvar "${form_name}_data:${row_index}" row if { ![info exists row] } { - ns_log notice "clipboard::ui::generate_form_header: No such row $row_index" + ns_log notice "cms::clipboard::ui::generate_form_header: No such row $row_index" return } @@ -223,7 +227,7 @@ } } -ad_proc -public clipboard::ui::process_form { form_name row_dml } { +ad_proc -public cms::clipboard::ui::process_form { form_name row_dml } { Process the entire form, executing the same DML for each row If no DML is specified, uses the global dml @@ -232,19 +236,20 @@ upvar "${form_name}_data:rowcount" rowcount for {set i 1} {$i <= $rowcount} {incr i} { - uplevel "clipboard::ui::process_row $form_name $i \{$row_dml\}" + uplevel "cms::clipboard::ui::process_row $form_name $i \{$row_dml\}" } } -ad_proc -public clipboard::ui::render_bookmark { mount_point id package_url} { +ad_proc -public cms::clipboard::ui::render_bookmark { mount_point id package_url} { Compile and eval a chunk of ADP for the bookmark + @author Michael Steigman } { set img_checked "${package_url}resources/checked.gif" set img_unchecked "${package_url}resources/unchecked.gif" - set clipboardfloats_p [clipboard::floats_p] + set clipboardfloats_p [cms::clipboard::ui::floats_p] set code "<a href=\"javascript:markx('@package_url@', '@mount_point@', '@id@', '@img_checked@', '@img_unchecked@', '@clipboardfloats_p@')\" title=\"Copy this item to the clipboard\"> @@ -253,3 +258,13 @@ set compiled_code [template::adp_compile -string $code] return [template::adp_eval compiled_code] } + +ad_proc -public cms::clipboard::ui::floats_p {} { + + determines whether clipboard should float or not + currently incomplete, should be checking user prefs + +} { + return [ad_parameter ClipboardFloatsP] + +} Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/cms-folder-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/cms-folder-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/cms-folder-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/tcl/cms-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/cms-init.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/cms/tcl/cms-init.tcl 6 Jun 2005 17:07:23 -0000 1.1.2.1 +++ openacs-4/packages/cms/tcl/cms-init.tcl 31 Aug 2006 19:59:04 -0000 1.1.2.2 @@ -11,8 +11,6 @@ @cvs-id $Id$ } -# Should be a CR parameter +# Should be a CR parameter? set interval 120 -ad_schedule_proc -thread t $interval publish::track_publish_status - - +ad_schedule_proc -thread t $interval cms::publish::track_publish_status Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/cms-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/content-add-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/content-add-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.6.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/content-method-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.6.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/content-method-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/content-method-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/content-method-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/folder-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/folder-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/tcl/form-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-oracle.xql,v diff -u -r1.17 -r1.17.2.1 --- openacs-4/packages/cms/tcl/form-procs-oracle.xql 17 May 2005 21:25:08 -0000 1.17 +++ openacs-4/packages/cms/tcl/form-procs-oracle.xql 31 Aug 2006 19:59:05 -0000 1.17.2.1 @@ -2,7 +2,7 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> -<partialquery name="content::query_form_metadata.attributes_query_1"> +<partialquery name="cms::form::query_form_metadata.attributes_query_1"> <querytext> select @@ -241,14 +241,6 @@ </querytext> </fullquery> -<fullquery name="content::add_child_relation_element.get_parent_title"> - <querytext> - - select content_item.get_title(:parent_id) from dual - - </querytext> -</fullquery> - <partialquery name="content::set_attribute_values.timestamp_to_string"> <querytext> Index: openacs-4/packages/cms/tcl/form-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs-postgresql.xql,v diff -u -r1.21 -r1.21.2.1 --- openacs-4/packages/cms/tcl/form-procs-postgresql.xql 17 May 2005 21:25:08 -0000 1.21 +++ openacs-4/packages/cms/tcl/form-procs-postgresql.xql 31 Aug 2006 19:59:05 -0000 1.21.2.1 @@ -2,7 +2,7 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> -<partialquery name="content::query_form_metadata.attributes_query_1"> +<partialquery name="cms::form::query_form_metadata.attributes_query_1"> <querytext> select @@ -160,7 +160,7 @@ </querytext> </partialquery> -<fullquery name="content::new_item.get_item_id"> +<fullquery name="cms::form::new_item.get_item_id"> <querytext> select content_item__new(varchar :name, @@ -183,7 +183,7 @@ </querytext> </fullquery> -<fullquery name="content::upload_content.upload_file_revision"> +<fullquery name="cms::form::upload_content.upload_file_revision"> <querytext> @@ -194,7 +194,7 @@ </querytext> </fullquery> -<fullquery name="content::upload_content.upload_text_revision"> +<fullquery name="cms::form::upload_content.upload_text_revision"> <querytext> update @@ -209,7 +209,7 @@ </fullquery> -<fullquery name="content::upload_content.upload_revision"> +<fullquery name="cms::form::upload_content.upload_revision"> <querytext> update cr_revisions @@ -221,7 +221,7 @@ </fullquery> -<fullquery name="content::update_content_from_file.upload_file_revision"> +<fullquery name="cms::form::update_content_from_file.upload_file_revision"> <querytext> @@ -233,7 +233,7 @@ </querytext> </fullquery> -<fullquery name="content::update_content_from_file.upload_text_revision"> +<fullquery name="cms::form::update_content_from_file.upload_text_revision"> <querytext> update @@ -248,7 +248,7 @@ </fullquery> -<fullquery name="content::update_content_from_file.upload_revision"> +<fullquery name="cms::form::update_content_from_file.upload_revision"> <querytext> update cr_revisions @@ -270,7 +270,7 @@ </querytext> </partialquery> -<fullquery name="content::add_child_relation_element.get_all_valid_relation_tags"> +<fullquery name="cms::form::add_child_relation_element.get_all_valid_relation_tags"> <querytext> select @@ -287,24 +287,16 @@ </querytext> </fullquery> -<fullquery name="content::add_child_relation_element.get_parent_title"> +<partialquery name="cms::form::set_attribute_values.timestamp_to_string"> <querytext> - select content_item__get_title(:parent_id, 'f') - - </querytext> -</fullquery> - -<partialquery name="content::set_attribute_values.timestamp_to_string"> - <querytext> - to_char($attr, 'YYYY MM DD HH24 MI SS') as $attr </querytext> </partialquery> -<fullquery name="content::get_attributes.ga_get_attributes"> +<fullquery name="cms::form::get_attributes.ga_get_attributes"> <querytext> select @@ -349,14 +341,6 @@ </querytext> </fullquery> -<fullquery name="content::get_latest_revision.glr_get_latest_revision"> - <querytext> - - select content_item__get_latest_revision(:item_id) - - </querytext> -</fullquery> - <fullquery name="content::add_basic_revision.basic_get_revision_id"> <querytext> Index: openacs-4/packages/cms/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs.tcl,v diff -u -r1.27.2.2 -r1.27.2.3 --- openacs-4/packages/cms/tcl/form-procs.tcl 19 Nov 2005 23:12:09 -0000 1.27.2.2 +++ openacs-4/packages/cms/tcl/form-procs.tcl 31 Aug 2006 19:59:05 -0000 1.27.2.3 @@ -1,10 +1,14 @@ -namespace eval content { +ad_library { + These procs manage building and processing the forms used in CMS. +} +# MS: old namespace stuff - now converted to cms::form +#namespace eval content { # namespace import seems to prevent content:: procs from being recognized # namespace import ::template::query ::template::form ::template::element -} +#} +namespace eval cms::form {} - -ad_proc -private content::query_form_metadata { +ad_proc -private cms::form::query_form_metadata { {datasource_name rows} {datasource_type multirow} {extra_where {}} @@ -13,6 +17,7 @@ Helper proc: query out all the information neccessary to create a custom form element based on stored metadata Requires the variable content_type to be set in the calling frame + @ www/modules/items/relate-items-2.tcl } { # query for all attribute widget param values associated with a content # the 3 nvl subqueries are necessary because we cannot outer join @@ -41,8 +46,10 @@ } -ad_proc -private content::assemble_form_element { - datasource_ref the_attribute_name start_row {db {}} +ad_proc -private cms::form::assemble_form_element { + datasource_ref + the_attribute_name + start_row {db {}} } { Process the query and assemble the "element create..." statement @@ -70,7 +77,7 @@ template::util::array_to_vars q_row - content::get_revision_create_element + get_revision_create_element } set last_row $i @@ -97,202 +104,202 @@ } -ad_proc -public content::create_form_element { - form_name attribute_name args -} { +# ad_proc -public content::create_form_element { +# form_name attribute_name args +# } { - Create a form widget based on the given attribute. Query parameters - out of the database, override them with the passed-in parameters - if they exist. - If the -revision_id flag exists, fills in the value of the attribute from - the database, based on the given revision_id. - If the -content_type flag exists, uses the attribute for the given content - type (without inheritance). - If the -item_id flag is present, the live revision for the item will be - used. - If the -item_id and the -revision_id flags are missing, the -content_type - flag must be specified. - Example: - content::create_form_element my_form width -revision_id $image_id -size 10 - This call will create an element representing the width attribute - of the image type, with the textbox size set to 10 characters, - and query the current value of the attribute out of the database. +# Create a form widget based on the given attribute. Query parameters +# out of the database, override them with the passed-in parameters +# if they exist. +# If the -revision_id flag exists, fills in the value of the attribute from +# the database, based on the given revision_id. +# If the -content_type flag exists, uses the attribute for the given content +# type (without inheritance). +# If the -item_id flag is present, the live revision for the item will be +# used. +# If the -item_id and the -revision_id flags are missing, the -content_type +# flag must be specified. +# Example: +# content::create_form_element my_form width -revision_id $image_id -size 10 +# This call will create an element representing the width attribute +# of the image type, with the textbox size set to 10 characters, +# and query the current value of the attribute out of the database. -} { - template::util::get_opts $args +# } { +# template::util::get_opts $args - # Get the revision id if the item id is specified, or if - # it is passed in directly - if { ![template::util::is_nil opts(revision_id)] } { - set revision_id $opts(revision_id) +# # Get the revision id if the item id is specified, or if +# # it is passed in directly +# if { ![template::util::is_nil opts(revision_id)] } { +# set revision_id $opts(revision_id) - } elseif { ![template::util::is_nil opts(item_id)] } { +# } elseif { ![template::util::is_nil opts(item_id)] } { - set item_id $opts(item_id) - set revision_id [db_string get_revision_id ""] - } +# set item_id $opts(item_id) +# set revision_id [db_string get_revision_id ""] +# } - if { [info exists opts(content_type)] } { - # The type is known: use it - set content_type $opts(content_type) - } else { +# if { [info exists opts(content_type)] } { +# # The type is known: use it +# set content_type $opts(content_type) +# } else { - # Figure out the type based on revision_id - if { ![info exists revision_id] } { - template::request error invalid_element_flags " - No revision_id, item_id or content_type specified in - content::create_form_element for attribute ${form_name}:${attribute_name}" - return - } +# # Figure out the type based on revision_id +# if { ![info exists revision_id] } { +# template::request error invalid_element_flags " +# No revision_id, item_id or content_type specified in +# content::create_form_element for attribute ${form_name}:${attribute_name}" +# return +# } - set content_type [db_string get_content_type ""] - } +# set content_type [db_string get_content_type ""] +# } - # Run the gigantic uber-query. This is somewhat wasteful; should - # be replaced by 2 smaller queries: one for the attribute_id, one - # for parameter types and values. - query_form_metadata params multirow "attribute_name = :attribute_name" +# # Run the gigantic uber-query. This is somewhat wasteful; should +# # be replaced by 2 smaller queries: one for the attribute_id, one +# # for parameter types and values. +# query_form_metadata params multirow "attribute_name = :attribute_name" - if { ${params:rowcount} < 1} { - error "No widgets are registered for ${content_type}.${attribute_name}" - } +# if { ${params:rowcount} < 1} { +# error "No widgets are registered for ${content_type}.${attribute_name}" +# } - template::util::array_to_vars "params:1" - assemble_form_element params $attribute_name 1 +# template::util::array_to_vars "params:1" +# assemble_form_element params $attribute_name 1 - # If the -revision_id switch exists, look up the existing value for the - # element - if { ![template::util::is_nil revision_id] && [lsearch $code_params "-value"] < 0 } { +# # If the -revision_id switch exists, look up the existing value for the +# # element +# if { ![template::util::is_nil revision_id] && [lsearch $code_params "-value"] < 0 } { - # Handle custom datatypes... Basically, this is done so that - # the date widget will work :-/ - # In the future, upgrade the date widget and use acs_object.get_attribute +# # Handle custom datatypes... Basically, this is done so that +# # the date widget will work :-/ +# # In the future, upgrade the date widget and use acs_object.get_attribute - switch $datatype { - date { - set what [db_map cfe_attribute_name_to_char] - } +# switch $datatype { +# date { +# set what [db_map cfe_attribute_name_to_char] +# } - default { - set what [db_map cfe_attribute_name] - } - } +# default { +# set what [db_map cfe_attribute_name] +# } +# } - set element [db_string get_element_value ""] +# set element [db_string get_element_value ""] - lappend code_params -value $element_value -values [list $element_value] - } +# lappend code_params -value $element_value -values [list $element_value] +# } - set form_element "template::element create $form_name $attribute_name $code_params" - if { ![string equal $is_required t] } { - append form_element " -optional" - } +# set form_element "template::element create $form_name $attribute_name $code_params" +# if { ![string equal $is_required t] } { +# append form_element " -optional" +# } - eval $form_element -} +# eval $form_element +# } -ad_proc -public content::get_revision_form { - content_type item_id form_name {show_sections t} {element_override {}} -} { +# ad_proc -public content::get_revision_form { +# content_type item_id form_name {show_sections t} {element_override {}} +# } { - generate a form based on metadata +# generate a form based on metadata -} { +# } { - # Convert overrides to an array - array set overrides $element_override +# # Convert overrides to an array +# array set overrides $element_override - set last_type "" - set last_attribute_name "" - set new_section_p 1 +# set last_type "" +# set last_attribute_name "" +# set new_section_p 1 - set code_params [list] - set html_params [list] +# set code_params [list] +# set html_params [list] - # Perform a gigantic query to retreive all metadata - query_form_metadata +# # Perform a gigantic query to retreive all metadata +# query_form_metadata - # Process the results and create the elements - for { set i 1 } { $i <= ${rows:rowcount} } { incr i } { - upvar 0 "rows:${i}" row - template::util::array_to_vars row +# # Process the results and create the elements +# for { set i 1 } { $i <= ${rows:rowcount} } { incr i } { +# upvar 0 "rows:${i}" row +# template::util::array_to_vars row - # make a new section in the form for each type in the content type hierarchy - if { $new_section_p == 1 && [string equal $show_sections t]} { - # put attributes for each supertype in their own section - template::form section $form_name $last_type - } +# # make a new section in the form for each type in the content type hierarchy +# if { $new_section_p == 1 && [string equal $show_sections t]} { +# # put attributes for each supertype in their own section +# template::form section $form_name $last_type +# } - # check if attributes should be placed in a new content type section - if { ! [string equal $type_label $last_type] } { - set new_section_p 1 - } else { - set new_section_p 0 - } +# # check if attributes should be placed in a new content type section +# if { ! [string equal $type_label $last_type] } { +# set new_section_p 1 +# } else { +# set new_section_p 0 +# } - # if the attribute is new - if { ![string equal $last_attribute_name $attribute_name] } { +# # if the attribute is new +# if { ![string equal $last_attribute_name $attribute_name] } { - # if this is a new attribute and it isn't the first attribute ( $i != 1 ), - # then evaluate the current "element create" string, and reset the params lists - if { $i != 1 } { +# # if this is a new attribute and it isn't the first attribute ( $i != 1 ), +# # then evaluate the current "element create" string, and reset the params lists +# if { $i != 1 } { - if { [llength $html_params] } { - # widget has html parameters - lappend code_params -html $html_params - } - set form_element \ - "template::element create $form_name $last_attribute_name $code_params" - ns_log debug "content::get_revision_form: CREATING" - ns_log debug "content::get_revision_form: attribute : $last_attribute_name" - ns_log debug "content::get_revision_form: type_label: $last_type" - eval $form_element +# if { [llength $html_params] } { +# # widget has html parameters +# lappend code_params -html $html_params +# } +# set form_element \ +# "template::element create $form_name $last_attribute_name $code_params" +# ns_log debug "content::get_revision_form: CREATING" +# ns_log debug "content::get_revision_form: attribute : $last_attribute_name" +# ns_log debug "content::get_revision_form: type_label: $last_type" +# eval $form_element - set code_params [list] - set html_params [list] - } +# set code_params [list] +# set html_params [list] +# } - # start a new "element create" string - get_element_default_params - } +# # start a new "element create" string +# get_element_default_params +# } - # evaluate the param - get_revision_create_element - if { [info exists overrides($last_attribute_name)] } { - set code_params [concat $code_params $overrides($last_attribute_name)] - } +# # evaluate the param +# get_revision_create_element +# if { [info exists overrides($last_attribute_name)] } { +# set code_params [concat $code_params $overrides($last_attribute_name)] +# } - set last_attribute_name $attribute_name - set last_type $type_label - } +# set last_attribute_name $attribute_name +# set last_type $type_label +# } - # eval the last "element create" string - if { [llength $html_params] } { - # widget has html parameters - lappend code_params -html $html_params - } +# # eval the last "element create" string +# if { [llength $html_params] } { +# # widget has html parameters +# lappend code_params -html $html_params +# } - set form_element "template::element create $form_name $last_attribute_name $code_params" - ns_log debug "content::get_revision_form: ELEMENT CREATE: $form_element" - eval $form_element +# set form_element "template::element create $form_name $last_attribute_name $code_params" +# ns_log debug "content::get_revision_form: ELEMENT CREATE: $form_element" +# eval $form_element - # add some default form elements - eval template::element create $form_name content_type \ - -widget hidden -datatype keyword -value $content_type +# # add some default form elements +# eval template::element create $form_name content_type \ +# -widget hidden -datatype keyword -value $content_type - if { ![string equal $item_id ""] } { - eval template::element create $form_name item_id \ - -widget hidden -datatype integer -value $item_id - } -} +# if { ![string equal $item_id ""] } { +# eval template::element create $form_name item_id \ +# -widget hidden -datatype integer -value $item_id +# } +# } -ad_proc -public content::get_element_default_params {} { +ad_proc -public cms::form::get_element_default_params {} { PRE: requires datatype, widget, attribute_label, is_required code_params to be set in the calling frame @@ -310,7 +317,7 @@ } } -ad_proc content::get_revision_create_element {} { +ad_proc cms::form::get_revision_create_element {} { PRE: requires the following variables to be set in the uplevel scope: db, code_params, html_params, @@ -369,90 +376,90 @@ } -ad_proc -public content::process_revision_form { form_name content_type item_id {db{}} } { +# ad_proc -public content::process_revision_form { form_name content_type item_id {db{}} } { - perform the appropriate DML based on metadata +# perform the appropriate DML based on metadata -} { +# } { - template::form get_values $form_name title description mime_type +# template::form get_values $form_name title description mime_type - # create the basic revision - set revision_id [db_exec_plsql new_content_revision {}] +# # create the basic revision +# set revision_id [db_exec_plsql new_content_revision {}] - # query for extended attribute tables - set last_table "" - set last_id_column "" - db_multirow rows get_extended_attributes "" +# # query for extended attribute tables +# set last_table "" +# set last_id_column "" +# db_multirow rows get_extended_attributes "" - for { set i 1 } { $i <= ${rows:rowcount} } { incr i } { - upvar 0 "rows:${i}" row - template::util::array_to_vars row +# for { set i 1 } { $i <= ${rows:rowcount} } { incr i } { +# upvar 0 "rows:${i}" row +# template::util::array_to_vars row - ns_log debug "content::process_revision_form: attribute_name $attribute_name" - ns_log debug "content::process_revision_form: table_name $table_name" +# ns_log debug "content::process_revision_form: attribute_name $attribute_name" +# ns_log debug "content::process_revision_form: table_name $table_name" - if { ![string equal $last_table $table_name] } { - if { $i != 1 } { - content::process_revision_form_dml - } - set columns [list] - set values [list] - } +# if { ![string equal $last_table $table_name] } { +# if { $i != 1 } { +# content::process_revision_form_dml +# } +# set columns [list] +# set values [list] +# } - # fetch the value of the attribute from the form - if { ![template::util::is_nil attribute_name] } { - set $attribute_name [template::element::get_value \ - $form_name $attribute_name] +# # fetch the value of the attribute from the form +# if { ![template::util::is_nil attribute_name] } { +# set $attribute_name [template::element::get_value \ +# $form_name $attribute_name] - lappend columns $attribute_name +# lappend columns $attribute_name - # If the attribute is a date, get the date - if { [string equal $datatype date] } { - set $attribute_name \ - [template::util::date::get_property sql_date [set $attribute_name]] - # Can't use bind vars because this will be a to_date call - lappend values "[set $attribute_name]" - } else { - lappend values ":$attribute_name" - } - } - set last_table $table_name - set last_id_column $id_column - } +# # If the attribute is a date, get the date +# if { [string equal $datatype date] } { +# set $attribute_name \ +# [template::util::date::get_property sql_date [set $attribute_name]] +# # Can't use bind vars because this will be a to_date call +# lappend values "[set $attribute_name]" +# } else { +# lappend values ":$attribute_name" +# } +# } +# set last_table $table_name +# set last_id_column $id_column +# } - content::process_revision_form_dml +# content::process_revision_form_dml - return $revision_id -} +# return $revision_id +# } -ad_proc -public content::process_revision_form_dml {} { +# ad_proc -public content::process_revision_form_dml {} { - helper function for process_revision_form - PRE: the following variables must be set in the uplevel scope: - columns, values, last_table +# helper function for process_revision_form +# PRE: the following variables must be set in the uplevel scope: +# columns, values, last_table -} { +# } { - upvar last_table __last_table - upvar columns __columns - upvar values __values - upvar __sql sql - set sql [db_map insert_revision_form] +# upvar last_table __last_table +# upvar columns __columns +# upvar values __values +# upvar __sql sql +# set sql [db_map insert_revision_form] - uplevel { +# uplevel { - if { ! [string equal $last_table {}] } { - lappend columns $last_id_column - lappend values ":revision_id" +# if { ! [string equal $last_table {}] } { +# lappend columns $last_id_column +# lappend values ":revision_id" - db_dml insert_revision_form $__sql - } - } -} +# db_dml insert_revision_form $__sql +# } +# } +# } -ad_proc -public content::insert_element_data { +ad_proc -public cms::form::insert_element_data { form_name content_type exclusion_list id_value \ {suffix ""} {extra_where ""} } { @@ -462,6 +469,7 @@ exclusion_list is a list of all object types for which the elements are NOT to be inserted id_value is the revision_id + @see www/modules/items/relate-items-2 } { @@ -476,7 +484,7 @@ append query [db_map ied_get_objects_tree_order_by] - ns_log debug "content::insert_element_data: $query" + ns_log debug "cms::form::insert_element_data: $query" set last_table "" set last_id_column "" @@ -486,12 +494,12 @@ upvar 0 "rows:${i}" row template::util::array_to_vars row - ns_log debug "content::insert_element_data: attribute_name $attribute_name" - ns_log debug "content::insert_element_data: table_name $table_name" + ns_log debug "cms::form::insert_element_data: attribute_name $attribute_name" + ns_log debug "cms::form::insert_element_data: table_name $table_name" if { ![string equal $last_table $table_name] } { if { $i != 1 } { - content::process_insert_statement + process_insert_statement } set columns [list] set values [list] @@ -519,16 +527,16 @@ set last_id_column $id_column } - content::process_insert_statement + process_insert_statement } -ad_proc -public content::process_insert_statement {} { +ad_proc -public cms::form::process_insert_statement {} { helper function for process_revision_form PRE: the following variables must be set in the uplevel scope: columns, values, last_table, id_value_ref - + @see www/modules/items/relate-items-2 } { upvar last_table __last_table upvar columns __columns @@ -547,61 +555,17 @@ } } -ad_proc -public content::assemble_passthrough { args } { - - Assemble a passthrough list out of variables - -} { - set result [list] - foreach varname $args { - upvar $varname var - lappend result [list $varname $var] - } - return $result -} - -ad_proc -public content::url_passthrough { passthrough } { - - Convert passthrough to a URL fragment - -} { - - set extra_url "" - foreach pair $passthrough { - append extra_url "&[lindex $pair 0]=[lindex $pair 1]" - } - return $extra_url -} - -ad_proc -public content::assemble_url { base_url args } { - - Assemble a URL out of component parts - -} { - set result $base_url - if { [string first $base_url "?"] == -1 } { - set joiner "?" - } else { - set joiner "&" - } - foreach fragment $args { - set fragment [string trimleft $fragment "&?"] - if { ![string equal $fragment {}] } { - append result $joiner $fragment - set joiner "&" - } - } - return $result -} - ################################################################# -# @namespace content - # Procedures for generating and processing content content creation # and editing forms.. -ad_proc -public content::new_item { form_name { storage_type text } { tmpfile "" } {prefix {StArT}} } { +ad_proc -public cms::form::new_item { + form_name + { storage_type text } + { tmpfile "" } + {prefix {StArT}} +} { Create a new item, including the initial revision, based on a valid form submission. @@ -619,16 +583,16 @@ @param prefix A prefix to remove from the form when looking up attributes - @see content::add_revision + @see cms::form::add_revision } { # Here we walk the item prefixes and create them all, unless the content_prefixes var # does not exist or we are already handling the form - ns_log Warning "content::new_item: handling prefix $prefix" + ns_log Warning "cms::form::new_item: handling prefix $prefix" if {[string equal "StArT" $prefix]} { if {[template::element exists $form_name content_prefixes]} { foreach prefix [template::element get_value $form_name content_prefixes] { - lappend item_id [content::new_item $form_name $storage_type $tmpfile $prefix] + lappend item_id [new_item $form_name $storage_type $tmpfile $prefix] } return $item_id } else { @@ -645,9 +609,9 @@ # If the item does not already exist build the call to create it. if { !$exists } { - array set defaults [list item_id "" locale "" parent_id "" content_type "content_revision"] + array set defaults [list item_id "" locale "" parent_id "" content_type "content_revision" creation_ip "" creation_user ""] - foreach param { item_id name locale parent_id content_type } { + foreach param { item_id name locale parent_id content_type creation_ip creation_user } { if { [template::element exists $form_name $prefix$param] } { set $param [template::element get_value $form_name $prefix$param] @@ -678,10 +642,10 @@ db_transaction { if {!$exists} { - set item_id [db_exec_plsql get_item_id " - begin - :1 := content_item.new( [join $params ","] ); - end;"] + set item_id [content::item::new -name $name -parent_id $parent_id \ + -locale $locale -item_id $item_id -storage_type $storage_type \ + -content_type $content_type -creation_ip $creation_ip \ + -creation_user $creation_user] } add_revision $form_name $tmpfile $prefix [expr !$exists] } @@ -699,7 +663,12 @@ } -ad_proc -public content::add_revision { form_name { tmpfile "" } {prefix {}} {new_p 1}} { +ad_proc -public cms::form::add_revision { + form_name + { tmpfile "" } + { prefix "" } + { new_p 1 } +} { Create a new revision for an existing item based on a valid form submission. Queries for attribute names and inserts a row into the @@ -708,16 +677,19 @@ for the revision as well. @param form_name Name of the form from which to obtain attribute - values. The form should include an item_id and revision_id. + values. The form should include an item_id, revision_id and + creation_user/creation_ip. @param tmpfile Name of the temporary file containing the content to upload. @param prefix A prefix to prepend when looking up attributes in the form data - @param new_p Whether the revision is attached to a new cr_item or if previousrevision exist + @param new_p Whether the revision is attached to a new cr_item or if previous revision exist + + @see called by revision-add-2 in the items module } { - ns_log Debug "content::add_revision: $form_name $tmpfile $prefix $new_p" + ns_log Debug "cms::form::add_revision: $form_name $tmpfile $prefix $new_p" # initialize an ns_set to hold bind values set bind_vars [ns_set create] @@ -754,7 +726,7 @@ } -ad_proc -private content::attribute_insert_statement { +ad_proc -private cms::form::attribute_insert_statement { content_type table_name bind_vars form_name {prefix {}} {new_p 1} } { @@ -775,14 +747,10 @@ submission. } { - # get creation_user and creation_ip - ns_set put $bind_vars creation_user null - ns_set put $bind_vars creation_ip null - # initialize the column and value list - set columns [list item_id revision_id creation_user creation_ip] - set values [list :item_id :revision_id null null] + set columns [list item_id revision_id] + set values [list :item_id :revision_id] set default_columns [list] set default_values [list] set missing_columns [list] @@ -807,7 +775,7 @@ } } - if { ! [string equal $value {} ] } { + if { ! [string equal $value {}] && ![expr { [string equal $ancestor "content_revision"] && [string equal $attribute_name "title"] }] } { ns_set put $bind_vars $attribute_name $value lappend columns $attribute_name @@ -837,7 +805,7 @@ } -ad_proc -private content::add_revision_dml { statement bind_vars tmpfile filename } { +ad_proc -private cms::form::add_revision_dml { statement bind_vars tmpfile filename } { Perform the DML to insert a revision into the appropriate input view. @@ -869,7 +837,7 @@ } -ad_proc -public content::upload_content { revision_id tmpfile filename } { +ad_proc -public cms::form::upload_content { revision_id tmpfile filename } { @private upload_content @@ -919,19 +887,11 @@ db_dml upload_file_revision {} } elseif {[string equal $storage_type text]} { # upload the file into the revision content - db_dml upload_text_revision "update cr_revisions - set content = empty_blob(), - content_length = '[file size $tmpfile]' - where revision_id = :revision_id - returning content into :1" -blob_files [list $tmpfile] + db_dml upload_text_revision {} -blob_files [list $tmpfile] } else { # upload the file into the revision content - db_dml upload_revision "update cr_revisions - set content = empty_blob(), - content_length = '[file size $tmpfile]' - where revision_id = :revision_id - returning content into :1" -blob_files [list $tmpfile] + db_dml upload_revision {} -blob_files [list $tmpfile] } # this seems to abort the transaction even with the catch. @@ -951,7 +911,7 @@ } -ad_proc -private content::get_sql_value { name datatype } { +ad_proc -private cms::form::get_sql_value { name datatype } { Return the sql statement for a column value in an insert or update statement, using a bind variable for the actual value and wrapping it @@ -974,7 +934,7 @@ } -ad_proc -private content::prepare_content_file { form_name } { +ad_proc -private cms::form::prepare_content_file { form_name } { Looks for an element named "content" in a form and prepares a temporarily file in UTF-8 for uploading to the content repository. @@ -1022,7 +982,7 @@ } -ad_proc -private content::string_to_file { s } { +ad_proc -private cms::form::string_to_file { s } { Write a string in UTF-8 encoding to of temp file so it can be uploaded into a BLOB (which is blind to character encodings). @@ -1047,7 +1007,7 @@ # Form preparation procs -namespace eval content { +namespace eval cms::form { variable columns set columns [list object_type sort_order attribute_name param_type \ @@ -1057,7 +1017,7 @@ } -ad_proc -public content::new_item_form { args } { +ad_proc -public cms::form::new_item_form { args } { Adds elements to an ATS form object for creating an item and its initial revision. If the form does not already exist, creates the @@ -1128,7 +1088,7 @@ } } - if { [string equal {} $opts(item_id)] } { + if { $opts(item_id) eq "" } { # Only add all this junk for # new items. @@ -1186,7 +1146,7 @@ if { [template::form is_request $opts(form_name)] } { if {[template::util::is_nil item_id]} { - set item_id [get_object_id] + set item_id [new_object_id] template::element set_properties $opts(form_name) "$opts(prefix)item_id" -value $item_id @@ -1206,7 +1166,7 @@ } -ad_proc -public content::add_revision_form { args } { +ad_proc -public cms::form::add_revision_form { args } { Adds elements to an ATS form object for adding a revision to an existing item. If the item already exists, element values default a @@ -1273,7 +1233,7 @@ set attributes [add_attribute_elements $opts(form_name) $opts(content_type) {} $opts(prefix) $opts(section) $opts(exclude) $opts(hidden)] - ns_log debug "content::add_revision_form: content method $opts(content_method)" + ns_log debug "cms::form::add_revision_form: content method $opts(content_method); revision id $opts(revision_id)" add_content_element $opts(form_name) $opts(content_method) $opts(prefix) @@ -1283,11 +1243,11 @@ # template::element set_properties $opts(form_name) "$opts(prefix)revision_id" -value $revision_id - if { [string equal $opts(revision_id) {}] } { - set opts(revision_id) [get_latest_revision $opts(item_id)] + if { $opts(revision_id) eq "" } { + set opts(revision_id) [content::item::get_latest_revision -item_id $opts(item_id)] } - if { ! [string equal $opts(revision_id) {}] } { + if { $opts(revision_id) ne "" } { set_attribute_values $opts(form_name) $opts(content_type) \ $opts(revision_id) $attributes $opts(prefix) } @@ -1313,7 +1273,7 @@ } -ad_proc -public content::add_attribute_elements { +ad_proc -public cms::form::add_attribute_elements { form_name content_type { revision_id "" } {prefix {}} {section {}} {exclude {}} {hidden {}} } { @@ -1389,7 +1349,7 @@ } -ad_proc -public content::add_attribute_element { +ad_proc -public cms::form::add_attribute_element { form_name content_type attribute { attribute_data "" } {prefix {}} {section {}} {hidden_p 0} } { @@ -1413,8 +1373,8 @@ set command [list "template::element" create $form_name "$prefix$attribute"] - if { [string equal $attribute_data {}] } { - set attribute_data [get_attribute_params $content_type $attribute] + if { $attribute_data eq "" } { + set attribute_data [cms::form::get_attribute_params $content_type $attribute] } array set is_html $attribute_data @@ -1466,7 +1426,7 @@ -datatype $param(datatype) -section $section # changed from widget_is_required to param_is_required (OpenACS - DanW) - if { [string equal $param(param_is_required) f] } { + if { $param(param_is_required) eq "f" } { lappend command -optional } @@ -1476,7 +1436,7 @@ } -ad_proc -public content::add_content_element { +ad_proc -public cms::form::add_content_element { form_name content_method { prefix {}} @@ -1537,7 +1497,7 @@ } -ad_proc content::add_child_relation_element { form_name args } { +ad_proc cms::form::add_child_relation_element { form_name args } { Add a select box listing all valid child relation tags. The form must contain a parent_id element and a content_type element. @@ -1579,7 +1539,7 @@ } # Get the parent type. If the parent is not an item, abort - set parent_type [db_string get_parent_type ""] + set parent_type [content::item::get_content_type -item_id $parent_id] if { [template::util::is_nil parent_type] } { return @@ -1594,7 +1554,7 @@ # Create the section, if specified if { ![template::util::is_nil opts(section)] } { - set parent_title [db_string get_parent_title ""] + set parent_title [content::item::get_title -item_id $parent_id -is_live f] if { ![template::util::is_nil parent_title] } { template::form section $form_name "Relationship to $parent_title" @@ -1609,7 +1569,7 @@ } -ad_proc -private content::get_widget_param_value { +ad_proc -private cms::form::get_widget_param_value { array_ref {content_type content_revision} } { @@ -1672,7 +1632,7 @@ } -ad_proc -private content::get_type_attribute_params { args } { +ad_proc -private cms::form::get_type_attribute_params { args } { Query for attribute form metadata @@ -1704,7 +1664,7 @@ } -ad_proc -private content::get_attribute_params { content_type attribute_name } { +ad_proc -private cms::form::get_attribute_params { content_type attribute_name } { Query for parameters associated with a particular attribute @@ -1732,7 +1692,7 @@ } -ad_proc -private content::set_attribute_values { +ad_proc -private cms::form::set_attribute_values { form_name content_type revision_id attributes {prefix {}} } { @@ -1749,7 +1709,7 @@ } { if { [llength $attributes] == 0 } { - set attributes [get_attributes $content_type] + set attributes [cms::form::get_attributes $content_type] } # Assemble the list of columns to query, handling dates @@ -1798,7 +1758,7 @@ } -ad_proc -private content::set_content_value { form_name revision_id } { +ad_proc -private cms::form::set_content_value { form_name revision_id } { Set the default value for the content text area in an ATS form object based on a previous revision @@ -1808,14 +1768,14 @@ @param revision_id The revision ID of the content to revise } { + + set content [template::util::richtext::create [content::get_content_value $revision_id] {}] - set content [template::util::richtext::create [get_content_value $revision_id] {}] - template::element set_properties $form_name content -value $content } -ad_proc -private content::get_default_content_method { content_type } { +ad_proc -private cms::form::get_default_content_method { content_type } { Gets the content input method most appropriate for an content type, based on the MIME types that are registered for that content type. @@ -1824,23 +1784,20 @@ } { - set is_text [db_string count_mime_type ""] - - if { $is_text > 0 } { - set content_method text_entry + if { [cms::type::has_text_mime_types_p -content_type $content_type] } { + return text_entry } else { - set content_method file_upload + return file_upload } - return $content_method } # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * # Procedure wrappers for basic ACS Object and Content Repository queries # * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -ad_proc -private content::get_type_info { object_type ref args } { +ad_proc -private cms::form::get_type_info { object_type ref args } { Return specified columns from the acs_object_types table. @@ -1864,7 +1821,7 @@ } -ad_proc -public content::get_object_id {} { +ad_proc -public cms::form::new_object_id {} { Grab an object ID for creating a new ACS object. @@ -1874,7 +1831,7 @@ } -ad_proc -private content::get_attributes { content_type args } { +ad_proc -private cms::form::get_attributes { content_type args } { Returns columns from the acs_attributes table for all attributes associated with a content type. @@ -1909,7 +1866,7 @@ } -ad_proc -public content::get_attribute_enum_values { attribute_id } { +ad_proc -public cms::form::get_attribute_enum_values { attribute_id } { Returns a list of { pretty_name enum_value } for an attribute of datatype enumeration. @@ -1924,22 +1881,8 @@ return $enum } -ad_proc -public content::get_latest_revision { item_id } { +ad_proc -public cms::form::add_basic_revision { item_id revision_id title args } { - Get the ID of the latest revision for the specified content item. - - @param item_id The ID of the content item. - -} { - - set latest_revision [db_string glr_get_latest_revision ""] - - return $latest_revision -} - - -ad_proc -public content::add_basic_revision { item_id revision_id title args } { - Create a basic new revision using the content_revision PL/SQL API. @param item_id @@ -1979,7 +1922,7 @@ } -ad_proc -private content::update_content_from_file { revision_id tmpfile } { +ad_proc -private cms::form::update_content_from_file { revision_id tmpfile } { Update the BLOB column of a revision with the contents of a file @@ -2001,26 +1944,14 @@ where revision_id = :revision_id)} if {[string equal $storage_type file]} { - db_dml upload_file_revision " - update cr_revisions - set filename = '[cr_create_content_file $item_id $revision_id $tmpfile]', - content_length = [file size $tmpfile] - where revision_id = :revision_id" + db_dml upload_file_revision {} } elseif {[string equal $storage_type text]} { # upload the file into the revision content - db_dml upload_text_revision "update cr_revisions - set content = empty_blob(), - content_length = [file size $tmpfile] where - revision_id = :revision_id - returning content into :1" -blob_files [list $tmpfile] + db_dml upload_text_revision {} -blob_files [list $tmpfile] } else { # upload the file into the revision content - db_dml upload_revision "update cr_revisions - set content = empty_blob(), - content_length = [file size $tmpfile] - where revision_id = :revision_id - returning content into :1" -blob_files [list $tmpfile] + db_dml upload_revision {} -blob_files [list $tmpfile] } # delete the tempfile @@ -2029,7 +1960,7 @@ -ad_proc -public content::copy_content { revision_id_src revision_id_dest } { +ad_proc -public cms::form::copy_content { revision_id_src revision_id_dest } { Update the BLOB column of one revision with the content of another revision @@ -2039,19 +1970,13 @@ @param revision_id_dest The object ID of the revision to be updated. copied. + @see only used by attributes-edit in the items module } { db_transaction { # copy the content from the source to the target - db_exec_plsql cc_copy_content { - begin - content_revision.content_copy ( - revision_id => :revision_id_src, - revision_id_dest => :revision_id_dest - ); - end; - } + db_exec_plsql cc_copy_content {} # fetch the mime_type of the source revision set mime_type [db_string cc_get_mime_type ""] @@ -2063,7 +1988,7 @@ } -ad_proc -public content::add_content { form_name revision_id } { +ad_proc -public cms::form::add_content { form_name revision_id } { Update the BLOB column of a revision with content submitted in a form @@ -2087,7 +2012,7 @@ } } -ad_proc -public content::validate_name { form_name } { +ad_proc -public cms::form::validate_name { form_name } { Make sure that name is unique for the folder Index: openacs-4/packages/cms/tcl/form-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/form-procs.xql,v diff -u -r1.9 -r1.9.12.1 --- openacs-4/packages/cms/tcl/form-procs.xql 19 Sep 2002 13:09:12 -0000 1.9 +++ openacs-4/packages/cms/tcl/form-procs.xql 31 Aug 2006 19:59:05 -0000 1.9.12.1 @@ -25,7 +25,7 @@ </querytext> </fullquery> -<partialquery name="content::query_form_metadata.attributes_query_extra_where"> +<partialquery name="cms::form::query_form_metadata.attributes_query_extra_where"> <querytext> and $extra_where @@ -43,15 +43,15 @@ </querytext> </fullquery> -<partialquery name="content::insert_element_data.ied_get_objects_tree_extra_where"> +<partialquery name="cms::form::insert_element_data.ied_get_objects_tree_extra_where"> <querytext> and $extra_where </querytext> </partialquery> -<partialquery name="content::insert_element_data.ied_get_objects_tree_order_by"> +<partialquery name="cms::form::insert_element_data.ied_get_objects_tree_order_by"> <querytext> order by @@ -60,7 +60,7 @@ </querytext> </partialquery> -<fullquery name="content::process_insert_statement.process_insert_statement"> +<fullquery name="cms::form::process_insert_statement.process_insert_statement"> <querytext> insert into $__last_table ( [join $__columns ", "] @@ -70,7 +70,7 @@ </querytext> </fullquery> -<fullquery name="content::add_revision.addrev_get_content_type"> +<fullquery name="cms::form::add_revision.addrev_get_content_type"> <querytext> select object_type as content_type, table_name from acs_object_types @@ -89,7 +89,7 @@ </querytext> </fullquery> -<fullquery name="content::add_content_element.get_text_mime_types"> +<fullquery name="cms::form::add_content_element.get_text_mime_types"> <querytext> select @@ -108,18 +108,9 @@ </querytext> </fullquery> -<fullquery name="content::add_child_relation_element.get_parent_type"> +<fullquery name="cms::form::get_widget_param_value.set_content_values"> <querytext> - select content_type from cr_items - where item_id = :parent_id - - </querytext> -</fullquery> - -<fullquery name="content::get_widget_param_value.set_content_values"> - <querytext> - $param(value) </querytext> @@ -138,7 +129,7 @@ </querytext> </fullquery> -<fullquery name="content::get_attribute_params.gap_get_attribute_data"> +<fullquery name="cms::form::get_attribute_params.gap_get_attribute_data"> <querytext> select @@ -153,7 +144,7 @@ </querytext> </fullquery> -<fullquery name="content::set_attribute_values.get_previous_version_values"> +<fullquery name="cms::form::set_attribute_values.get_previous_version_values"> <querytext> select @@ -166,18 +157,9 @@ </querytext> </fullquery> -<fullquery name="content::get_default_content_method.count_mime_type"> +<fullquery name="cms::form::get_type_info.get_type_info_1"> <querytext> - select count(*) from cr_content_mime_type_map - where content_type = :content_type and mime_type like 'text/%' - - </querytext> -</fullquery> - -<fullquery name="content::get_type_info.get_type_info_1"> - <querytext> - select $ref from @@ -220,7 +202,7 @@ </querytext> </fullquery> -<fullquery name="content::validate_name.vn_same_name_count1"> +<fullquery name="cms::form::validate_name.vn_same_name_count1"> <querytext> select count(1) @@ -230,7 +212,7 @@ </querytext> </fullquery> -<fullquery name="content::validate_name.vn_same_name_count2"> +<fullquery name="cms::form::validate_name.vn_same_name_count2"> <querytext> select count(1) Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/image-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/image-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/install-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/install-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/tcl/install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/install-procs.tcl,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/cms/tcl/install-procs.tcl 9 Jun 2005 21:15:26 -0000 1.1.2.2 +++ openacs-4/packages/cms/tcl/install-procs.tcl 31 Aug 2006 19:59:05 -0000 1.1.2.3 @@ -1,32 +1,226 @@ ad_library { - install callbacks + Install routines for CMS package } namespace eval cms::install {} +ad_proc -public cms::install::package_install {} { + Procedures to run on package installation +} { + + db_transaction { + # register callback implementations and create the basic workflow + cms::install::register_implementations + set workflow_id [cms::workflow::create] + ns_log debug "cms::install::package_install - workflow_id is $workflow_id" + + # add system roles for editors, authors and publishers + # roles will be mapped to subsite rel segments on package instantiation + # --Role-- --Pretty-- --Plural-- + set roles " [list author Author Authors] \ + [list editor Editor Editors] \ + [list publisher Publisher Publishers]" + + foreach {role pn pp} $roles { + + # Base existence check on existing role + if { ![db_0or1row role_exists {}] } { + db_1row new_role create_role {} + } + } + } +} + +ad_proc -public cms::install::package_uninstall {} { + Procedures to run on package uninstall (roles will remain in system) +} { + cms::workflow::delete + cms::install::unregister_implementations +} + ad_proc -public cms::install::package_instantiate { -package_id } { Procedures to run on package instantiation } { - # create modules for new instance + # create modules and clone workflow for new instance cm::modules::install::create_modules -package_id $package_id + cms::workflow::instance_workflow_create -package_id $package_id - set subsite_id [ad_conn subsite_id] + array set package_info [site_node::get_from_object_id -object_id $package_id] + set subsite_package [site_node::closest_ancestor_package -url $package_info(url) -element package_id] + array set subsite_info [site_node::get_from_object_id -object_id $subsite_package] + db_dml map_subsite {} - set subsite_dir "[acs_root_dir]/www" - append subsite_dir [site_node::get_url_from_object_id -object_id [ad_conn subsite_id]] + set subsite_dir "[acs_root_dir]/www/$subsite_info(url)" # check that directory exists and... if { ![file exists $subsite_dir] } { file mkdir $subsite_dir } # copy content delivery .vuh file to subsite root file copy -force [acs_root_dir]/packages/cms/www/index.vuh $subsite_dir - + + # set up subsite segments for for workflow + set app_group [application_group::group_id_from_package_id -package_id $subsite_package] + + set roles " [list author Author Authors] \ + [list editor Editor Editors] \ + [list publisher Publisher Publishers]" + set content_root [cm::modules::sitemap::getRootFolderID $subsite_package] + set template_root [cm::modules::templates::getRootFolderID $subsite_package] + + foreach { role pn pp } $roles { + set rel [rel_types::new -supertype membership_rel -role_one "" -role_two $role ${role}_rel_${subsite_package} \ + "$subsite_info(instance_name) $pn" "$subsite_info(instance_name) $pp" group 0 0 person 0 0] + rel_types::add_permissible application_group $rel + # MS: move to tcl API with 5.2 + db_dml update_group_rels {} + set segment [rel_segments_new $app_group $rel "$subsite_info(instance_name) $pp"] + switch $role { + publisher { + permission::grant -party_id $segment -object_id $content_root -privilege admin + permission::grant -party_id $segment -object_id $template_root -privilege admin + } + default { + permission::grant -party_id $segment -object_id $content_root -privilege read + permission::grant -party_id $segment -object_id $template_root -privilege read + permission::grant -party_id $segment -object_id $content_root -privilege create + permission::grant -party_id $segment -object_id $template_root -privilege create + permission::grant -party_id $segment -object_id $content_root -privilege write + permission::grant -party_id $segment -object_id $template_root -privilege write + } + } + } + + # register template folder with dav module + #set subsite_node [site_node::get_node_id_from_object_id -object_id [ad_conn subsite_id]] + #set templates_node [site_node::new -name templates -parent_id $subsite_node] + #oacs_dav::register_folder $templates_folder $templates_node } -ad_proc -public cms::install::package_uninstantiate { -package_id } { +ad_proc -public cms::install::package_uninstantiate { -package_id:required } { Procedures to run on package uninstantiation } { + # unregister template folder + #set subsite_url [site_node::get_url -node_id [site_node::get_node_id_from_object_id -object_id [ad_conn subsite_id]] -notrailing] + #array set template_node [site_node::get_from_url -url ${subsite_url}/templates] + #set template_root [cm::modules::templates::getRootFolderID $package_id $template_node(node_id)] + #oacs_dav::unregister_folder $template_root node_id + + # delete modules and workflow cm::modules::install::delete_modules -package_id $package_id + cms::workflow::instance_workflow_delete -package_id $package_id + + # remove index.vuh + set subsite_dir "[acs_root_dir]/www" + append subsite_dir [site_node::get_url_from_object_id -object_id [ad_conn subsite_id]] + file delete -force $subsite_dir/index.vuh } + + +##### +# +# Service contract implementations +# +##### + +ad_proc -private cms::install::register_implementations {} { + db_transaction { + cms::install::register_get_authors_impl + cms::install::register_get_editors_impl + cms::install::register_get_publishers_impl + cms::install::register_set_publish_status_impl + } +} + +ad_proc -private cms::install::unregister_implementations {} { + db_transaction { + + acs_sc::impl::delete \ + -contract_name [workflow::service_contract::role_default_assignees] \ + -impl_name "GetAuthors" + + acs_sc::impl::delete \ + -contract_name [workflow::service_contract::role_default_assignees] \ + -impl_name "GetEditors" + + acs_sc::impl::delete \ + -contract_name [workflow::service_contract::role_default_assignees] \ + -impl_name "GetPublishers" + + acs_sc::impl::delete \ + -contract_name [workflow::service_contract::action_side_effect] \ + -impl_name "SetPublishStatus" + + } +} + +ad_proc -private cms::install::register_get_authors_impl {} { + + set spec { + name "GetAuthors" + aliases { + GetObjectType cms::workflow::object_type + GetPrettyName cms::workflow::get_authors::pretty_name + GetAssignees cms::workflow::get_authors::get_assignees + } + } + + lappend spec contract_name [workflow::service_contract::role_default_assignees] + lappend spec owner [cms::package_key] + + acs_sc::impl::new_from_spec -spec $spec +} + +ad_proc -private cms::install::register_get_editors_impl {} { + + set spec { + name "GetEditors" + aliases { + GetObjectType cms::workflow::object_type + GetPrettyName cms::workflow::get_editors::pretty_name + GetAssignees cms::workflow::get_editors::get_assignees + } + } + + lappend spec contract_name [workflow::service_contract::role_default_assignees] + lappend spec owner [cms::package_key] + + acs_sc::impl::new_from_spec -spec $spec +} + +ad_proc -private cms::install::register_get_publishers_impl {} { + + set spec { + name "GetPublishers" + aliases { + GetObjectType cms::workflow::object_type + GetPrettyName cms::workflow::get_publishers::pretty_name + GetAssignees cms::workflow::get_publishers::get_assignees + } + } + + lappend spec contract_name [workflow::service_contract::role_default_assignees] + lappend spec owner [cms::package_key] + + acs_sc::impl::new_from_spec -spec $spec +} + +ad_proc -private cms::install::register_set_publish_status_impl {} { + + set spec { + name "SetPublishStatus" + aliases { + GetObjectType cms::workflow::object_type + GetPrettyName cms::workflow::set_publish_status::pretty_name + DoSideEffect cms::workflow::set_publish_status::set_status + } + } + + lappend spec contract_name [workflow::service_contract::action_side_effect] + lappend spec owner [cms::package_key] + + acs_sc::impl::new_from_spec -spec $spec +} + + Index: openacs-4/packages/cms/tcl/install-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/Attic/install-procs.xql,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/cms/tcl/install-procs.xql 9 Jun 2005 21:15:26 -0000 1.1.2.1 +++ openacs-4/packages/cms/tcl/install-procs.xql 31 Aug 2006 19:59:05 -0000 1.1.2.2 @@ -1,12 +1,27 @@ <?xml version="1.0"?> <queryset> +<fullquery name="cms::install::package_install.role_exists"> + <querytext> + select r.pretty_name from acs_rel_roles r where r.role=:role + </querytext> +</fullquery> + +<fullquery name="cms::install::package_instantiate.update_group_rels"> + <querytext> + insert into group_rels + (group_rel_id, group_id, rel_type) + values + (acs_object_id_seq.nextval,:app_group,:rel); + </querytext> +</fullquery> + <fullquery name="cms::install::package_instantiate.map_subsite"> <querytext> insert into cms_subsite_package_map (subsite_id,package_id) values - (:subsite_id,:package_id) + (:subsite_package,:package_id) </querytext> </fullquery> Fisheye: Tag 1.10.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/item-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/item-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/perm-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/perm-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/perm-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/perm-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/tcl/publish-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs-oracle.xql,v diff -u -r1.3 -r1.3.14.1 --- openacs-4/packages/cms/tcl/publish-procs-oracle.xql 17 Sep 2001 05:16:40 -0000 1.3 +++ openacs-4/packages/cms/tcl/publish-procs-oracle.xql 31 Aug 2006 19:59:05 -0000 1.3.14.1 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>oracle</type><version>8.1.6</version></rdbms> -<fullquery name="publish::track_publish_status.tps_get_items_multilist"> +<fullquery name="cms::publish::track_publish_status.tps_get_items_multilist"> <querytext> select @@ -23,7 +23,7 @@ </fullquery> -<fullquery name="publish::track_publish_status.tps_get_items_onelist"> +<fullquery name="cms::publish::track_publish_status.tps_get_items_onelist"> <querytext> select Index: openacs-4/packages/cms/tcl/publish-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs-postgresql.xql,v diff -u -r1.4 -r1.4.14.1 --- openacs-4/packages/cms/tcl/publish-procs-postgresql.xql 17 Sep 2001 05:16:40 -0000 1.4 +++ openacs-4/packages/cms/tcl/publish-procs-postgresql.xql 31 Aug 2006 19:59:05 -0000 1.4.14.1 @@ -5,7 +5,7 @@ -<fullquery name="publish::track_publish_status.tps_get_items_multilist"> +<fullquery name="cms::publish::track_publish_status.tps_get_items_multilist"> <querytext> select @@ -25,7 +25,7 @@ </fullquery> -<fullquery name="publish::track_publish_status.tps_get_items_onelist"> +<fullquery name="cms::publish::track_publish_status.tps_get_items_onelist"> <querytext> select Index: openacs-4/packages/cms/tcl/publish-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/publish-procs.tcl,v diff -u -r1.16.2.1 -r1.16.2.2 --- openacs-4/packages/cms/tcl/publish-procs.tcl 6 Jun 2005 17:05:58 -0000 1.16.2.1 +++ openacs-4/packages/cms/tcl/publish-procs.tcl 31 Aug 2006 19:59:05 -0000 1.16.2.2 @@ -1,19 +1,18 @@ -############################################################### -# -# @namespace publish -# -# @author Stanislav Freidin -# -# The procs in this namespace are useful for publishing items, -# including items inside other items, and writing items to the -# filesystem. <p> -# Specifically, the <tt>content</tt>, <tt>child</tt> and -# <tt>relation</tt> 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. <p> + Specifically, the <tt>content</tt>, <tt>child</tt> and + <tt>relation</tt> 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 -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 @@ <?xml version="1.0"?> <queryset> -<fullquery name="publish::set_publish_status.sps_update_cr_items"> +<fullquery name="cms::publish::set_publish_status.sps_update_cr_items"> <querytext> update cr_items set publish_status = :new_status where item_id = :item_id </querytext> </fullquery> -<fullquery name="publish::schedule_status_sweep.get_package_ids"> +<fullquery name="cms::publish::schedule_status_sweep.get_package_ids"> <querytext> select package_id from apm_packages where package_key = 'cms' </querytext> Index: openacs-4/packages/cms/tcl/rel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/rel-procs.tcl,v diff -u -r1.5 -r1.5.8.1 --- openacs-4/packages/cms/tcl/rel-procs.tcl 17 May 2003 10:23:15 -0000 1.5 +++ openacs-4/packages/cms/tcl/rel-procs.tcl 31 Aug 2006 19:59:05 -0000 1.5.8.1 @@ -1,9 +1,11 @@ -# @namespace cms_rel -# Procedures for managing relation items and child items +ad_library { + Procedures for managing related/child items +} -namespace eval cms_rel {} +# @namespace cms::rel +namespace eval cms::rel {} -ad_proc -public cms_rel::sort_related_item_order { item_id } { +ad_proc -public cms::rel::sort_related_item_order { item_id } { @public sort_related_item_order @@ -35,7 +37,7 @@ } -ad_proc -public cms_rel::sort_child_item_order { item_id } { +ad_proc -public cms::rel::sort_child_item_order { item_id } { @public sort_child_item_order Index: openacs-4/packages/cms/tcl/rel-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/rel-procs.xql,v diff -u -r1.2 -r1.2.8.1 --- openacs-4/packages/cms/tcl/rel-procs.xql 17 May 2003 10:23:15 -0000 1.2 +++ openacs-4/packages/cms/tcl/rel-procs.xql 31 Aug 2006 19:59:05 -0000 1.2.8.1 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <queryset> -<fullquery name="cms_rel::sort_related_item_order.get_related_items"> +<fullquery name="cms::rel::sort_related_item_order.get_related_items"> <querytext> select @@ -17,7 +17,7 @@ </fullquery> -<fullquery name="cms_rel::sort_related_item_order.reorder"> +<fullquery name="cms::rel::sort_related_item_order.reorder"> <querytext> update cr_item_rels set order_n = :i @@ -26,7 +26,7 @@ </fullquery> -<fullquery name="cms_rel::sort_child_item_order.get_child_order"> +<fullquery name="cms::rel::sort_child_item_order.get_child_order"> <querytext> select @@ -41,7 +41,7 @@ </querytext> </fullquery> -<fullquery name="cms_rel::sort_child_item_order.reorder"> +<fullquery name="cms::rel::sort_child_item_order.reorder"> <querytext> update cr_child_rels set order_n = :i Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/template-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/template-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/template-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/type-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/type-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/type-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/type-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/tcl/widget-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/widget-procs-postgresql.xql,v diff -u -r1.1 -r1.1.14.1 --- openacs-4/packages/cms/tcl/widget-procs-postgresql.xql 11 Aug 2001 17:41:34 -0000 1.1 +++ openacs-4/packages/cms/tcl/widget-procs-postgresql.xql 31 Aug 2006 19:59:05 -0000 1.1.14.1 @@ -3,7 +3,7 @@ <queryset> <rdbms><type>postgresql</type><version>7.1</version></rdbms> -<fullquery name="widget::process_param.pp_proces_param"> +<fullquery name="cms::widget::process_param.pp_proces_param"> <querytext> select cm_form_widget__set_attribute_param_value (:content_type, :attribute_name, :param_$order, :param_value_$order, :param_type_$order, :param_source_$order) Index: openacs-4/packages/cms/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/widget-procs.tcl,v diff -u -r1.4 -r1.4.14.1 --- openacs-4/packages/cms/tcl/widget-procs.tcl 20 Aug 2001 04:35:42 -0000 1.4 +++ openacs-4/packages/cms/tcl/widget-procs.tcl 31 Aug 2006 19:59:05 -0000 1.4.14.1 @@ -1,14 +1,11 @@ +ad_library { + Procedures for generating and processing metadata form widgets, editing + attribute widgets +} -# @namespace widget +namespace eval cms::widget {} -# Procedures for generating and processing metadata form widgets, editing -# attribute widgets - -namespace eval widget {} - - - -ad_proc -public widget::param_element_create { form param order param_id \ +ad_proc -public cms::widget::param_element_create { form param order param_id \ {default ""} {is_required ""} {param_source ""}} { @public param_element_create @@ -51,7 +48,7 @@ -ad_proc -private widget::create_param_type { form order } { +ad_proc -private cms::widget::create_param_type { form order } { @private create_param_type @@ -77,7 +74,7 @@ -ad_proc -private widget::create_param_source { form order param_source } { +ad_proc -private cms::widget::create_param_source { form order param_source } { @private create_param_source @@ -101,7 +98,7 @@ } -ad_proc -private widget::create_param_value { form order default is_required } { +ad_proc -private cms::widget::create_param_value { form order default is_required } { @private create_param_value @@ -137,7 +134,7 @@ } -ad_proc -private widget::create_text_param { form order default is_required param_source} { +ad_proc -private cms::widget::create_text_param { form order default is_required param_source} { @private create_text_param @@ -159,15 +156,15 @@ -widget hidden \ -value "onevalue" - widget::create_param_source $form $order $param_source - widget::create_param_value $form $order $default $is_required + cms::widget::create_param_source $form $order $param_source + cms::widget::create_param_value $form $order $default $is_required } -ad_proc -private widget::create_options_param { form order default is_required \ +ad_proc -private cms::widget::create_options_param { form order default is_required \ param_source} { @private create_options_param @@ -192,13 +189,13 @@ -widget hidden \ -value "multilist" - widget::create_param_source $form $order $param_source - widget::create_param_value $form $order $default $is_required + cms::widget::create_param_source $form $order $param_source + cms::widget::create_param_value $form $order $default $is_required } -ad_proc -private widget::create_values_param { form order default is_required param_source} { +ad_proc -private cms::widget::create_values_param { form order default is_required param_source} { @private create_values_param @@ -222,15 +219,15 @@ -widget hidden \ -value "onelist" - widget::create_param_source $form $order $param_source - widget::create_param_value $form $order $default $is_required + cms::widget::create_param_source $form $order $param_source + cms::widget::create_param_value $form $order $default $is_required } -ad_proc -private widget::process_param { form order content_type attribute_name } { +ad_proc -private cms::widget::process_param { form order content_type attribute_name } { @private process_param @@ -250,17 +247,7 @@ param_source_$order param_value_$order - db_exec_plsql pp_proces_param " - begin - cm_form_widget.set_attribute_param_value ( - content_type => :content_type, - attribute_name => :attribute_name, - param => :param_$order, - param_type => :param_type_$order, - param_source => :param_source_$order, - value => :param_value_$order - ); - end;" + db_exec_plsql pp_proces_param {} } Fisheye: Tag 1.11.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/workflow-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/workflow-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/bookmark.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/bookmark.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/error.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/error.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/head.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/head.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/head.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/master.adp,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/cms/www/master.adp 6 Jun 2005 15:39:10 -0000 1.6.2.1 +++ openacs-4/packages/cms/www/master.adp 31 Aug 2006 19:59:05 -0000 1.6.2.2 @@ -94,8 +94,5 @@ </div> </div> -<div id="subnavbar-body"> - <slave> -</div> \ No newline at end of file Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/table-footer.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/table-footer.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/table-header.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/table-header.tcl'. Fisheye: No comparison available. Pass `N' to diff? 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 -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 -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 @@ <p/> -<include src="../../bookmark" mount_point="@mount_point@" id="@original_id@"> +<include src="/packages/cms/lib/clip" mount_point="@mount_point@" id="@original_id@"> @page_title;noquote@ Index: openacs-4/packages/cms/www/modules/categories/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/categories/index.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/cms/www/modules/categories/index.tcl 6 Jun 2005 17:07:23 -0000 1.6.2.1 +++ openacs-4/packages/cms/www/modules/categories/index.tcl 31 Aug 2006 19:59:05 -0000 1.6.2.2 @@ -59,7 +59,7 @@ } set page_title "$info(heading) $what" -set clip [clipboard::parse_cookie] +set clip [cms::clipboard::parse_cookie] template::list::create \ -name items \ @@ -95,5 +95,5 @@ } set id $keyword_id set keyword_url [export_vars -base index?mount_point=categories { id parent_id }] - set copy [clipboard::ui::render_bookmark categories $keyword_id [ad_conn package_url]] + set copy [cms::clipboard::ui::render_bookmark categories $keyword_id [ad_conn package_url]] } Index: openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl 6 Jun 2005 17:07:23 -0000 1.4.2.1 +++ openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl 31 Aug 2006 19:59:05 -0000 1.4.2.2 @@ -14,9 +14,9 @@ # Preserve the item_id since the clipboard::parse_cookie wil overwrite it set saved_item_id $item_id -set clip [clipboard::parse_cookie] +set clip [cms::clipboard::parse_cookie] db_transaction { - clipboard::map_code $clip categories { + cms::clipboard::map_code $clip categories { if { [catch { db_exec_plsql assign_keyword { @@ -28,6 +28,6 @@ } } -clipboard::free $clip +cms::clipboard::free $clip template::forward "../items/index?item_id=$saved_item_id&mount_point=$mount_point" Index: openacs-4/packages/cms/www/modules/categories/move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/categories/move.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/cms/www/modules/categories/move.tcl 12 Apr 2005 21:45:42 -0000 1.3 +++ openacs-4/packages/cms/www/modules/categories/move.tcl 31 Aug 2006 19:59:05 -0000 1.3.2.1 @@ -15,11 +15,11 @@ set update_value "$target_id" } -set clip [clipboard::parse_cookie] +set clip [cms::clipboard::parse_cookie] db_transaction { - clipboard::map_code $clip $mount_point { + cms::clipboard::map_code $clip $mount_point { if { [catch { db_dml move_keyword_item {} db_dml move_keyword_keyword {} @@ -29,7 +29,7 @@ } } -clipboard::free $clip +cms::clipboard::free $clip set id $target_id ad_returnredirect [export_vars -base index {id mount_point}] Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/clipboard/add.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/clipboard/clear-clipboard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/clipboard/clear-clipboard.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/cms/www/modules/clipboard/clear-clipboard.tcl 9 May 2005 23:45:14 -0000 1.3 +++ openacs-4/packages/cms/www/modules/clipboard/clear-clipboard.tcl 31 Aug 2006 19:59:05 -0000 1.3.2.1 @@ -6,5 +6,5 @@ {float_p "0"} } -#clipboard::clear_cookie -#ns_returnredirect "index" \ No newline at end of file +ad_set_cookie content_marks +ad_returnredirect "index" \ No newline at end of file Index: openacs-4/packages/cms/www/modules/clipboard/floating.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/clipboard/floating.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/clipboard/floating.tcl 16 Nov 2004 22:32:48 -0000 1.1 +++ openacs-4/packages/cms/www/modules/clipboard/floating.tcl 31 Aug 2006 19:59:05 -0000 1.1.2.1 @@ -2,7 +2,7 @@ set heads [ad_conn headers] set package_url [ad_conn package_url] -set clipboardfloats_p [clipboard::floats_p] +set clipboardfloats_p [cms::clipboard::ui::floats_p] for { set i 0 } { $i < [ns_set size $heads] } { incr i } { ns_log notice "[ns_set key $heads $i] = [ns_set value $heads $i]" @@ -34,14 +34,14 @@ # The cookie for the clipboard looks like this: # mnt:id,id,id|mnt:id,id,id|mnt:id,id,id. -set clip [clipboard::parse_cookie] +set clip [cms::clipboard::parse_cookie] -set total_items [clipboard::get_total_items $clip] -set user_id [User::getID] +set total_items [cms::clipboard::get_total_items $clip] +set user_id [auth::require_login] if { ![util::is_nil id] } { - set item_id_list [clipboard::get_items $clip $id] + set item_id_list [cms::clipboard::get_items $clip $id] ns_log Notice "item_id_list = [join $item_id_list ","]" # First, attempt to ask the module for the list of item paths in sorted order Index: openacs-4/packages/cms/www/modules/clipboard/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/clipboard/index.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/clipboard/index.adp 17 May 2005 22:13:52 -0000 1.5 +++ openacs-4/packages/cms/www/modules/clipboard/index.adp 31 Aug 2006 19:59:05 -0000 1.5.2.1 @@ -1,24 +1,13 @@ <master src="../../master"> <property name="title">Clipboard</property> -<script language=javascript> - - top.treeFrame.setCurrentFolder('@mount_point@', '@id@', '@parent_id@'); - - function mark_and_reload(mount_point, id) { - mark('@package_url@', mount_point, id, '@clipboardfloats_p@'); - window.location.reload(); - } - -</script> - <p/> Clipboard <p/> - Browse and delete from the clipboard below + Manage items on the clipboard <p/> @@ -97,47 +86,24 @@ </div> <div id="subnavbar-body"> - <if @id@ nil> - - <if @total_items@ gt 0> - <p>There are a total of @total_items@ items on the clipboard. Select one of - the mount points on the left to view a list of clipped items for the - mount point.</p> - - <p><a href="clear-clipboard">Clear the clipboard</a></p> - - </if> - <else> - There are no items on the clipboard. - </else> - + <div id="section"> + <div id="section-header">Clipboard Main Menu</div> + <if @total_items@ gt 0> + <p>There @total_items_string@ on the clipboard. You may select one of + the mount points on the left to view a list of marked items for the + mount point or <a href="clear-clipboard">clear the clipboard</a>.</p> + </if> + <else> + <p>There are no items on the clipboard.</p> + </else> + </div> </if> <else> -<h2>Clipped Items</h2> - -<if @items:rowcount@ gt 0> - - <table border=0 cellpadding=4 cellspacing=0> - - <multiple name=items> - <tr> - <td> - <a href="javascript:mark_and_reload('@id@', '@items.item_id@')"><img - src="../../resources/Delete24.gif" width=24 height=24 - border=0></a> - </td> - <td> - <a href="@items.url@">@items.item_path@</a> - </td> - </tr> - </multiple> - </table> -</if> -<else><p><i>No items</i></p></else> - + <div id="section"> + <div id="section-header">Marked Items</div> + <listtemplate name="marked_items"></listtemplate> + </div> </else> -</body> -</html> Index: openacs-4/packages/cms/www/modules/clipboard/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/clipboard/index.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/cms/www/modules/clipboard/index.tcl 6 Jun 2005 17:07:23 -0000 1.6.2.1 +++ openacs-4/packages/cms/www/modules/clipboard/index.tcl 31 Aug 2006 19:59:05 -0000 1.6.2.2 @@ -1,101 +1,107 @@ -# Display a list of items on the clipboard +ad_page_contract { + Display a list of items on the clipboard -set heads [ad_conn headers] -set package_url [ad_conn package_url] -set clipboardfloats_p [clipboard::floats_p] - -for { set i 0 } { $i < [ns_set size $heads] } { incr i } { - ns_log notice "[ns_set key $heads $i] = [ns_set value $heads $i]" + @author Michael Steigman + @creation-date March 2006 +} { + { id ""} + { parent_id:integer ""} + { mount_point:optional "clipboard" } + { clip_tab "main"} } -request create -request set_param id -datatype keyword -optional -request set_param parent_id -datatype keyword -optional -request set_param state -datatype text -param -optional -value [list] -request set_param mount_point -datatype keyword -optional -value clipboard -request set_param clip_tab -datatype keyword -optional -value main +set user_id [auth::require_login] +set package_url [ad_conn package_url] +set clipboardfloats_p [cms::clipboard::ui::floats_p] +# set heads [ad_conn headers] +# for { set i 0 } { $i < [ns_set size $heads] } { incr i } { +# ns_log debug "clipboard/index.tcl: [ns_set key $heads $i] = [ns_set value $heads $i]" +# } + # using the tabs to set the page id; # then making sure that the tabs display the correct page -if {![template::util::is_nil clip_tab]} { - if {$clip_tab == "main" } { - set id "" - } else { - set id $clip_tab - } -} - -if {$id == "" } { - set curr_tab main +if { $clip_tab eq "main" } { + set id "" } else { - set curr_tab $id + set id $clip_tab } # The cookie for the clipboard looks like this: # mnt:id,id,id|mnt:id,id,id|mnt:id,id,id. - -set clip [clipboard::parse_cookie] - -set total_items [clipboard::get_total_items $clip] -set user_id [auth::require_login] - -if { ![util::is_nil id] } { - - set item_id_list [clipboard::get_items $clip $id] - ns_log Notice "item_id_list = [join $item_id_list ","]" - - # First, attempt to ask the module for the list of item paths in sorted order - # Could fail because of some SQL error or because the procedure does not exist - - if { [catch { - cm::modules::${id}::getSortedPaths items $item_id_list \ - [cm::modules::${id}::getRootFolderID [ad_conn subsite_id]] - - template::multirow extend items url - template::multirow foreach items { - switch $item_type { - content_template { - set url "../templates/properties?id=$item_id" - } - party { - set url "../$id/index?id=" - } - user { - set url "../$id/one-user?id=$item_id" - } - default { - set url "../$id/index?id=$item_id" - } - } - # this is for all items in the sitemap that need to be listed under the - # item folder - if {$id == "sitemap" && $item_type != "content_folder"} { - set url "../items/index?item_id=$item_id" - } - append url "&mount_point=$id" - } - } errmsg ] } { - # Process the list manually. Path information will not be shown, but at least - # the names will be - - ns_log Warning "CLIPBOARD ERROR: $errmsg" - template::multirow create items item_id item_path item_type url - - foreach item_id $item_id_list { - if { [string equal $item_id "content_revision"] && [string equal $id "types"] } { - set link_id "" - set item_path "Basic Item" - } else { - set link_id $item_id - set item_path [folderAccess name [getFolder $user_id $id $link_id state]] - } - set item_type "" - set url "../$id/index?id=$link_id" - - template::multirow append items $item_id $item_path $item_type $url - } - } +# i.e., %22%22%7Csitemap%3A1254%7Ctemplates%3A1337%2C1441%7Ctypes%3Acontent_revision +# where %3A = : and %7C = | +set clip [cms::clipboard::parse_cookie] +set total_items [cms::clipboard::get_total_items $clip] +set total_items_string [ad_decode $total_items 1 "is a total of 1 item" \ + "are a total of $total_items items"] +if { $id ne "" } { + + template::list::create \ + -name marked_items \ + -multirow marked_items \ + -key item_id \ + -no_data "No items of this type on the clipboard" \ + -bulk_actions [list "Remove" \ + "remove-items" \ + "Remove checked types from the clipboard"] \ + -bulk_action_export_vars {mount_point clip_tab} \ + -elements { + title { + label "Title" + link_url_col item_url + } + type { + label "Type" + } + path { + label "Path" + } + } + + template::multirow create marked_items item_id title type path item_url + set item_list [cms::clipboard::get_items $clip $id] + ns_log notice " ------------------> $item_list" + foreach item $item_list { + switch $id { + sitemap - templates { + set title [content::item::get_title -item_id $item] + set type [content::item::content_type -item_id $item] + set path [content::item::get_path -item_id $item] + switch $type { + content_folder { + set base_url "../${id}/index" + set item_var folder_id + } + content_template { + set base_url "../templates/properties" + set item_var item_id + } + default { + set base_url "../items/index" + set item_var item_id + } + } + } + types { + set title [cms::type::pretty_name -content_type $item] + set type "$item" + set path "N/A" + set base_url "../types/index" + set item_var content_type + } + categories { + set title [content::keyword::get_heading -keyword_id $item] + set type "keyword" + set path "N/A" + set base_url "../categories/index" + set item_var id + } + } + set $item_var $item + set item_url [export_vars -base $base_url $item_var ] + template::multirow append marked_items $item $title $type $path $item_url + } } -set url [ad_conn url] -append url "?mount_point=clipboard&id=$id&parent_id=$parent_id&refresh_tree=f" +cms::clipboard::free $clip Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/clipboard/list.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/clipboard/remove-items.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/clipboard/remove.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/assign-keywords.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/assign-keywords.tcl,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/cms/www/modules/items/assign-keywords.tcl 6 Jun 2005 17:07:23 -0000 1.4.2.1 +++ openacs-4/packages/cms/www/modules/items/assign-keywords.tcl 31 Aug 2006 19:59:06 -0000 1.4.2.2 @@ -17,10 +17,10 @@ set root_id $id } -set clip [clipboard::parse_cookie] +set clip [cms::clipboard::parse_cookie] db_transaction { - clipboard::map_code $clip categories { + cms::clipboard::map_code $clip categories { if { [catch { db_exec_plsql item_assign {} lappend folder_list [list $mount_point $item_id] @@ -30,7 +30,7 @@ } -clipboard::free $clip +cms::clipboard::free $clip # Specify a null id so that the entire branch will be refreshed template::forward "index?item_id=$id&mount_point=$mount_point" Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/attributes-edit-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/attributes-edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/attributes-edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/attributes-edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/attributes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes.adp,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/cms/www/modules/items/attributes.adp 6 Jun 2005 15:49:13 -0000 1.3.2.1 +++ openacs-4/packages/cms/www/modules/items/attributes.adp 31 Aug 2006 19:59:06 -0000 1.3.2.2 @@ -1,7 +1,4 @@ -<div id=section-header>Content Attributes - - Revision @info.revision_number@ of @info.revision_count@ - <if @info.live_revision@ eq @revision_id@> (Live)</if> -</div> +<div id=section-header>Attributes</div> <p/> Index: openacs-4/packages/cms/www/modules/items/attributes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/attributes.tcl,v diff -u -r1.11.2.4 -r1.11.2.5 --- openacs-4/packages/cms/www/modules/items/attributes.tcl 18 May 2005 21:20:56 -0000 1.11.2.4 +++ openacs-4/packages/cms/www/modules/items/attributes.tcl 31 Aug 2006 19:59:06 -0000 1.11.2.5 @@ -1,10 +1,4 @@ # display the attributes of an item - -request create -params { - revision_id -datatype integer - mount_point -datatype keyword -optional -value sitemap -} - # query the content type and table so we know which view to examine db_0or1row get_type_info "" -column_array type_info @@ -39,22 +33,20 @@ template::list::create \ -name attributes \ -multirow attributes \ - -actions [list "Edit item attributes" \ - "attributes-edit?item_id=$info(item_id)" \ - "Edit item attributes"] \ -elements { attribute_label { label "Attribute" + html { width 20% } } + object_label { + label "From Content Type" + html { width 20% } + } attribute_value { label "Value" display_template "@attributes.attribute_value;noquote@" - html { width 50% } + html { width 60% } } - object_label { - label "Origin" - html { width 10% } - } } db_multirow -extend { attribute_value } attributes get_attributes "" { Index: openacs-4/packages/cms/www/modules/items/children.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/children.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/items/children.tcl 17 May 2005 21:25:08 -0000 1.7 +++ openacs-4/packages/cms/www/modules/items/children.tcl 31 Aug 2006 19:59:06 -0000 1.7.2.1 @@ -1,15 +1,8 @@ -# Display information about items for which the item is the context. +# expects item_id and (optionally) mount_point -# page variables -request create -params { - item_id -datatype integer - mount_point -datatype keyword -optional -value sitemap -} +set user_id [ad_conn user_id] +set return_url [ad_return_url] -set user_id [auth::require_login] -permission::require_permission -party_id $user_id \ - -object_id $item_id -privilege read - # create a form to add child items... set child_types [db_list_of_lists get_child_types ""] @@ -20,6 +13,8 @@ form create add_child -method get -action create-1 element create add_child parent_id -datatype integer \ -widget hidden -value $item_id + element create add_child return_url -datatype text \ + -widget hidden -value $return_url element create add_child content_type -datatype keyword \ -options $child_types -widget select } @@ -36,16 +31,17 @@ "[export_vars -base unrelate-item?mount_point=sitemap { rel_id }]" \ "Remove marked relations from this item"] \ -elements { - content_type { - label "Content Type" - } - title_url { + title { label "Title" - display_template "<a href=\"@children.title_url@\" title=\"View content item\">@children.title@</a>" + link_url_col title_url + link_html { title "View child item" } } type_name { label "Relationship Type" } + content_type { + label "Content Type" + } tag { label "Tag" } @@ -58,6 +54,6 @@ db_multirow -extend { title_url relation_view_url move_up_url move_down_url reorder } children get_children "" { set title_url "index?item_id=$item_id&mount_point=$mount_point" - set move_up_url "relate-order?rel_id=$rel_id&order=up&mount_point=$mount_point&item_props_tab=children&relation_type=relation" - set move_down_url "relate-order?rel_id=$rel_id&order=down&mount_point=$mount_point&item_props_tab=children&relation_type=relation" + set move_up_url "relate-order?rel_id=$rel_id&order=up&mount_point=$mount_point&tab=children&relation_type=relation" + set move_down_url "relate-order?rel_id=$rel_id&order=down&mount_point=$mount_point&tab=children&relation_type=relation" } Index: openacs-4/packages/cms/www/modules/items/content-add-1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-add-1.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/cms/www/modules/items/content-add-1.tcl 13 Apr 2005 20:15:19 -0000 1.6 +++ openacs-4/packages/cms/www/modules/items/content-add-1.tcl 31 Aug 2006 19:59:06 -0000 1.6.2.1 @@ -27,7 +27,7 @@ # get associated content methods set content_methods \ - [content_method::get_content_methods $content_type -get_labels] + [cms::type::get_content_methods $content_type -get_labels] # filter out xml_import and no_content set filtered_content_methods [list] Fisheye: Tag 1.3.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/content-download-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/content-download-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/content-download.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-download.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/cms/www/modules/items/content-download.tcl 13 Apr 2005 20:15:19 -0000 1.6 +++ openacs-4/packages/cms/www/modules/items/content-download.tcl 31 Aug 2006 19:59:06 -0000 1.6.2.1 @@ -1,17 +1,13 @@ -# download.tcl -# -# see if this person is authorized to read the file in question -# and if so, write it to the connection. +ad_page_contract { + see if this person is authorized to read the file in question -template::request create -template::request set_param revision_id -datatype integer +} { + { item_id:integer } + { revision_id:integer } +} -db_1row get_iteminfo "" - -# item_id, is_live - -# check cm permissions on file -if { ![string equal $is_live t] } { +# check permissions on file +if { ![content::revision::is_live -revision_id $revision_id] } { permission::require_permission -party_id [auth::require_login] \ -object_id $item_id -privilege read } Index: openacs-4/packages/cms/www/modules/items/content-method-links.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/content-method-links.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.14.1 --- openacs-4/packages/cms/www/modules/items/content-method-links.tcl 20 Apr 2001 20:51:10 -0000 1.1.1.1 +++ openacs-4/packages/cms/www/modules/items/content-method-links.tcl 31 Aug 2006 19:59:06 -0000 1.1.1.1.14.1 @@ -15,7 +15,7 @@ # get the list of associated content methods set content_methods \ - [content_method::get_content_methods $content_type -get_labels] + [cms::type::get_content_methods $content_type -get_labels] set content_method_count [llength $content_methods] Index: openacs-4/packages/cms/www/modules/items/create-1.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-1.adp,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/cms/www/modules/items/create-1.adp 16 May 2005 22:59:24 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/create-1.adp 31 Aug 2006 19:59:06 -0000 1.3.2.1 @@ -1,10 +1,9 @@ <master src="../../master"> <property name="title">@page_title;noquote@</property> - <div id=section> - <div id=section-header>@page_title@</div> - <p/> - <formtemplate id="choose_content_method"></formtemplate> - </div> +<h2>@page_title@</h2> +<p/> +<formtemplate id="choose_content_method"></formtemplate> + Index: openacs-4/packages/cms/www/modules/items/create-1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-1.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/cms/www/modules/items/create-1.tcl 6 Jun 2005 17:07:23 -0000 1.5.2.1 +++ openacs-4/packages/cms/www/modules/items/create-1.tcl 31 Aug 2006 19:59:06 -0000 1.5.2.2 @@ -1,15 +1,19 @@ -# create-1.tcl -# choose from (no content, file upload, text entry, xml import) -# then forward to create-2 or revision-upload +ad_page_contract { -request create -request set_param content_type -datatype keyword -value "content_revision" -request set_param mount_point -datatype keyword -value "sitemap" -request set_param parent_id -datatype integer -optional + create-1.tcl + choose content method from (no content, file upload, text entry, xml import) + then forward to create-2 or revision-upload +} { + { content_type:optional "content_revision" } + { mount_point:optional "sitemap" } + { parent_id:optional "" } + { return_url:optional "" } +} + # Manually set the value since the templating system is still broken in # the -value flag -if { [template::util::is_nil parent_id] } { +if { $parent_id eq "" } { set parent_id [cm::modules::${mount_point}::getRootFolderID [ad_conn subsite_id]] } @@ -24,34 +28,37 @@ } -set content_type_name [db_string get_content_typ_name ""] +set content_type_name [cms::type::pretty_name -content_type $content_type] set page_title "Create a New $content_type_name" -if { [template::util::is_nil content_type_name] } { +if { $content_type_name eq "" } { template::request::error bad_content_type \ "create-1.tcl - Bad content type - $content_type" } # get the list of associated content methods -set content_methods \ - [content_method::get_content_methods $content_type -get_labels] +set content_methods [cms::type::get_content_methods $content_type -get_labels] set first_method [lindex [lindex $content_methods 0] 1] set first_label [lindex [lindex $content_methods 0] 0] -form create choose_content_method -form section choose_content_method "Choose Content Creation Method" +form create choose_content_method -cancel_url $return_url element create choose_content_method parent_id \ - -datatype integer \ - -widget hidden \ - -value $parent_id + -datatype integer \ + -widget hidden \ + -value $parent_id element create choose_content_method content_type \ - -datatype keyword \ - -widget hidden \ - -value $content_type + -datatype keyword \ + -widget hidden \ + -value $content_type +element create choose_content_method return_url \ + -datatype text \ + -widget hidden \ + -value $return_url \ + -optional # if there is only one valid content_method, don't show the radio buttons # and instead use a hidden widget and inform widget for content_method @@ -64,35 +71,37 @@ element create choose_content_method content_method_inform \ -widget inform \ - -label "Method" \ + -label "Content Method" \ -value $first_label } else { element create choose_content_method content_method \ -datatype keyword \ -widget radio \ - -label "Method" \ + -label "Content Method" \ -options $content_methods \ + -help_text "Choose a method for entering this item's content" \ -values $first_method } # Add the relation tag element -content::add_child_relation_element choose_content_method -section +cms::form::add_child_relation_element choose_content_method -section # if there is no relation tag necessary and there is only one content method, # then forward to create-2 with that content method if { ![element exists choose_content_method relation_tag] && \ [llength $content_methods] == 1 } { - template::forward "create-2?parent_id=$parent_id&content_type=$content_type&content_method=$first_method" + set content_method $first_method + ad_returnredirect [export_vars -base create-2 {parent_id content_type content_method return_url}] + ad_script_abort } - # Process the form if { [form is_valid choose_content_method] } { form get_values choose_content_method \ - content_type parent_id content_method + content_type parent_id content_method if { [element exists choose_content_method relation_tag] } { set relation_tag \ @@ -107,11 +116,12 @@ # XML imports should forward to revision-upload # otherwise pass the content_method to revision-add if { [string equal $content_method "xml_import"] } { - template::forward "revision-upload?content_type=$content_type&parent_id=$parent_id&relation_tag=$relation_tag" + ad_returnredirect [export_vars -base revision-upload {content_type parent_id relation_tag}] + ad_script_abort } - template::forward "create-2?content_type=$content_type&parent_id=$parent_id&content_method=$content_method&relation_tag=$relation_tag" - + ad_returnredirect [export_vars -base create-2 {content_type parent_id content_method relation_tag return_url}] + ad_script_abort } Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/create-1.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/create-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-2.adp,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/cms/www/modules/items/create-2.adp 16 May 2005 22:59:24 -0000 1.4 +++ openacs-4/packages/cms/www/modules/items/create-2.adp 31 Aug 2006 19:59:06 -0000 1.4.2.1 @@ -3,10 +3,9 @@ <property name="title">@page_title;noquote@</property> </if> - <div id=section> - <div id=section-header>@page_title;noquote@</div> - <p/> - <formtemplate id="create_item"></formtemplate> - </div> +<h3>@page_title;noquote@</h3> +<p/> +<formtemplate id="create_item"></formtemplate> + Index: openacs-4/packages/cms/www/modules/items/create-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/create-2.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/items/create-2.tcl 9 May 2005 22:44:49 -0000 1.7 +++ openacs-4/packages/cms/www/modules/items/create-2.tcl 31 Aug 2006 19:59:06 -0000 1.7.2.1 @@ -41,37 +41,49 @@ # Create a form for the basic item, no revision info -form create create_item -html { enctype "multipart/form-data" } +form create create_item -html { enctype "multipart/form-data" } -cancel_url $return_url element create create_item item_path \ - -datatype text \ - -widget inform \ - -label "Folder" \ - -value $item_path + -datatype text \ + -widget inform \ + -label "Folder" \ + -value $item_path element create create_item content_type_name \ - -datatype text \ - -widget inform \ - -label "Content Type" \ - -value $content_type_name + -datatype text \ + -widget inform \ + -label "Content Type" \ + -value $content_type_name element create create_item return_url \ - -datatype text \ - -widget hidden \ - -optional \ - -value $return_url + -datatype text \ + -widget hidden \ + -optional \ + -value $return_url element create create_item relation_tag \ - -datatype text \ - -widget hidden \ - -optional \ - -param + -datatype text \ + -widget hidden \ + -optional \ + -param +element create create_item creation_ip \ + -datatype text \ + -widget hidden \ + -optional \ + -value [ad_conn peeraddr] + +element create create_item creation_user \ + -datatype text \ + -widget hidden \ + -optional \ + -value [ad_conn user_id] + # auto-generated form -content::new_item_form -form_name create_item \ - -parent_id $parent_id \ - -content_type $content_type \ - -content_method $content_method +cms::form::new_item_form -form_name create_item \ + -parent_id $parent_id \ + -content_type $content_type \ + -content_method $content_method # added to support content storage selection (OpenACS - DanW) element create create_item storage_type \ @@ -91,7 +103,7 @@ if { [form is_valid create_item] } { # check for duplicate name within same folder or parent item. - if { ![content::validate_name create_item] } { + if { ![cms::form::validate_name create_item] } { set name [template::element get_value create_item name] template::element::set_error create_item name \ "The name \"$name\" is already in use by an existing item<br> @@ -100,13 +112,12 @@ } form get_values create_item return_url item_id storage_type - ns_log notice "----------------- creating item $item_id $storage_type" - set item_id [content::new_item create_item $storage_type] + ns_log debug "create-2.tcl: creating item $item_id $storage_type" + set item_id [cms::form::new_item create_item $storage_type] # do wizard forward or forward to return_url if { ![wizard exists] } { - template::forward \ - [content::assemble_url $return_url "item_id=$item_id"] + ad_returnredirect [export_vars -base $return_url item_id] } else { template::wizard forward } Fisheye: Tag 1.2.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/delete-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/delete-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/delete.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/index.adp,v diff -u -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/cms/www/modules/items/index.adp 29 Nov 2005 21:36:05 -0000 1.7.2.2 +++ openacs-4/packages/cms/www/modules/items/index.adp 31 Aug 2006 19:59:06 -0000 1.7.2.3 @@ -5,27 +5,37 @@ <!-- Tabs --> -<include src="item-tabs" item_props_tab="@item_props_tab@" item_id="@item_id@"> +<include src="item-tabs" &=tab &=item_id> <! -- Content --> <div id="subnavbar-body"> -<if @item_props_tab@ eq editing> +<if @tab@ eq item> <div id=section> - <include src="attributes" revision_id="@info.latest_revision;noquote@"> + <include src="attributes" revision_id="@revision_id@"> </div> <p> + <include-optional src="one-revision" &=revision_id &=content_method &=item_id> + <div id=section> + <include-output> + </div> + </include-optional> + +</if> + +<if @tab@ eq revisions> + <div id=section> - <include src="revisions" item_id="@item_id;noquote@"> + <include src="/packages/cms/lib/revisions" item_id="@item_id@" content_method="@content_method@" mount_point=@mount_point@> </div> <p> </if> -<if @item_props_tab@ eq related> +<if @tab@ eq related> <div id=section> <div id=section-header>Related Items</div> @@ -43,15 +53,15 @@ </if> -<if @item_props_tab@ eq categories> +<if @tab@ eq categories> <div id=section> <include src="keywords" item_id="@item_id;noquote@" mount_point="@mount_point;noquote@"> </div> </if> -<if @item_props_tab@ eq publishing> +<if @tab@ eq publishing> <div id=section> <div id=section-header>Publishing Status</div> @@ -60,13 +70,17 @@ </div> <p> +</if> + +<if @tab@ eq templates> <div id=section> <div id=section-header>Registered Templates</div> <p/> - <include src="templates" item_id="@item_id;noquote@"> + <include src="templates" item_id="@item_id@"> </div> <p> +</if> <!-- <div id=section> <div id=section-header>Comments</div> <p/> @@ -76,7 +90,7 @@ </if> -<if @item_props_tab@ eq permissions> +<if @tab@ eq permissions> <div id=section> <div id=section-header>Item permissions</div> @@ -88,14 +102,14 @@ <!-- Options at the end --> -<if @can_edit_p@> - <ul class="action-links"> - <li><a href="rename?item_id=@item_id@&mount_point=@mount_point@&item_props_tab=@item_props_tab@"> - Rename</a> this content item</li> - <li><a href="delete?item_id=@item_id@&mount_point=@mount_point@" - onClick="return confirm('Warning! You are about to delete this @type_pretty_name@: @title@.');"> - Delete</a> this content item</li> - </ul> +<p> + +<if @write_p@> + <a href="@revise_url@" class="button">@revise_button@</a> + <a href="@rename_url@" class="button">Rename Item</a> + <a href="@delete_url@" class="button" + onClick="return confirm('Warning! You are about to delete this @content_item.content_type@: @content_item.title@.');"> + Delete Item</a> </if> </div> Index: openacs-4/packages/cms/www/modules/items/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/index.tcl,v diff -u -r1.9.2.2 -r1.9.2.3 --- openacs-4/packages/cms/www/modules/items/index.tcl 29 Nov 2005 21:36:05 -0000 1.9.2.2 +++ openacs-4/packages/cms/www/modules/items/index.tcl 31 Aug 2006 19:59:06 -0000 1.9.2.3 @@ -7,18 +7,19 @@ @creation-date May 2005 } { { item_id:integer } + { revision_id:integer,optional } { mount_point:optional "sitemap" } - { item_props_tab:optional "editing" } + { tab:optional "item" } } set package_url [ad_conn package_url] # HACK: sometimes the query string does not get parsed when returning # from revision-add-2. The reason for this is unclear. -if { [string equal [ns_queryget item_id] {}] } { - ns_log Notice "ITEM ID NOT FOUND...PARSING QUERY STRING" - set item_id [lindex [split [ns_conn query] "="] 1] -} +# if { [string equal [ns_queryget item_id] {}] } { +# ns_log Notice "ITEM ID NOT FOUND...PARSING QUERY STRING" +# set item_id [lindex [split [ns_conn query] "="] 1] +# } # resolve any symlinks set item_id [content::symlink::resolve -item_id $item_id] @@ -27,18 +28,22 @@ permission::require_permission -party_id $user_id \ -object_id $item_id -privilege read -set can_edit_p [permission::permission_p -party_id $user_id \ +set write_p [permission::permission_p -party_id $user_id \ -object_id $item_id -privilege write] -# query the content_type of the item ID so we can check for a custom info page (among other things) -db_1row get_info "" -column_array info -template::util::array_to_vars info +content::item::get -item_id $item_id -revision latest +if { ![info exists revision_id] } { + set revision_id $content_item(latest_revision) +} -set page_title "Content Item - $title" +#db_1row get_info "" -column_array info +#template::util::array_to_vars info +set page_title "Content Item - $content_item(title)" + # build the path to the custom interface directory for this content type -set custom_dir [file dirname [ns_conn url]]/custom/$content_type +set custom_dir [file dirname [ns_conn url]]/custom/$content_item(content_type) # check for the custom info page and redirect if found @@ -47,6 +52,24 @@ template::forward $custom_dir/index?item_id=$item_id } -# The root ID is to determine the appropriate path to the item +if { [cms::item::storage_type -revision_id $revision_id] eq "text" } { + set revise_button "Author Revision" + if { [cms::item::has_text_content_p -revision_id $revision_id] } { + set content_method text_entry + } else { + set content_method no_content + } +} else { + set revise_button "Upload Revision" + set content_method file_upload +} -set root_id [cm::modules::${mount_point}::getRootFolderID [ad_conn subsite_id]] +set return_url [ad_return_url] +set revise_url [export_vars -base revision-add-2 {item_id revision_id mount_point tab content_method return_url}] +set rename_url [export_vars -base rename {item_id mount_point tab return_url}] + +# send over to manage-items-2 to delete +set action delete +set folder_id $content_item(parent_id) +set delete_url [export_vars -base ../sitemap/manage-items-2 {item_id mount_point folder_id action return_url}] + Index: openacs-4/packages/cms/www/modules/items/item-header.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/item-header.adp,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/cms/www/modules/items/item-header.adp 20 Mar 2006 20:30:41 -0000 1.1.2.1 +++ openacs-4/packages/cms/www/modules/items/item-header.adp 31 Aug 2006 19:59:06 -0000 1.1.2.2 @@ -1,7 +1,7 @@ <nobr> <p> -<include src="../../bookmark" mount_point="@mount_point@" id="@item_id@"> -@page_title;noquote@ (<a href="@path@" target="_new">preview</a>) +<include src="/packages/cms/lib/clip" mount_point="@mount_point@" id="@item_id@">@page_title;noquote@ +<span style="font-size: 70%;">[<a href="@path@" target="_new">preview</a>]</span> </p> </nobr> <p/> @@ -12,6 +12,6 @@ <p/> -<include src="../sitemap/ancestors" item_id=@item_id@> +<include src="/packages/cms/lib/ancestors" item_id=@item_id@> <p/> Index: openacs-4/packages/cms/www/modules/items/item-tabs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/item-tabs.adp,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/items/item-tabs.adp 16 May 2005 03:06:16 -0000 1.1 +++ openacs-4/packages/cms/www/modules/items/item-tabs.adp 31 Aug 2006 19:59:06 -0000 1.1.2.1 @@ -2,58 +2,80 @@ <div id="subnavbar-container"> <div id="subnavbar"> - <if @item_props_tab@ eq editing> + <if @tab@ eq item> <div class="tab" id="subnavbar-here"> - Editing + Item </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&item_props_tab=editing" title="" class="subnavbar-unselected">Editing</a> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=item" title="" class="subnavbar-unselected">Item</a> </div> </else> - <if @item_props_tab@ eq related> + <if @tab@ eq revisions> <div class="tab" id="subnavbar-here"> - Related Content + Revisions </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&item_props_tab=related" title="" class="subnavbar-unselected">Related Content</a> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=revisions" title="" class="subnavbar-unselected">Revisions</a> </div> </else> - <if @item_props_tab@ eq categories> + <if @tab@ eq related> <div class="tab" id="subnavbar-here"> + Related + </div> + </if> + <else> + <div class="tab"> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=related" title="" class="subnavbar-unselected">Related</a> + </div> + </else> + + <if @tab@ eq categories> + <div class="tab" id="subnavbar-here"> Categories </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&item_props_tab=categories" title="" class="subnavbar-unselected">Categories</a> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=categories" title="" class="subnavbar-unselected">Categories</a> </div> </else> - <if @item_props_tab@ eq publishing> + <if @tab@ eq templates> <div class="tab" id="subnavbar-here"> + Templates + </div> + </if> + <else> + <div class="tab"> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=templates" title="" class="subnavbar-unselected">Templates</a> + </div> + </else> + + <if @tab@ eq publishing> + <div class="tab" id="subnavbar-here"> Publishing </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&item_props_tab=publishing" title="" class="subnavbar-unselected">Publishing</a> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=publishing" title="" class="subnavbar-unselected">Publishing</a> </div> </else> - <if @item_props_tab@ eq permissions> + <if @tab@ eq permissions> <div class="tab" id="subnavbar-here"> Permissions </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&item_props_tab=permissions" title="" class="subnavbar-unselected">Permissions</a> + <a href="@package_url@modules/items/index?item_id=@item_id@&mount_point=sitemap&tab=permissions" title="" class="subnavbar-unselected">Permissions</a> </div> </else> Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/one-revision.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/one-revision.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/publish-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/publish-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/publish-status.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish-status.adp,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/cms/www/modules/items/publish-status.adp 6 Jun 2005 15:51:26 -0000 1.4.2.2 +++ openacs-4/packages/cms/www/modules/items/publish-status.adp 31 Aug 2006 19:59:06 -0000 1.4.2.3 @@ -55,9 +55,9 @@ <if @can_edit_status_p@> <ul class="action-links"> <if @live_revision@ nil> - <li><a href="publish?item_id=@item_id@&item_props_tab=@item_props_tab@&revision_id=@latest_revision@">Make latest revision live</a></li> + <li><a href="publish?item_id=@item_id@&tab=@tab@&revision_id=@latest_revision@">Make latest revision live</a></li> </if> - <li><a href="status-edit?item_id=@item_id@&item_props_tab=@item_props_tab@">Edit publishing status</a></li> + <li><a href="status-edit?item_id=@item_id@&tab=@tab@">Edit publishing status</a></li> </ul> </if> Index: openacs-4/packages/cms/www/modules/items/publish-status.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish-status.tcl,v diff -u -r1.9.2.2 -r1.9.2.3 --- openacs-4/packages/cms/www/modules/items/publish-status.tcl 6 Jun 2005 15:51:26 -0000 1.9.2.2 +++ openacs-4/packages/cms/www/modules/items/publish-status.tcl 31 Aug 2006 19:59:06 -0000 1.9.2.3 @@ -3,7 +3,7 @@ # what needs to be done before this item can be published. request create request set_param item_id -datatype integer -request set_param item_props_tab -datatype text +request set_param tab -datatype text set user_id [auth::require_login] permission::require_permission -party_id $user_id -object_id $item_id \ Index: openacs-4/packages/cms/www/modules/items/publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish.tcl,v diff -u -r1.6.12.1 -r1.6.12.2 --- openacs-4/packages/cms/www/modules/items/publish.tcl 6 Jun 2005 15:53:03 -0000 1.6.12.1 +++ openacs-4/packages/cms/www/modules/items/publish.tcl 31 Aug 2006 19:59:06 -0000 1.6.12.2 @@ -6,11 +6,11 @@ { item_id:naturalnum } { revision_id:naturalnum } { mount_point "sitemap" } - { item_props_tab:optional "publishing" } + { tab:optional "revisions" } } content::item::set_live_revision -revision_id $revision_id -ad_returnredirect [export_vars -base index {item_id item_props_tab mount_point}] +ad_returnredirect [export_vars -base index {item_id tab mount_point}] # set root_path [ns_info pageroot] @@ -20,7 +20,7 @@ # if { [string equal $publish_p t] } { -# # publish::publish_revision $revision_id +# # cms::publish::publish_revision $revision_id # db_exec_plsql set_live_revision {} # publish::unpublish_item $item_id Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/publish.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/relate-items-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items-2.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/cms/www/modules/items/relate-items-2.tcl 17 May 2005 21:25:08 -0000 1.8 +++ openacs-4/packages/cms/www/modules/items/relate-items-2.tcl 31 Aug 2006 19:59:06 -0000 1.8.2.1 @@ -6,6 +6,7 @@ mount_point -datatype keyword -value sitemap -optional rel_list -datatype text page_title -datatype text -optional -value "Relate Items" + tab -datatype text -optional -value related } # rel_list is a list of lists in form of @@ -57,7 +58,7 @@ # Get all elements, if any # FIXME: set content_type $relation_type - content::query_form_metadata params multirow { + cms::form::query_form_metadata params multirow { object_type <> 'cr_item_rel' } @@ -84,7 +85,7 @@ template::util::array_to_vars el_row lappend rel_row(elements) $attribute_name - set j [content::assemble_form_element params $attribute_name $j] + set j [cms::form::assemble_form_element params $attribute_name $j] ns_log notice "$j : $attribute_name, $code_params" eval "template::element create rel_form_2 ${attribute_name}_$index $code_params" @@ -103,7 +104,7 @@ # sort order_n for all related items for consistency form get_values rel_form_2 item_id - cms_rel::sort_related_item_order $item_id + cms::rel::sort_related_item_order $item_id db_transaction { @@ -122,28 +123,21 @@ } # Perform the insertion - set rel_id [db_exec_plsql relate "begin - :1 := content_item.relate ( - item_id => :item_id, - object_id => :related_id, - relation_tag => :relation_tag, - order_n => :order_n, - relation_type => :relation_type - ); - end;"] + set rel_id [db_exec_plsql relate {}] # Insert any extra attributes if { [llength $elements] > 0 } { set attr_list [template::util::tcl_to_sql_list $elements] ns_log notice "$i : $attr_list" - content::insert_element_data rel_form_2 $relation_type \ + cms::form::insert_element_data rel_form_2 $relation_type \ [list acs_object cr_item_rel] $rel_id "_$i" \ " attribute_name in ($attr_list)" } } } - template::forward "index?item_id=$item_id&mount_point=$mount_point&item_props_tab=related" + ad_returnredirect [export_vars -index { item_id mount_point tab }] + ad_script_abort } Index: openacs-4/packages/cms/www/modules/items/relate-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items.adp,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/cms/www/modules/items/relate-items.adp 16 May 2005 22:59:24 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/relate-items.adp 31 Aug 2006 19:59:06 -0000 1.3.2.1 @@ -3,7 +3,7 @@ <include src="item-header" item_id="@item_id@" mount_point="sitemap"> -<include src="item-tabs" item_id="@item_id@" item_props_tab="related"> +<include src="item-tabs" item_id="@item_id@" tab="related"> <div id="subnavbar-body"> Index: openacs-4/packages/cms/www/modules/items/relate-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-items.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/cms/www/modules/items/relate-items.tcl 17 May 2005 21:25:08 -0000 1.6 +++ openacs-4/packages/cms/www/modules/items/relate-items.tcl 31 Aug 2006 19:59:06 -0000 1.6.2.1 @@ -18,8 +18,8 @@ set page_title "Relate Items to \"$item_title\"" # get related items from the clipboard - set clip [clipboard::parse_cookie] - set items [clipboard::get_items $clip $mount_point] + set clip [cms::clipboard::parse_cookie] + set items [cms::clipboard::get_items $clip $mount_point] # If no items are clipped, abort if { [llength $items] < 1 } { @@ -49,20 +49,20 @@ } # Process the query - clipboard::ui::form_create rel_form + cms::clipboard::ui::form_create rel_form # A short proc to add a row proc add_row { } { uplevel { upvar 0 "clip_items:[expr $j - 1]" prev_row - clipboard::ui::add_row rel_form $mount_point $prev_row(related_id) $prev_row(title) -checked - clipboard::ui::element_create rel_form path -datatype text -widget hidden \ + cms::clipboard::ui::add_row rel_form $mount_point $prev_row(related_id) $prev_row(title) -checked + cms::clipboard::ui::element_create rel_form path -datatype text -widget hidden \ -value $prev_row(path) - clipboard::ui::element_create rel_form relation_type -datatype keyword -widget select \ + cms::clipboard::ui::element_create rel_form relation_type -datatype keyword -widget select \ -options $type_options - clipboard::ui::element_create rel_form relation_tag -datatype text -widget select \ + cms::clipboard::ui::element_create rel_form relation_tag -datatype text -widget select \ -options $item_tags - clipboard::ui::element_create rel_form order_n -datatype integer -widget text \ + cms::clipboard::ui::element_create rel_form order_n -datatype integer -widget text \ -html { size 3 } -optional } } @@ -125,7 +125,7 @@ set source_id $item_id db_transaction { - clipboard::ui::process_form rel_form { + cms::clipboard::ui::process_form rel_form { if { $row(checked) } { template::util::array_to_vars row Index: openacs-4/packages/cms/www/modules/items/relate-order.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-order.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/items/relate-order.tcl 16 May 2005 22:59:24 -0000 1.7 +++ openacs-4/packages/cms/www/modules/items/relate-order.tcl 31 Aug 2006 19:59:06 -0000 1.7.2.1 @@ -5,7 +5,7 @@ request set_param order -datatype keyword request set_param mount_point -datatype keyword -value "sitemap" request set_param return_url -datatype text -value "index" -request set_param item_props_tab -datatype text -value "related" +request set_param tab -datatype text -value "related" request set_param relation_type -datatype keyword -value "relation" # Use hardcoding instead of inheritance, since inheritance is not in the @@ -39,9 +39,9 @@ # Sort the related/child items order to ensure unique order_n if { [string equal $relation_type child] } { - cms_rel::sort_child_item_order $item_id + cms::rel::sort_child_item_order $item_id } else { - cms_rel::sort_related_item_order $item_id + cms::rel::sort_related_item_order $item_id } # grab the (sorted) order of the original related/child item @@ -65,19 +65,13 @@ set swap_id $swap_rel(rel_id) set swap_order $swap_rel(order_n) - db_dml relate_swap_1 " - update $rel_table - set order_n = :swap_order - where rel_id = :rel_id" + db_dml relate_swap_1 {} + db_dml relate_swap_2 {} - db_dml relate_swap_2 " - update $rel_table - set order_n = :order_n - where rel_id = :swap_id" - } else { ns_log notice "relate-order.tcl: $relation_type cannot be moved further" } } -template::forward "$return_url?item_props_tab=$item_props_tab[content::url_passthrough $passthrough]" +ad_returnredirect [export_vars -base $return_url tab] +ad_script_abort Index: openacs-4/packages/cms/www/modules/items/related-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/related-items.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/items/related-items.adp 13 Apr 2005 20:15:19 -0000 1.5 +++ openacs-4/packages/cms/www/modules/items/related-items.adp 31 Aug 2006 19:59:06 -0000 1.5.2.1 @@ -1,4 +1,12 @@ <listtemplate name="related"></listtemplate> +<p> +<if @related_types_registered_p@> + <formtemplate id=add_related_item> + Add a new related item + <formwidget id=parent_id><formwidget id=content_type> + <input type=submit value="Add"> + </formtemplate> +</if> Index: openacs-4/packages/cms/www/modules/items/related-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/related-items.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/items/related-items.tcl 17 May 2005 21:25:08 -0000 1.7 +++ openacs-4/packages/cms/www/modules/items/related-items.tcl 31 Aug 2006 19:59:06 -0000 1.7.2.1 @@ -1,49 +1,47 @@ -request create -params { - item_id -datatype integer - mount_point -datatype text -value sitemap - item_props_tab -datatype text -optional -} +# expexts item_id, mount_point and tab -set user_id [auth::require_login] -permission::require_permission -party_id $user_id \ - -object_id $item_id -privilege read +set user_id [ad_conn user_id] +set return_url [ad_return_url] -# # create a form to add related items... -# set related_types [db_list_of_lists get_related_types ""] +# form to allow creation of a *new* related item of an allowable type... +set related_types [db_list_of_lists get_related_types ""] -# # but do not display form if this content type does not allow relations -# set related_types_registered_p [llength $related_types] +# but do not display form if this content type does not allow relations +set related_types_registered_p [llength $related_types] -# if { [permission::permission_p -party_id $user_id -object_id $item_id -privilege write] } { -# form create add_related_item -method get -action create-1 -# element create add_related_item parent_id -datatype integer \ -# -widget hidden -value $item_id -# element create add_related_item content_type -datatype keyword \ -# -options $related_types -widget select -# } +if { [permission::permission_p -party_id $user_id -object_id $item_id -privilege write] } { + form create add_related_item -method get -action create-1 + element create add_related_item parent_id -datatype integer \ + -widget hidden -value $item_id + element create add_related_item return_url -datatype text \ + -widget hidden -value $return_url + element create add_related_item content_type -datatype keyword \ + -options $related_types -widget select +} template::list::create \ -name related \ -key rel_id \ -no_data "No related items" \ -multirow related \ -actions [list "Relate marked items to this item" \ - [export_vars -base relate-items {item_id item_props_tab mount_point}] \ + [export_vars -base relate-items {item_id tab mount_point}] \ "Relate marks items to this item"] \ -bulk_actions [list "Remove marked relations" \ - [export_vars -base unrelate-item?mount_point=sitemap { rel_id }] \ + [export_vars -base unrelate-item { rel_id mount_point}] \ "Remove marked relations from this item"] \ -elements { - content_type { - label "Content Type" - } - title_url { + title { label "Title" - display_template "<a href=\"@related.title_url@\" title=\"View content item\">@related.title@</a>" + link_url_col title_url + link_html { title "View related item" } } type_name { label "Relationship Type" } + content_type { + label "Content Type" + } tag { label "Tag" } @@ -55,8 +53,7 @@ } db_multirow -extend { title_url relation_view_url move_up_url move_down_url reorder } related get_related "" { - set title_url "index?item_id=$item_id&mount_point=$mount_point" - set move_up_url "relate-order?rel_id=$rel_id&order=up&mount_point=$mount_point&item_props_tab=related&relation_type=relation" - set move_down_url "relate-order?rel_id=$rel_id&order=down&mount_point=$mount_point&item_props_tab=related&relation_type=relation" + set title_url [export_vars -base index {item_id mount_point}] + set move_up_url [export_vars -base "relate-order?order=up&relation_type=relation" {rel_id mount_point tab}] + set move_down_url [export_vars -base "relate-order?order=down&relation_type=relation" {rel_id mount_point tab}] } - Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/rename-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/rename-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/rename.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/rename.adp,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/cms/www/modules/items/rename.adp 16 May 2005 03:06:16 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/rename.adp 31 Aug 2006 19:59:06 -0000 1.3.2.1 @@ -1,16 +1,6 @@ <master src="../../master"> <property name="title">@page_title;noquote@</property> -<include src="item-header" item_id="@item_id@" mount_point="sitemap"> - -<include src="item-tabs" item_id="@item_id@" item_props_tab="@item_props_tab@"> - -<div id="subnavbar-body"> - - <div id=section> - <div id=section-header>@page_title@</div> - <p/> - <formtemplate id="rename_item"></formtemplate> - </div> - -</div> +<h2>@page_title@</h2> +<p/> +<formtemplate id="rename_item"></formtemplate> Index: openacs-4/packages/cms/www/modules/items/rename.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/rename.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/cms/www/modules/items/rename.tcl 16 May 2005 22:59:24 -0000 1.8 +++ openacs-4/packages/cms/www/modules/items/rename.tcl 31 Aug 2006 19:59:06 -0000 1.8.2.1 @@ -1,61 +1,78 @@ -# /items/rename.tcl -# Change name of a content item +ad_page_contract { + Change name of a content item -request create -request set_param item_id -datatype integer -request set_param mount_point -datatype text -value sitemap -request set_param item_props_tab -datatype text + @author Michael Steigman + @creation-date April 2006 +} { + { item_id:integer } + { mount_point:optional "sitemap" } + { return_url } + { tab:optional } +} permission::require_permission -party_id [auth::require_login] \ -object_id $item_id -privilege read -set item_name [db_string get_item_name ""] +set content_type [content::item::get_content_type -item_id $item_id] +if { $content_type eq "content_template" } { + cms::template::get -template_id $item_id -array_name content_item +} elseif { $content_type eq "image" } { + cms::image::get -image_id $item_id +} else { + content::item::get -item_id $item_id +} +set name $content_item(name) + +set page_title "Rename $name" -set page_title "Rename $item_name" +form create rename_item -cancel_url $return_url -form create rename_item - element create rename_item mount_point \ -datatype text \ -widget hidden \ -value $mount_point \ -optional +element create rename_item content_type \ + -datatype text \ + -widget hidden \ + -value $content_type \ + -optional + +element create rename_item return_url \ + -datatype text \ + -widget hidden \ + -value $return_url \ + -optional + element create rename_item item_id \ -datatype integer \ -widget hidden \ -param element create rename_item name \ - -label "Rename $item_name to" \ + -label "Rename $name to" \ -datatype keyword \ -widget text \ -html { size 20 } \ -validate { { expr ![string match $value "/"] } \ { Item name cannot contain slashes }} \ - -value $item_name \ - -help_text "Short name using no special characters" + -value $name \ + -help_text "Short name using no special characters and without file extension" # Rename if { [form is_valid rename_item] } { form get_values rename_item \ - mount_point item_id name + mount_point item_id name content_type - db_transaction { - db_exec_plsql rename_item " - begin - content_item.edit_name ( - item_id => :item_id, - name => :name - ); - end;" + # handle file system stuff for templates + if { $content_type eq "content_template" } { + cms::template::rename -template_id $template_id -name $name + } + content::item::rename -item_id $item_id -name $name - set parent_id [db_string get_parent_id ""] - } - - # flush cache - cms_folder::flush $mount_point $parent_id - - template::forward "index?item_id=$item_id" + set base_url [ad_decode $content_type content_template "../templates/properties" "../items/index"] + ad_returnredirect [export_vars -base $base_url {item_id tab}] + ad_script_abort } Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/rename.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/revision-add-1.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-1.adp,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/cms/www/modules/items/revision-add-1.adp 16 May 2005 22:59:24 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/revision-add-1.adp 31 Aug 2006 19:59:06 -0000 1.3.2.1 @@ -3,7 +3,7 @@ <include src="item-header" item_id="@item_id@" mount_point="sitemap"> -<include src="item-tabs" item_id="@item_id@" item_props_tab="editing"> +<include src="item-tabs" item_id="@item_id@" tab="item"> <div id="subnavbar-body"> Index: openacs-4/packages/cms/www/modules/items/revision-add-1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-1.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/items/revision-add-1.tcl 13 Apr 2005 20:15:19 -0000 1.5 +++ openacs-4/packages/cms/www/modules/items/revision-add-1.tcl 31 Aug 2006 19:59:06 -0000 1.5.2.1 @@ -33,7 +33,7 @@ # get the list of associated content methods set content_methods \ - [content_method::get_content_methods $content_type -get_labels] + [cms::type::get_content_methods $content_type -get_labels] set first_method [lindex [lindex $content_methods 0] 1] # if only one valid content method exists, redirect to revision-add-2 Index: openacs-4/packages/cms/www/modules/items/revision-add-2.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-2.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/items/revision-add-2.adp 16 May 2005 03:06:16 -0000 1.5 +++ openacs-4/packages/cms/www/modules/items/revision-add-2.adp 31 Aug 2006 19:59:06 -0000 1.5.2.1 @@ -1,17 +1,6 @@ <master src="../../master"> <property name="title">@page_title@</property> -<include src="item-header" item_id="@item_id@" mount_point="sitemap"> +<h2>@page_title@</h2> +<formtemplate id="add_revision"></formtemplate> -<include src="item-tabs" item_id="@item_id@" item_props_tab="editing"> - -<div id="subnavbar-body"> - - <div id=section> - <div id=section-header>@page_title@</div> - <p/> - <formtemplate id="add_revision"></formtemplate> - </div> - -</div> - Index: openacs-4/packages/cms/www/modules/items/revision-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/revision-add-2.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/items/revision-add-2.tcl 16 May 2005 22:59:24 -0000 1.7 +++ openacs-4/packages/cms/www/modules/items/revision-add-2.tcl 31 Aug 2006 19:59:06 -0000 1.7.2.1 @@ -1,43 +1,67 @@ -# Add a revision of the item +ad_page_contract { -request create -request set_param item_id -datatype integer -request set_param content_method -datatype keyword -value no_content + Add a revision of the item +} { + { item_id:integer } + { revision_id:integer } + { mount_point:optional "sitemap" } + { content_method "no_content" } + { return_url:optional "" } +} + permission::require_permission -party_id [auth::require_login] \ -object_id $item_id -privilege write # get content_type and name of item -db_0or1row get_one_item "" +content::item::get -item_id $item_id -revision latest # validate item_id -if { [template::util::is_nil content_type] } { - template::request::error add_revision "Error - invalid item_id - $item_id" -} +# if { [template::util::is_nil content_type] } { +# template::request::error add_revision "Error - invalid item_id - $item_id" +# } -set page_title "Add a Revision to $name" +set page_title "Add a Revision to $content_item(name)" - # check for custom revision-add-1 form if { [file exists [ns_url2file \ - "custom/$content_type/revision-add-1.tcl"]] } { - template::forward "custom/$content_type/revision-add-1?item_id=$item_id&content_method=$content_method" + "custom/$content_item(content_type)/revision-add-1.tcl"]] } { + template::forward "custom/$content_type/revision-add-1?item_id=$item_id&content_method=$content_method" } -form create add_revision -html { enctype "multipart/form-data" } +form create add_revision -html { enctype "multipart/form-data" } -cancel_url $return_url +element create add_revision return_url \ + -datatype text \ + -widget hidden \ + -value $return_url \ + -optional + +element create add_revision creation_user \ + -datatype text \ + -widget hidden \ + -value [ad_conn user_id] \ + -optional + +element create add_revision creation_ip \ + -datatype text \ + -widget hidden \ + -value [ad_conn peeraddr] \ + -optional + # autogenerate the revision form -content::add_revision_form \ +cms::form::add_revision_form \ -form_name add_revision \ -content_method $content_method \ - -content_type $content_type \ - -item_id $item_id - + -content_type $content_item(content_type) \ + -item_id $item_id \ + -revision_id $revision_id + if { [form is_valid add_revision] } { form get_values add_revision item_id - + ns_log notice "WHAT THE FUCK ????" # autoprocess the revision form - content::add_revision add_revision + cms::form::add_revision add_revision - template::forward "index?item_id=$item_id" + ad_returnredirect [export_vars -base index item_id] } Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision-add-2.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision-handler.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.9.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revision.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revisions-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revisions-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revisions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.3 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/revisions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/status-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit.adp,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/cms/www/modules/items/status-edit.adp 16 May 2005 03:06:16 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/status-edit.adp 31 Aug 2006 19:59:06 -0000 1.2.2.1 @@ -3,7 +3,7 @@ <include src="item-header" item_id="@item_id@" mount_point="sitemap"> -<include src="item-tabs" item_id="@item_id@" item_props_tab="publishing"> +<include src="item-tabs" item_id="@item_id@" tab="publishing"> <div id="subnavbar-body"> Index: openacs-4/packages/cms/www/modules/items/status-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/cms/www/modules/items/status-edit.tcl 6 Jun 2005 15:55:02 -0000 1.9.2.1 +++ openacs-4/packages/cms/www/modules/items/status-edit.tcl 31 Aug 2006 19:59:06 -0000 1.9.2.2 @@ -7,7 +7,7 @@ { item_id:integer } { parent_id:integer,optional } { mount_point "sitemap" } - { item_props_tab ""} + { tab:optional "publishing"} } ## Create the form @@ -105,16 +105,15 @@ db_transaction { ns_log notice "setting publish status to $publish_status for item $item_id" - publish::set_publish_status $item_id $publish_status + cms::publish::set_publish_status $item_id $publish_status set start_when [template::util::date get_property sql_date $start_when] set end_when [template::util::date get_property sql_date $end_when] db_exec_plsql set_release_period {} } - set item_props_tab publishing - ad_returnredirect [export_vars -base index { item_id item_props_tab }] + ad_returnredirect [export_vars -base index { item_id tab }] } # If the item is in a production state, we may simply be marking Fisheye: Tag 1.1.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/symlink-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/symlink-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/symlink.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/template-register.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/Attic/template-register.adp,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/cms/www/modules/items/template-register.adp 31 May 2005 04:55:51 -0000 1.1.2.1 +++ openacs-4/packages/cms/www/modules/items/template-register.adp 31 Aug 2006 19:59:06 -0000 1.1.2.2 @@ -3,7 +3,7 @@ <include src="item-header" item_id="@item_id@" mount_point="sitemap"> -<include src="item-tabs" item_id="@item_id@" item_props_tab="publishing"> +<include src="item-tabs" item_id="@item_id@" tab="templates"> <div id="subnavbar-body"> Index: openacs-4/packages/cms/www/modules/items/template-register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/template-register.tcl,v diff -u -r1.4.12.1 -r1.4.12.2 --- openacs-4/packages/cms/www/modules/items/template-register.tcl 31 May 2005 04:55:51 -0000 1.4.12.1 +++ openacs-4/packages/cms/www/modules/items/template-register.tcl 31 Aug 2006 19:59:06 -0000 1.4.12.2 @@ -5,19 +5,19 @@ } { { item_id:naturalnum } { mount_point:optional "sitemap" } - { item_props_tab:optional "publishing" } + { tab:optional "templates" } { template_id:naturalnum,optional } { context:optional } } # get templates from the clipboard -set clip [clipboard::parse_cookie] -set templates [clipboard::get_items $clip templates] +set clip [cms::clipboard::parse_cookie] +set templates [cms::clipboard::get_items $clip templates] # if no templates are clipped, send user a message and abort if { [llength $templates] < 1 } { util_user_message -message "There are no templates on the clipboard" - ad_returnredirect [export_vars -base index {item_id item_props_tab mount_point}] + ad_returnredirect [export_vars -base index {item_id tab mount_point}] } ad_form -name select_template -form { @@ -66,6 +66,6 @@ util_user_message -message "There is already a template registered for $context context" } - ad_returnredirect [export_vars -base index { item_id mount_point item_props_tab }] + ad_returnredirect [export_vars -base index { item_id mount_point tab }] } Index: openacs-4/packages/cms/www/modules/items/template-unregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/template-unregister.tcl,v diff -u -r1.3.14.1 -r1.3.14.2 --- openacs-4/packages/cms/www/modules/items/template-unregister.tcl 31 May 2005 14:46:57 -0000 1.3.14.1 +++ openacs-4/packages/cms/www/modules/items/template-unregister.tcl 31 Aug 2006 19:59:06 -0000 1.3.14.2 @@ -8,10 +8,10 @@ { template_id:naturalnum } { context } { mount_point:optional "sitemap" } - { item_props_tab:optional "publishing" } + { tab:optional "templates" } } content::item::unregister_template -item_id $item_id \ -template_id $template_id -use_context $context -ad_returnredirect [export_vars -base index {item_id mount_point item_props_tab}] +ad_returnredirect [export_vars -base index {item_id mount_point tab}] Index: openacs-4/packages/cms/www/modules/items/unpublish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unpublish.tcl,v diff -u -r1.2.14.1 -r1.2.14.2 --- openacs-4/packages/cms/www/modules/items/unpublish.tcl 6 Jun 2005 15:57:43 -0000 1.2.14.1 +++ openacs-4/packages/cms/www/modules/items/unpublish.tcl 31 Aug 2006 19:59:06 -0000 1.2.14.2 @@ -5,11 +5,11 @@ } { { item_id:naturalnum } { mount_point "sitemap" } - { item_props_tab:optional "editing" } + { tab:optional "item" } } content::item::unset_live_revision -item_id $item_id -#publish::unpublish_item $item_id +#cms::publish::unpublish_item $item_id -ad_returnredirect [export_vars -base index {item_id item_props_tab mount_point}] +ad_returnredirect [export_vars -base index {item_id tab mount_point}] Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/unrelate-item-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/items/unrelate-item-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/items/unrelate-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unrelate-item.tcl,v diff -u -r1.9 -r1.9.2.1 --- openacs-4/packages/cms/www/modules/items/unrelate-item.tcl 17 May 2005 21:25:08 -0000 1.9 +++ openacs-4/packages/cms/www/modules/items/unrelate-item.tcl 31 Aug 2006 19:59:06 -0000 1.9.2.1 @@ -5,8 +5,9 @@ @creation-date October 2004 } { { rel_id:integer,multiple } - { mount_point "sitemap" } - { return_url "index" } + { mount_point:optional "sitemap" } + { return_url:optional "index" } + { tab:optional "related" } } set item_id "" @@ -16,15 +17,14 @@ set item_id [db_string get_item_id "" -default ""] if { [string equal $item_id ""] } { db_abort_transaction - request::error no_such_rel "The relationship $rel_id does not exist." - return + ad_return_complaint "The relationship $rel_id does not exist." + ad_script_abort } # Check permissions permission::require_permission -party_id [auth::require_login] \ -object_id $item_id -privilege write - db_exec_plsql unrelate_item {} + content::item::unrelate -rel_id $rel } -set item_props_tab related -ad_returnredirect [export_vars -base $return_url {item_id mount_pount item_props_tab}] +ad_returnredirect [export_vars -base $return_url {item_id mount_pount tab}] Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/ancestors-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/ancestors-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/ancestors.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.11.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/attributes-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/attributes-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/attributes.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.10.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/attributes.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/attributes.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/copy-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/copy-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/copy.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/copy.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/create.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/create.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/delete-items-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/delete-items-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/delete-items.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/delete-items.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/delete-items.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-attributes-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-attributes-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-attributes.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-attributes.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-tabs.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/folder-tabs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/sitemap/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/index.adp,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/sitemap/index.adp 9 May 2005 22:44:49 -0000 1.7 +++ openacs-4/packages/cms/www/modules/sitemap/index.adp 31 Aug 2006 19:59:06 -0000 1.7.2.1 @@ -1,12 +1,9 @@ <master src="../../master"> <property name="title">@page_title@</property> -<p/> - -<include src="../../bookmark" mount_point="@mount_point@" id="@original_folder_id@"> - +<p> +<include src="/packages/cms/lib/clip" mount_point="@mount_point@" id="@original_folder_id@"> @page_title;noquote@ - <p/> @@ -15,13 +12,13 @@ <p/> -<include src="ancestors" item_id=@original_folder_id@ +<include src="/packages/cms/lib/ancestors" item_id=@original_folder_id@ index_page_id=@index_page_id@ mount_point=@mount_point@ /> <p/> -<include src="../../../lib/folder-items" folder_id="@folder_id@" +<include src="/packages/cms/lib/folder-items" folder_id="@folder_id@" parent_id="@parent_id@" actions="@actions;noquote@" orderby="@orderby@" page="@page@" mount_point="@mount_point@" /> Index: openacs-4/packages/cms/www/modules/sitemap/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/index.tcl,v diff -u -r1.12.2.1 -r1.12.2.2 --- openacs-4/packages/cms/www/modules/sitemap/index.tcl 6 Jun 2005 17:07:24 -0000 1.12.2.1 +++ openacs-4/packages/cms/www/modules/sitemap/index.tcl 31 Aug 2006 19:59:06 -0000 1.12.2.2 @@ -105,21 +105,19 @@ # symlinks to this folder/item db_multirow symlinks get_symlinks "" -# build folder contents list - +set return_url [ad_return_url] set page_title "Content Folder - $info(label)" -set actions "Attributes [export_vars -base attributes?mount_point=sitemap {folder_id}] \"Folder Attributes\"" -if { [permission::permission_p -party_id $user_id \ - -object_id $folder_id -privilege write] } { +set actions "\"Folder Attributes\" [export_vars -base folder-attributes {mount_point folder_id return_url}] \"Folder Attributes\"" +if { [permission::permission_p -party_id $user_id -object_id $folder_id -privilege write] } { append actions " -\"Delete Folder\" [export_vars -base delete?mount_point=sitemap {folder_id parent_id}] \"Delete this folder\" -\"Rename Folder\" [export_vars -base rename?mount_point=sitemap {folder_id}] \"Rename this folder\" -\"New Folder\" [export_vars -base create?mount_point=sitemap {folder_id}] \"Create a new folder within this folder\" -\"Move Items\" [export_vars -base move?mount_point=sitemap {folder_id}] \"Move marked items to this folder\" -\"Copy Items\" [export_vars -base copy?mount_point=sitemap {folder_id}] \"Copy marked items to this folder\" -\"Link Items\" [export_vars -base symlink?mount_point=sitemap {folder_id}] \"Link marked items to this folder\" -\"Delete Items\" [export_vars -base delete-items?mount_point=sitemap {folder_id}] \"Delete marked items\" +\"Delete Folder\" [export_vars -base folder-delete {mount_point folder_id parent_id}] \"Delete this folder\" +\"Edit Folder Info\" [export_vars -base folder-ae?mount_point=sitemap {folder_id return_url}] \"Edit folder information\" +\"New Folder\" [export_vars -base folder-ae?parent_id=$folder_id {mount_point return_url}] \"Create a new folder within this folder\" +\"Move Items\" [export_vars -base manage-items?action=move {mount_point folder_id return_url}] \"Move marked items to this folder\" +\"Copy Items\" [export_vars -base manage-items?action=copy {mount_point folder_id return_url}] \"Copy marked items to this folder\" +\"Link Items\" [export_vars -base manage-items?action=link {mount_point folder_id return_url}] \"Link marked items to this folder\" +\"Delete Items\" [export_vars -base manage-items?action=delete {mount_point folder_id return_url}] \"Delete marked items\" " } @@ -139,7 +137,7 @@ set revision_types [list [list "----------------" ""]] append revision_types " " -append revision_types [cms_folder::get_registered_types $the_id] +append revision_types [cms::folder::get_registered_types $the_id] set num_revision_types [llength $revision_types] element create add_item content_type \ @@ -149,8 +147,13 @@ -options $revision_types \ -html { onchange "javascript:this.form.submit();" } +element create add_item return_url \ + -datatype url \ + -widget hidden \ + -value $return_url + if { [form is_valid add_item] } { - form get_values add_item folder_id mount_point content_type + form get_values add_item folder_id mount_point content_type return_url # if the folder_id is empty, then it must be the root folder if { [template::util::is_nil folder_id] } { @@ -162,7 +165,9 @@ if { [string equal $mount_point "templates"] } { forward "../items/template?parent_id=$folder_id&mount_point=$mount_point" } else { - forward "../items/create-1?parent_id=$folder_id&mount_point=$mount_point&content_type=$content_type" + set parent_id $folder_id + ad_returnredirect [export_vars -base ../items/create-1 {parent_id mount_point content_type return_url}] + ad_script_abort } } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/manage-items-2.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/manage-items-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/manage-items.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/manage-items.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/move-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/move-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/move.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/move.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/refresh-tree.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/refresh-tree.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/rename-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/rename-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/rename.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/rename.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/rename.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/symlink-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/symlink-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/symlink.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/symlink.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/type-register-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/type-register-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/sitemap/type-register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/type-register.tcl,v diff -u -r1.2 -r1.2.14.1 --- openacs-4/packages/cms/www/modules/sitemap/type-register.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/sitemap/type-register.tcl 31 Aug 2006 19:59:06 -0000 1.2.14.1 @@ -1,27 +1,25 @@ -# register content types from clipboard to a folder +ad_page_contract { + Register content types from clipboard to a folder -request create -request set_param folder_id -datatype integer + @author Michael Steigman + @creation-date October 2004 +} { + { folder_id:integer } +} +permission::require_permission -party_id [auth::require_login] \ + -object_id $folder_id -privilege write -set clip [clipboard::parse_cookie] -set marked_types [clipboard::get_items $clip "types"] +set clip [cms::clipboard::parse_cookie] +set marked_types [cms::clipboard::get_items $clip "types"] db_transaction { foreach type $marked_types { - - db_exec_plsql register_type "begin - content_folder.register_content_type( - folder_id => :folder_id, - content_type => :type, - include_subtypes => 'f' - ); - end;" + content::folder::register_content_type -folder_id $folder_id \ + -content_type $type -include_subtypes f } } -cms_folder::flush_registered_types $folder_id +cms::clipboard::free $clip -clipboard::free $clip - -forward "attributes?folder_id=$folder_id" +ad_returnredirect [export_vars -base folder-attributes folder_id] Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/type-unregister-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/sitemap/type-unregister-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl 16 Nov 2004 22:32:50 -0000 1.4 +++ openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl 31 Aug 2006 19:59:06 -0000 1.4.2.1 @@ -8,10 +8,12 @@ { content_type:multiple } } +permission::require_permission -party_id [auth::require_login] \ + -object_id $folder_id -privilege write + foreach type $content_type { - db_exec_plsql unregister "" + content::folder::unregister_content_type -folder_id $folder_id \ + -content_type $type -include_subtypes f } -cms_folder::flush_registered_types $folder_id - -ns_returnredirect "attributes?folder_id=$folder_id" +ad_returnredirect [export_vars -base folder-attributes folder_id] Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/clipboard-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/clipboard-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/clipboard.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/clipboard.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/copy-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/copy-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/copy.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/copy.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/datasources.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/datasources.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.14.1 --- openacs-4/packages/cms/www/modules/templates/datasources.tcl 20 Apr 2001 20:51:10 -0000 1.1.1.1 +++ openacs-4/packages/cms/www/modules/templates/datasources.tcl 31 Aug 2006 19:59:07 -0000 1.1.1.1.14.1 @@ -16,9 +16,11 @@ set tcl_stub "${url}.tcl" -# In the future, we may have many roots ! -set template_root [publish::get_template_root] -set tcl_file [ns_normalizepath "/$template_root/${url}.tcl"] +# Get template path +set path [content::template::get_path -template_id $template_id \ + -root_folder_id [cm::modules::templates::getRootFolderID [ad_conn subsite_id]]] +set tcl_file [ns_normalizepath "[acs_root_dir]/templates/${path}.tcl"] +ns_log debug "datasources.tcl: looking for template code in $tcl_file" # Load and process the file if { ![file exists $tcl_file] } { Fisheye: Tag 1.2.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/delete-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/delete-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/delete.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/download.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/download.tcl,v diff -u -r1.1.1.1 -r1.1.1.1.14.1 --- openacs-4/packages/cms/www/modules/templates/download.tcl 20 Apr 2001 20:51:10 -0000 1.1.1.1 +++ openacs-4/packages/cms/www/modules/templates/download.tcl 31 Aug 2006 19:59:07 -0000 1.1.1.1.14.1 @@ -1,18 +1,8 @@ -request create -params { - template_id -datatype integer - edit_revision -datatype integer -optional +ad_page_contract { + Return text of template to the browser +} { + { template_id:integer } + { edit_revision:integer,optional "[content::item::get_latest_revision -item_id $template_id]"} } -if { ! [request is_valid] } { return } - -if { [string equal $edit_revision {}] } { - - set edit_revision [content::get_latest_revision $template_id] -} - -set text [content::get_content_value $edit_revision] - -ns_return 200 text/plain $text - - - +ns_return 200 text/plain [content::get_content_value $edit_revision] Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/edit-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/edit-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/edit.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/edit.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/edit.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/general.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/index.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/templates/index.adp 9 May 2005 22:44:49 -0000 1.5 +++ openacs-4/packages/cms/www/modules/templates/index.adp 31 Aug 2006 19:59:07 -0000 1.5.2.1 @@ -1,29 +1,32 @@ <master src="../../master"> -<property name="title">@page_title@</property> +<property name="title">Template Folder - @folder_info.label;noquote@</property> <p/> -<include src="../../bookmark" mount_point="@mount_point@" id="@folder_id@"> +<include src="/packages/cms/lib/clip" mount_point="@mount_point@" id="@folder_id@"> -@page_title;noquote@ +Template Folder - @folder_info.label;noquote@ <p/> -<if @info.description@ not nil>@info.description@</if> +<if @folder_info.description@ not nil>@folder_info.description;noquote@</if> <else>No description</else> <p/> -<include src="../sitemap/ancestors" item_id="@folder_id@" mount_point="@mount_point@"> +<include src="/packages/cms/lib/ancestors" item_id="@folder_id@" mount_point="@mount_point@"> <p/> -<include src="../../../lib/folder-items" folder_id="@folder_id@" - parent_id="@parent_id@" actions="@actions;noquote@" - orderby="@orderby@" page="@page@" mount_point="@mount_point@" /> +<include src="/packages/cms/lib/folder-items" + folder_id="@folder_id@" + parent_id="@parent_id@" + actions="@actions;noquote@" + orderby="@orderby@" + page="@page@" + mount_point="@mount_point@" /> - <script language=JavaScript> set_marks('@mount_point@', '../../resources/checked'); </script> \ No newline at end of file Index: openacs-4/packages/cms/www/modules/templates/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/index.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/cms/www/modules/templates/index.tcl 6 Jun 2005 17:07:24 -0000 1.9.2.1 +++ openacs-4/packages/cms/www/modules/templates/index.tcl 31 Aug 2006 19:59:07 -0000 1.9.2.2 @@ -14,47 +14,31 @@ } set package_url [ad_conn package_url] -set clipboardfloats_p [clipboard::floats_p] -if { ! [string equal $path {}] } { - - set item_id [db_string get_id ""] - - if { [string equal $folder_id {}] } { - - set msg "The requested folder <tt>$path</tt> does not exist." - request error invalid_path $msg +# the ability to pass in a path is not currently utilized by any CMS pages +if { $path ne "" } { + set folder_id [content::item::get_id -item_path $path] + if { $folder_id eq "" } { + ad_return_complaint 1 "The requested folder \"$path\" does not exist." } } else { - - if { [string equal $folder_id {}] } { + if { $folder_id eq "" } { set folder_id [cm::modules::templates::getRootFolderID [ad_conn subsite_id]] } - - set path [db_string get_path ""] } -# query for the content type and redirect if a folder -set type [db_string get_type ""] +permission::require_permission -party_id [auth::require_login] \ + -object_id $folder_id -privilege read -if { [string equal $type content_template] } { - template::forward properties?item_id=$item_id -} +cms::folder::get -folder_id $folder_id +set return_url [ad_return_url] -db_1row get_info "" -column_array info - -set page_title "Template Folder - $info(label)" - -#set folder_id $item_id -#set parent_id $item_id - -set actions "Attributes [export_vars -base ../sitemap/attributes?mount_point=templates {folder_id}] \"Folder Attributes\" -\"Delete Folder\" [export_vars -base ../sitemap/delete?mount_point=templates {folder_id parent_id}] \"Delete this folder\" -\"Rename Folder\" [export_vars -base ../sitemap/rename?mount_point=templates {folder_id}] \"Rename this folder\" -\"New Template\" [export_vars -base new-template?mount_point=templates {folder_id}] \"Create a new template within this folder\" -\"New Folder\" [export_vars -base new-folder?mount_point=templates {parent_id}] \"Create a new folder within this folder\" -\"Move Items\" [export_vars -base move?mount_point=templates {folder_id}] \"Move folder\" -\"Copy Items\" [export_vars -base copy?mount_point=templates {folder_id}] \"Copy folder\" -\"Delete Items\" [export_vars -base delete?mount_point=templates {folder_id}] \"Delete folder\" +set actions "\"Folder Attributes\" [export_vars -base ../sitemap/folder-attributes?mount_point=templates {folder_id return_url}] \"Folder Attributes\" +\"Delete Folder\" [export_vars -base ../sitemap/folder-delete {mount_point folder_id parent_id return_url}] \"Delete this folder\" +\"Edit Folder Info\" [export_vars -base ../sitemap/folder-ae {mount_point folder_id return_url}] \"Rename this folder\" +\"New Template\" [export_vars -base template-ae {mount_point folder_id return_url}] \"Create a new template within this folder\" +\"New Folder\" [export_vars -base ../sitemap/folder-ae?parent_id=$folder_id {mount_point return_url}] \"Create a new folder within this folder\" +\"Move Items\" [export_vars -base ../sitemap/manage-items?action=move {mount_point folder_id return_url}] \"Move marked items to this folder\" +\"Copy Items\" [export_vars -base ../sitemap/manage-items?action=copy {mount_point folder_id return_url}] \"Copy marked items to this folder\" +\"Delete Items\" [export_vars -base ../sitemap/manage-items?action=delete {mount_point folder_id return_url}] \"Delete marked items to this folder\" " - Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/items.adp,v diff -u -r1.1.1.1 -r1.1.1.1.14.1 --- openacs-4/packages/cms/www/modules/templates/items.adp 20 Apr 2001 20:51:10 -0000 1.1.1.1 +++ openacs-4/packages/cms/www/modules/templates/items.adp 31 Aug 2006 19:59:07 -0000 1.1.1.1.14.1 @@ -1 +1,5 @@ -Not implemented yet. \ No newline at end of file +<div id=section-header>Content Items</div> +<p/> +This template is associated with the following content items. +<p/> +<listtemplate name="content_items"></listtemplate> \ No newline at end of file Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/items.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/items.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/move-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/move-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/move.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/move.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-folder-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-folder-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-folder.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-folder.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-template-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-template-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-template.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-template.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/new-template.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/properties-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/properties-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/properties.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/properties.adp,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/cms/www/modules/templates/properties.adp 16 May 2005 20:47:56 -0000 1.6 +++ openacs-4/packages/cms/www/modules/templates/properties.adp 31 Aug 2006 19:59:07 -0000 1.6.2.1 @@ -1,20 +1,36 @@ <master src="../../master"> <property name="title">@page_title@</property> -<include src="template-header" mount_point=@mount_point@ item_id=@item_id@ template_props_tab=@template_props_tab@> +<include src="template-header" mount_point=@mount_point@ item_id=@item_id@ &=tab> -<include src="template-tabs" mount_point=@mount_point@ item_id=@item_id@ template_props_tab=@template_props_tab@> +<include src="template-tabs" mount_point=@mount_point@ item_id=@item_id@ &=tab> <div id="subnavbar-body"> -<div id=section> - <include src=@template_props_tab@ template_id=@item_id@> -</div> + <div id=section> + <if @tab@ eq revisions> + <include src="/packages/cms/lib/revisions" item_id=@item_id@ mount_point=@mount_point@ content_method=""> + </if> + <elseif @tab@ eq permissions> + <div id=section-header>Template permissions</div> + <include src="/packages/acs-subsite/www/permissions/perm-include" object_id="@item_id@"> + </div> + </elseif> + <else> + <include src=@tab@ template_id=@item_id@ &=tab revision_id=@revision_id@> + </else> + </div> -<ul class="action-links"> - <li><a href="edit?template_id=@item_id@&template_props_tab=@template_props_tab@">Edit</a> this template in the browser</li> - <li><a href="download?template_id=@item_id@&template_props_tab=@template_props_tab@">Save</a> the latest version of this template to a file</li> - <li><a href="upload?template_id=@item_id@&template_props_tab=@template_props_tab@">Upload</a> a new version of this template</li> -</ul> + <p> + <if @write_p@> + <a href="@revise_url@" class="button">Author Revision</a> + <a href="@rename_url@" class="button">Rename Template</a> + <a href="@delete_url@" class="button" + onClick="return confirm('Warning! You are about to delete this template: @template_info.title@.');"> + Delete Template</a> + <a href="@upload_url@" class="button">Upload Revision</a> + <a href="@download_url@" class="button">Download Revision</a> + </if> + </div> \ No newline at end of file Index: openacs-4/packages/cms/www/modules/templates/properties.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/properties.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/templates/properties.tcl 16 May 2005 20:47:56 -0000 1.5 +++ openacs-4/packages/cms/www/modules/templates/properties.tcl 31 Aug 2006 19:59:07 -0000 1.5.2.1 @@ -6,42 +6,47 @@ @creation-date October 2004 } { { item_id:integer ""} + { revision_id:integer,optional } { path:optional "" } { mount_point "templates"} - { template_props_tab:optional "revisions"} + { tab:optional "template"} } +set template_id $item_id +set user_id [auth::require_login] -if { ! [string equal $path {}] } { +permission::require_permission -party_id $user_id \ + -object_id $template_id -privilege read - set item_id [db_string get_id ""] - - if { [string equal $item_id {}] } { - - set msg "The requested folder <tt>$path</tt> does not exist." - request error invalid_path $msg +# the ability to pass in a path is not currently utilized by any CMS pages +if { $path ne "" } { + set item_id [content::item::get_id -item_path $path] + if { $item_id eq "" } { + ad_return_complaint 1 "The requested folder \"$path\" does not exist." } - -} else { - - if { [string equal $item_id {}] } { - set id [db_string get_root_id ""] - } - - set path [db_string get_path ""] +} elseif { $item_id eq "" } { + set folder_id [cm::modules::templates::getRootFolderID [ad_conn subsite_id]] + ad_returnredirect [export_vars -base index {mount_point folder_id}] + ad_script_abort } -# query for the content type and redirect if a folder - -set type [db_string get_type ""] - -if { [string equal $type content_folder] } { - template::forward index?id=$item_id +cms::template::get -template_id $item_id +if { ![info exists revision_id] } { + set revision_id [content::item::get_latest_revision -item_id $item_id] } -# query the content_type of the item ID so we can check for a custom info page -db_1row get_info "" -column_array info -template::util::array_to_vars info +set page_title "Content Template - $template_info(title)" -set item_title [db_string get_item_title ""] -set page_title "Content Template - $item_title" +set write_p [permission::permission_p -party_id $user_id \ + -object_id $template_id -privilege write] +# set up links that will appear on all tabs +set return_url [ad_return_url] +set revise_url [export_vars -base template-ae {template_id revision_id mount_point tab return_url}] +set rename_url [export_vars -base ../items/rename {item_id mount_point tab return_url}] +set upload_url [export_vars -base upload {template_id tab return_url}] +set download_url [export_vars -base download {template_id tab return_url}] + +# send over to manage-items-2 to delete +set action delete +set folder_id $template_info(parent_id) +set delete_url [export_vars -base ../sitemap/manage-items-2 {item_id mount_point folder_id action return_url}] Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/properties.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/publish-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/publish-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/publish.tcl,v diff -u -r1.3 -r1.3.12.1 --- openacs-4/packages/cms/www/modules/templates/publish.tcl 19 Aug 2002 04:19:45 -0000 1.3 +++ openacs-4/packages/cms/www/modules/templates/publish.tcl 31 Aug 2006 19:59:07 -0000 1.3.12.1 @@ -1,27 +1,27 @@ -request create -params { - revision_id -datatype integer +ad_page_contract { + + @author Michael Steigman + @creation-date October 2004 +} { + { revision_id:integer} + { return_url } } +set template_id [cms::item::get_id_from_revision -revision_id $revision_id] -# query for the path and ID of the template -db_1row get_info "" -column_array info - # write the template to the file system - set text [content::get_content_value $revision_id] +set template_root [cm::modules::templates::getRootFolderID [ad_conn subsite_id]] +set path [content::template::get_path -template_id $template_id -root_folder_id $template_root] -set path [content::get_template_path]/$info(path) +if { [ catch { + util::write_file [acs_root_dir]/templates/$path.adp $text + content::item::set_live_revision -revision_id $revision_id } err ] } { + util_user_message -message "There was an error writing the file and/or setting the live revision: $err" +} else { + util_user_message -message "[content::revision::revision_name -revision_id $revision_id] written to file system and marked \"live\"" +} -util::write_file $path.adp $text +ad_returnredirect $return_url +ad_script_abort -# update the live revision - -set template_id $info(item_id) - -db_dml update_items "update cr_items set live_revision = :revision_id - where item_id = :template_id" - - -set return_url [ns_set iget [ns_conn headers] Referer] -template::forward $return_url - Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/publish.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/refresh-tree.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/refresh-tree.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/revisions-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/revisions-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/revisions.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/revisions.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/revisions.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-ae.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-ae.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-create-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-create-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-create.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.6.2.2 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-create.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-create.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-delete-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.2.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-delete-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5.8.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/template-header.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template-header.adp,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/templates/template-header.adp 16 May 2005 20:47:56 -0000 1.1 +++ openacs-4/packages/cms/www/modules/templates/template-header.adp 31 Aug 2006 19:59:07 -0000 1.1.2.1 @@ -1,16 +1,16 @@ <nobr><p> -<include src="../../bookmark" mount_point="@mount_point@" id="@item_id@"> -@page_title;noquote@ +<include src="/packages/cms/lib/clip" mount_point="@mount_point@" id="@item_id@"> +Content Template - @template_info.title;noquote@ </p> </nobr> <p/> -<if @description@ not nil>@description;noquote@</if> +<if @template_info.description@ not nil>@template_info.description;noquote@</if> <else>No description</else> <p/> -<include src="../sitemap/ancestors" mount_point=@mount_point@ item_id=@item_id@> +<include src="/packages/cms/lib/ancestors" mount_point=@mount_point@ item_id=@item_id@> -<p/> \ No newline at end of file +<p/> Index: openacs-4/packages/cms/www/modules/templates/template-header.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template-header.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/templates/template-header.tcl 16 May 2005 20:47:56 -0000 1.1 +++ openacs-4/packages/cms/www/modules/templates/template-header.tcl 31 Aug 2006 19:59:07 -0000 1.1.2.1 @@ -4,9 +4,4 @@ template_props_tab -datatype keyword -optional -value revisions } -# query the content_type of the item ID so we can check for a custom info page -db_1row get_info "" -column_array info -template::util::array_to_vars info - -set item_title [db_string get_item_title ""] -set page_title "Content Template - $item_title" \ No newline at end of file +cms::template::get -template_id $item_id Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-header.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3.12.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/template-tabs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template-tabs.adp,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/templates/template-tabs.adp 16 May 2005 20:47:56 -0000 1.1 +++ openacs-4/packages/cms/www/modules/templates/template-tabs.adp 31 Aug 2006 19:59:07 -0000 1.1.2.1 @@ -4,61 +4,83 @@ <div id="subnavbar-container"> <div id="subnavbar"> - <if @template_props_tab@ eq revisions> + <if @tab@ eq template> <div class="tab" id="subnavbar-here"> + Template + </div> + </if> + <else> + <div class="tab"> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=template" title="" class="subnavbar-unselected">Template</a> + </div> + </else> + + <if @tab@ eq revisions> + <div class="tab" id="subnavbar-here"> Revisions </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&template_props_tab=revisions" title="" class="subnavbar-unselected">Revisions</a> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=revisions" title="" class="subnavbar-unselected">Revisions</a> </div> </else> - <if @template_props_tab@ eq datasources> + <if @tab@ eq datasources> <div class="tab" id="subnavbar-here"> Datasources </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&template_props_tab=datasources" title="" class="subnavbar-unselected">Datasources</a> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=datasources" title="" class="subnavbar-unselected">Datasources</a> </div> </else> - <if @template_props_tab@ eq assets> + <if @tab@ eq assets> <div class="tab" id="subnavbar-here"> Assets </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&template_props_tab=assets" title="" class="subnavbar-unselected">Assets</a> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=assets" title="" class="subnavbar-unselected">Assets</a> </div> </else> - <if @template_props_tab@ eq types> + <if @tab@ eq types> <div class="tab" id="subnavbar-here"> Content Types </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&template_props_tab=types" title="" class="subnavbar-unselected">Content Types</a> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=types" title="" class="subnavbar-unselected">Content Types</a> </div> </else> - <if @template_props_tab@ eq items> + <if @tab@ eq items> <div class="tab" id="subnavbar-here"> Content Items </div> </if> <else> <div class="tab"> - <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&template_props_tab=items" title="" class="subnavbar-unselected">Content Items</a> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=items" title="" class="subnavbar-unselected">Content Items</a> </div> </else> + <if @tab@ eq permissions> + <div class="tab" id="subnavbar-here"> + Permissions + </div> + </if> + <else> + <div class="tab"> + <a href="@package_url@modules/templates/properties?item_id=@item_id@&mount_point=@mount_point@&tab=permissions" title="" class="subnavbar-unselected">Permissions</a> + </div> + </else> + </div> </div> </div> Index: openacs-4/packages/cms/www/modules/templates/template-tabs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template-tabs.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/templates/template-tabs.tcl 16 May 2005 20:47:56 -0000 1.1 +++ openacs-4/packages/cms/www/modules/templates/template-tabs.tcl 31 Aug 2006 19:59:07 -0000 1.1.2.1 @@ -1,7 +1 @@ -request create -params { - item_id -datatype integer - mount_point -datatype text -optional -value templates - template_props_tab -datatype text -} - set package_url [ad_conn package_url] Index: openacs-4/packages/cms/www/modules/templates/template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template.adp,v diff -u -r1.2 -r1.2.14.1 --- openacs-4/packages/cms/www/modules/templates/template.adp 12 Jun 2001 04:13:46 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/template.adp 31 Aug 2006 19:59:07 -0000 1.2.14.1 @@ -1,97 +1,9 @@ -<master src="../../master"> -<property name="title">Content Template</property> -<table border=0 width="95%"> -<tr> - -<td align=left><b> - <multiple name=context> - <a href="../sitemap/index?id=@context.context_id@"> - <img src="../../resources/folder.gif" border=0> - </a> - <a href="../sitemap/index?id=@context.context_id@">@context.title@</a> - <if @context.rownum@ lt @context:rowcount@> : </if> - </multiple> -</b></td> -<td align=right><b><tt>@path@</tt></b></td> -</table> - - +<div id=section-header>Content</div> <p> - -<if @items:rowcount@ eq 0> - <i>This template is not registered to any content items.</i><p> +<if @content_exists_p@> + @template;noquote@ </if> <else> - - <table bgcolor=#6699CC cellspacing=0 cellpadding=4 border=0 width="95%"> - <tr> - <th align=left>Registered Content Items</th> - </tr> - <tr><td> - - <table border=0 cellspacing=0 width="100%"> - <tr bgcolor="#99ccff"> - <th>Title</th> - <th>Context</th> - <th> </th> - </tr> - - <multiple name="items"> - <if @items.rownum@ odd><tr bgcolor="#ffffff"></if> - <else><tr bgcolor="#eeeeee"></else> - <td>@items.title@</td> - <td>@items.use_context@</td> - <td> - <a href="../items/template-unregister?template_id=@template_id@&context=@items.use_context@&item_id=@items.item_id@">Unregister</a> - </td> - </tr> - - </multiple> - </table> - </td></tr> - </table> - -</else> - -<p> - - -<if @types:rowcount@ eq 0> - <i>This template is not registered to any content types.</i><p> -</if> -<else> - - <table bgcolor=#6699CC cellspacing=0 cellpadding=4 border=0 width="95%"> - <tr> - <th align=left>Registered Content Types</th> - </tr> - <tr><td> - - <table border=0 cellspacing=0 width="100%"> - <tr bgcolor="#99ccff"> - <th>Content Type</th> - <th>Context</th> - <th> </th> - </tr> - - <multiple name="types"> - <if @types.rownum@ odd><tr bgcolor="#ffffff"></if> - <else><tr bgcolor="#eeeeee"></else> - <td>@types.pretty_name@</td> - <td>@types.use_context@</td> - <td> - <a href="unregister-template?template_id=@template_id@&context=@types.use_context@&content_type=@types.content_type@">Unregister</a> - </td> - </tr> - - </multiple> - </table> - - </td></tr> - </table> -</else> - -<p> -<a href="../templates/rename?item_id=@template_id@">Rename this template</a><br> -<a href="../templates/template-delete?template_id=@template_id@" onClick="return window.confirm('Are you sure you want to delete this template?');">Delete this template</a> + No template content. +</else> \ No newline at end of file Index: openacs-4/packages/cms/www/modules/templates/template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/template.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/cms/www/modules/templates/template.tcl 6 Jun 2005 17:07:24 -0000 1.6.2.1 +++ openacs-4/packages/cms/www/modules/templates/template.tcl 31 Aug 2006 19:59:07 -0000 1.6.2.2 @@ -1,42 +1,2 @@ -# /cms/modules/templates/template.tcl - -# Assemble information for a content item. Note this page is only -# appropriate for revisioned content items. Non-revisioned content -# items (symlinks, extlinks and folders) have separate admin pages - -# Most information on this page is included via components. - -# The mount_point is used to determine the proper root context -# when querying the path to the item. - -request create -params { - template_id -datatype integer -} - -# The root ID is to determine the appropriate path to the item -set root_id [cm::modules::templates::getRootFolderID [ad_conn subsite_id]] - - -# resolve any symlinks -set resolved_template_id [db_string get_id ""] - -set template_id $resolved_template_id - -# get the path -set path [db_string get_path "" -default ""] - -# check for valid template_id -if { [string equal $path ""] } { - ns_log Notice "/templates/template.tcl - BAD TEMPLATE_ID - $template_id" - template::forward "../sitemap/index?mount_point=templates&id=" -} - - -# get the context bar info -db_multirow context get_context "" - -# find out which items this template is registered to -db_multirow items get_items "" - -# find out which types this template is registered to -db_multirow types get_types "" +set template [content::get_content_value $revision_id] +set content_exists_p ![string equal $template ""] \ No newline at end of file Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/template.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/types.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/types.adp,v diff -u -r1.1.1.1 -r1.1.1.1.14.1 --- openacs-4/packages/cms/www/modules/templates/types.adp 20 Apr 2001 20:51:10 -0000 1.1.1.1 +++ openacs-4/packages/cms/www/modules/templates/types.adp 31 Aug 2006 19:59:07 -0000 1.1.1.1.14.1 @@ -1 +1,5 @@ -Not implemented yet. \ No newline at end of file +<div id=section-header>Content Types</div> +<p/> +This template is associated with the following content types. +<p/> +<listtemplate name="content_types"></listtemplate> \ No newline at end of file Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/types.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/types.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/upload-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/templates/upload-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/templates/upload.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/upload.adp,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/cms/www/modules/templates/upload.adp 16 May 2005 20:47:56 -0000 1.5 +++ openacs-4/packages/cms/www/modules/templates/upload.adp 31 Aug 2006 19:59:07 -0000 1.5.2.1 @@ -1,9 +1,9 @@ <master src="../../master"> <property name="title">Upload new template revision</property> -<include src="template-header" mount_point=@mount_point@ item_id=@template_id@ template_props_tab=@template_props_tab@> +<include src="template-header" mount_point=@mount_point@ item_id=@template_id@ tab=@tab@> -<include src="template-tabs" mount_point=@mount_point@ item_id=@template_id@ template_props_tab=@template_props_tab@> +<include src="template-tabs" mount_point=@mount_point@ item_id=@template_id@ tab=@tab@> <div id="subnavbar-body"> Index: openacs-4/packages/cms/www/modules/templates/upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/upload.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/cms/www/modules/templates/upload.tcl 16 May 2005 20:47:56 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/upload.tcl 31 Aug 2006 19:59:07 -0000 1.4.2.1 @@ -5,14 +5,16 @@ } { { template_id:integer } { mount_point "templates"} - { template_props_tab:optional "revision"} + { tab:optional "revision"} + { return_url } } if { ! [request is_valid] } { return } -set path [db_string get_path ""] +set template_root [cm::modules::templates::getRootFolderID [ad_conn subsite_id]] +set path [content::template::get_path -template_id $template_id -root_folder_id $template_root] -form create edit_template -html { enctype multipart/form-data } +form create edit_template -html { enctype multipart/form-data } -cancel_url $return_url element create edit_template return_url -datatype url -widget hidden @@ -27,16 +29,12 @@ if { [form is_request edit_template] } { element set_properties edit_template revision_id \ - -value [content::get_object_id] + -value [cms::form::new_object_id] - set return_url [ns_set iget [ns_conn headers] Referer] element set_properties edit_template return_url -value $return_url -} else { +} - set return_url [element get_value edit_template return_url] -} - if { [string equal [ns_queryget action] "Cancel"] } { template::forward $return_url } @@ -45,9 +43,9 @@ form get_values edit_template template_id revision_id - set tmpfile [content::prepare_content_file edit_template] + set tmpfile [cms::form::prepare_content_file edit_template] - content::add_basic_revision $template_id $revision_id "Template" \ + cms::form::add_basic_revision $template_id $revision_id "Template" \ -tmpfile $tmpfile template::forward $return_url Index: openacs-4/packages/cms/www/modules/types/content-method-set-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/content-method-set-default.tcl,v diff -u -r1.2.14.1 -r1.2.14.2 --- openacs-4/packages/cms/www/modules/types/content-method-set-default.tcl 18 May 2005 15:13:12 -0000 1.2.14.1 +++ openacs-4/packages/cms/www/modules/types/content-method-set-default.tcl 31 Aug 2006 19:59:07 -0000 1.2.14.2 @@ -1,29 +1,23 @@ -# /cms/www/modules/types/content-method-set-default.tcl -# -# Set the default content insertion method for a content type +ad_page_contract { + Set the default content insertion method for a content type -request create -request set_param content_type -datatype keyword -request set_param content_method -datatype keyword -request set_param return_url -datatype text -value "" + @author Michael Steigman (michael@steigman.net) + @creation-date March 2006 +} { + {content_type} + {content_method} + {return_url ""} +} # default return_url -if { [template::util::is_nil return_url] } { - set return_url "index?content_type=$content_type" +if { $return_url eq "" } { + set return_url [export_vars -base index content_type] } +db_exec_plsql set_content_method_default {} +#cms::type::set_content_method_default -content_type $content_type \ + -content_method $content_method +cms::type::flush_content_methods_cache $content_type -db_transaction { - db_exec_plsql set_content_method_default " - begin - content_method.set_default_method ( - content_type => :content_type, - content_method => :content_method - ); - end;" -} - -content_method::flush_content_methods_cache $content_type - -template::forward $return_url +ad_returnredirect $return_url Index: openacs-4/packages/cms/www/modules/types/content-method-unregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/content-method-unregister.tcl,v diff -u -r1.2.14.1 -r1.2.14.2 --- openacs-4/packages/cms/www/modules/types/content-method-unregister.tcl 18 May 2005 15:13:12 -0000 1.2.14.1 +++ openacs-4/packages/cms/www/modules/types/content-method-unregister.tcl 31 Aug 2006 19:59:07 -0000 1.2.14.2 @@ -10,20 +10,11 @@ # default return_url if { [template::util::is_nil return_url] } { - set return_url "index?content_type=$content_type" + set return_url [export_vars -base index content_type] } - db_transaction { - db_exec_plsql content_method_unregister " - begin - content_method.remove_method ( - content_type => :content_type, - content_method => :content_method - ); - end; -" + db_exec_plsql content_method_unregister {} } - template::forward $return_url Index: openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl,v diff -u -r1.3.14.1 -r1.3.14.2 --- openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl 18 May 2005 15:13:12 -0000 1.3.14.1 +++ openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl 31 Aug 2006 19:59:07 -0000 1.3.14.2 @@ -9,21 +9,14 @@ # default return_url if { [template::util::is_nil return_url] } { - set return_url "index?content_type=$content_type" + set return_url [export_vars -base index content_type] } db_transaction { - db_exec_plsql unset_content_method_default " - begin - content_method.unset_default_method ( - content_type => :content_type - ); - end; -" + db_exec_plsql unset_content_method_default {} } -content_method::flush_content_methods_cache $content_type +cms::type::flush_content_methods_cache $content_type - -template::forward $return_url +ad_returnredirect $return_url Index: openacs-4/packages/cms/www/modules/types/content-method.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/content-method.tcl,v diff -u -r1.8.2.2 -r1.8.2.3 --- openacs-4/packages/cms/www/modules/types/content-method.tcl 6 Jun 2005 17:07:24 -0000 1.8.2.2 +++ openacs-4/packages/cms/www/modules/types/content-method.tcl 31 Aug 2006 19:59:07 -0000 1.8.2.3 @@ -1,6 +1,6 @@ request create request set_param content_type -datatype keyword -value content_revision -request set_param return_url -datatype text -value "" +request set_param type_props_tab -datatype text -value content_method # permissions check - user must have read on the types module permission::require_permission -party_id [auth::require_login] \ @@ -69,7 +69,7 @@ # form to register unregistered content methods to this content type -form create register +form create register -action content-method element create register content_type \ -datatype keyword \ @@ -99,18 +99,11 @@ db_transaction { - db_exec_plsql add_method " - begin - content_method.add_method ( - content_type => :content_type, - content_method => :content_method, - is_default => 'f' - ); - end; - " + db_exec_plsql add_method {} + } - content_method::flush_content_methods_cache $content_type + cms::type::flush_content_methods_cache $content_type - template::forward $return_url + ad_returnredirect [export_vars -base index { mount_point type_props_tab content_type }] } Index: openacs-4/packages/cms/www/modules/types/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/index.adp,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/cms/www/modules/types/index.adp 16 May 2005 17:38:19 -0000 1.7 +++ openacs-4/packages/cms/www/modules/types/index.adp 31 Aug 2006 19:59:08 -0000 1.7.2.1 @@ -12,13 +12,19 @@ <div id=section> <include src="attributes" can_edit_widgets_p="@can_edit_widgets_p@" content_type="@content_type@"> </div> - <p/> + </if> + + <if @type_props_tab@ eq mime_types> + <div id=section> <include src="mime-types" content_type="@content_type@"> </div> - <p/> + </if> + + <if @type_props_tab@ eq content_method> + <div id=section> <include src="content-method" content_type="@content_type@"> </div> Index: openacs-4/packages/cms/www/modules/types/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/index.tcl,v diff -u -r1.10.2.1 -r1.10.2.2 --- openacs-4/packages/cms/www/modules/types/index.tcl 6 Jun 2005 17:07:24 -0000 1.10.2.1 +++ openacs-4/packages/cms/www/modules/types/index.tcl 31 Aug 2006 19:59:08 -0000 1.10.2.2 @@ -28,15 +28,9 @@ -object_id $module_id -privilege write] # get the content type pretty name -set object_type_pretty [db_string get_object_type ""] +set object_type_pretty [cms::type::pretty_name -content_type $content_type] set page_title "Content Type - $object_type_pretty" -if { [string equal $object_type_pretty ""] } { - # error - invalid content_type - template::forward index -} - - # get all the content types that this content type inherits from db_multirow content_type_tree get_content_type "" Fisheye: Tag 1.3.2.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/types/index.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/types/mime-types.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/mime-types.tcl,v diff -u -r1.7.2.2 -r1.7.2.3 --- openacs-4/packages/cms/www/modules/types/mime-types.tcl 6 Jun 2005 17:07:24 -0000 1.7.2.2 +++ openacs-4/packages/cms/www/modules/types/mime-types.tcl 31 Aug 2006 19:59:08 -0000 1.7.2.3 @@ -23,26 +23,24 @@ template::list::create \ -name mime_types \ -multirow registered_mime_types \ - -has_checkboxes \ - -key mime_types \ + -key mime_type \ + -bulk_actions [list "Unregister marked mime types" \ + [export_vars -base unregister-mime-type {mount_point}] \ + "Unregister marked mime types"] \ + -bulk_action_export_vars content_type \ + -no_data "No mime types registered to this content type yet." \ -elements { label { label "Mime Type" } - unreg { - display_template "<a href=\"@registered_mime_types.unreg_url@\">unregister</a>" - } } -db_multirow -extend {unreg unreg_url} registered_mime_types get_reg_mime_types "" { - set unreg_url [export_vars -base unregister-mime-type {content_type mime_type}] -} - +db_multirow registered_mime_types get_reg_mime_types {} + set page_title "Register MIME types to $content_type_name" -form create register -#-action "mime-types" +form create register -action mime-types element create register id \ -datatype keyword \ @@ -64,20 +62,11 @@ if { [form is_valid register] } { form get_values register content_type mime_type + ns_log notice "========================================== is_valid! " + content::type::register_mime_type -content_type $content_type \ + -mime_type $mime_type - db_transaction { - - db_exec_plsql register_mime_type " - begin - content_type.register_mime_type ( - content_type => :content_type, - mime_type => :mime_type - ); - end;" - - } - - content_method::flush_content_methods_cache $content_type - - template::forward "index?content_type=$content_type" + cms::type::flush_content_methods_cache $content_type + set type_props_tab mime_types + ad_returnredirect [export_vars -base index {content_type type_props_tab}] } Index: openacs-4/packages/cms/www/modules/types/register-templates.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/register-templates.tcl,v diff -u -r1.6 -r1.6.2.1 --- openacs-4/packages/cms/www/modules/types/register-templates.tcl 16 May 2005 22:59:25 -0000 1.6 +++ openacs-4/packages/cms/www/modules/types/register-templates.tcl 31 Aug 2006 19:59:08 -0000 1.6.2.1 @@ -33,8 +33,8 @@ # grab marked templates from the clipboard #set root_id [cm::modules::templates::getRootFolderID] -set clip [clipboard::parse_cookie] -set marked_templates [clipboard::get_items $clip templates] +set clip [cms::clipboard::parse_cookie] +set marked_templates [cms::clipboard::get_items $clip templates] set marked_templates_csv [join $marked_templates ","] if { [llength $marked_templates] == 0 } { Index: openacs-4/packages/cms/www/modules/types/types-header.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/types-header.adp,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/types/types-header.adp 16 May 2005 17:38:19 -0000 1.1 +++ openacs-4/packages/cms/www/modules/types/types-header.adp 31 Aug 2006 19:59:08 -0000 1.1.2.1 @@ -1,5 +1,5 @@ <nobr><p> -<include src="../../bookmark" mount_point="@mount_point@" id="@content_type@"> +<include src="/packages/cms/lib/clip" mount_point="@mount_point@" id="@content_type@"> @page_title;noquote@ </p> </nobr> Index: openacs-4/packages/cms/www/modules/types/types-tabs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/types-tabs.adp,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/types/types-tabs.adp 16 May 2005 17:38:19 -0000 1.1 +++ openacs-4/packages/cms/www/modules/types/types-tabs.adp 31 Aug 2006 19:59:08 -0000 1.1.2.1 @@ -13,6 +13,28 @@ </div> </else> + <if @type_props_tab@ eq mime_types> + <div class="tab" id="subnavbar-here"> + Mime Types + </div> + </if> + <else> + <div class="tab"> + <a href="@package_url@modules/types/index?content_type=@content_type@&mount_point=types&parent_type=@parent_type@&type_props_tab=mime_types" title="" class="subnavbar-unselected">Mime Types</a> + </div> + </else> + + <if @type_props_tab@ eq content_method> + <div class="tab" id="subnavbar-here"> + Content Methods + </div> + </if> + <else> + <div class="tab"> + <a href="@package_url@modules/types/index?content_type=@content_type@&mount_point=types&parent_type=@parent_type@&type_props_tab=content_method" title="" class="subnavbar-unselected">Content Methods</a> + </div> + </else> + <if @type_props_tab@ eq relations> <div class="tab" id="subnavbar-here"> Relations @@ -52,9 +74,11 @@ </div> </if> <else> + <if @has_subtypes_p@> <div class="tab"> <a href="@package_url@modules/types/index?content_type=@content_type@&mount_point=types&parent_type=@parent_type@&type_props_tab=subtypes" title="" class="subnavbar-unselected">Subtypes</a> </div> + </if> </else> </div> Index: openacs-4/packages/cms/www/modules/types/types-tabs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/types-tabs.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/cms/www/modules/types/types-tabs.tcl 16 May 2005 17:38:19 -0000 1.1 +++ openacs-4/packages/cms/www/modules/types/types-tabs.tcl 31 Aug 2006 19:59:08 -0000 1.1.2.1 @@ -5,3 +5,4 @@ request set_param type_props_tab -datatype keyword -optional -value attributes set package_url [ad_conn package_url] +set has_subtypes_p [cms::type::has_subtypes_p -content_type $content_type] Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/types/unregister-mime-type-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1.14.1 refers to a dead (removed) revision in file `openacs-4/packages/cms/www/modules/types/unregister-mime-type-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/cms/www/modules/types/unregister-mime-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/unregister-mime-type.tcl,v diff -u -r1.5.2.2 -r1.5.2.3 --- openacs-4/packages/cms/www/modules/types/unregister-mime-type.tcl 6 Jun 2005 17:07:24 -0000 1.5.2.2 +++ openacs-4/packages/cms/www/modules/types/unregister-mime-type.tcl 31 Aug 2006 19:59:08 -0000 1.5.2.3 @@ -1,21 +1,22 @@ -# /types/unregister-mime-type.tcl -# Unregister a MIME type to a content type +ad_page_contract { + Unregister a MIME type to a content type + @author Michael Steigman + @creation-date April 2006 +} { + { mime_type:multiple } + { content_type } + { type_props_tab "mime_types" } +} -request create -request set_param content_type -datatype keyword -request set_param mime_type -datatype text +permission::require_permission -party_id [auth::require_login] \ + -object_id [cm::modules::get_module_id -module_name types \ + -subsite_id [ad_conn subsite_id]] -privilege write - -db_transaction { - - permission::require_permission -party_id [auth::require_login] \ - -object_id [cm::modules::get_module_id -module_name types -subsite_id [ad_conn subsite_id]] -privilege write - - db_exec_plsql unregister_mime_type {} - +foreach mt $mime_type { + content::type::unregister_mime_type -content_type $content_type \ + -mime_type $mt } -content_method::flush_content_methods_cache $content_type - -template::forward "index?content_type=$content_type" +cms::type::flush_content_methods_cache $content_type +ad_returnredirect [export_vars -base index {content_type type_props_tab}] Index: openacs-4/packages/cms/www/modules/types/widget-register-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/widget-register-2.tcl,v diff -u -r1.4 -r1.4.12.1 --- openacs-4/packages/cms/www/modules/types/widget-register-2.tcl 20 Aug 2002 04:18:00 -0000 1.4 +++ openacs-4/packages/cms/www/modules/types/widget-register-2.tcl 31 Aug 2006 19:59:08 -0000 1.4.12.1 @@ -43,7 +43,7 @@ set param_source [lindex $wparam 5] form section widget_register "Param - $param" - widget::param_element_create widget_register $param $i $param_id \ + cms::widget::param_element_create widget_register $param $i $param_id \ $default_value $is_required $param_source incr i } @@ -64,7 +64,7 @@ db_transaction { for { set i 0 } { $i < $param_count } { incr i } { - widget::process_param \ + cms::widget::process_param \ widget_register $i $content_type $attribute_name } } Index: openacs-4/packages/cms/www/modules/types/widget-register-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/widget-register-3.tcl,v diff -u -r1.3 -r1.3.12.1 --- openacs-4/packages/cms/www/modules/types/widget-register-3.tcl 20 Aug 2002 11:17:30 -0000 1.3 +++ openacs-4/packages/cms/www/modules/types/widget-register-3.tcl 31 Aug 2006 19:59:08 -0000 1.3.12.1 @@ -26,7 +26,7 @@ set outstanding_params [llength $outstanding_params_list] db_1row get_name "" - content::add_attribute_element widget_preview $object_type $attribute_name + cms::form::add_attribute_element widget_preview $object_type $attribute_name } if { [form is_valid widget_preview] } {