Index: openacs-4/packages/cms/cms.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/cms.info,v diff -u -r1.14 -r1.15 --- openacs-4/packages/cms/cms.info 11 Apr 2005 17:14:16 -0000 1.14 +++ openacs-4/packages/cms/cms.info 9 May 2005 22:44:47 -0000 1.15 @@ -1,23 +1,19 @@ - + Content Management System Content Management Systems f - t - - - - oracle - postgresql - - Karl Goldstein - David Lutterkort - Michael Steigman - A CMS implemented on top of the Content Repository. + f + + + Michael Steigman + Karl Goldstein + David Lutterkort + A CMS implemented on top of the Content Repository 2001-01-26 - OpenACS + OpenACS CMS is a full featured content management system implemented on top of the content repository which supports workflow, composite objects, dynamicly created attributes, publishing to the filesystem and categorization. The user interface needs a great deal of work and the package relies on @@ -27,14 +23,18 @@ + + + + - - + + Index: openacs-4/packages/cms/todo =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/todo,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/todo 13 Apr 2005 20:15:18 -0000 1.4 +++ openacs-4/packages/cms/todo 9 May 2005 22:44:47 -0000 1.5 @@ -14,7 +14,7 @@ - serveroot/cms -> redirects to the cms? - all other urls are served by index.vuh? - create a new basic revision for each site upon which other content types will be based - - otherwise, all edits to basic item (content methods, etc.) will affect all sites + - otherwise, all edits to basic item (content methods, etc.) will affect all sites (actually, not true- UI doesn't allow editing of basic revision) - set root_key for content types to new basic revision type - create a new folder for templates and content and set module root_keys to folder_ids - set root content and template folder contexts to package_id @@ -28,10 +28,10 @@ top priority ------------ set up install procs that set contexts appropriately +remove unused procs files tidy up "view revision" page move tab setup in index pages into a per section tab master and call that from each subpage - select from cm_modules to build tabs -truncate (and noquote, if richtext) value column in content attribute list basic/cosmetic --------- @@ -88,26 +88,28 @@ drop function content_workflow__can_touch (integer,integer); drop function content_workflow__unfinished_workflow_exists (integer); + + -- to drop old perms: delete from acs_permissions where privilege like '%cm%'; -select acs_privilege__remove_child('cm_root', 'cm_admin'); -select acs_privilege__remove_child('cm_admin', 'cm_relate'); -select acs_privilege__remove_child('cm_relate', 'cm_write'); -select acs_privilege__remove_child('cm_write', 'cm_new'); -select acs_privilege__remove_child('cm_new', 'cm_examine'); -select acs_privilege__remove_child('cm_examine', 'cm_read'); -select acs_privilege__remove_child('cm_admin', 'cm_item_workflow'); -select acs_privilege__remove_child('cm_admin', 'cm_perm_admin'); -select acs_privilege__remove_child('cm_perm_admin', 'cm_perm'); -select acs_privilege__remove_child('admin', 'cm_root'); -select acs_privilege__drop_privilege('cm_root'); -select acs_privilege__drop_privilege('cm_admin'); -select acs_privilege__drop_privilege('cm_relate'); -select acs_privilege__drop_privilege('cm_write'); -select acs_privilege__drop_privilege('cm_new'); -select acs_privilege__drop_privilege('cm_examine'); -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'); - +-- removing privs below broke cms; still not sure why +-- select acs_privilege__remove_child('cm_root', 'cm_admin'); +-- select acs_privilege__remove_child('cm_admin', 'cm_relate'); +-- select acs_privilege__remove_child('cm_relate', 'cm_write'); +-- select acs_privilege__remove_child('cm_write', 'cm_new'); +-- select acs_privilege__remove_child('cm_new', 'cm_examine'); +-- select acs_privilege__remove_child('cm_examine', 'cm_read'); +-- select acs_privilege__remove_child('cm_admin', 'cm_item_workflow'); +-- select acs_privilege__remove_child('cm_admin', 'cm_perm_admin'); +-- select acs_privilege__remove_child('cm_perm_admin', 'cm_perm'); +-- select acs_privilege__remove_child('admin', 'cm_root'); +-- select acs_privilege__drop_privilege('cm_root'); +-- select acs_privilege__drop_privilege('cm_admin'); +-- select acs_privilege__drop_privilege('cm_relate'); +-- select acs_privilege__drop_privilege('cm_write'); +-- select acs_privilege__drop_privilege('cm_new'); +-- select acs_privilege__drop_privilege('cm_examine'); +-- 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 Index: openacs-4/packages/cms/lib/folder-items-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/lib/folder-items-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/lib/folder-items-oracle.xql 9 May 2005 22:44:47 -0000 1.1 @@ -0,0 +1,67 @@ + + + + oracle8.1.6 + + + + + select + r.item_id, v.title, last_modified + from + cr_resolved_items r, cr_items i, cr_folders f, cr_revisions v, + cr_revisions u, acs_objects o + where + r.parent_id = :parent_id + and + r.resolved_id = i.item_id + and + i.item_id = o.object_id + and + i.latest_revision = v.revision_id (+) + and + i.live_revision = u.revision_id (+) + and + i.item_id = f.folder_id (+) + [template::list::orderby_clause -name folder_items -orderby] + + + + + + + + select + r.item_id, r.item_id as id, v.revision_id, r.resolved_id, r.is_symlink, + r.name, i.parent_id, i.content_type, i.publish_status, u.publish_date, + NVL(trim( + decode(o.object_type, 'content_symlink', r.label, + 'content_folder', f.label, + nvl(v.title, i.name))), + '-') title, + o.object_type, t.pretty_name as pretty_content_type, last_modified, + v.content_length + from + cr_resolved_items r, cr_items i, cr_folders f, cr_revisions v, + cr_revisions u, acs_objects o, acs_object_types t + where + r.parent_id = :parent_id + and + r.resolved_id = i.item_id + and + i.item_id = o.object_id + and + i.content_type = t.object_type + and + i.latest_revision = v.revision_id (+) + and + i.live_revision = u.revision_id (+) + and + i.item_id = f.folder_id (+) + and + [template::list::page_where_clause -and -name folder_items -key r.item_id] + [template::list::orderby_clause -name folder_items -orderby] + + + + \ No newline at end of file Index: openacs-4/packages/cms/lib/folder-items-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/lib/folder-items-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/lib/folder-items-postgresql.xql 9 May 2005 22:44:47 -0000 1.1 @@ -0,0 +1,66 @@ + + + + postgresql7.1 + + + + + select + r.item_id, v.title, last_modified + from + cr_items i + LEFT OUTER JOIN + cr_revisions v ON i.latest_revision = v.revision_id + LEFT OUTER JOIN + cr_revisions u ON i.live_revision = u.revision_id + LEFT OUTER JOIN + cr_folders f ON i.item_id = f.folder_id, + cr_resolved_items r, acs_objects o + where + r.parent_id = :folder_id + and + r.resolved_id = i.item_id + and + i.item_id = o.object_id + [template::list::orderby_clause -name folder_items -orderby] + + + + + + + + select + r.item_id, r.item_id as id, v.revision_id, r.resolved_id, r.is_symlink, + r.name, i.parent_id, i.content_type, i.publish_status, u.publish_date, + coalesce(trim( + case when i.content_type = 'content_symlink' then r.label + when i.content_type = 'content_folder' then f.label + else coalesce(v.title, i.name) end),'-') as title, + t.pretty_name as pretty_content_type, last_modified, + v.content_length + from + cr_items i + LEFT OUTER JOIN + cr_revisions v ON i.latest_revision = v.revision_id + LEFT OUTER JOIN + cr_revisions u ON i.live_revision = u.revision_id + LEFT OUTER JOIN + cr_folders f ON i.item_id = f.folder_id, + cr_resolved_items r, acs_objects o, acs_object_types t + where + r.parent_id = :folder_id + and + r.resolved_id = i.item_id + and + i.item_id = o.object_id + and + i.content_type = t.object_type + [template::list::page_where_clause -and -name folder_items -key r.item_id] + [template::list::orderby_clause -name folder_items -orderby] + + + + + \ No newline at end of file Index: openacs-4/packages/cms/lib/folder-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/lib/folder-items.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/lib/folder-items.adp 9 May 2005 22:44:47 -0000 1.1 @@ -0,0 +1,2 @@ + + 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/lib/folder-items.tcl 9 May 2005 22:44:47 -0000 1.1 @@ -0,0 +1,70 @@ +# expects folder_id, parent_id, actions, orderby, page, mount_point + +template::list::create \ + -name folder_items \ + -multirow folder_contents \ + -has_checkboxes \ + -key item_id \ + -no_data "There are no items in this folder" \ + -page_size 20 \ + -page_query_name get_folder_contents_paginate \ + -actions $actions \ + -elements { + copy { + label "Clipboard" + display_template "
@folder_contents.copy;noquote@
" + } + title { + label "Name" + link_html { title "View this item"} + link_url_col item_url + orderby title + } + file_size { + label "Size" + } + publish_date { + label "Publish Date" + display_eval { + [ad_decode $publish_status "live" \ + [lc_time_fmt $publish_date "%q %r"] \ + "-"] + } + } + pretty_content_type { + label "Type" + } + last_modified { + label "Last Modified" + orderby last_modified + display_eval {[lc_time_fmt $last_modified "%q %r"]} + } + } \ + -filters { + folder_id {} + parent_id {} + mount_point {} + } + +db_multirow -extend { item_url copy file_size } folder_contents get_folder_contents "" { + switch $content_type { + content_folder { + set folder_id $item_id + set item_url [export_vars -base index { folder_id parent_id mount_point}] + } + content_template { + set item_url [export_vars -base ../templates/properties { item_id folder_id parent_id mount_point}] + } + default { + set item_url [export_vars -base ../items/index { item_id revision_id parent_id mount_point}] + } + } + + if { ![ template::util::is_nil content_length ] } { + set file_size [lc_numeric [expr $content_length / 1000.00] "%.2f"] + } else { + set file_size "-" + } + + set copy [clipboard::render_bookmark $mount_point $item_id [ad_conn package_url]] +} Index: openacs-4/packages/cms/sql/oracle/cms-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/oracle/cms-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/sql/oracle/cms-create.sql 11 Apr 2005 17:14:17 -0000 1.3 +++ openacs-4/packages/cms/sql/oracle/cms-create.sql 9 May 2005 22:44:48 -0000 1.4 @@ -52,7 +52,15 @@ pretty_plural => 'Sort Keys' ); + attr_id := acs_attribute.create_attribute ( + object_type => 'content_module', + attribute_name => 'package_id', + datatype => 'number', + pretty_name => 'Package ID', + pretty_plural => 'Package IDs' + ); + end; / show errors @@ -87,6 +95,7 @@ root_key in cm_modules.root_key%TYPE, sort_key in cm_modules.sort_key%TYPE, parent_id in acs_objects.context_id%TYPE default null, + package_id in cm_modules.package_id%TYPE, object_id in acs_objects.object_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -96,7 +105,6 @@ object_type in acs_objects.object_type%TYPE default 'content_module' ) return acs_objects.object_id%TYPE; - function get_label ( --/** Returns the label for the module. -- This function is the default name method for the module object @@ -107,6 +115,9 @@ module_id in cm_modules.module_id%TYPE ) return cm_modules.name%TYPE; +function delete ( + module_id in cm_modules.module_id%TYPE +) return cm_modules.module_id%TYPE; end content_module; / @@ -121,6 +132,7 @@ root_key in cm_modules.root_key%TYPE, sort_key in cm_modules.sort_key%TYPE, parent_id in acs_objects.context_id%TYPE default null, + package_id in cm_modules.package_id%TYPE, object_id in acs_objects.object_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -144,9 +156,9 @@ ); insert into cm_modules - (module_id, key, name, root_key, sort_key) + (module_id, key, name, root_key, sort_key, package_id) values - (module_id, key, name, root_key, sort_key); + (module_id, key, name, root_key, sort_key, package_id); return module_id; end; @@ -173,34 +185,45 @@ end get_label; +function delete ( + p_module_id in cm_modules.module_id%TYPE +) return cm_modules.module_id%TYPE +is + v_module_id cm_modules.name%TYPE; +begin + select content_item__delete(delete.p_module_id); + delete from cm_modules where module_id = delete.p_module_id; + return delete.p_module_id; +end delete; + end content_module; / show errors -- Insert the default modules -declare - v_id integer; - v_module_id integer; -begin +-- declare +-- v_id integer; +-- v_module_id integer; +-- begin - v_id := content_module.new('My Tasks', 'workspace', NULL, 1,0); - v_id := content_module.new('Site Map', 'sitemap', - content_item.get_root_folder, 2,0); - v_id := content_module.new('Templates', 'templates', - content_template.get_root_folder, 3,0); - v_id := content_module.new('Content Types', 'types', - 'content_revision', 4,0); - v_id := content_module.new('Search', 'search', null, 5,0); - v_id := content_module.new('Subject Keywords', 'categories', 0, 6,0); - v_id := content_module.new('Users', 'users', null, 7,0); - v_id := content_module.new('Workflows', 'workflow', null, 8,0); +-- v_id := content_module.new('My Tasks', 'workspace', NULL, 1,0); +-- v_id := content_module.new('Site Map', 'sitemap', +-- content_item.get_root_folder, 2,0); +-- v_id := content_module.new('Templates', 'templates', +-- content_template.get_root_folder, 3,0); +-- v_id := content_module.new('Content Types', 'types', +-- 'content_revision', 4,0); +-- v_id := content_module.new('Search', 'search', null, 5,0); +-- v_id := content_module.new('Subject Keywords', 'categories', 0, 6,0); +-- v_id := content_module.new('Users', 'users', null, 7,0); +-- v_id := content_module.new('Workflows', 'workflow', null, 8,0); -end; -/ -show errors +-- end; +-- / +-- show errors prompt *** Defining utility functions @@ -231,10 +254,10 @@ @@ cms-content-methods prompt *** Compiling workflow model... -@@ cms-publishing-wf +-- @@ cms-publishing-wf prompt *** Compiling workflow helper package... -@@ cms-workflow +-- @@ cms-workflow prompt *** Compiling permissions model... -- @@ cms-permissions Index: openacs-4/packages/cms/sql/postgresql/cms-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/sql/postgresql/cms-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/cms/sql/postgresql/cms-create.sql 11 Apr 2005 17:14:17 -0000 1.10 +++ openacs-4/packages/cms/sql/postgresql/cms-create.sql 9 May 2005 22:44:48 -0000 1.11 @@ -81,7 +81,23 @@ ''f'' ); + attr_id := acs_attribute__create_attribute ( + ''content_module'', + ''package_id'', + ''number'', + ''Package ID'', + ''Package IDs'', + null, + null, + null, + 1, + 1, + null, + ''type_specific'', + ''f'' + ); + return 0; end;' language 'plpgsql'; @@ -99,14 +115,16 @@ acs_objects on delete cascade constraint cm_modules_pk primary key, - key varchar(20) - constraint cm_modules_unq - unique, + key varchar(20), name varchar(100) constraint cm_modules_name_nil not null, root_key varchar(100), - sort_key integer + sort_key integer, + -- can probably remove this after 5.2 release but it made things v. easy + package_id integer + constraint cm_modules_pkg_id_fk + refereneces apm_packages ); comment on column cm_modules.root_key is ' @@ -149,21 +167,23 @@ -- create or replace package body content_module -create or replace function content_module__new (varchar,varchar,varchar,integer,integer) +create or replace function content_module__new (varchar,varchar,varchar,integer,integer,integer) returns integer as ' declare p_name alias for $1; p_key alias for $2; p_root_key alias for $3; p_sort_key alias for $4; - p_parent_id alias for $5; -- default null + p_parent_id alias for $5; -- default package_id + p_package_id alias for $6; begin return content_module__new(p_name, p_key, p_root_key, p_sort_key, p_parent_id, + p_package_id, null, now(), null, @@ -172,26 +192,27 @@ ); end;' language 'plpgsql'; -create or replace function content_module__new (varchar,varchar,integer,integer,integer) +create or replace function content_module__new (varchar,varchar,integer,integer,integer,integer) returns integer as ' begin - return content_module__new ($1, $2, cast ($3 as varchar), $4, $5); + return content_module__new ($1, $2, cast ($3 as varchar), $4, $5, $6); end;' language 'plpgsql'; -- function new -create or replace function content_module__new (varchar,varchar,varchar,integer,integer,integer,timestamptz,integer,varchar,varchar) +create or replace function content_module__new (varchar,varchar,varchar,integer,integer,integer,integer,timestamptz,integer,varchar,varchar) returns integer as ' declare p_name alias for $1; p_key alias for $2; p_root_key alias for $3; p_sort_key alias for $4; p_parent_id alias for $5; -- null - p_object_id alias for $6; -- null - p_creation_date alias for $7; -- now() - p_creation_user alias for $8; -- null - p_creation_ip alias for $9; -- null - p_object_type alias for $10; -- ''content_module'' + p_package_id alias for $6; + p_object_id alias for $7; -- null + p_creation_date alias for $8; -- now() + p_creation_user alias for $9; -- null + p_creation_ip alias for $10; -- null + p_object_type alias for $11; -- ''content_module'' v_module_id integer; begin v_module_id := content_item__new( @@ -214,15 +235,26 @@ ); insert into cm_modules - (module_id, key, name, root_key, sort_key) + (module_id, key, name, root_key, sort_key, package_id) values - (v_module_id, p_key, p_name, p_root_key, p_sort_key); + (v_module_id, p_key, p_name, p_root_key, p_sort_key, p_package_id); return v_module_id; end;' language 'plpgsql'; +create or replace function content_module__delete (integer) returns int4 as ' +declare + p_module_id alias for $1; +begin + select content_item__delete(:p_module_id); + delete from cm_modules where module_id = :p_module_id; + + return 0; + +end;' language 'plpgsql'; + create or replace function content_module__get_label (integer) returns varchar as ' declare p_module_id alias for $1; @@ -240,32 +272,32 @@ end;' language 'plpgsql'; --- Insert the default modules -create or replace function inline_1 () returns integer as ' -declare - v_id integer; - v_module_id integer; -begin +-- Insert the default modules (MS: now done via callbacks) +-- create or replace function inline_1 () returns integer as ' +-- declare +-- v_id integer; +-- v_module_id integer; +-- begin - v_id := content_module__new(''My Tasks'', ''workspace'', NULL, 1,0); - v_id := content_module__new(''Site Map'', ''sitemap'', - content_item__get_root_folder(null), 2,0); - v_id := content_module__new(''Templates'', ''templates'', - content_template__get_root_folder(), 3,0); - v_id := content_module__new(''Content Types'', ''types'', - ''content_revision'', 4,0); - v_id := content_module__new(''Search'', ''search'', null, 5,0); - v_id := content_module__new(''Subject Keywords'', ''categories'', 0, 6,0); - v_id := content_module__new(''Users'', ''users'', null, 7,0); - v_id := content_module__new(''Workflows'', ''workflow'', null, 8,0); +-- v_id := content_module__new(''My Tasks'', ''workspace'', NULL, 1,0); +-- v_id := content_module__new(''Site Map'', ''sitemap'', +-- content_item__get_root_folder(null), 2,0); +-- v_id := content_module__new(''Templates'', ''templates'', +-- content_template__get_root_folder(), 3,0); +-- v_id := content_module__new(''Content Types'', ''types'', +-- ''content_revision'', 4,0); +-- v_id := content_module__new(''Search'', ''search'', null, 5,0); +-- v_id := content_module__new(''Subject Keywords'', ''categories'', 0, 6,0); +-- v_id := content_module__new(''Users'', ''users'', null, 7,0); +-- v_id := content_module__new(''Workflows'', ''workflow'', null, 8,0); - return null; +-- return null; -end;' language 'plpgsql'; +-- end;' language 'plpgsql'; -select inline_1 (); +-- select inline_1 (); -drop function inline_1 (); +-- drop function inline_1 (); -- prompt *** Defining utility functions 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.4 -r1.5 --- openacs-4/packages/cms/tcl/clipboard-procs.tcl 16 Nov 2004 22:32:46 -0000 1.4 +++ openacs-4/packages/cms/tcl/clipboard-procs.tcl 9 May 2005 22:44:48 -0000 1.5 @@ -87,8 +87,8 @@ Compile and eval a chunk of ADP for the bookmark } { - set img_checked "[ad_conn package_url]resources/checked.gif" - set img_unchecked "[ad_conn package_url]resources/unchecked.gif" + set img_checked "${package_url}resources/checked.gif" + set img_unchecked "${package_url}resources/unchecked.gif" set clipboardfloats_p [clipboard::floats_p] 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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/cms/tcl/install-procs.tcl 9 May 2005 22:44:48 -0000 1.1 @@ -0,0 +1,15 @@ +ad_library { + install callbacks +} +namespace eval cms::install {} +ad_proc -public cms::install::package_instantiate { -package_id } { + Procedures to run on package instantiation +} { + cm::modules::install::create_modules -package_id $package_id +} + +ad_proc -public cms::install::package_uninstantiate { -package_id } { + Procedures to run on package uninstantiation +} { + cm::modules::install::delete_modules -package_id $package_id +} Index: openacs-4/packages/cms/tcl/module-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs-oracle.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/tcl/module-procs-oracle.xql 20 Aug 2001 04:35:41 -0000 1.3 +++ openacs-4/packages/cms/tcl/module-procs-oracle.xql 9 May 2005 22:44:48 -0000 1.4 @@ -190,5 +190,27 @@ + + + begin + :1 := content_module.new ( + :module_name, --name + to_lower(:module), + :root_key, + :sort_key, + :package_id, -- parent_id + :package_id -- package_id + ); + end; + + + + + + begin + :1 := content_module.delete (:module_id); + end; + + Index: openacs-4/packages/cms/tcl/module-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs-postgresql.xql,v diff -u -r1.7 -r1.8 --- openacs-4/packages/cms/tcl/module-procs-postgresql.xql 16 Sep 2002 15:30:29 -0000 1.7 +++ openacs-4/packages/cms/tcl/module-procs-postgresql.xql 9 May 2005 22:44:48 -0000 1.8 @@ -83,16 +83,16 @@ - - select content_template__get_root_folder() + select root_key from cm_modules where key = 'templates' and package_id = :package_id + -- select content_template__get_root_folder() - - select content_item__get_root_folder(null) + -- select content_item__get_root_folder(null) + select root_key from cm_modules where key = 'sitemap' and package_id = :package_id @@ -191,5 +191,23 @@ - + + + select content_module__new ( + :module_name, --name + lower(:module), + :root_key, + :sort_key, + :package_id, -- parent_id + :package_id -- package_id + ) + + + + + + select content_module__delete (:module_id) + + + Index: openacs-4/packages/cms/tcl/module-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/cms/tcl/module-procs.tcl 15 Sep 2002 14:35:00 -0000 1.7 +++ openacs-4/packages/cms/tcl/module-procs.tcl 9 May 2005 22:44:48 -0000 1.8 @@ -29,18 +29,20 @@ namespace eval categories { } namespace eval users { } namespace eval clipboard { } + namespace eval install { } } } -ad_proc -public cm::modules::get_module_id { module_name } { +ad_proc -public cm::modules::get_module_id { + -module_name:required + -package_id:required +} { Get the id of some module, return empty string on failure } { - set id [db_string module_get_id ""] - - return $id + return [db_string module_get_id ""] } ad_proc -public cm::modules::getMountPoints {} { @@ -78,17 +80,17 @@ -ad_proc -public cm::modules::templates::getRootFolderID {} { +ad_proc -public cm::modules::templates::getRootFolderID { package_id } { Retreive the id of the root folder } { - if { ![nsv_exists browser_state template_root] } { + if { ![nsv_exists browser_state template_root_$package_id] } { set root_id [db_string template_get_root_id ""] - nsv_set browser_state template_root $root_id + nsv_set browser_state template_root_$package_id $root_id return $root_id } else { - return [nsv_get browser_state template_root] + return [nsv_get browser_state template_root_$package_id] } } @@ -123,17 +125,17 @@ -ad_proc -public cm::modules::sitemap::getRootFolderID {} { +ad_proc -public cm::modules::sitemap::getRootFolderID { package_id } { Retreive the id of the root folder } { - if { ![nsv_exists browser_state sitemap_root] } { + if { ![nsv_exists browser_state sitemap_root_$package_id] } { set root_id [db_string sitemap_get_root_id ""] - nsv_set browser_state sitemap_root $root_id + nsv_set browser_state sitemap_root_$package_id $root_id return $root_id } else { - return [nsv_get browser_state sitemap_root] + return [nsv_get browser_state sitemap_root_$package_id] } } @@ -316,4 +318,56 @@ # end of clipboard namespace +ad_proc -private cm::modules::install::create_modules { + -package_id:required +} { + Create modules for a new CMS instance + +} { + set instance_name [apm_instance_name_from_id $package_id] + set modules [list Sitemap Templates Types Categories Search] + set sort_key 0 + set root_key "" + foreach module $modules { + incr sort_key + set module_name "$instance_name $module" + switch $module { + "Sitemap" { + set root_key [content::folder::new -name pkg_${package_id}_content \ + -context_id $package_id \ + -parent_id "-100" \ + -label "$instance_name $module" ] + } + "Templates" { + set root_key [content::folder::new -name pkg_${package_id}_templates \ + -context_id $package_id \ + -parent_id "-200" \ + -label "$instance_name $module" ] + } + "Types" { + set root_key content_revision + } + "Categories" { + set root_key 0 + } + } + set module_id [db_exec_plsql create_module {}] + # assign context_id of package_id + db_dml update_module_context {} + } +} + +ad_proc -private cm::modules::install::delete_modules { + -package_id:required +} { + + Delete modules for a given CMS instance + +} { + + db_foreach get_module_ids { + db_exec_plsql delete_module {} + } + +} \ No newline at end of file Index: openacs-4/packages/cms/tcl/module-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/module-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/tcl/module-procs.xql 20 Aug 2001 04:35:42 -0000 1.3 +++ openacs-4/packages/cms/tcl/module-procs.xql 9 May 2005 22:44:48 -0000 1.4 @@ -6,6 +6,7 @@ select module_id from cm_modules where key = :module_name + and package_id = :package_id @@ -35,5 +36,16 @@ + + + update acs_objects set context_id = :package_id where object_id = :module_id + + + + + + select module_id from cm_modules where package_id = :package_id + + Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/pagination-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/pagination-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.8 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/pagination-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/pagination-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? 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.13 -r1.14 --- openacs-4/packages/cms/tcl/publish-procs.tcl 29 Jun 2004 10:17:52 -0000 1.13 +++ openacs-4/packages/cms/tcl/publish-procs.tcl 9 May 2005 22:44:48 -0000 1.14 @@ -24,72 +24,72 @@ # # Publish procs -ad_proc -public publish::get_page_root {} { +# ad_proc -public publish::get_page_root {} { - @public get_page_root +# @public get_page_root - Get the page root. All items will be published to the - filesystem with their URLs relative to this root. - The page root is controlled by the PageRoot parameter in CMS. - A relative path is relative to [ns_info pageroot] - The default is [ns_info pageroot] +# Get the page root. All items will be published to the +# filesystem with their URLs relative to this root. +# The page root is controlled by the PageRoot parameter in CMS. +# A relative path is relative to [ns_info pageroot] +# The default is [ns_info pageroot] - @return The page root +# @return The page root - @see publish::get_template_root - @see publish::get_publish_roots +# @see publish::get_template_root +# @see publish::get_publish_roots -} { +# } { - set root_path [ad_parameter -package_id [ad_conn package_id] \ - PageRoot dummy ""] +# set root_path [ad_parameter -package_id [ad_conn package_id] \ +# PageRoot dummy ""] - if { [string index $root_path 0] != "/" } { - # Relative path, prepend server_root - set root_path "[ns_info pageroot]/$root_path" - } +# if { [string index $root_path 0] != "/" } { +# # Relative path, prepend server_root +# set root_path "[ns_info pageroot]/$root_path" +# } - return [ns_normalizepath $root_path] +# return [ns_normalizepath $root_path] -} +# } -ad_proc -public publish::get_publish_roots {} { +# ad_proc -public publish::get_publish_roots {} { - @public get_publish_roots +# @public get_publish_roots - Get a list of all page roots to which files may be published. - The publish roots are controlled by the PublishRoots parameter in CMS, - which should be a space-separated list of all the roots. Relative paths - are relative to publish::get_page_root. - The default is [list [publish::get_page_root]] +# Get a list of all page roots to which files may be published. +# The publish roots are controlled by the PublishRoots parameter in CMS, +# which should be a space-separated list of all the roots. Relative paths +# are relative to publish::get_page_root. +# The default is [list [publish::get_page_root]] - @return A list of all the publish roots +# @return A list of all the publish roots - @see publish::get_template_root - @see publish::get_page_root +# @see publish::get_template_root +# @see publish::get_page_root -} { +# } { - set root_paths [ad_parameter -package_id [ad_conn package_id] \ - PublishRoots dummy] +# set root_paths [ad_parameter -package_id [ad_conn package_id] \ +# PublishRoots dummy] - if { [llength $root_paths] == 0 } { - set root_paths [list [get_page_root]] - } +# if { [llength $root_paths] == 0 } { +# set root_paths [list [get_page_root]] +# } - # Resolve relative paths - set page_root [publish::get_page_root] - set absolute_paths [list] - foreach path $root_paths { - if { [string index $path 0] != "/" } { - lappend absolute_paths [ns_normalizepath "$page_root/$path"] - } else { - lappend absolute_paths $path - } - } +# # Resolve relative paths +# set page_root [publish::get_page_root] +# set absolute_paths [list] +# foreach path $root_paths { +# if { [string index $path 0] != "/" } { +# lappend absolute_paths [ns_normalizepath "$page_root/$path"] +# } else { +# lappend absolute_paths $path +# } +# } - return $absolute_paths -} +# return $absolute_paths +# } @@ -121,23 +121,23 @@ } -ad_proc -public publish::mkdirs { path } { +# ad_proc -public publish::mkdirs { path } { - @public mkdirs +# @public mkdirs - Create all the directories neccessary to save the specified file +# Create all the directories neccessary to save the specified file - @param path - The path to the file that is about to be saved +# @param path +# The path to the file that is about to be saved -} { +# } { - set index [string last "/" $path] - if { $index != -1 } { - file mkdir [string range $path 0 [expr $index - 1]] - } -} +# set index [string last "/" $path] +# if { $index != -1 } { +# file mkdir [string range $path 0 [expr $index - 1]] +# } +# } Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/user-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.5 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/user-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/user-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/user-procs.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/workflow-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/workflow-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.11 refers to a dead (removed) revision in file `openacs-4/packages/cms/tcl/workflow-procs.tcl'. 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.5 -r1.6 --- openacs-4/packages/cms/www/master.adp 13 Apr 2005 20:15:18 -0000 1.5 +++ openacs-4/packages/cms/www/master.adp 9 May 2005 22:44:48 -0000 1.6 @@ -85,7 +85,7 @@ 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.5 -r1.6 --- openacs-4/packages/cms/www/modules/clipboard/index.tcl 17 Nov 2004 23:07:36 -0000 1.5 +++ openacs-4/packages/cms/www/modules/clipboard/index.tcl 9 May 2005 22:44:48 -0000 1.6 @@ -49,7 +49,7 @@ if { [catch { cm::modules::${id}::getSortedPaths items $item_id_list \ - [cm::modules::${id}::getRootFolderID] + [cm::modules::${id}::getRootFolderID [ad_conn package_id]] template::multirow extend items url template::multirow foreach items { 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.9 -r1.10 --- openacs-4/packages/cms/www/modules/items/attributes.tcl 13 Apr 2005 20:15:19 -0000 1.9 +++ openacs-4/packages/cms/www/modules/items/attributes.tcl 9 May 2005 22:44:49 -0000 1.10 @@ -48,9 +48,12 @@ } attribute_value { label "Value" + display_template "@attributes.attribute_value;noquote@" + html { width 60% } } object_label { label "Origin" + html { width 10% } } } @@ -65,6 +68,6 @@ set value "-" } - set attribute_value $value + set attribute_value [string_truncate $value] } 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.6 -r1.7 --- openacs-4/packages/cms/www/modules/items/create-2.tcl 13 Apr 2005 20:15:19 -0000 1.6 +++ openacs-4/packages/cms/www/modules/items/create-2.tcl 9 May 2005 22:44:49 -0000 1.7 @@ -100,7 +100,7 @@ } 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] # do wizard forward or forward to return_url 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.5 -r1.6 --- openacs-4/packages/cms/www/modules/items/index.adp 13 Apr 2005 20:15:19 -0000 1.5 +++ openacs-4/packages/cms/www/modules/items/index.adp 9 May 2005 22:44:49 -0000 1.6 @@ -77,17 +77,17 @@
- +

- +

- +
@@ -97,14 +97,14 @@
Child Items

- +

Related Items

- +

@@ -115,21 +115,21 @@

Publishing Status

- +

Registered Templates

- +

Comments

- Place holder for comments + Place holder for comments

@@ -139,7 +139,7 @@

Item permissions
- +

@@ -148,16 +148,13 @@ -

- - Rename this content item - - -
- +

  • + Rename this content item
  • +
  • - Delete this content item -

    + Delete this content item

  • + 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.6 -r1.7 --- openacs-4/packages/cms/www/modules/items/index.tcl 13 Apr 2005 20:15:19 -0000 1.6 +++ openacs-4/packages/cms/www/modules/items/index.tcl 9 May 2005 22:44:49 -0000 1.7 @@ -59,9 +59,9 @@ # The root ID is to determine the appropriate path to the item if { [string equal $mount_point templates] } { - set root_id [cm::modules::templates::getRootFolderID] + set root_id [cm::modules::templates::getRootFolderID [ad_conn package_id]] } else { - set root_id [cm::modules::sitemap::getRootFolderID] + set root_id [cm::modules::sitemap::getRootFolderID [ad_conn package_id]] } # Set up passthrough for permissions Index: openacs-4/packages/cms/www/modules/sitemap/ancestors-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/ancestors-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/sitemap/ancestors-postgresql.xql 16 Nov 2004 22:32:50 -0000 1.4 +++ openacs-4/packages/cms/www/modules/sitemap/ancestors-postgresql.xql 9 May 2005 22:44:49 -0000 1.5 @@ -32,7 +32,7 @@ i1.tree_sortkey between i2.tree_sortkey and tree_right(i2.tree_sortkey) ) t where - i.item_id = t.parent_id + i.item_id = t.parent_id and t.tree_level > 2 order by tree_level asc Index: openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl 16 Nov 2004 22:32:50 -0000 1.10 +++ openacs-4/packages/cms/www/modules/sitemap/ancestors.tcl 9 May 2005 22:44:49 -0000 1.11 @@ -10,7 +10,7 @@ index_page_id -datatype integer -optional } -set root_id [cm::modules::${mount_point}::getRootFolderID] +set root_id [cm::modules::${mount_point}::getRootFolderID [ad_conn package_id]] set root_title [item::get_title $root_id] # special case - when the item_id is null, set it to the root folder @@ -26,9 +26,12 @@ #set bookmark [clipboard::get_bookmark_icon $clip $mount_point $item_id] # get the context bar info +if { $root_id == $item_id } { + set context:rowcount 0 +} else { + db_multirow context get_context "" +} -db_multirow context get_context "" - # pass in index_page_id to improve efficiency if { ![template::util::is_nil index_page_id] } { Index: openacs-4/packages/cms/www/modules/sitemap/attributes.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/attributes.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/cms/www/modules/sitemap/attributes.adp 13 Apr 2005 20:15:19 -0000 1.6 +++ openacs-4/packages/cms/www/modules/sitemap/attributes.adp 9 May 2005 22:44:49 -0000 1.7 @@ -8,7 +8,7 @@

    -Back to @folder_name@ contents +Back to @folder_name@ contents

    Index: openacs-4/packages/cms/www/modules/sitemap/attributes.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/attributes.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/cms/www/modules/sitemap/attributes.tcl 13 Apr 2005 20:15:19 -0000 1.9 +++ openacs-4/packages/cms/www/modules/sitemap/attributes.tcl 9 May 2005 22:44:49 -0000 1.10 @@ -11,7 +11,7 @@ # default folder_id is the root folder if { [template::util::is_nil folder_id] } { - set folder_id [cm::modules::${mount_point}::getRootFolderID] + set folder_id [cm::modules::${mount_point}::getRootFolderID [ad_conn package_id]] } if { [template::util::is_nil folder_resolved_id] } { Index: openacs-4/packages/cms/www/modules/sitemap/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/delete.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/cms/www/modules/sitemap/delete.tcl 13 Apr 2005 20:15:19 -0000 1.7 +++ openacs-4/packages/cms/www/modules/sitemap/delete.tcl 9 May 2005 22:44:49 -0000 1.8 @@ -16,7 +16,7 @@ if { [string match [content::folder::is_empty -folder_id $folder_id] "f" ] } { util_user_message -message "Folder is not empty. Please delete folder contents and try again." - ad_returnredirect [export_vars -base index {folder_id}] + ad_returnredirect [export_vars -base ../$mount_point/index {folder_id}] } else { @@ -30,6 +30,6 @@ # Redirect to parent folder set folder_id $parent_id - ad_returnredirect [export_vars -base index {folder_id}] + ad_returnredirect [export_vars -base ../$mount_point/index {folder_id}] } 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.6 -r1.7 --- openacs-4/packages/cms/www/modules/sitemap/index.adp 13 Apr 2005 20:15:19 -0000 1.6 +++ openacs-4/packages/cms/www/modules/sitemap/index.adp 9 May 2005 22:44:49 -0000 1.7 @@ -3,7 +3,7 @@

    - + @page_title;noquote@ @@ -15,18 +15,19 @@

    - + mount_point=@mount_point@ />

    - + +

    -
    - Links to this folder: @@ -45,27 +46,16 @@ - - - - - Add a new under this @what@. - -
    +

    -
    - -

    - - - - - - - - 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.11 -r1.12 --- openacs-4/packages/cms/www/modules/sitemap/index.tcl 14 Apr 2005 00:51:47 -0000 1.11 +++ openacs-4/packages/cms/www/modules/sitemap/index.tcl 9 May 2005 22:44:49 -0000 1.12 @@ -8,15 +8,16 @@ @creation-date October 2004 } { { folder_id:integer ""} - { mount_point "sitemap" } + { mount_point:optional "sitemap" } { parent_id:integer ""} { orderby "title,asc" } - { page:optional } + { page:optional ""} } set original_folder_id $folder_id set user_id [auth::require_login] -set root_id [cm::modules::${mount_point}::getRootFolderID] +set package_id [ad_conn package_id] +set root_id [cm::modules::${mount_point}::getRootFolderID $package_id] # Get the folder label/description # If :id does not exist, then use :root_id @@ -122,69 +123,6 @@ " } -template::list::create \ - -name folder_items \ - -multirow folder_contents \ - -has_checkboxes \ - -key item_id \ - -page_size 20 \ - -page_query_name get_folder_contents_paginate \ - -actions $actions \ - -elements { - copy { - label "Clipboard" - display_template "

    @folder_contents.copy;noquote@
    " - } - title { - label "Name" - link_html { title "View this item"} - link_url_col item_url - orderby title - } - file_size { - label "Size" - } - publish_date { - label "Publish Date" - display_eval { - [ad_decode $publish_status "live" \ - [lc_time_fmt $publish_date "%q %r"] \ - "-"] - } - } - pretty_content_type { - label "Type" - } - last_modified { - label "Last Modified" - orderby last_modified - display_eval {[lc_time_fmt $last_modified "%q %r"]} - } - } \ - -filters { - folder_id {} - parent_id {} - mount_point {} - } - -db_multirow -extend { item_url copy file_size } folder_contents get_folder_contents "" { - switch $content_type { - content_folder { - set folder_id $item_id - set item_url [export_vars -base index?mount_point=sitemap { folder_id parent_id }] - } - default { - set item_url [export_vars -base ../items/index?mount_point=sitemap { item_id revision_id parent_id }] - } - } - if { ![ template::util::is_nil content_length ] } { - set file_size [lc_numeric [expr $content_length / 1000.00] "%.2f"] - } else { - set file_size "-" - } - set copy [clipboard::render_bookmark sitemap $item_id [ad_conn package_url]] -} - form create add_item if { [template::util::is_nil original_folder_id] } { @@ -197,23 +135,26 @@ -datatype integer -widget hidden -param -optional element create add_item mount_point \ - -datatype string -widget hidden -param -optional + -datatype string -widget hidden -value $mount_point -set revision_types [cms_folder::get_registered_types $the_id] +set revision_types [list [list "----------------" ""]] +append revision_types " " +append revision_types [cms_folder::get_registered_types $the_id] set num_revision_types [llength $revision_types] element create add_item content_type \ - -datatype keyword \ - -widget select \ - -label "Content Type" \ - -options $revision_types + -datatype keyword \ + -widget select \ + -label "Content Type" \ + -options $revision_types \ + -html { onchange "javascript:this.form.submit();" } if { [form is_valid add_item] } { form get_values add_item folder_id mount_point content_type # if the folder_id is empty, then it must be the root folder if { [template::util::is_nil folder_id] } { - set folder_id [cm::modules::${mount_point}::getRootFolderID] + set folder_id [cm::modules::${mount_point}::getRootFolderID [ad_conn package_id]] } else { set folder_id $original_folder_id } @@ -224,3 +165,4 @@ forward "../items/create-1?parent_id=$folder_id&mount_point=$mount_point&content_type=$content_type" } } + Index: openacs-4/packages/cms/www/modules/sitemap/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/index.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/sitemap/index.xql 13 Apr 2005 20:15:19 -0000 1.4 +++ openacs-4/packages/cms/www/modules/sitemap/index.xql 9 May 2005 22:44:49 -0000 1.5 @@ -4,15 +4,15 @@ - select module_id from cm_modules where key = 'sitemap' + select module_id from cm_modules where key = 'sitemap' and package_id = :package_id - select name from cm_modules where key = :mount_point + select name from cm_modules where key = :mount_point and package_id = :package_id Index: openacs-4/packages/cms/www/modules/sitemap/rename.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/rename.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/cms/www/modules/sitemap/rename.tcl 13 Apr 2005 20:15:19 -0000 1.7 +++ openacs-4/packages/cms/www/modules/sitemap/rename.tcl 9 May 2005 22:44:49 -0000 1.8 @@ -20,7 +20,7 @@ -datatype keyword -widget hidden -value $mount_point element create rename_folder name \ - -label "Name" -datatype keyword -widget text -html { size 20 } \ + -label "Name" -datatype url -widget text -html { size 20 } \ -validate { { expr ![string match $value "/"] } { Folder name cannot contain slashes }} @@ -55,7 +55,7 @@ db_exec_plsql rename_folder {} } - ad_returnredirect [export_vars -base index {folder_id}] + ad_returnredirect [export_vars -base ../$mount_point/index {folder_id}] } Index: openacs-4/packages/cms/www/modules/templates/edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/edit.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/edit.adp 16 Nov 2004 22:32:51 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/edit.adp 9 May 2005 22:44:49 -0000 1.5 @@ -1,63 +1,31 @@ +Edit Template - - - - -
    - +

    Edit Template

    +@path;noquote@ +
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - -
    Edit Template: @path;noquote@
    -
      
      Output Type: + + +
    +Output Type: -
      Create new revision: +
    +Create new revision: @formgroup.widget;noquote@ @formgroup.label;noquote@ -
    +
       -
    -
    + Index: openacs-4/packages/cms/www/modules/templates/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/index-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/index-postgresql.xql 16 Nov 2004 22:32:51 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/index-postgresql.xql 9 May 2005 22:44:49 -0000 1.5 @@ -24,7 +24,7 @@ - select content_item__get_path(:item_id, null) + select content_item__get_path(:folder_id, null) @@ -42,7 +42,7 @@ RIGHT OUTER JOIN cr_items i ON i.latest_revision = r.revision_id where - i.parent_id = :item_id + i.parent_id = :folder_id and i.item_id = t.template_id and @@ -63,7 +63,7 @@ where i.item_id = f.folder_id and - f.folder_id = :item_id + f.folder_id = :folder_id 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.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/index.adp 13 Apr 2005 20:15:19 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/index.adp 9 May 2005 22:44:49 -0000 1.5 @@ -3,7 +3,7 @@

    - + @page_title;noquote@ @@ -15,10 +15,15 @@

    - +

    - + - + + \ 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.8 -r1.9 --- openacs-4/packages/cms/www/modules/templates/index.tcl 17 Nov 2004 23:07:37 -0000 1.8 +++ openacs-4/packages/cms/www/modules/templates/index.tcl 9 May 2005 22:44:49 -0000 1.9 @@ -5,34 +5,30 @@ @author Michael Steigman @creation-date October 2004 } { - { item_id:integer ""} - { mount_point:optional "templates"} + { folder_id:integer ""} + { mount_point "templates" } + { parent_id:integer ""} + { orderby "title,asc" } + { page:optional ""} { path:optional "" } } set package_url [ad_conn package_url] set clipboardfloats_p [clipboard::floats_p] -# Tree hack -if { $item_id == [cm::modules::templates::getRootFolderID] } { - set refresh_id "" -} else { - set refresh_id $item_id -} - if { ! [string equal $path {}] } { set item_id [db_string get_id ""] - if { [string equal $item_id {}] } { + if { [string equal $folder_id {}] } { set msg "The requested folder $path does not exist." request error invalid_path $msg } } else { - if { [string equal $item_id {}] } { - set item_id [db_string get_root_folder_id ""] + if { [string equal $folder_id {}] } { + set folder_id [cm::modules::templates::getRootFolderID [ad_conn package_id]] } set path [db_string get_path ""] @@ -49,55 +45,16 @@ set page_title "Template Folder - $info(label)" -set folder_id $item_id -set parent_id $item_id +#set folder_id $item_id +#set parent_id $item_id -template::list::create \ - -name folder_contents \ - -multirow folder_contents \ - -has_checkboxes \ - -actions [list "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=sitemap {folder_id}] "Move folder" \ - "Copy Items" [export_vars -base copy?mount_point=sitemap {folder_id}] "Copy folder" \ - "Delete Items" [export_vars -base delete?mount_point=sitemap {folder_id}] "Delete folder"] \ - -elements { - copy { - label "Clipboard" - display_template "

    @folder_contents.copy;noquote@
    " - } - name { - label "Name" - link_url_col item_url - link_html { title "View this item" } - } - file_size { - label "Size" - } - type { - label "Type" - } - modified { - label "Last Modified" - } - transact { - display_template "edit   |   \ - upload" - } - } +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\" +" -db_multirow -extend { copy file_size is_folder template_id upload_url edit_url type item_url } -unclobber folder_contents get_folders "" { - set copy [clipboard::render_bookmark templates $item_id $package_url] - set is_folder 1 - set type "Template Folder" - set item_url [export_vars -base index { item_id }] -} - -db_multirow -append -extend { copy is_folder folder_id label upload_url edit_url type item_url } folder_contents get_items "" { - set copy [clipboard::render_bookmark templates $item_id $package_url] - set is_folder 0 - set type "Template" - set item_url [export_vars -base properties { item_id }] - set edit_url [export_vars -base edit { template_id }] - set upload_url [export_vars -base upload { template_id }] -} Index: openacs-4/packages/cms/www/modules/templates/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/index.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/index.xql 16 Nov 2004 22:32:51 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/index.xql 9 May 2005 22:44:49 -0000 1.3 @@ -5,7 +5,7 @@ - select content_type from cr_items where item_id = :item_id + select content_type from cr_items where item_id = :folder_id @@ -19,7 +19,7 @@ from cr_folders f, cr_items i, acs_objects o where - i.item_id = (select parent_id from cr_items where item_id = :item_id) + i.item_id = (select parent_id from cr_items where item_id = :folder_id) and i.item_id = f.folder_id and @@ -37,7 +37,7 @@ from cr_folders f, cr_items i, acs_objects o where - i.parent_id = :item_id + i.parent_id = :folder_id and i.item_id = f.folder_id and Index: openacs-4/packages/cms/www/modules/templates/new-folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-folder.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/templates/new-folder.adp 16 Nov 2004 22:32:51 -0000 1.3 +++ openacs-4/packages/cms/www/modules/templates/new-folder.adp 9 May 2005 22:44:49 -0000 1.4 @@ -1,5 +1,5 @@ +@title@ +

    @title@

    -

    New Folder

    - Index: openacs-4/packages/cms/www/modules/templates/new-folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-folder.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/cms/www/modules/templates/new-folder.tcl 16 Nov 2004 22:32:51 -0000 1.6 +++ openacs-4/packages/cms/www/modules/templates/new-folder.tcl 9 May 2005 22:44:49 -0000 1.7 @@ -3,13 +3,14 @@ } set path [db_string get_path ""] +set title "New Template Folder" form create new_folder -elements " return_url -datatype url -widget hidden folder_id -datatype integer -widget hidden parent_id -datatype integer -widget hidden - name -datatype filename -html { size 40 } -label {Folder Name} - label -datatype text -html { size 40 } -optional + name -datatype filename -html { size 40 } -label {Folder Name} -help_text {Short name containing no special characters} + label -datatype text -html { size 40 } -optional -help_text {More descriptive label} description -datatype text -widget textarea -optional \ -html { rows 4 cols 40 } " Index: openacs-4/packages/cms/www/modules/templates/new-template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-template.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/templates/new-template.adp 16 Nov 2004 22:32:51 -0000 1.3 +++ openacs-4/packages/cms/www/modules/templates/new-template.adp 9 May 2005 22:44:49 -0000 1.4 @@ -1,5 +1,6 @@ + -

    New Template

    +

    @title@

    Index: openacs-4/packages/cms/www/modules/templates/new-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-template.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/cms/www/modules/templates/new-template.tcl 16 Nov 2004 22:32:51 -0000 1.6 +++ openacs-4/packages/cms/www/modules/templates/new-template.tcl 9 May 2005 22:44:49 -0000 1.7 @@ -2,15 +2,16 @@ folder_id -datatype integer } -ns_log Notice "folder_id is $folder_id" +set title "New Template" set path [db_string get_path ""] form create new_template -elements " return_url -datatype url -widget hidden template_id -datatype integer -widget hidden folder_id -datatype integer -widget hidden - name -datatype filename -html { size 40 } + path -datatype url -widget inform -label {Create in} -value $path + name -datatype filename -label {Template Name} Name -html { size 40 } -help_text {Must not contain any spaces or special characters} " set mime_types [db_list_of_lists get_mime_types ""] 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.4 -r1.5 --- openacs-4/packages/cms/www/modules/templates/properties.adp 16 Nov 2004 22:32:51 -0000 1.4 +++ openacs-4/packages/cms/www/modules/templates/properties.adp 9 May 2005 22:44:49 -0000 1.5 @@ -24,17 +24,6 @@