Index: openacs-4/contrib/packages/bcds/bcds.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/bcds.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/bcds.info 14 May 2003 15:30:01 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + Basic Content Delivery System + Basic Content Delivery System + f + f + + + ghost bear + A presentation system for Content Repository. + A presentation system for Content Repository. Normally used together with Basic Content Management System + + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/bcds/sql/postgresql/bcds-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/sql/postgresql/bcds-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/sql/postgresql/bcds-create.sql 14 May 2003 15:30:22 -0000 1.1 @@ -0,0 +1,26 @@ +-- @author Ghost Bear +-- @creation-date 2002-10-14 +-- @cvs-id $Id: bcds-create.sql,v 1.1 2003/05/14 15:30:22 juny Exp $ + +-- this are praesagus custom stuff +-- TODO: study and refactor to be integrated to bcds + +create table praesagus_protected_items ( + page_id integer + constraint praesagus_protected_items_fk + references cr_items(item_id) + on delete cascade + constraint praesagus_protected_items_pk + primary key +); + + +create table praesagus_featured_items ( + page_id integer + constraint praesagus_featured_items_fk + references cr_items(item_id) + on delete cascade + constraint praesagus_featured_items_pk + primary key +); + Index: openacs-4/contrib/packages/bcds/sql/postgresql/bcds-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/sql/postgresql/bcds-sc-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/sql/postgresql/bcds-sc-create.sql 14 May 2003 15:30:22 -0000 1.1 @@ -0,0 +1,23 @@ +-- Implement OpenFTS service contracts + +select acs_sc_impl__new( + 'FtsContentProvider', -- impl_contract_name + 'bcms_page', -- impl_name + 'bcds' -- impl_owner.name +); + +select acs_sc_impl_alias__new( + 'FtsContentProvider', -- impl_contract_name + 'bcms_page', -- impl_name + 'datasource', -- impl_operation_name + 'bcds::search::datasource', -- impl_alias + 'TCL' -- impl_pl +); + +select acs_sc_impl_alias__new( + 'FtsContentProvider', -- impl_contract_name + 'bcms_page', -- impl_name + 'url', -- impl_operation_name + 'bcds::search::url', -- impl_alias + 'TCL' -- impl_pl +); Index: openacs-4/contrib/packages/bcds/tcl/bcds-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/tcl/bcds-init.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/tcl/bcds-init.tcl 14 May 2003 15:30:38 -0000 1.1 @@ -0,0 +1,57 @@ +# Repeat a template chunk for each item in a list +# similar to the stock "list" tag. But this one adds +# support for list of lists. Similar to how multiple +# tag works +# ex. +# @mylist_1row.firstname@ @mylist_1row.lastname +# + +# for possible contribution + +template_tag bcds_list { chunk params } { + + # the list tag accepts a value so that it may be used without a data + # source in the tcl script + + set value [ns_set iget $params value] + + # If the value exists, use it and create a fake name for it + + if { ![template::util::is_nil value] } { + + set name [ns_set iget $params name] + if { [empty_string_p $name] } { + set name "__ats_list_value" + } + + template::adp_append_code "\nset $name \[eval list $value\]\n" + template::adp_append_code "\nset $name:rowcount \[llength \$$name\]\n" + + } else { + + # Expect a data source from the tcl script + set name [template::get_attribute list $params name] + template::adp_append_code "\nset {$name:rowcount} \[llength \${$name}\]\n" + } + + set list_type [template::get_attribute bcds_list $params list_type list] + + template::adp_append_code " + + for { set __ats_i 0 } { \$__ats_i < \${$name:rowcount} } { incr __ats_i } {" + + if [string equal $list_type "listoflists"] { + template::adp_append_code " + array set ${name}_1row \[lindex \${$name} \$__ats_i\]" + } else { + template::adp_append_code " + set $name:item \[lindex \${$name} \$__ats_i\]" + } + + template::adp_append_code " + set $name:rownum \[expr \$__ats_i + 1\] + " + template::adp_compile_chunk $chunk + + template::adp_append_code "}" +} Index: openacs-4/contrib/packages/bcds/tcl/bcds-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/tcl/bcds-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/tcl/bcds-procs-postgresql.xql 14 May 2003 15:30:38 -0000 1.1 @@ -0,0 +1,57 @@ + + + + postgresql7.2 + + + + select content_template__new(:template_name, :parent_id, + null, now(), :creation_user_id, :creation_ip) + + + + + + select content_template__delete(:template_id) + + + + + + select content_template__get_root_folder() + + + + + + select content_item__register_template(:item_id, :template_id, :context) + + + + + + select content_item__unregister_template(:item_id, :template_id, :context) + + + + + + select name, item_id from cr_items where item_id = content_item__get_template(:item_id, :context) + + + + + + + + select content_item__get_id(:url, :root_id, 'true'); + + + + + + select name from cr_items where item_id = content_item__get_template(:item_id, :context) + + + + Index: openacs-4/contrib/packages/bcds/tcl/bcds-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/tcl/bcds-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/tcl/bcds-procs.tcl 14 May 2003 15:30:38 -0000 1.1 @@ -0,0 +1,156 @@ +ad_library { + + Procs for content_template, and some helper procs + +} + +namespace eval bcds { + + ad_proc -public create_template { + {-template_name:required} + {-parent_id} + {-creation_user_id ""} + {-creation_ip ""} + } { + This proc creates a template and returns the item_id of the new template + } { + if ![info exists parent_id] { + set parent_id [get_bcds_root_folder] + } + set item_id [db_exec_plsql create_template "SQL"] + return $item_id + } + + ad_proc -public delete_template { + {-template_id:required} + } { + Delete a template + } { + return [db_exec_plsql delete_template "SQL"] + } + + # for possible contribution + ad_proc -public get_cr_template_root {} { + gets the folder_id of the template root of cr + } { + set template_root [db_exec_plsql get_template_root "SQL"] + } + + ad_proc -public get_bcds_root_folder {} { + gets the root folder of bcds + } { + set package_id [ad_conn package_id] + + if [db_0or1row get_bcds_folder "SQL"] { + return $folder_id + } else { + return 0 + } + } + + ad_proc -public apply_template { + {-item_id:required} + {-template_id:required} + {-context} + } { + applies a template to a content item with the context given or the current + context of BCDS + } { + + if ![info exists context] { + set context [parameter::get -parameter context] + } + + db_exec_plsql apply_template "SQL" + + } + + ad_proc -public unregister_template { + {-item_id:required} + {-template_id ""} + {-context ""} + } { + unregister a template for a item_id + } { + db_exec_plsql unregister_template "SQL" + } + + ad_proc -public get_template { + {-item_id:required} + {-context} + } { + gets the template of the content item on the context specified + } { + if ![info exists context] { + set context [parameter::get -parameter context] + } + if {[db_0or1row get_template "SQL" -column_array one_template]} { + return [array get one_template] + } else { + return {} + } + + } + + +####################### depracated procs below............... maybe i can get something from the old junk ################## + + ad_proc -public get_template_name { + {-item_id:required} + {-context} + } { + gets the template of the content item on the context specified + + @depracated use get_template + } { + if ![info exists context] { + set context [parameter::get -parameter context] + } + return [db_string get_template_name "SQL" -default ""] + + } + + ad_proc -public get_content_item_id { + {-url:required} + {-root_id} + {-resolve_index:boolean true} + } { + gets a content items based from the url and the starting root_id. + returns the item_id of + + @depracated use bcms::item::get_item_by_url + } { + if ![info exists root_id] { + if [string equal $url ""] { + set url "index" + } + set root_id [parameter::get -parameter root_folder_id] + } + return [db_exec_plsql get_item_id "SQL"] + + } + + ad_proc -public template_option_list {} { + returns a list normally used for ad_form option list. The format is + template title, template_id + + @depracated make use of bcms::item::list_items directly + } { + set bcms_list_items [bcms::item::list_items -parent_id [bcds::get_bcds_root_folder] -return_list] + + # construct the option list + set option_list [list] + foreach one_item $bcms_list_items { + if ![string equal [lindex $one_item [expr [lsearch $one_item content_type] + 1]] "content_folder"] { + lappend option_list [list [lindex $one_item [expr [lsearch $one_item name] + 1]] \ + [lindex $one_item [expr [lsearch $one_item item_id] + 1]]] + } + } + return $option_list + + } + + +# end of bcds namespace +} + Index: openacs-4/contrib/packages/bcds/tcl/bcds-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/tcl/bcds-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/tcl/bcds-procs.xql 14 May 2003 15:30:38 -0000 1.1 @@ -0,0 +1,12 @@ + + + + postgresql7.2 + + + + select folder_id from cr_folders where package_id = :package_id + + + + Index: openacs-4/contrib/packages/bcds/tcl/bcds-search-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/tcl/bcds-search-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/tcl/bcds-search-procs.tcl 14 May 2003 15:30:38 -0000 1.1 @@ -0,0 +1,53 @@ +ad_library { + + Procs for openFTS search + +} + +namespace eval bcds::search { + + ad_proc -public datasource { + object_id + } { + openfts datasource implementation + } { + db_1row get_datasource { + select r.revision_id as object_id, + r.title as title, + r.content as content, + r.mime_type as mime, + '' as keywords, + i.storage_type as storage_type + from cr_revisions r, cr_items i + where revision_id = :object_id + and i.item_id = r.item_id + } -column_array datasource_array + + return [array get datasource_array] + } + + + ad_proc -public url { + object_id + } { + openfts url implementation + } { + + # TODO: we need to rethink about this outside on generic terms + # currently we hard code the root_url and getting the package id + + set root_url "/site/" + set root_id [parameter::get_from_package_key -package_key bcds -parameter root_folder_id] + + db_1row get_url { + select content_item__get_path(r.item_id, :root_id) as page_url + from cr_revisions r + where r.revision_id = :object_id + } + + return "$root_url$page_url" + + } + +# end of bcds::search +} Index: openacs-4/contrib/packages/bcds/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/index.vuh 14 May 2003 15:30:56 -0000 1.1 @@ -0,0 +1,17 @@ +ad_page_contract { + @author Ghost Bear + @creation-date Oct 10, 2002 + @cvs-id index.vuh,v 1.1.1.1 2002/10/04 10:05:17 nsadmin Exp +} { + +} + +# Get the paths +set the_root [acs_root_dir] +set package_key [ad_conn package_key] + +# route to the default template which acts as the adp dispatcher +set file "$the_root/packages/$package_key/www/templates/default" +rp_internal_redirect -absolute_path $file + + Index: openacs-4/contrib/packages/bcds/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/admin/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/admin/index.tcl 14 May 2003 15:31:11 -0000 1.1 @@ -0,0 +1,30 @@ +# TODO: mulitiple instance of bcds support to have different template +# right now its shared + + +set cr_template_root [bcds::get_cr_template_root] + +# check to see if the bcds root is present under the cr_folders Templates root +# if not create a new folder under it +if { ![bcds::get_bcds_root_folder] } { + # create the bcds root folder + + db_transaction { + + set bcds_label "bcds" + set bcds_description "This is where bcds templates will be stored" + set bcds_folder_id [bcms::folder::create_folder -name "bcds" -folder_label $bcds_label -parent_id $cr_template_root -description $bcds_description] + + # bind this package instance to that cr_folder + # we are going to populate the root bcds package_id column only + set package_id [ad_conn package_id] + db_dml update_package_id "update cr_folders set package_id = :package_id where folder_id = :bcds_folder_id" + + } + ns_log notice "bcds: template folder created" + +} + +# temp only +ad_returnredirect template-list + Index: openacs-4/contrib/packages/bcds/www/admin/template-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/admin/template-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/admin/template-delete.tcl 14 May 2003 15:31:11 -0000 1.1 @@ -0,0 +1,12 @@ +ad_page_contract { + delete a template +} { + template_id:notnull,naturalnum + return_url:notnull +} + +bcds::delete_template -template_id $template_id + +ad_returnredirect $return_url + +# TODO: delete the template on the file system Index: openacs-4/contrib/packages/bcds/www/admin/template-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/admin/template-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/admin/template-list.adp 14 May 2003 15:31:11 -0000 1.1 @@ -0,0 +1,27 @@ + + +

Add Template

+ + + + + + + + + + + + + +
Template List
+ + <%= [string repeat " " [expr (@bcms_list_items.level@ - @bcms_list_items.parent_level@) * 5]] %> + @bcms_list_items.name@ + + edit + delete + +
+ + Index: openacs-4/contrib/packages/bcds/www/admin/template-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/admin/template-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/admin/template-list.tcl 14 May 2003 15:31:11 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + list the template in the CR +} + +bcms::item::list_items -parent_id [bcds::get_bcds_root_folder] + + + Index: openacs-4/contrib/packages/bcds/www/admin/template-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/admin/template-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/admin/template-one.adp 14 May 2003 15:31:11 -0000 1.1 @@ -0,0 +1,3 @@ + + + Index: openacs-4/contrib/packages/bcds/www/admin/template-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/admin/template-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/admin/template-one.tcl 14 May 2003 15:31:11 -0000 1.1 @@ -0,0 +1,70 @@ +ad_page_contract { + add and edit a template +} { + item_id:optional,naturalnum + {return_url:optional ""} +} + +ad_form -name onetemplate -html {enctype multipart/form-data} -form { + + item_id:key + + {name:text(text) {label "Name"}} + {title:text(text) {label "Title"}} + {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} + {content:text(textarea),optional {html {rows 20 cols 80}} {label "Template Code"}} + {upload_file:filename(file),optional {label "File"}} + {return_url:text(hidden) {value $return_url}} + +} -edit_request { + + array set one_item [bcms::item::get_item -item_id $item_id] + set name $one_item(name) + + array set one_revision [bcms::item::get_item_best -item_id $item_id] + set title $one_revision(title) + set description $one_revision(description) + set content $one_revision(content) + + ad_set_form_values name title description content + +} -new_data { + + set creation_user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + +# TODO: revisit file upload function +# revise so that we can accomodate on a per instance of bcds + db_transaction { + set item_id [bcds::create_template -template_name $name \ + -creation_user_id $creation_user_id -creation_ip $creation_ip] + + bcms::revision::revision_create_in_text -item_id $item_id -content_type content_revision \ + -title $title -content $content -description $description \ + -mime_type "text/html" \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + } + + set file "[acs_root_dir]/packages/bcds/www/templates/${name}.adp" + template::util::write_file $file $content + + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } +} -edit_data { + + array set one_revision [bcms::item::get_item_best -item_id $item_id] + set revision_id $one_revision(revision_id) + + bcms::item::edit_item -item_id $item_id -name $name + + bcms::revision::edit_revision -revision_id $revision_id \ + -title $title -content $content -description $description + + set file "[acs_root_dir]/packages/bcds/www/templates/${name}.adp" + template::util::write_file $file $content + + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } +} Index: openacs-4/contrib/packages/bcds/www/files/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/files/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/files/index.vuh 14 May 2003 15:31:30 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + gets a related file + see images/index.vuh for futher comments +} { + file_revision_id:optional,naturalnum +} + +if ![info exists file_revision_id] { + set extra_url [ad_conn extra_url] + set bcms_root_folder_id [parameter::get -parameter bcms_root_folder_id] + array set current_item [bcms::item::get_item_by_url -root_id $bcms_root_folder_id -url $extra_url -revision latest] + if {[array size current_item] > 1} { + set file_revision_id $current_item(latest_revision) + } else { + ns_returnnotfound + ad_script_abort + } +} + +cr_write_content -revision_id $file_revision_id + + Index: openacs-4/contrib/packages/bcds/www/images/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/images/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/images/index.vuh 14 May 2003 15:32:05 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + gets a related image, we are using this since we are not yet + utilizing versioning on images. We only use the latest revision + to make things simple +} { + image_revision_id:optional,naturalnum +} + +if ![info exists image_revision_id] { + set extra_url [ad_conn extra_url] + set bcms_root_folder_id [parameter::get -parameter bcms_root_folder_id] + array set current_item [bcms::item::get_item_by_url -root_id $bcms_root_folder_id -url $extra_url -revision latest] + if {[array size current_item] > 1} { + set image_revision_id $current_item(latest_revision) + } else { + ns_returnnotfound + ad_script_abort + } +} + +cr_write_content -revision_id $image_revision_id + + Index: openacs-4/contrib/packages/bcds/www/templates/default-sidelinks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/default-sidelinks.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/default-sidelinks.adp 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,98 @@ + + + + + + + + <% set level_diff [expr @content_sections.level@ - @content_sections.parent_level@] %> + + <% + # construct the path, loop using group tag + set path {} + set trail_level_diff 0 + %> + + <% + append path @content_sections.name@/ + set trail_level_diff [expr @content_sections.level@ - @content_sections.parent_level@] + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ @content_sections.label@ + + + + @content_sections.label@ +
+ @content_sections.label@ + + @content_sections.label@ +
+ + @content_sections.label@ + + + @content_sections.label@ +
Index: openacs-4/contrib/packages/bcds/www/templates/default-sidelinks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/default-sidelinks.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/default-sidelinks.tcl 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + display the side links +} + +bcms::folder::list_folders_and_ancestors -parent_id $root_id -level_diff 3 -multirow_name content_sections + +# we need to make this var present so it can be accessed +# on and tag +set path {} +set trail_level_diff {} Index: openacs-4/contrib/packages/bcds/www/templates/default.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/default.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/default.adp 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,64 @@ + +@current_item.title@ +  + + + + + + + + + + +
+ + + + + + @pages.title@ + + + + @pages.title@ + + + @pages.title@ + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + +
+

+ Printer Friendly Page +

+ @current_item.content@ +
+ +
+
+ + Index: openacs-4/contrib/packages/bcds/www/templates/default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/default.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/default.tcl 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,79 @@ +ad_page_contract { + gets the bcms page and related items +} { + revision_id:optional,naturalnum + {printer_friendly_p:optional 0} +} + +# get the root_id that this bcds is serving +set root_id [parameter::get -parameter root_folder_id] +set root_url [ad_conn package_url] + +set extra_url [ad_conn extra_url] +if [string equal $extra_url ""] {set extra_url index} + +# get the item by url if now revision id is given +if ![info exists revision_id] { + array set current_item [bcms::item::get_item_by_url -root_id $root_id -url $extra_url -revision live] +} else { + array set current_item [bcms::revision::get_revision -revision_id $revision_id] +} + +# check to see if there is a content item for this url. +# array size 1 is item is present but not live +# array size 0 there is no item in this url +if {[array size current_item] > 1} { + + # if content is a file then stream it out + if [string equal $current_item(storage_type) "file"] { + cr_write_content -revision_id $current_item(revision_id) + ad_script_abort + } + + # lets check if we need to have / on the url + # if the item is index but the last urlv is not index or the url does not have / on the end + # we need to redirect. + set current_url_list [ad_conn urlv] + set current_url [ad_conn url] + if {![string equal [lindex $current_url_list end] "index"] \ + && ![regexp {/$} $current_url] \ + && [string equal $current_item(name) "index"]} { + ad_returnredirect "$current_url/" + } + + # get the pages on the same level + bcms::item::list_pages -parent_id $current_item(parent_id) -revision live -multirow_name pages + + # get the related images + bcms::item::list_related_items -item_id $current_item(item_id) -revision latest -relation_tag images -multirow_name related_images + + # get the related files + bcms::item::list_related_items -item_id $current_item(item_id) -revision latest -relation_tag files -multirow_name related_files + + if {$printer_friendly_p} { + ad_return_template printer-friendly + } else { + + # get the template for this item + array set one_template [bcds::get_template -item_id $current_item(item_id)] + + # check to see if there is a template of this item if not look at the folder template + # if not serve the default template + if {[array size one_template] > 0} { + ad_return_template $one_template(name) + } else { + # get the template for this item + array set one_template [bcds::get_template -item_id $current_item(parent_id)] + if {[array size one_template] > 0} { + ad_return_template $one_template(name) + } else { + ad_return_template + } + } + } +} else { + ns_returnnotfound + ad_script_abort +} + + Index: openacs-4/contrib/packages/bcds/www/templates/praesagus-content.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/praesagus-content.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/praesagus-content.adp 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,100 @@ + + +@current_item.title@ + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ CONTACT US + + LOGIN / REGISTER + @user_name@ [LOGOUT] +
+ SEARCH + +
+ +
+ + + + + + + + + + +
+ + + + + + @pages.title@ + + + + @pages.title@ + + + @pages.title@ + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + +
+

+ Printer Friendly Page +

+ @current_item.content@ +
+ +
+
+ + Index: openacs-4/contrib/packages/bcds/www/templates/praesagus-content.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/praesagus-content.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/praesagus-content.tcl 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,29 @@ +# we are going to check for the user again here since +# this is also used as the side wide template +set user_id [ad_get_user_id] +if { $user_id != 0 } { + # The user is loged in. + db_0or1row user_name_select { + select first_names || ' ' || last_name as user_name, email + from persons, parties + where person_id = :user_id + and person_id = party_id + } +} else { + set user_name "" + set email "" +} + +# test if we are in bcds packages, if not then set this vars +set package_id [ad_conn package_id] +if [db_0or1row check_packages "select 1 from apm_packages where package_id = :package_id and package_key != 'bcds'"] { + set root_url "/site/" + array set root_folder [bcms::item::get_item_by_url -root_id [bcms::get_cr_folder_root] -url "1ic-cms/pages" -resolve_index false] + set root_id $root_folder(item_id) + set current_item(parent_id) 0 + set current_item(title) "Praesagus" + ad_return_template +} + + + Index: openacs-4/contrib/packages/bcds/www/templates/praesagus-home.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/praesagus-home.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/praesagus-home.adp 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,116 @@ + + +@current_item.title@ + + + + + + + + + + + + + +
+ + + + + + + + +
+ + CONTACT US + + SEARCH + + + + LOGIN / REGISTER + @user_name@ [LOGOUT] +
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+

Welcome

+

+ Praesagus provides characterization and modeling products to improve the + chemical mechanical polishing semiconductor manufacturing process. This + site is our main site, if you are looking for our on-line software tools, + please contact us. +

+
+ + + + + <% set random_page [expr [ns_rand @featured_page:rowcount@] + 1] %> + + + + + + + + + + + + + + + + + + + + <% + # we are using get_virtual_path and regsub due to performance reason + regsub {1ic-cms/pages} @featured_page.path@ {site} featured_path + %> + + + + + +

+ + + + +
@featured_page.title@
 

@featured_page.description@

 
More...  
+ +
 
@current_item.content@
+ +
+ + Index: openacs-4/contrib/packages/bcds/www/templates/praesagus-home.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/praesagus-home.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/praesagus-home.tcl 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,9 @@ +set current_section $current_item(parent_id) + +db_multirow featured_page get_featured_pages " +select title, description, content_item__get_virtual_path(i.item_id, :current_section) as path from + praesagus_featured_items fi, cr_items i, cr_revisions r +where fi.page_id = i.item_id + and i.live_revision = r.revision_id +" + Index: openacs-4/contrib/packages/bcds/www/templates/praesagus-sidelinks.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/praesagus-sidelinks.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/praesagus-sidelinks.adp 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,125 @@ + + + + + + + <% set first_pass_p true %> + + <% set level_diff [expr @content_sections.level@ - @content_sections.parent_level@] %> + + <% + # construct the path, loop using group tag + set path {} + set trail_level_diff 0 + %> + + <% + append path @content_sections.name@/ + set trail_level_diff [expr @content_sections.level@ - @content_sections.parent_level@] + %> + + + + + + + <% set first_pass_p false %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ @content_sections.label@ + + + + @content_sections.label@ +
+ @content_sections.label@ + + + @content_sections.label@ + + @content_sections.label@ + + + @content_sections.label@ +
+ + @content_sections.label@ + + + @content_sections.label@ +
Index: openacs-4/contrib/packages/bcds/www/templates/praesagus-sidelinks.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/praesagus-sidelinks.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/praesagus-sidelinks.tcl 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + display the side links +} + +bcms::folder::list_folders_and_ancestors -parent_id $root_id -level_diff 3 -multirow_name content_sections + +# we need to make this var present so it can be accessed +# on and tag +set path {} +set trail_level_diff {} Index: openacs-4/contrib/packages/bcds/www/templates/printer-friendly.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/printer-friendly.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/printer-friendly.adp 14 May 2003 15:32:39 -0000 1.1 @@ -0,0 +1,41 @@ + + +@current_item.title@ + + + + + + + + + + +
+ + + + + + + + + + + +
+ @current_item.content@ + + +
+ + +

@related_images.title@

+

+
+
+
+ + + + Index: openacs-4/contrib/packages/bcds/www/templates/mapping/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/mapping/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/mapping/index.adp 14 May 2003 15:33:04 -0000 1.1 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + +
NameAction
+ <%= [string repeat " " [expr (@bcms_list_items.level@ - @bcms_list_items.parent_level@) * 5]] %> + + + + + + + @bcms_list_items.name@ + + + apply template + +
+ Index: openacs-4/contrib/packages/bcds/www/templates/mapping/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/mapping/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/mapping/index.tcl 14 May 2003 15:33:04 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + lists the content item for that this bcds delivers + +} { + +} + +set parent_id [parameter::get -parameter root_folder_id] +bcms::item::list_items -parent_id $parent_id + + + + Index: openacs-4/contrib/packages/bcds/www/templates/mapping/template-apply.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/mapping/template-apply.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/mapping/template-apply.adp 14 May 2003 15:33:04 -0000 1.1 @@ -0,0 +1,3 @@ + + + Index: openacs-4/contrib/packages/bcds/www/templates/mapping/template-apply.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcds/www/templates/mapping/template-apply.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcds/www/templates/mapping/template-apply.tcl 14 May 2003 15:33:04 -0000 1.1 @@ -0,0 +1,15 @@ +ad_page_contract { + + applies a template to a content item + +} { + item_id:naturalnum,notnull + +} + +ad_form -name applytemplate -form { + {template_id:integer(select) {label "Template"} {options [bcds::template_option_list]}} + {item_id:integer(hidden) {value $item_id}} +} -on_submit { + bcds::apply_template -item_id $item_id -template_id $template_id +} Index: openacs-4/contrib/packages/bcms/bcms.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/bcms.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/bcms.info 14 May 2003 15:33:40 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + Basic Content Management System + Basic Content Management Systems + f + f + + + Jun Yamog + Basic CMS is a small layer on top of Content Repository to manipulate its data model + 2003-04-26 + Basic CMS is a small layer on top of Content Repository to manipulate its data model + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql 14 May 2003 15:34:18 -0000 1.1 @@ -0,0 +1,95 @@ +-- +-- bcms/sql/postgresql/bcms-create.sql +-- +-- @author +-- @create-date 10 Aug 2002 +-- @cvs-id $Id +-- +-- creates bcms content types + +-- this content type are just for convinience, bcms_page are the text pages, bcms_file are binary files +-- bcms_images are for images +select content_type__create_type ('bcms_page', 'content_revision', 'BCMS Page', 'BCMS Pages', 'cr_bcms_pages', 'page_id', null); +select content_type__create_type ('bcms_file', 'content_revision', 'BCMS File', 'BCMS Files', 'cr_bcms_files', 'file_id', null); +-- select content_type__create_type ('bcms_images', 'image', 'BCMS Image', 'BCMS Images', 'cr_bcms_image', 'image_id', null); + +-- bcms_links are external links... href values +select content_type__create_type ('bcms_link', 'content_revision', 'BCMS Link', 'BCMS Links', 'cr_bcms_links', 'link_id', null); + +-- bcms_nav nav links are used to build the navigation +select acs_object_type__create_type ('bcms_navlink', 'BCMS Navigation Link', 'BCMS Navigation Links', 'content_item', 'cr_bcms_navlinks', 'navlink_id', null, 'f', null, null); +select acs_attribute__create_attribute ('bcms_navlink', 'nav_object_id', 'integer', 'Navigation Object ID', 'Navigation Object IDs', null, null, null, 1, 1, null, 'type_specific', 'f'); +select acs_attribute__create_attribute ('bcms_navlink', 'sort_key', 'integer', 'Sort Key', 'Sort Keys', null, null, null, 1, 1, null, 'type_specific', 'f'); + +-- create the relations, bcms_page may relate to another page, file, image +select content_type__register_relation_type ('bcms_page', 'bcms_page', 'pages', '0', null); +select content_type__register_relation_type ('bcms_page', 'bcms_file', 'files', '0', null); +select content_type__register_relation_type ('bcms_page', 'image', 'images', '0', null); + +create or replace function bcms__get_title(integer, varchar) +returns varchar as ' +declare + p_item_id alias for $1; + p_revision alias for $2; -- either live or latest + v_title cr_revisions.title%TYPE; + v_content_type acs_objects.object_type%TYPE; +begin + +-- lets determine the content type + + select object_type from acs_objects into v_content_type + where object_id = p_item_id; + +-- as of now only content_folder is treated differently + + if v_content_type = ''content_folder'' then + +-- lets get the revision_id of what we are interested in +-- live or latest + + if p_revision = ''live_revision'' then + select r.title into v_title + from cr_items i, cr_revisions r + where i.parent_id = p_item_id + and i.name = ''index'' + and r.revision_id = i.live_revision; + return v_title; + end if; + if p_revision = ''latest_revision'' then + select r.title into v_title + from cr_items i, cr_revisions r + where i.parent_id = p_item_id + and i.name = ''index'' + and r.revision_id = i.latest_revision; + return v_title; + end if; + + end if; + + +-- lets get the revision_id of what we are interested in +-- live or latest + + if p_revision = ''live_revision'' then + select r.title into v_title + from cr_items i, cr_revisions r + where i.item_id = p_item_id + and r.revision_id = i.live_revision; + return v_title; + end if; + if p_revision = ''latest_revision'' then + select r.title into v_title + from cr_items i, cr_revisions r + where i.item_id = p_item_id + and r.revision_id = i.latest_revision; + return v_title; + end if; + + +end; +' language 'plpgsql'; + + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,75 @@ + + + + + postgresql7.2 + + + + select content_item__get_root_folder(null); + + + + + + select f.folder_id, i.name, f.label, f.has_child_folders, tree_level(i.tree_sortkey) as level, + tree_level(p.tree_sortkey) as parent_level + $addtnl_select + from cr_items i, cr_folders f, + (select tree_sortkey from cr_items where item_id = :parent_id) p + where f.folder_id = i.item_id + and tree_ancestor_p(p.tree_sortkey, i.tree_sortkey) + $addtnl_where + order by i.tree_sortkey + + + + + + select a.item_id as folder_id, o.name, f.label, f.has_child_folders, tree_level(a.tree_sortkey_trail) as level, + tree_level(parent_sortkey) as parent_level + $addtnl_select + from cr_items o, cr_folders f, + (select tree_ancestor_keys(i.tree_sortkey) as tree_sortkey_trail, p.tree_sortkey as parent_sortkey, i.item_id, i.tree_sortkey + from cr_items i, + (select tree_sortkey from cr_items where item_id = :parent_id) p + where tree_ancestor_p(p.tree_sortkey, i.tree_sortkey) + and content_type = 'content_folder' + $addtnl_where) a + where o.item_id = f.folder_id + and o.tree_sortkey = a.tree_sortkey_trail + and tree_ancestor_p(parent_sortkey, o.tree_sortkey) + order by a.tree_sortkey + + + + + + + select content_folder__new(:name, :folder_label, :description, :parent_id) + + + + + + + select content_folder__delete(:folder_id) + + + + + + + + + select label as folder_name, folder_id, tree_level(i.tree_sortkey) as level, + tree_level(a.tree_sortkey) as parent_level + from cr_folders f, cr_items i, + (select tree_sortkey from cr_items where item_id = :bcms_parent_folder) a + where i.item_id = f.folder_id + and tree_ancestor_p(a.tree_sortkey, i.tree_sortkey) + + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,240 @@ +ad_library { + + Provide functions for Content Repository folders + + @author Jun Yamog + @creation-date 10 Aug 2002 + @cvs-id $Id: bcms-folder-procs.tcl,v 1.1 2003/05/14 15:34:59 juny Exp $ +} + +namespace eval bcms::folder {} + +# for possible contribution +ad_proc -public bcms::folder::get_cr_root_folder {} { + Gets the CR Pages root, this is helpful as BCMS will always + create its root from there. returns the folder_id of cr_folder's Pages root +} { + return [db_string get_cr_root_folder "SQL"] +} + +ad_proc -public bcms::folder::get_bcms_root_folder {} { + returns the BCMS folder_id based from the current package instance + if it is not setup properly it returns 0 +} { + set bcms_root_folder [parameter::get -parameter root_folder_id -default 0] + if {($bcms_root_folder > 0) || ($bcms_root_folder == [bcms::folder::get_cr_root_folder])} { + return $bcms_root_folder + } else { + ns_log warning "bcms root folder id not properly set, please set on the admin pages" + return 0 + } +} + +# for possible contribution - maybe we move this on CR's api +ad_proc -public bcms::folder::create_folder { + {-name:required} + {-folder_label:required} + {-parent_id:required} + {-description ""} +} { + creates a new folder in cr_folders a basic tcl wrapper + for content_folder__new + returns the folder_id that was created +} { + set folder_id [db_exec_plsql create_folder "SQL"] + ns_log notice "bcms::folder::create_folder created folder $folder_id" + return $folder_id +} + + +# for possible contribution - maybe we move this on CR's api +ad_proc -public bcms::folder::delete_folder { + {-folder_id:required} +} { + deletes a cr_folder based from the folder_id, a tcl wrapper + for content_folder__delete, if its unable to delete the folder + it returns 0 +} { + # TODO: test of we are catching the error message + if [catch {db_exec_plsql delete_folder "SQL"} folder_id] { + ns_log warning "bcms::folder::delete_folder unable to delete $folder_id" + return 0 + } else { + return 1 + ns_log notice "bcms::folder::delete_folder deleted folder $folder_id" + } + +} + +ad_proc -public bcms::folder::set_folder { + {-folder_id:required} + {-name} + {-label} + {-parent_id} +} { + edits the folder +} { + + set update_list [list] + + if [info exists name] { + lappend update_list "name = :name" + } + if [info exists parent_id] { + lappend update_list "parent_id = :parent_id" + } + + if {[llength $update_list] > 0} { + set update_string [join $update_list ","] + db_dml edit_folder "SQL" + } + + if [info exists label] { + db_dml edit_folder_label "SQL" + } + ns_log notice "bcms::folder::set_folder updated $folder_id" +} + + +ad_proc -public bcms::folder::get_folder { + {-folder_id:required} +} { + the the properties of a folder + which are parent_id, name, label, description, has_child_folders, + has_child_symlinks, package_id +} { + if {[db_0or1row get_1folder "SQL" -column_array one_folder]} { + return [array get one_folder] + } else { + return {} + } + +} + +ad_proc -public bcms::folder::get_image_folder { } { + returns the folder_id of the image folder of this bcms instance +} { + array set one_item [bcms::item::get_item_by_url -root_id [get_bcms_root_folder] -url images -resolve_index false] + return $one_item(item_id) +} + +ad_proc -public bcms::folder::get_file_folder { } { + returns the folder_id of the file folder of this bcms instance +} { + array set one_item [bcms::item::get_item_by_url -root_id [get_bcms_root_folder] -url files -resolve_index false] + return $one_item(item_id) +} + +ad_proc -public bcms::folder::get_page_folder { } { + returns the folder_id of the page folder of this bcms instance +} { + array set one_item [bcms::item::get_item_by_url -root_id [get_bcms_root_folder] -url pages -resolve_index false] + return $one_item(item_id) +} + +# TODO: remove level_diff similar to bcms::item::list_items +ad_proc -public bcms::folder::list_folders { + {-parent_id} + {-level_diff 1} + {-multirow_name} + {-return_list:boolean false} +} { + returns a listing of the content folder under the parent_id, if + no parent_id is provided the bcms root folder is used as the parent_id + + returns this columns: folder_id, name, label, has_child_folders, level and parent_level + + if -return_list is used it returns a list of ns_sets otherwise it + returns a multirow uses the multirow_name if given + + -with_path return the relative path of items to the parent_id, adds path columns + that is returns +} { + # initialize the addtionals we will use + set addtnl_where_list [list] + set addtnl_select_list [list] + + if ![info exists parent_id] { + # if the parent_id does not exists then start from the root + set parent_id [get_bcms_root_folder] + } + + # TODO: make use of db_map... + # check to see how deep we want to go + if {$level_diff != 0} { + lappend addtnl_where_list ":level_diff >= tree_level(i.tree_sortkey) - tree_level(p.tree_sortkey)" + } + + # construct the additionals + if {[llength $addtnl_where_list] > 0} { + set addtnl_where "and [join $addtnl_where_list " and "]" + } else { + set addtnl_where "" + } + if {[llength $addtnl_select_list] > 0} { + set addtnl_select ", [join $addtnl_select_list ", "]" + } else { + set addtnl_select "" + } + + if $return_list_p { + # return a list of lists + return [db_list_of_ns_sets get_cr_folders "SQL"] + } else { + # make a multirow + if ![info exists multirow_name] { set multirow_name bcms_list_folders } + db_multirow $multirow_name get_cr_folders "SQL" + } +} + + +ad_proc -public bcms::folder::tree_folders { + {-parent_id} + {-level_diff 0} + {-multirow_name} + {-return_list:boolean false} +} { + similar to list_folders but also gives additional rows with ancestors, similar to item_lists_and_ancestors + + returns the following columns: folder_id, name, label, has_child_folders, level and parent_level + +} { + # initialize the addtionals we will use + set addtnl_where_list [list] + set addtnl_select_list [list] + + if ![info exists parent_id] { + # if the parent_id does not exists then start from the root + set parent_id [get_bcms_root_folder] + } + + # TODO: make use of db_map... + # check to see how deep we want to go + if {$level_diff != 0} { + lappend addtnl_where_list ":level_diff >= tree_level(i.tree_sortkey) - tree_level(p.tree_sortkey)" + } + + # construct the additionals + if {[llength $addtnl_where_list] > 0} { + set addtnl_where "and [join $addtnl_where_list " and "]" + } else { + set addtnl_where "" + } + if {[llength $addtnl_select_list] > 0} { + set addtnl_select ", [join $addtnl_select_list ", "]" + } else { + set addtnl_select "" + } + + if $return_list_p { + # return a list of lists + return [db_list_of_ns_sets get_cr_folders "SQL"] + } else { + # make a multirow + if ![info exists multirow_name] { set multirow_name bcms_list_folders } + db_multirow $multirow_name get_cr_folders "SQL" + } + +} + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + + + update cr_items set $update_string + where item_id = :folder_id + + + + + + update cr_folders set label = :label + where folder_id = :folder_id + + + + + + select i.name, i.parent_id, f.label, f.description, f.has_child_folders, + f.has_child_symlinks, f.package_id + from cr_folders f, cr_items i + where f.folder_id = :folder_id + and i.item_id = f.folder_id + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,192 @@ + + + + postgresql7.2 + + + + select content_item__new ( + :item_name, -- name + integer :parent_id, -- parent_id for some reason PG gets confused on this param, explicit typecasting was needed + null, -- item_id + null, -- locale + now(), -- creation_date + :creation_user_id, -- creation_user + :parent_id, -- context_id + :creation_ip, -- creation_ip + 'content_revision', -- item_subtype + :content_type, -- content_type + null, -- title + null, -- description + null, -- mime_type + null, -- nls_language + null, -- data + :storage_type -- storage_type + ) + + + + + + + select content_item__move(:item_id, :parent_id) + + + + + + select i.item_id, i.name, i.live_revision, i.latest_revision, i.publish_status, + i.content_type, i.storage_type, + tree_level(i.tree_sortkey) as level, + tree_level(p.tree_sortkey) as parent_level + $addtnl_select + from cr_items i, (select tree_sortkey from cr_items where item_id = :parent_id) p + $addtnl_from + where + tree_ancestor_p(p.tree_sortkey,i.tree_sortkey) + $addtnl_where + order by i.tree_sortkey + + + + + + select a.item_id, o.name, o.live_revision, o.latest_revision, o.publish_status, + o.content_type, o.storage_type, + tree_level(o.tree_sortkey) as level, + tree_level(parent_sortkey) as parent_level + $addtnl_select + from cr_items o, + (select tree_ancestor_keys(i.tree_sortkey) as tree_sortkey_trail, p.tree_sortkey as parent_sortkey, i.item_id, i.tree_sortkey + $addtnl_inner_select + from cr_items i, + (select tree_sortkey from cr_items where item_id = :parent_id) p + $addtnl_from + where + tree_ancestor_p(p.tree_sortkey, i.tree_sortkey) + $addtnl_where) a + where + o.tree_sortkey = tree_sortkey_trail + and tree_ancestor_p(parent_sortkey, o.tree_sortkey) + order by a.tree_sortkey + + + + + + select i.item_id, i.name, i.live_revision, i.latest_revision, i.publish_status, + i.content_type, i.storage_type, ir.rel_id, ir.order_n + $addtnl_select + from cr_items i, cr_item_rels ir + $addtnl_from + where ir.item_id = :item_id + and ir.related_object_id = i.item_id + and ir.relation_tag = :relation_tag + $addtnl_where + order by order_n + + + + + + select content_item__delete(:item_id) + + + + + + select content_revision__delete(revision_id) + from cr_revisions where item_id = :item_id + + + + + + select content_symlink__new( + :name, -- name + :label, -- label + :target_id, -- target_id + :parent_id, -- parent_id + null, -- symlink_id + now(), -- creation_date + :creation_user_id, -- creation_user_id + :creation_ip -- creation_ip + ) + + + + + + select content_item__relate( + :item_id, -- item_id + :related_object_id, -- related_object_id + :relation_type, -- relation_tag + null, -- order_n + 'cr_item_rel' -- relation_type + ) + + + + + + select content_item__unrelate(:rel_id) + + + + + + select name, parent_id, storage_type, content_type, storage_type, publish_status, + revision_id, title, content, description, publish_date, mime_type + from cr_items i, cr_revisions r where + i.item_id = r.item_id + and i.item_id = :item_id + and content_item__get_best_revision(:item_id) = r.revision_id + + + + + + select i.item_id, i.name, i.publish_status, i.content_type, i.storage_type $addtnl_select + from cr_items i + where i.parent_id = :parent_id + order by i.tree_sortkey + + + + + + select content_item__get_id(:url, :root_id, :resolve_index); + + + + + + select tree_sortkey as current_sortkey, parent_id from cr_items where item_id = :item_id + + + + + + select i.tree_sortkey as next_sortkey + from cr_items i, (select tree_sortkey from cr_items where item_id = :item_id) c + where i.parent_id = :parent_id + and i.tree_sortkey > c.tree_sortkey + order by i.tree_sortkey + limit 1 + + + + + + select i.tree_sortkey as prev_sortkey + from cr_items i, (select tree_sortkey from cr_items where item_id = :item_id) c + where i.parent_id = :parent_id + and i.tree_sortkey < c.tree_sortkey + order by i.tree_sortkey desc + limit 1 + + + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.tcl 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,568 @@ +ad_library { + + Procs for Content Repository content items + + @author Jun Yamog + @creation-date 10 Aug 2002 + @cvs-id $Id: bcms-item-procs.tcl,v 1.1 2003/05/14 15:34:59 juny Exp $ + +} + +namespace eval bcms::item {} + +# for possible contribution +ad_proc -public bcms::item::get_content_type { + -item_id:required +} { + returns the content type of a particular item_id +} { + array set one_item [get_item -item_id $item_id] + return $one_item(content_type) +} + +ad_proc -public bcms::item::create_item { + {-item_name:required} + {-parent_id:required} + {-content_type "content_revision"} + {-storage_type "text"} + {-creation_user_id ""} + {-creation_ip ""} +} { + This proc only creates the content item but not the revision. + Normally you would like couple this with create_revision or + your own custom create_revision. + + Returns the item_id that was created +} { + set item_id [db_exec_plsql create_item "SQL"] + ns_log notice "bcms::item::create_item created new item $item_id" + return $item_id +} + +ad_proc -public bcms::item::create_link { + {-parent_id:required} + {-target_id:required} + {-name:required} + {-label:required} + {-creation_user_id ""} + {-creation_ip ""} +} { + creates a symlink to the content item target_id + + returns the item_id of the new link +} { + set item_id [db_exec_plsql create_link "SQL"] + ns_log notice "bcms::item::create_link created new link $item_id to $target_id" + return $item_id +} + +ad_proc -public bcms::item::set_item { + {-item_id:required} + {-name} + {-parent_id} +} { + edits the content item's name or folder/parent_id +} { + + if [info exists name] { + db_dml update_name "SQL" + } + if [info exists parent_id] { + db_exec_plsql update_parent "SQL" + } + +} + + +ad_proc -public bcms::item::delete_item { + {-item_id:required} +} { + nukes out the content item. + + returns 0 if successful. + + This also deletes the all the revision of the content item +} { + db_transaction { + # use db_foreach because we may have multiple revisions + db_foreach delete_all_revisions "SQL" {} + return [db_exec_plsql delete_item "SQL"] + } + +} + +# TODO: refactor this code so we the view cr_XXXx instead of cr_items and cr_revisions. +# remove the depth, lets just use the list_tree +ad_proc -public bcms::item::list_items { + {-parent_id:required} + {-revision} + {-content_type} + {-level_diff 1} + {-multirow_name} + {-return_list:boolean false} +} { + Gets all content item under the parent_id + + upvars a bcms_list_items variable to the adp level that + contains rows of content items below the parent_id + with the following columns: + + item_id, name, live_revision, latest_revision, publish_status, + content_type, storage_type, level, parent_level + + Since multirow is not easy to pass around procs I have decided just add a return_list switch. + This will return a list of ns_sets. + + -revision will only returns items that have live or latest revision under the parent_id + if this is used additional info are returned such as revision_id, title, description, publish_date + + -level_diff if present will only returns items that is level_diff >= level - parent_level. + That means "-level_diff 1" will only return the current child of the parent_id. + if its not present then we return all childrens + DO NOT USE THIS ANYMORE, use tree_items instead. + + +} { + # initialize the addtionals we will use + set addtnl_where_list [list] + set addtnl_select_list [list] + + # if additional revision data must be returned, set the additional columns here + # for revisions. we need to make use of db_map + if [info exists revision] { + lappend addtnl_select_list r.revision_id r.title r.description r.publish_date + set addtnl_from ", cr_revisions r" + switch -exact $revision { + latest { lappend addtnl_where_list "i.latest_revision = r.revision_id" } + live { lappend addtnl_where_list "i.live_revision = r.revision_id" } + default { + # abort the proc + ns_log notice "bcms: revision requested not valid" + return + } + } + } else { + set addtnl_from "" + } + + # TODO: make use of db_map... + # check to see how deep we want to go + if {$level_diff != 0} { + lappend addtnl_where_list ":level_diff >= tree_level(i.tree_sortkey) - tree_level(p.tree_sortkey)" + } + + # pick a particular content type + if [info exists content_type] { + lappend addtnl_where_list "content_type = :content_type" + } + + # construct the additionals + if {[llength $addtnl_where_list] > 0} { + set addtnl_where "and [join $addtnl_where_list " and "]" + } else { + set addtnl_where "" + } + if {[llength $addtnl_select_list] > 0} { + set addtnl_select ", [join $addtnl_select_list ", "]" + } else { + set addtnl_select "" + } + + if {$return_list_p} { + # return a list of lists since its not easy to pass multirow from proc to proc + return [db_list_of_ns_sets get_items "SQL"] + } else { + # make a multirow, it is likely that this proc is not being called from another proc + if ![info exists multirow_name] { set multirow_name bcms_list_items } + db_multirow $multirow_name get_items "SQL" + } + +} + +ad_proc -public bcms::item::tree_items { + {-parent_id:required} + {-revision} + {-content_type} + {-level_diff 0} + {-multirow_name} + {-return_list:boolean false} +} { + this is similar to list_items, i may merge it later on. but since + both are complex i haven't decided if making them into one and + adding more complexity to list_items is good, once this proves to be ok and + fast enough then I will merge the 2 api. +} { + # initialize the addtional where we will use + set addtnl_where_list [list] + set addtnl_select_list [list] + + # if additional revision data must be returned, set the additional columns here + # for revisions. we need to make use of db_map + if [info exists revision] { + lappend addtnl_select_list a.revision_id "case when o.content_type = 'content_folder' then content_folder__get_label(o.item_id) else a.title end as title" a.description a.publish_date + set addtnl_inner_select ", r.revision_id, r.title, r.description, r.publish_date " + set addtnl_from ", cr_revisions r" + switch -exact $revision { + latest { lappend addtnl_where_list "i.latest_revision = r.revision_id" } + live { lappend addtnl_where_list "i.live_revision = r.revision_id" } + default { + # abort the proc + ns_log notice "bcms: revision requested not valid" + return + } + } + } else { + set addtnl_inner_select "" + set addtnl_from "" + } + + # TODO: make use of db_map... + # check to see how deep we want to go + if {$level_diff != 0} { + lappend addtnl_where_list ":level_diff >= tree_level(i.tree_sortkey) - tree_level(p.tree_sortkey)" + } + + # pick a particular content type + if [info exists content_type] { + lappend addtnl_where_list "content_type = :content_type" + } + + # construct the additionals + if {[llength $addtnl_where_list] > 0} { + set addtnl_where "and [join $addtnl_where_list " and "]" + } else { + set addtnl_where "" + } + if {[llength $addtnl_select_list] > 0} { + set addtnl_select ", [join $addtnl_select_list ", "]" + } else { + set addtnl_select "" + } + + if {$return_list_p} { + # return a list of lists since its not easy to pass multirow from proc to proc + return [db_list_of_ns_sets get_items "SQL"] + } else { + # make a multirow, it is likely that this proc is not being called from another proc + if ![info exists multirow_name] { set multirow_name bcms_list_items } + db_multirow $multirow_name get_items "SQL" + } +} + +ad_proc -public bcms::item::list_related_items { + {-item_id:required} + {-relation_tag:required} + {-multirow_name} + {-revision} + {-return_list:boolean false} +} { + get the related items of item_id. it returns the following columns + + item_id, name, live_revision, latest_revision, publish_status, + content_type, storage_type, level, parent_level, rel_id, order_n + + -revision will only returns items that have live or latest revision under the parent_id + if this is used additional info are returned such as revision_id, title, description, publish_date + +} { + # initialize the addtional where we will use + set addtnl_where_list [list] + + # if additional revision data must be returned, set the additional columns here + # for revisions. we need to make use of db_map + if [info exists revision] { + set addtnl_select ", r.revision_id, r.title, r.description, r.publish_date" + set addtnl_from ", cr_revisions r" + switch -exact $revision { + latest { lappend addtnl_where_list "i.latest_revision = r.revision_id" } + live { lappend addtnl_where_list "i.live_revision = r.revision_id" } + default { + # abort the proc + ns_log notice "bcms: revision requested not valid" + return + } + } + } else { + set addtnl_select "" + set addtnl_from "" + } + + # construct the additional where + if {[llength $addtnl_where_list] > 0} { + set addtnl_where "and [join $addtnl_where_list " and "]" + } else { + set addtnl_where "" + } + + if {$return_list_p} { + # return a list of lists since its not easy to pass multirow from proc to proc + return [db_list_of_ns_sets get_related_items "SQL"] + } else { + # make a multirow, it is likely that this proc is not being called from another proc + if ![info exists multirow_name] { set multirow_name bcms_list_related_items } + db_multirow $multirow_name get_related_items "SQL" + } + +} + +ad_proc -public bcms::item::get_item_by_url { + {-root_id:required} + {-url:required} + {-resolve_index true} + {-revision} +} { + get the content item details. Returns an array that contains the following + item_id, name, parent_id, live_revision, latest_revision, publish_status, content_type + and storage_type + + if "-revision live" or "-revision lastest" is given then the details of the + live or lastest revision is also place inside the array. The additional + details are: + + revision_id, title, content, description, publish_date, mime_type + + -resolve_index is to return the item_id of the index content item on a content_folder + rather than the content_folder's item_id + + if it returns a single element array that means no item exists so using + [array size yourarray] > 0 should check if such item does exists + + [array size yourarray] > 1 should check if a revision was retrieved. item exists + but revision does not exists + + Be careful in checking [array size yourarray] inside a loop, you must unset the array first. + array unset yourarray. + +} { + set item_id [db_exec_plsql get_item_id "SQL"] + + if [string equal $item_id ""] { + return {} + } else { + if [info exists revision] { + array set one_item [get_item -item_id $item_id -revision $revision] + } else { + array set one_item [get_item -item_id $item_id] + } + set one_item(item_id) $item_id + return [array get one_item] + } +} + +ad_proc -public bcms::item::get_item { + {-item_id:required} + {-revision} +} { + get the content item details. Returns an array that contains the following + name, parent_id, live_revision, latest_revision, publish_status, content_type + and storage_type + + if "-revision live" or "-revision lastest" is given then the details of the + live or lastest revision is also place inside the array. The additional + details are: + + revision_id, title, content, description, publish_date, mime_type + +} { + # initialize the addtional where we will use + set addtnl_where_list [list] + + # currently I have implemented it by building the query as opposed to using 3 + # queries. If I get some complains regarding the readability then I will + # just make use of 3 separate queries rather than building them + # the api should insulate other developers on how I implement this. + + # if additional revision data must be returned, set the additional columns here + # for revisions. I am not using db_map since I think its not useful. + if [info exists revision] { + set addtnl_select ", r.revision_id, r.title, r.content, r.description, r.publish_date, r.mime_type" + set addtnl_from ", cr_revisions r" + switch -exact $revision { + latest { lappend addtnl_where_list "i.latest_revision = r.revision_id" } + live { lappend addtnl_where_list "i.live_revision = r.revision_id" } + default { + ns_log notice "bcms: revision requested not valid" + return {} + } + } + } else { + set addtnl_select "" + set addtnl_from "" + } + + # construct the additional where + if {[llength $addtnl_where_list] > 0} { + set addtnl_where "and [join $addtnl_where_list " and "]" + } else { + set addtnl_where "" + } + + if {[db_0or1row get_1item "SQL" -column_array one_item]} { + return [array get one_item] + } else { + return {} + } +} + +ad_proc -public bcms::item::list_pages { + {-parent_id:required} + {-revision latest} + {-multirow_name} + {-return_list:boolean false} +} { + returns a list of pages under the parent_id. it also gets the latest + or live pages with index name on the folder under parent_id. if revision + is not specified then we will just get the folder label + + returns item_id, name, publish_status, content_type, storage_type, title + + TODO: will need to merge this with list_items + I think we really need to rethink what this proc really want to do, + confusing proc, gets pages and folders, get live... latest etc. +} { + switch -exact $revision { + latest { + set addtnl_select ", bcms__get_title(i.item_id, 'latest_revision') as title, content_folder__get_label(i.item_id) as folder_label" + } + live { + set addtnl_select ", bcms__get_title(i.item_id, 'live_revision') as title, content_folder__get_label(i.item_id) as folder_label" + } + default { + ns_log notice "bcms: revision requested not valid" + return + } + } + + if {$return_list_p} { + # return a list of lists since its not easy to pass multirow from proc to proc + return [db_list_of_ns_sets get_pages "SQL"] + } else { + # make a multirow, it is likely that this proc is not being called from another proc + if ![info exists multirow_name] { set multirow_name bcms_list_pages } + db_multirow $multirow_name get_pages "SQL" + } + +} + + +ad_proc -public bcms::item::list_images { + {-parent_id:required} + {-live_items:boolean false} + {-level_diff 0} + {-multirow_name} + {-return_list:boolean false} +} { + list the images related to a content item which is the parent_id +} { + if {$return_list_p} { + # return a list of lists since its not easy to pass multirow from proc to proc + return [list_items -parent_id $parent_id -content_type image -level_diff $level_diff -return_list] + } else { + # make a multirow, it is likely that this proc is not being called from another proc + if ![info exists multirow_name] { set multirow_name bcms_list_images } + list_items -parent_id $parent_id -content_type image -level_diff $level_diff -multirow_name $multirow_name + } + +} + +ad_proc -public bcms::item::list_files { + {-parent_id:required} + {-live_items:boolean false} + {-level_diff 0} + {-multirow_name} + {-return_list:boolean false} +} { + list the files related to a content item which is the parent_id +} { + if {$return_list_p} { + # return a list of lists since its not easy to pass multirow from proc to proc + return [list_items -parent_id $parent_id -content_type bcms_file -level_diff $level_diff -return_list] + } else { + # make a multirow, it is likely that this proc is not being called from another proc + if ![info exists multirow_name] { set multirow_name bcms_list_files } + list_items -parent_id $parent_id -content_type bcms_file -level_diff $level_diff -multirow_name $multirow_name + } + +} + +ad_proc -public bcms::item::relate_item { + {-relation_type:required} + {-item_id:required} + {-related_object_id:required} +} { + relate item_id to related_object_id with relation_type + +} { + return [db_exec_plsql relate_item "SQL"] + +} + +ad_proc -public bcms::item::unrelate_item { + {-rel_id:required} +} { + unrelate an item +} { + return [db_exec_plsql unrelate_item "SQL"] +} + +ad_proc -public bcms::item::get_sortkeys { + {-item_id:required} +} { + gets the tree_sortkey of an item. current_sortkey, next_sortkey and prev_sortkey + its postgres specific so i need to rehash this to be portable to oracle +} { + + array set sortkeys {} + + db_1row get_currentkey "SQL" + set sortkeys(current_sortkey) $current_sortkey + + set sortkeys(next_sortkey) [db_string get_nextkey "SQL" -default {}] + set sortkeys(prev_sortkey) [db_string get_prevkey "SQL" -default {}] + + return [array get sortkeys] + +} + + + +ad_proc -public bcms::item::format_string_as_url { + {-url:required} +} { + trim the string to format as url +} { + set url [string trim $url] + regsub -all " " $url "" url + regsub -all {([^a-zA-Z0-9])} $url "" url + return $url +} + +ad_proc -public bcms::item::is_item_duplicate_p { + {-url:required} + {-root_id:required} +} { + checks if given url is a duplicate + returns 1 if duplicate + 0 if not +} { + array set item_tester [bcms::item::get_item_by_url -url $url -root_id $root_id ] + return [array size item_tester] +} + +ad_proc -public bcms::item::item_url_duplicate_test { + {-url:required} + {-root_id:required} + {-count:required} +} { + this eliminates the chance of having dupplicate pages + it checks if url exists, if it does it then pads a 1 after url +} { + set ctr 0 + while { ([bcms::item::is_item_duplicate_p -url $url -root_id $root_id] > 0) && ($ctr < $count) } { + set url "${url}1" + set ctr [expr $ctr + 1] + } + return $url +} + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-item-procs.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,43 @@ + + + + + + + select i.name, i.parent_id, i.live_revision, i.latest_revision, + i.content_type, i.storage_type, i.publish_status + $addtnl_select + from cr_items i $addtnl_from + where i.item_id = :item_id + $addtnl_where + + + + + + update cr_items set name = :name + where item_id = :item_id + + + + + + select content_type from cr_items where item_id = :item_id + + + + + + + + select i.item_id, i.live_revision, i.latest_revision, + i.content_type, i.storage_type, i.publish_status + $addtnl_select + from cr_items i $addtnl_from + where i.parent_id = :parent_id + and i.name = :name + $addtnl_where + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-procs-postgresql.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,32 @@ + + + + postgresql7.2 + + + + select nextval('t_acs_object_id_seq') + + + + + + update cr_folders set package_id = :package_id where folder_id = :root_folder_id + + + + + + select content_folder__register_content_type (:folder_id, :content_type, 't'); + + + + + + select content_folder__is_registered (:folder_id, :content_type, 'f'); + + + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,134 @@ +ad_library { + + Utility procs and procs that are not grouped/belong to the other library + + @author Jun Yamog + @creation-date 10 Aug 2002 + @cvs-id bcms-procs.tcl,v 1.2 2002/10/10 07:34:49 nsadmin Exp +} + +namespace eval bcms {} + +# for possible contribution +ad_proc -public bcms::get_table_name { + -object_type:required +} { + returns the table name of a particular object_type +} { + return [db_string get_table_name "SQL"] +} + + +# for possible contribution +ad_proc -public bcms::get_next_objectid { } { + returns the next acs objectID sequence from the database +} { + return [db_string get_next_objectid "SQL"] +} + + +# for possible contribution +ad_proc -public bcms::wizard_step { + {-back:boolean false} + {-set_param_list} +} { + creates the url for the wizard + + -set_param_list is a list of parameters that you would like to set in the + wizard. It must be in a form of "varname value" pairs +} { + # build the parameter list + if [info exists set_param_list] { + for {set i 0} {$i < [llength $set_param_list]} {set i [expr $i + 2]} { + template::wizard set_param [lindex $set_param_list $i] \ + [lindex $set_param_list [expr $i + 1]] + } + } + + if {$back_p} {set step_no -1} else {set step_no 1} + return [template::wizard::get_forward_url [expr [template::wizard current_step] + $step_no]] +} + + +# TODO: move this out of bcms? Since this is a UI specific requirement +ad_proc -public bcms::init_bcms { + -root_folder:required + -root_folder_label:required + {-description ""} +} { + Makes a new bcms instance. creates the root folder and default subfolders + then registers the content types, creates also an index page on the pages folder +} { + set cr_folder_root [bcms::folder::get_cr_root_folder] + + db_transaction { + + # create the root folder + set root_folder_id [bcms::folder::create_folder -name $root_folder \ + -folder_label $root_folder_label -parent_id $cr_folder_root \ + -description $description] + + # register the content types to the folders + # we register the content type to the root folder to be flexible + # even though we have created the default folders + register_content_type -folder_id $root_folder_id -content_type bcms_page + register_content_type -folder_id $root_folder_id -content_type bcms_file + + # bind this package instance to that cr_folder + # we are going to populate the root bcms package_id column only + set package_id [ad_conn package_id] + db_dml update_package_id "SQL" + + # create the default subfolders + set pages_folder_id [bcms::folder::create_folder -name "pages" \ + -folder_label "Pages" -parent_id $root_folder_id \ + -description "This folder holds web pages"] + set images_folder_id [bcms::folder::create_folder -name "images" \ + -folder_label "Images" -parent_id $root_folder_id \ + -description "This folder holds images"] + set files_folder_id [bcms::folder::create_folder -name "files" -folder_label "Files" \ + -parent_id $root_folder_id \ + -description "This folder holds files"] + + # create the index page for the folder + set item_id [bcms::item::create_item -item_name index -parent_id $pages_folder_id \ + -content_type bcms_page -storage_type text] + + # create an initial revision that is blank + set revision_id [bcms::revision::revision_create_in_text -item_id $item_id \ + -title $root_folder_label -content "" -description $description \ + -mime_type "text/html" ] + + # create the template folder + set template_folder_id [bcms::folder::create_folder -name $root_folder \ + -folder_label $root_folder_label -parent_id [bcds::get_cr_template_root] \ + -description $description] + parameter::set_value -parameter template_folder_id -value $template_folder_id + + } + ns_log notice "bcms::init created root folder id $root_folder_id" +} + + +ad_proc -public bcms::register_content_type { + -folder_id:required + -content_type:required +} { + register a content type to a folder +} { + db_exec_plsql register_content_type "SQL" +} + +ad_proc -public bcms::is_registered_content_type { + -folder_id:required + -content_type:required +} { + checks to see if a content type is registered on a folder +} { + set result [db_exec_plsql check_content_type "SQL"] + if {$result == "t"} { + return 1 + } else { + return 0 + } +} Index: openacs-4/contrib/packages/bcms/tcl/bcms-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-procs.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,11 @@ + + + + + + + select table_name from acs_object_types where object_type = :object_type + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs-postgresql.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,44 @@ + + + + postgresql7.2 + + + + select content_revision__delete(:revision_id); + + + + + + select count(*) from cr_revisions where item_id = ( + select item_id from cr_revisions where revision_id = :revision_id + ) + + + + + + select content_item__set_live_revision (:revision_id, 'live') + + + + + + select content_item__unset_live_revision (item_id) from cr_revisions + where revision_id = :revision_id + + + + + + select x.revision_id, x.title, x.description, p.first_names, p.last_name, + to_char(x.creation_date,'HH:MI AM MM/DD/YYYY') as creation_date, l.live_revision_id + from ${table_name}x x, persons p, (select content_item__get_live_revision(:item_id) as live_revision_id) l + where x.creation_user = p.person_id + and x.item_id = :item_id; + + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,203 @@ +ad_library { + + Procs for Content Repository's content revision + + @author Jun Yamog + @creation-date 06 Oct 2002 + @cvs-id $Id: bcms-revision-procs.tcl,v 1.1 2003/05/14 15:34:59 juny Exp $ + +TODO: refactor the creation_user_id "" to something ad_conn +TODO: add back the lob support + +} + +namespace eval bcms::revision {} + +ad_proc -private bcms::revision::add_revision { + {-item_id:required} + {-title:required} + {-content_type} + {-mime_type "text/plain"} + {-description ""} + {-content ""} + {-creation_user_id ""} + {-creation_ip ""} +} { + Adds a new revision to a content item stored in the cr_revision.content column. + Normally you will use your own proc patterned after this proc +} { + if ![info exists content_type] { + set content_type [bcms::item::get_content_type -item_id $item_id] + } + set table_name [bcms::get_table_name -object_type $content_type] + + db_transaction { + set revision_id [bcms::get_next_objectid] + db_dml insert_revision "SQL" + } + + ns_log notice "bcms::revision::revision_create_in_text created new revision $revision_id" + return $revision_id + +} + +ad_proc -private bcms::revision::upload_file_revision { + {-item_id:required} + {-revision_id} + {-title ""} + {-content_type} + {-description ""} + {-upload_tmpfile:required} + {-upload_filename:required} + {-mime_type "application/octet-stream"} + {-creation_user_id ""} + {-creation_ip ""} +} { + Adds a new revision to a content item stored in file system at + acs_root/content-repository-content-files. + Normally you will use your own proc patterned after this proc + + TODO: think about merging this with edit_revision since + now its also used for editing + also lets just accept the upload_file and get the tmpfile and mimetype + inside the proc +} { + if ![info exists content_type] { + set content_type [bcms::item::get_content_type -item_id $item_id] + } + set table_name [bcms::get_table_name -object_type $content_type] + + set file_extension [string trimleft [file extension $upload_filename] "."] + if [string equal $file_extension ""] { + ad_return_complaint 1 "please specify file extension" + } + # check the mime type if it does not exists insert it + if ![db_0or1row check_mime "SQL"] { + db_dml new_mime_type "SQL" + } + + db_transaction { + # if we are editing a existing revision then lets get the next object_id + if ![info exists revision_id] { + set revision_id [bcms::get_next_objectid] + set insert_revision_p 1 + } else { + set insert_revision_p 0 + } + + # create the file in the file system and get its name and size + set tmp_filename [cr_create_content_file $item_id $revision_id $upload_tmpfile] + set tmp_filesize [cr_file_size $tmp_filename] + + # since we are using the file system we will set content to the filename in the fs + set content $tmp_filename + if $insert_revision_p { + # we do not need to reinsert an existing revision + db_dml insert_revision "SQL" + } + db_dml update_file_size "SQL" + } + +} + +ad_proc -public bcms::revision::revision_list { + {-item_id:required} + {-content_type "content_revision"} + {-return_list:boolean false} + {-multirow_name} +} { + returns a multirow of revision_id of the content item. Together with the + title, live_revision_id, creation_date, description and creation user's first_names and last_name +} { + set table_name [bcms::get_table_name -object_type $content_type] + if $return_list_p { + return [db_list_of_ns_sets get_revisions "SQL"] + } else { + if ![info exists multirow_name] { set multirow_name bcms_revision_list } + db_multirow $multirow_name get_revisions "SQL" + } +} + +# TODO: need to rehash this for binary content later +ad_proc -public bcms::revision::get_revision { + {-revision_id:required} +} { + Get the revision info on a single revision + returns an array that contains item_id, name, title, description, + content, content_type, publish_status, live_revision, storage_type +} { + + if {[db_0or1row get_1revision "SQL" -column_array one_revision]} { + return [array get one_revision] + } else { + return 0 + } + +} + +ad_proc -public bcms::revision::set_revision { + {-revision_id:required} + {-title} + {-description} + {-content} + {-upload_tmpfile} + {-mime_type} +} { + Edit a revision's title, description and content +} { + + set update_list [list] + + if [info exists title] { + lappend update_list "title = :title" + } + if [info exists description] { + lappend update_list "description = :description" + } + if [info exists content] { + lappend update_list "content = :content" + } + if [info exists mime_type] { + lappend update_list "mime_type = :mime_type" + } + + set update_string [join $update_list ","] + db_dml update_revision "SQL" + +} + +ad_proc -public bcms::revision::delete_revision { + {-revision_id:required} +} { + delete a revision with revision_id + will only delete the revision if there are + 2 or more revisions. Will not delete if there + is only one revision. You can try bcms::item::delete_item + if you want to remove an item. +} { + set revision_count [db_string get_revision_count "SQL"] + if {$revision_count > 1} { + db_exec_plsql delete_revision "SQL" + return 1 + } else { + return 0 + } +} + +# TODO: put in the other status of expired and ready +ad_proc -public bcms::revision::set_revision_status { + {-revision_id:required} + {-status:required} +} { + sets a revision to live or production, normally the query to know what to publish + is the revision that is set to live +} { + + switch -exact $status { + "live" {db_exec_plsql set_live "SQL"} + "production" {db_exec_plsql unset_live "SQL"} + } + +} + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,63 @@ + + + + + + + insert into ${table_name}i + (revision_id, object_type, creation_user, creation_date, creation_ip, title, description, item_id, text, mime_type) + values (:revision_id, :content_type, :creation_user_id, now(), :creation_ip, :title, :description, :item_id, :content, :mime_type) + + + + + + insert into ${table_name}i + (object_type, creation_user, creation_date, creation_ip, title, description, item_id, revision_id, text, mime_type) + values (:content_type, :creation_user_id, now(), :creation_ip, :title, :description, :item_id, :revision_id, :content, :mime_type) + + + + + + select mime_type + from cr_mime_types + where file_extension = :file_extension + + + + + + insert into cr_mime_types + (mime_type, file_extension) + values + (:mime_type, :file_extension) + + + + + + update cr_revisions + set content_length = :tmp_filesize + where revision_id = :revision_id + + + + + + select i.item_id, i.name, r.title, r.description, r.content, + i.content_type, i.publish_status, i.live_revision, i.storage_type + from cr_revisions r, cr_items i + where r.revision_id = :revision_id + and i.item_id = r.item_id + + + + + + update cr_revisions set $update_string + where revision_id = :revision_id + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template-postgresql.xsl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/Attic/bcms-template-postgresql.xsl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template-postgresql.xsl~ 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,57 @@ + + + + postgresql7.2 + + + + select content_template__new(:template_name, :parent_id, + null, now(), :creation_user_id, :creation_ip) + + + + + + select content_template__delete(:template_id) + + + + + + select content_template__get_root_folder() + + + + + + select content_item__register_template(:item_id, :template_id, :context) + + + + + + select content_item__unregister_template(:item_id, :template_id, :context) + + + + + + select name, item_id from cr_items where item_id = content_item__get_template(:item_id, :context) + + + + + + + + select content_item__get_id(:url, :root_id, 'true'); + + + + + + select name from cr_items where item_id = content_item__get_template(:item_id, :context) + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-template-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template-procs-postgresql.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,43 @@ + + + + postgresql7.2 + + + + select content_template__new(:template_name, :parent_id, + null, now(), :creation_user_id, :creation_ip) + + + + + + select content_template__delete(:template_id) + + + + + + select content_template__get_root_folder() + + + + + + select content_item__register_template(:item_id, :template_id, :context) + + + + + + select content_item__unregister_template(:item_id, :template_id, :context) + + + + + + select name, item_id from cr_items where item_id = content_item__get_template(:item_id, :context) + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template-procs-postgresql.xql~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/Attic/bcms-template-procs-postgresql.xql~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template-procs-postgresql.xql~ 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,43 @@ + + + + postgresql7.2 + + + + select content_template__new(:template_name, :parent_id, + null, now(), :creation_user_id, :creation_ip) + + + + + + select content_template__delete(:template_id) + + + + + + select content_template__get_root_folder() + + + + + + select content_item__register_template(:item_id, :template_id, :context) + + + + + + select content_item__unregister_template(:item_id, :template_id, :context) + + + + + + select name, item_id from cr_items where item_id = content_item__get_template(:item_id, :context) + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-template-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template-procs.tcl 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,88 @@ +ad_library { + + Procs for content_template, and some helper procs + +} + +namespace eval bcms::template {} + +ad_proc -public bcms::template::create_template { + {-template_name:required} + {-parent_id} + {-creation_user_id ""} + {-creation_ip ""} +} { + This proc creates a template and returns the item_id of the new template +} { + if ![info exists parent_id] { + set parent_id [get_bcds_root_folder] + } + set item_id [db_exec_plsql create_template "SQL"] + return $item_id +} + +ad_proc -public bcms::template::delete_template { + {-template_id:required} +} { + Delete a template +} { + return [db_exec_plsql delete_template "SQL"] +} + +# for possible contribution +ad_proc -public bcms::template::get_cr_root_template_folder {} { + gets the folder_id of the template root of cr +} { + set template_root [db_exec_plsql get_template_root "SQL"] + return $template_root +} + +ad_proc -public bcms::template::apply_template { + {-item_id:required} + {-template_id:required} + {-context} +} { + applies a template to a content item with the context given or the current + context of BCDS +} { + + if ![info exists context] { + set context [parameter::get -parameter context] + } + + db_exec_plsql apply_template "SQL" + +} + +ad_proc -public bcms::template::unregister_template { + {-item_id:required} + {-template_id ""} + {-context ""} +} { + unregister a template for a item_id +} { + db_exec_plsql unregister_template "SQL" +} + +ad_proc -public bcms::template::get_template { + {-item_id:required} + {-context} +} { + gets the template of the content item on the context specified +} { + if ![info exists context] { + set context [parameter::get -parameter context] + } + if {[db_0or1row get_template "SQL" -column_array one_template]} { + return [array get one_template] + } else { + return {} + } + +} + + + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-template-procs.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template-procs.xql 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,6 @@ + + + + postgresql7.2 + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/Attic/bcms-template.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template.tcl~ 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,156 @@ +ad_library { + + Procs for content_template, and some helper procs + +} + +namespace eval bcds { + + ad_proc -public create_template { + {-template_name:required} + {-parent_id} + {-creation_user_id ""} + {-creation_ip ""} + } { + This proc creates a template and returns the item_id of the new template + } { + if ![info exists parent_id] { + set parent_id [get_bcds_root_folder] + } + set item_id [db_exec_plsql create_template "SQL"] + return $item_id + } + + ad_proc -public delete_template { + {-template_id:required} + } { + Delete a template + } { + return [db_exec_plsql delete_template "SQL"] + } + + # for possible contribution + ad_proc -public get_cr_template_root {} { + gets the folder_id of the template root of cr + } { + set template_root [db_exec_plsql get_template_root "SQL"] + } + + ad_proc -public get_bcds_root_folder {} { + gets the root folder of bcds + } { + set package_id [ad_conn package_id] + + if [db_0or1row get_bcds_folder "SQL"] { + return $folder_id + } else { + return 0 + } + } + + ad_proc -public apply_template { + {-item_id:required} + {-template_id:required} + {-context} + } { + applies a template to a content item with the context given or the current + context of BCDS + } { + + if ![info exists context] { + set context [parameter::get -parameter context] + } + + db_exec_plsql apply_template "SQL" + + } + + ad_proc -public unregister_template { + {-item_id:required} + {-template_id ""} + {-context ""} + } { + unregister a template for a item_id + } { + db_exec_plsql unregister_template "SQL" + } + + ad_proc -public get_template { + {-item_id:required} + {-context} + } { + gets the template of the content item on the context specified + } { + if ![info exists context] { + set context [parameter::get -parameter context] + } + if {[db_0or1row get_template "SQL" -column_array one_template]} { + return [array get one_template] + } else { + return {} + } + + } + + +####################### depracated procs below............... maybe i can get something from the old junk ################## + + ad_proc -public get_template_name { + {-item_id:required} + {-context} + } { + gets the template of the content item on the context specified + + @depracated use get_template + } { + if ![info exists context] { + set context [parameter::get -parameter context] + } + return [db_string get_template_name "SQL" -default ""] + + } + + ad_proc -public get_content_item_id { + {-url:required} + {-root_id} + {-resolve_index:boolean true} + } { + gets a content items based from the url and the starting root_id. + returns the item_id of + + @depracated use bcms::item::get_item_by_url + } { + if ![info exists root_id] { + if [string equal $url ""] { + set url "index" + } + set root_id [parameter::get -parameter root_folder_id] + } + return [db_exec_plsql get_item_id "SQL"] + + } + + ad_proc -public template_option_list {} { + returns a list normally used for ad_form option list. The format is + template title, template_id + + @depracated make use of bcms::item::list_items directly + } { + set bcms_list_items [bcms::item::list_items -parent_id [bcds::get_bcds_root_folder] -return_list] + + # construct the option list + set option_list [list] + foreach one_item $bcms_list_items { + if ![string equal [lindex $one_item [expr [lsearch $one_item content_type] + 1]] "content_folder"] { + lappend option_list [list [lindex $one_item [expr [lsearch $one_item name] + 1]] \ + [lindex $one_item [expr [lsearch $one_item item_id] + 1]]] + } + } + return $option_list + + } + + +# end of bcds namespace +} + Index: openacs-4/contrib/packages/bcms/tcl/bcms-template.xql~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/Attic/bcms-template.xql~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-template.xql~ 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,12 @@ + + + + postgresql7.2 + + + + select folder_id from cr_folders where package_id = :package_id + + + + Index: openacs-4/contrib/packages/bcms/tcl/bcms-widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-widget-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/tcl/bcms-widget-procs.tcl 14 May 2003 15:34:59 -0000 1.1 @@ -0,0 +1,109 @@ +ad_library { + + Provide functions for bcms common widgets + + @author Jun Yamog + @creation-date 3 Mar 2002 + @cvs-id $Id: bcms-widget-procs.tcl,v 1.1 2003/05/14 15:34:59 juny Exp $ +} + +namespace eval bcms::widget {} + +ad_proc -public bcms::widget::option_list { + -list_of_ns_sets:required + -value_column:required + -display_columns:required + {-prefix " "} +} { + creates a list for use of ad_form's option_list. Gets a list of ns_sets. + + -value_column is the column that will be used the html value + -display_columns is the column or columns that will be + displayed in the select widget + + -prefix is appended before the display column in case the items + on the list_of_ns_sets have different levels. + +} { + + # construct the option list + set option_list [list] + foreach one_row $list_of_ns_sets { + set parent_level [ns_set get $one_row parent_level] + set level [ns_set get $one_row level] + set v_column [ns_set get $one_row $value_column] + + # build the display string + set d_column "" + foreach one_d_column $display_columns { + append d_column "[ns_set get $one_row $one_d_column] " + } + + #check to see if there is a heirachy... eg. level and parent_level + if {![string equal $parent_level ""] || ![string equal $level ""]} { + set option_list_padding [string repeat $prefix [expr ($level - $parent_level) * 4]] + } else { + set option_list_padding "" + } + + # build a single select row + lappend option_list [list "$option_list_padding $d_column" $v_column] + } + return $option_list + +} + + +ad_proc -public bcms::widget::option_tree { + -list_of_ns_sets:required + -value_column:required + -display_columns:required + {-separator " > "} +} { + makes and option list for ad_form option_list. makes a trail on each + select item until the -value_column changes. + + ex. parent > item + parent > parent > item + +} { + # initialize the needed vars + set option_list [list] + set last_item "" + set trail_string "" + + foreach one_row $list_of_ns_sets { + + set current_item [ns_set get $one_row $value_column] + + # build the display string + set current_d_column "" + foreach one_d_column $display_columns { + append current_d_column "[ns_set get $one_row $one_d_column] " + } + + if {$current_item == $last_item} { + # the item is still the same then just build the trail for a single + # row of select widget + append trail_string "${separator}${current_d_column}" + } else { + # build a single row in the select widget and reinitialize trail_string + if ![string equal $trail_string ""] { + # need to check this so the first iteration does not yeild a blank row + lappend option_list [list $trail_string $last_item] + } + set trail_string $current_d_column + } + + # save the current item for comparison on the next iteration + set last_item $current_item + } + + if {[info exists current_item]} { + # we need to append the last row + lappend option_list [list $trail_string $current_item] + } + + return $option_list + +} Index: openacs-4/contrib/packages/bcms/www/folder-create.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/folder-create.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/folder-create.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,4 @@ + +@context_bar@ + + Index: openacs-4/contrib/packages/bcms/www/folder-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/folder-create.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/folder-create.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,25 @@ +ad_page_contract { + Adding a new folder form + +} { + name:optional + folder_label:optional + parent_id:optional +} + +ad_form -name foldercreate -form { + + {name:text(text) {label "Name"}} + {folder_label:text(text) {label "Title"}} + {parent_id:integer(select) {label "Section"} {options [bcms::folder::folder_option_list]} + } + +} -on_submit { + + bcms::folder::create_folder -name $name -folder_label $folder_label -parent_id $parent_id + ad_returnredirect folder-create + +} + + +set context_bar [ad_context_bar "Add Section"] Index: openacs-4/contrib/packages/bcms/www/folder-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/folder-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/folder-delete.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,4 @@ + +@context_bar@ + + Index: openacs-4/contrib/packages/bcms/www/folder-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/folder-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/folder-delete.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + deleting a folder form + +} { + folder_id:optional +} + +ad_form -name folderdelete -form { + + {folder_id:integer(select) {label "Section"} {options [bcms::folder::folder_option_list]} + } + +} -on_submit { + + bcms::folder::delete_folder -folder_id $folder_id + ad_returnredirect folder-delete + +} + + +set context_bar [ad_context_bar "Delete Section"] Index: openacs-4/contrib/packages/bcms/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/index-postgresql.xql 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,13 @@ + + + + postgresql7.2 + + + + select content_folder__register_content_type (:bcms_folder_id, 'bcms_basic', 't'); + + + + + Index: openacs-4/contrib/packages/bcms/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/index.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,20 @@ + + + + + + + + + + +
Content Management System
ContentSection
+ Add Content
+ Edit Content
+ Delete Content
+
+ Add Section
+ Delete Section
+
+ + Index: openacs-4/contrib/packages/bcms/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/index.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,28 @@ +set bcms_root [parameter::get -parameter bcms_root] + +set cr_folder_root [bcms::get_cr_folder_root] + +# check to see if the bcms root is present under the cr_folders Pages root +# if not create a new folder under it +if { ![bcms::folder::get_bcms_root_folder] } { + # create the bcms root folder + + db_transaction { + + set bcms_label $bcms_root + set bcms_description "$bcms_root - root bcms folder of a bcms instance" + set bcms_folder_id [bcms::folder::create_folder -name $bcms_root -folder_label $bcms_label -parent_id $cr_folder_root -description $bcms_description] + + # bind this package instance to that cr_folder + # we are going to populate the root bcms package_id column only + set package_id [ad_conn package_id] + db_dml update_package_id "SQL" + + # register the bcms_basic content type to the folder + db_exec_plsql register_bcms_basic "SQL" + + } + ns_log notice "bcms: $bcms_root folder created" + +} + Index: openacs-4/contrib/packages/bcms/www/index.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/index.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/index.xql 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,13 @@ + + + + postgresql7.2 + + + + update cr_folders set package_id = :package_id where folder_id = :bcms_folder_id + + + + + Index: openacs-4/contrib/packages/bcms/www/item-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/item-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/item-delete.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + deletes a content_item and returns to return_url +} { + item_id:integer,notnull + return_url:notnull +} + +bcms::item::delete_item -item_id $item_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms/www/item-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/item-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/item-list.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,39 @@ + +@context_bar@ + + + + + + + + + + + + + + + + +
NameAction
+ <%= [string repeat " " [expr (@bcms_list_items.level@ - @bcms_list_items.parent_level@) * 5]] %> + + + + + + + @bcms_list_items.name@ + + + + delete + + + edit + + +
+
+ Index: openacs-4/contrib/packages/bcms/www/item-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/item-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/item-list.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + a form for listing the content items + +} { + {mode:optional edit} +} + +ad_form -name itemlistform -form { + + {parent_id:integer(select) {label "Section"} {options [bcms::folder::folder_option_list]}} + {mode:text(hidden) {value $mode}} + +} -on_submit { + set show_list_p true + bcms::item::list_items -parent_id $parent_id +} + + +set return_url "item-list" + +set context_bar [ad_context_bar "List Items"] + + Index: openacs-4/contrib/packages/bcms/www/item-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/item-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/item-one.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,8 @@ + +@context_bar@ + + + + + + Index: openacs-4/contrib/packages/bcms/www/item-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/item-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/item-one.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,52 @@ +ad_page_contract { + a form for editing and adding content items + +} { + item_id:optional + {return_url:optional ""} +} + +set creation_user_id [ad_conn user_id] +set creation_ip [ad_conn peeraddr] + +ad_form -name itemone -html {enctype multipart/form-data} -form { + + item_id:key + + {name:text(text) {label "Name"}} + {parent_id:integer(select) {label "Section"} {options [bcms::folder::folder_option_list]}} + {storage_type:text(select) {label "Content Type"} {options {{"Page" "text"} {"File" "file"}}}} + {return_url:text(hidden) {value $return_url}} + +} -edit_request { + # get the current item + array set one_item [bcms::item::get_item -item_id $item_id] + # set the local vars + set name $one_item(name) + set parent_id $one_item(parent_id) + set storage_type $one_item(storage_type) + # set the form vars + ad_set_form_values name parent_id storage_type + +} -edit_data { + + bcms::item::edit_item -item_id $item_id -name $name -parent_id $parent_id + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } + +} -new_data { + # create the content item + set item_id [bcms::item::create_item -item_name $name -parent_id $parent_id -content_type bcms_basic \ + -storage_type $storage_type -creation_user_id $creation_user_id -creation_ip $creation_ip] + # construct the return_url and then move to creating the revision + if ![string equal $return_url ""] { + set return_url [subsite::util::return_url_stack $return_url] + ad_returnredirect "revision-one?item_id=$item_id&storage_type=$storage_type&return_url=$return_url" + } else { + ad_returnredirect "revision-one?item_id=$item_id&storage_type=$storage_type" + } +} + +set context_bar [ad_context_bar "Content Item"] + Index: openacs-4/contrib/packages/bcms/www/render.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/render.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/render.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + +} { + item_id:integer,notnull +} + +array set one_item [bcms::item::get_item_best -item_id $item_id] +set revision_id $one_item(revision_id) + +cr_write_content -revision_id $revision_id Index: openacs-4/contrib/packages/bcms/www/revision-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/revision-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/revision-delete.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + delete a revision +} { + revision_id:notnull,naturalnum + return_url:notnull +} + +bcms::revision::delete_revision -revision_id $revision_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms/www/revision-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/revision-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/revision-list.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,28 @@ +

Add Revision

+ + + + + + + + + + + + + + + + + +
TitleDescriptionAuthorDateAction
@bcms_revision_list.title@@bcms_revision_list.description@@bcms_revision_list.first_names@ @bcms_revision_list.last_name@@bcms_revision_list.creation_date@ + edit + delete + + publish + + + unpublish + +
Index: openacs-4/contrib/packages/bcms/www/revision-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/revision-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/revision-list.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,9 @@ +ad_page_contract { + list the revision of a content item +} { + item_id:naturalnum,notnull +} + +bcms::revision::revision_list -item_id $item_id + +set return_url [subsite::util::return_url_stack "item-one?item_id=$item_id"] Index: openacs-4/contrib/packages/bcms/www/revision-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/revision-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/revision-one.adp 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,4 @@ + +@context_bar@ + + Index: openacs-4/contrib/packages/bcms/www/revision-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/revision-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/revision-one.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,131 @@ +ad_page_contract { + a form for adding revision and editing revision + +} { + revision_id:naturalnum,optional + storage_type:notnull + {item_id:naturalnum,optional 0} + {return_url:optional ""} +} + +set creation_user_id [ad_conn user_id] +set creation_ip [ad_conn peeraddr] + +ad_form -name revisionone -html {enctype multipart/form-data} -form { + + revision_id:key + + {title:text(text) {label "Title"}} + {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} + {return_url:text(hidden) {value $return_url}} + {item_id:integer(hidden) {value $item_id}} + {storage_type:text(hidden) {value $storage_type}} + +} + +# if the content is text and display a text area and stuff the item the db column +if [string equal $storage_type "text"] { + + ad_form -extend -name revisionone -form { + + {content:text(textarea),optional {html {rows 20 cols 80}} {label "Text Content"}} + + } -edit_request { + + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set title $one_revision(title) + set content $one_revision(content) + set description $one_revision(description) + + ad_set_form_values title content description + + } -edit_data { + + bcms::revision::edit_revision -revision_id $revision_id \ + -title $title -content $content -description $description + + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } + + } -new_data { + + # check if indeed there is an item id to map to + if {$item_id > 0} { + + bcms::revision::revision_create_in_text -item_id $item_id -content_type bcms_basic \ + -title $title -content $content -description $description \ + -mime_type "text/html" \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + + + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } + + } else { + ns_log notice "bcms: Unable to creation revision to a content item that does not exists" + } + } +# if the content revision is a file, when then store it to the fs +# TODO: bring back lob +} elseif [string equal $storage_type "file"] { + + ad_form -extend -name revisionone -form { + + {upload_file:file(file),optional {label "File"}} + + } -edit_request { + + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set title $one_revision(title) + set description $one_revision(description) + + ad_set_form_values title description + + } -edit_data { + # TODO: check if its not really possible to overwrite a file + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set upload_mime_type [template::util::file::get_property mime_type $upload_file] + + bcms::revision::edit_revision -revision_id $revision_id \ + -title $title -description $description + + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } + + } -new_data { + + # check if indeed there is an item id to map to + if {$item_id > 0} { + + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set upload_mime_type [template::util::file::get_property mime_type $upload_file] + + if ![string equal $upload_mime_type ""] { + bcms::revision::revision_create_in_fs -item_id $item_id -content_type bcms_basic \ + -title $title -description $description \ + -upload_tmpfile $upload_tmpfile -mime_type $upload_mime_type \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + } else { + # can't determine the mime type just use whatever is the default + bcms::revision::revision_create_in_fs -item_id $item_id -content_type bcms_basic \ + -title $title -description $description \ + -upload_tmpfile $upload_tmpfile \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + } + + if ![string equal $return_url ""] { + ad_returnredirect $return_url + } + + } else { + ns_log notice "bcms: Unable to creation revision to a content item that does not exists" + } + } + +} + + +set context_bar [ad_context_bar "Content Revision"] Index: openacs-4/contrib/packages/bcms/www/revision-set-status.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/www/Attic/revision-set-status.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms/www/revision-set-status.tcl 14 May 2003 15:35:39 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + set the status of a revision +} { + revision_id:notnull,naturalnum + status:notnull + return_url:notnull +} + +bcms::revision::set_revision_status -revision_id $revision_id -status $status + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/bcms-ui-wizard.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/bcms-ui-wizard.info,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/bcms-ui-wizard.info 14 May 2003 15:36:17 -0000 1.1 @@ -0,0 +1,29 @@ + + + + + BCMS UI Wizard + BCMS UI Wizard + f + f + + + Jun Yamog + A BCMS UI implementation that makes use of wizard + 2003-04-26 + A BCMS UI implementation that makes use of wizard + + + + + + + + + + + + + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/TODO.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/TODO.txt,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/TODO.txt 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,33 @@ +- check all form steps... it saves the return_url, it also optional gets the current data of the form in case the user presses back +- turn on the relation order_n column +- check that displayed names are using either the title or label +- add api on the folder-list to exclude a particular folder +- review all ns_log and properly set the sevirity level + - Notice, Warning, Error, Fatal, Bug, Debug +- do make procs to construct the addtnl_where +- possible construct the addthnl_select too +- test the multiple context in template, also we seem to only have 1 template per item. Maybe add support for multiple template per item +- what do we do if the index page is delete? +- report OpenACS bug that its possible to insert to a view and the item_id is not the same content type, for example i inserted with the item_id to be a content folder +- make_option_list_trail needs atleast on item fix it +- review all ad_page_contract var so that they are all uniform set optional id var to "" +- bring back the support for lob binary items +- merge/refactor bcms::item::list_items/tree_items, etc. + + + + +changes 3/3/2003 + +- move from bcms::get_cr_folder_root -> bcms::folder::get_cr_root_folder +- move from bcms::make_option_list -> bcms::widget::option_list +- move from bcms::make_option_list_trail -> bcms::widget::option_tree +- move from bcms::item::edit_item -> bcms::item::set_item +- move from bcms::item::list_items_with_ancestors -> bcms::item::tree_items +- move from bcms::folder::edit_folder -> bcms::folder::set_folder +- move from bcms::folder::list_folders_with_ancestors -> bcms::folder::tree_folders +- move from bcms::revision::revision_create_in_text -> bcms::revision::add_revision +- move from bcms::revision::revision_creare_in_fs -> bcms::revision::upload_file_revision +- move from bcms::revision::edit_revision -> bcms::revision::set_revision + +fully implement the folder_id rather than package_id Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-create-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-create-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-create-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + wizard for uploading a file + +} { + {content_type bcms_file} +} + +template::wizard create -action "file-create-wizard?content_type=$content_type" -params { + content_type folder_id relate_to return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Upload File" -url "file-upload" +} + +template::wizard get_current_step + +set wizard_title "Add File" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-delete-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-delete-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-delete-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + Delete a file +} { + file_id:notnull,naturalnum + return_url:notnull +} + +array set one_file [bcms::item::get_item -item_id $file_id -revision latest] + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "File to delete"} {value $one_file(title)}} + +} -on_submit { + + bcms::item::delete_item -item_id $file_id + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-delete-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-delete-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-delete-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for deleting files + +} { + +} + +template::wizard create -action "file-delete-wizard" -params { + folder_id file_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select File" -url "file-list" + 3 -label "Confirm" -url "file-delete-finish" +} + +template::wizard get_current_step + +set wizard_title "Delete File" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-edit-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-edit-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-edit-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + redirect to file-one passing in the correct file_id +} { + file_id:notnull,naturalnum + return_url:notnull +} + +ad_returnredirect "file-one?file_id=$file_id&return_url=$return_url" Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-edit-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-edit-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-edit-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for editing files + +} { + +} + +template::wizard create -action "file-edit-wizard" -params { + folder_id file_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select File" -url "file-list" + 3 -label "Edit File" -url "file-edit-finish" +} + +template::wizard get_current_step + +set wizard_title "Edit File" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + List the pages under the files folder + +} { + folder_id:notnull,naturalnum + {file_id:optional,naturalnum ""} + return_url:optional +} + +set item_option_list [bcms::widget::option_list -list_of_ns_sets \ + [bcms::item::list_items -parent_id $folder_id \ + -content_type bcms_file -revision latest -return_list] \ + -value_column item_id -display_columns title] + +# create the form +ad_form -name wizard_form -form { + + {file_id:integer(select) {label "Files"} {options $item_option_list} {value $file_id}} + +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # set the item_id and more the wizard forward + template::wizard set_param file_id $file_id + template::wizard forward + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-one.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,25 @@ + + +@context_bar@ + + + + + + + + + + + + + + + + +
@one_file.title@
File URL@one_file.name@Change File
Description@one_file.description@
Parent Section@one_folder.label@Change Section
download
+ +
+ +
+ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-one.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,16 @@ +ad_page_contract { + display the available actions for file + +} { + file_id:notnull,naturalnum + return_url:notnull +} + +# get the information about this page +array set one_file [bcms::item::get_item -item_id $file_id -revision latest] +array set one_folder [bcms::folder::get_folder -folder_id $one_file(parent_id)] + +set current_url [ad_return_url -urlencode] + +set context_bar [ad_context_bar $one_file(title)] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-relate-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-relate-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-relate-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + relate a file to a page +} { + page_id:notnull,naturalnum + file_id:notnull,naturalnum + return_url:notnull +} + +bcms::item::relate_item -relation_type files -item_id $page_id -related_object_id $file_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-relate-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-relate-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-relate-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for relating files + +} { + page_id:notnull,naturalnum +} + +template::wizard create -action "file-relate-wizard?page_id=$page_id" -params { + file_id page_id folder_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select File" -url "file-list" + 3 -label "Finish" -url "file-relate-finish" +} + +template::wizard get_current_step + +set wizard_title "Relate File" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-revision-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-revision-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-revision-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + wizard for editing a file revisions + +} { + revision_id:notnull,naturalnum + content_type:notnull +} + +# we pass in revision_id rather than determine in a wizard step since as of now +# we are not yet exposing the revisions for files + +template::wizard create -action "file-revision-wizard?revision_id=$revision_id" -params { + revision_id folder_id content_type return_url +} -steps { + 1 -label "Edit File" -url "file-upload" +} + +template::wizard get_current_step + +set wizard_title "File" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/file-upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/file-upload.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/file-upload.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,149 @@ +ad_page_contract { + a form for adding content + +} { + {relate_to:optional,naturalnum ""} + {revision_id:optional,naturalnum ""} + {name:optional ""} + folder_id:notnull,naturalnum + return_url:notnull + content_type:notnull +} + +# if the revision_id is 0 then unset it, its not a valid revision. Its likely that its requesting +# a new revision +if [string equal $revision_id ""] { unset revision_id } + +# lets get an existing item on that url +if {![string equal $name ""]} { + array set existing_name [bcms::item::get_item_by_url -root_id $folder_id -url $name -resolve_index false -revision latest] +} + +ad_form -name wizard_form -html {enctype multipart/form-data} -form { + + revision_id:key + + {name:text(text) {label "URL"}} + {title:text(text) {label "Title"}} + {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} + {upload_file:file(file),optional {label "File"}} + {relate_to:text(hidden) {value $relate_to}} + +} -edit_request { + + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set title $one_revision(title) + set description $one_revision(description) + set name $one_revision(name) + + ad_set_form_values name title description + +} -validate { + {name + {([array size existing_name] == 0) || ([info exists revision_id] && ($existing_name(latest_revision) == $revision_id))} + "URL already exists,
please use another URL" + } +} -edit_data { + + # get the file properties + set upload_filename [template::util::file::get_property filename $upload_file] + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set upload_mime_type [template::util::file::get_property mime_type $upload_file] + + # get the item based from revision_id + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + + db_transaction { + bcms::item::set_item -item_id $one_revision(item_id) -name $name + + bcms::revision::set_revision -revision_id $revision_id \ + -title $title -description $description + + # lets change the file if a new one is uploaded + if ![string equal $upload_tmpfile ""] { + + if ![string equal $upload_mime_type ""] { + bcms::revision::upload_file_revision -item_id $one_revision(item_id) -revision_id $revision_id \ + -upload_filename $upload_filename -upload_tmpfile $upload_tmpfile -mime_type $upload_mime_type + } else { + # can't determine the mime type just use whatever is the default + bcms::revision::upload_file_revision -item_id $one_revision(item_id) -revision_id $revision_id \ + -upload_filename $upload_filename -upload_tmpfile $upload_tmpfile + } + + } + + } + + ad_returnredirect $return_url + + +} -new_data { + + set creation_user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + # set the prover vars + switch -exact $content_type { + bcms_file { + set relation_type files + } + image { + set relation_type images + } + default { + ad_return_complaint 1 "content_type is invalid" + } + } + + db_transaction { + + # create the content item + set item_id [bcms::item::create_item -item_name $name -parent_id $folder_id -content_type $content_type \ + -storage_type file -creation_user_id $creation_user_id -creation_ip $creation_ip] + + # check if indeed there is an item id to map to + if {$item_id > 0} { + set upload_filename [template::util::file::get_property filename $upload_file] + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set upload_mime_type [template::util::file::get_property mime_type $upload_file] + + if [string equal $upload_tmpfile ""] { + ad_return_complaint 1 "please uploade a file" + } else { + + if ![string equal $upload_mime_type ""] { + bcms::revision::upload_file_revision -item_id $item_id \ + -title $title -description $description \ + -upload_filename $upload_filename -upload_tmpfile $upload_tmpfile -mime_type $upload_mime_type \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + } else { + # can't determine the mime type just use whatever is the default + bcms::revision::upload_file_revision -item_id $item_id \ + -title $title -description $description \ + -upload_filename $upload_filename -upload_tmpfile $upload_tmpfile \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + } + + # relate this file to another item if relate_to is existing + if ![string equal $relate_to ""] { + bcms::item::relate_item -relation_type $relation_type -item_id $relate_to -related_object_id $item_id + } + } + + } else { + ns_log notice "bcms: Unable to creation revision to a content item that does not exists" + } + + } + + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-create-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-create-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-create-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,65 @@ +ad_page_contract { + create a new folder form +} { + folder_name:notnull,trim + folder_label:notnull,trim + folder_id:notnull,naturalnum + template_id:notnull,naturalnum + return_url:notnull +} + +# the parent id of this folder is the folder_id that was choosen +set parent_id $folder_id + +array set parent_folder [bcms::folder::get_folder -folder_id $folder_id] +if {$template_id > 0} { + array set one_template [bcms::item::get_item -item_id $template_id -revision latest] +} else { + set one_template(title) "Default Template" +} + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Section URL"} {value $folder_name}} + {confirm_text2:text(inform) {label "Section Name"} {value $folder_label}} + {confirm_text3:text(inform) {label "Parent Section"} {value $parent_folder(label)}} + {confirm_text4:text(inform) {label "Section Template"} {value $one_template(title)}} + +} -on_submit { + + set creation_user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + db_transaction { + # now that we have all the data create the folder + set folder_id [bcms::folder::create_folder -name $folder_name -folder_label $folder_label -parent_id $parent_id] + + # create the index page for the folder + set item_id [bcms::item::create_item -item_name index -parent_id $folder_id -content_type bcms_page \ + -storage_type text -creation_user_id $creation_user_id -creation_ip $creation_ip] + + # create an initial revision that is blank + set revision_id [bcms::revision::add_revision -item_id $item_id \ + -title $folder_label -content "" -description "" \ + -mime_type "text/html" \ + -creation_user_id $creation_user_id -creation_ip $creation_ip] + + if {$template_id > 0} { + # set the template + bcds::apply_template -item_id $folder_id -template_id $template_id -context "public" + } + } + + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-create-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-create-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-create-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,25 @@ +ad_page_contract { + wizard to gather folder info to create a new folder +} { + +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "folder-create-wizard" -params { + folder_name folder_label folder_id template_id return_url +} -steps { + 1 -label "Select Parent Section" -url "folder-list" + 2 -label "Enter Section Name" -url "folder-name-create" + 3 -label "Select Section Template" -url "template-list" + 4 -label "Create Section" -url "folder-create-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Add Section" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-delete-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-delete-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-delete-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,33 @@ +ad_page_contract { + delete folder form +} { + folder_id:notnull,naturalnum + return_url:notnull +} + +array set one_folder [bcms::folder::get_folder -folder_id $folder_id] + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Section Name"} {value $one_folder(label)}} + +} -on_submit { + + if [bcms::folder::delete_folder -folder_id $folder_id] { + ad_returnredirect $return_url + } else { + ad_return_complaint 1 "Could not delete the section, there are still items under this section. Delete them first" + + } + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-delete-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-delete-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-delete-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + Delete a folder form wizard +} { + +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "folder-delete-wizard" -params { + folder_id return_url +} -steps { + 1 -label "Select Section to Delete" -url "folder-list" + 2 -label "Confirm" -url "folder-delete-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Delete Section" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + redirects to folder-one with the correct folder_id +} { + folder_id:notnull,naturalnum + return_url:notnull +} + +ad_returnredirect "folder-one?folder_id=$folder_id&return_url=$return_url" Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-name-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-name-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-name-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { + sets the folder_name and folder_label +} { + folder_name:notnull,trim + folder_label:notnull,trim + folder_id:notnull,naturalnum + return_url:notnull +} + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Section URL"} {value $folder_name}} + {confirm_text2:text(inform) {label "Section Name"} {value $folder_label}} + +} -on_submit { + + bcms::folder::set_folder -folder_id $folder_id -name $folder_name -label $folder_label + + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-name-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-name-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-name-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + Edit the name and label folder form wizard +} { + +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "folder-edit-name-wizard" -params { + folder_name folder_label folder_id return_url +} -steps { + 1 -label "Edit Section" -url "folder-name" + 2 -label "Confirm" -url "folder-edit-name-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Edit Section Name" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-template-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-template-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-template-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,44 @@ +ad_page_contract { + edit a folder template + +} { + folder_id:notnull,naturalnum + template_id:notnull,naturalnum + return_url:notnull +} + +if {$template_id > 0} { + array set one_template [bcms::item::get_item -item_id $template_id -revision latest] +} else { + set one_template(title) "Default Template" +} + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Template"} {value $one_template(title)}} + +} -on_submit { + + db_transaction { + # unregister all template for this item + bcds::unregister_template -item_id $folder_id + + if {$template_id > 0} { + # set the template + bcds::apply_template -item_id $folder_id -template_id $template_id -context "public" + } + } + + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-template-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-template-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-template-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + edit a template form wizard +} { + template_id:notnull,naturalnum +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "folder-edit-template-wizard" -params { + folder_id template_id return_url +} -steps { + 1 -label "Select Section Template" -url "template-list" + 2 -label "Confirm" -url "folder-edit-template-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Edit Section Template" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-edit-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + Editing a folder form wizard +} { + +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "folder-edit-wizard" -params { + folder_id return_url +} -steps { + 1 -label "Select Section to Edit" -url "folder-list" + 2 -label "Edit Section" -url "folder-edit-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Edit Section" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list-items.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list-items.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,42 @@ + + +@context_bar@ + + + + + + + + + + + + + + + + + +
TypePage TitleSection Title
+ + Sub Section + + + Page + + @pages_and_folders.title@@pages_and_folders.folder_label@ + + swap with next + + +   |   + + + swap with previous + +
+ +
+ +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list-items.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list-items.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + list the items of a folder for sorting +} { + folder_id:notnull,naturalnum + return_url:notnull +} + +bcms::item::list_pages -parent_id $folder_id -multirow_name pages_and_folders + +set current_url [ad_return_url -urlencode] + +set context_bar [ad_context_bar "Sort Section"] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,38 @@ +ad_page_contract { + List the sections under the bcms_root of this instance + sets the folder_id wizard var +} { + {folder_id:optional ""} + folder_parent_id:optional + return_url:optional +} + +set folder_option_list [bcms::widget::option_tree -list_of_ns_sets \ + [bcms::folder::tree_folders -return_list] \ + -value_column folder_id -display_columns label] + +# create the form +ad_form -name wizard_form -form { + + {folder_id:integer(select) {label "Section List"} {options $folder_option_list} {value $folder_id}} + +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # set the parent_id and more the wizard forward + template::wizard set_param folder_id $folder_id + template::wizard forward + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-name-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-name-create.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-name-create.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,50 @@ +ad_page_contract { + folder name and folder label form + sets folder_name and folder_label wizard vars +} { + folder_id:notnull,naturalnum + {folder_name:optional ""} + {folder_label:optional ""} + return_url:optional +} + +# we set the parent id to the folder_id that was passed +# since we are creating this folder under the existing +# folder_id +set parent_id $folder_id + +# lets get an existing item on that url +if {![string equal $folder_name ""]} { + array set existing_folder [bcms::item::get_item_by_url -root_id $parent_id -url $folder_name -resolve_index false] +} + +# create the form +ad_form -name wizard_form -form { + + {folder_name:text(text) {label "Section URL"} {value $folder_name}} + {folder_label:text(text) {label "Section Name"} {value $folder_label}} + +} -validate { + {folder_name + {([array size existing_folder] == 0)} + "Section URL already exists,
please use another Section URL" + } +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # save the folder_name and folder_label and move the wizard forward + template::wizard set_param folder_name $folder_name + template::wizard set_param folder_label $folder_label + template::wizard forward +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-name.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-name.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-name.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,56 @@ +ad_page_contract { + folder name and folder label form + sets folder_name and folder_label wizard vars +} { + folder_id:notnull,naturalnum + {folder_name:optional ""} + {folder_label:optional ""} + return_url:optional +} + +# we get the folder here rather than ad_form's edit_request since we need some +# value outside of ad_form, so we will query only once +array set one_folder [bcms::folder::get_folder -folder_id $folder_id] + +# if the folder_name or folder_label is blank most likely this is ther first time +# this form is visited from a wizard, if the have value the user must +# step back +if {[string equal $folder_name ""] || [string equal $folder_label ""]} { + set folder_name $one_folder(name) + set folder_label $one_folder(label) + +} + +# lets get an existing item on that url +array set existing_folder [bcms::item::get_item_by_url -root_id $one_folder(parent_id) -url $folder_name -resolve_index false] + +# create the form +ad_form -name wizard_form -form { + + {folder_name:text(text) {label "Section URL"} {value $folder_name}} + {folder_label:text(text) {label "Section Name"} {value $folder_label}} + +} -validate { + {folder_name + {([array size existing_folder] == 0) || ([info exists folder_id] && ($existing_folder(item_id) == $folder_id))} + "Section URL already exists,
please use another Section URL" + } +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # save the folder_name and folder_label and move the wizard forward + template::wizard set_param folder_name $folder_name + template::wizard set_param folder_label $folder_label + template::wizard forward +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-one.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,35 @@ + + +@context_bar@ + + + + + + + + + + + + + + + + + + + +
@one_folder.label@
Section URL@one_folder.name@Edit Section URL
Section Name@one_folder.label@Edit Section Name
Parent Section@parent_folder.label@Change Parent Section
Section Template + + Default Template + + + @one_template_properties.title@ + + Change Section Template
+ +
+ +
+ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-one.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + display the available actions for a folder + +} { + folder_id:notnull,naturalnum + return_url:notnull +} + +array set one_folder [bcms::folder::get_folder -folder_id $folder_id] +array set parent_folder [bcms::folder::get_folder -folder_id $one_folder(parent_id)] + +array set one_template [bcds::get_template -item_id $folder_id -context public] +#ns_log notice "debug: $one_template(name)" +if {[array size one_template] == 0} { + set one_template(item_id) 0 +} else { + array set one_template_properties [bcms::item::get_item -item_id $one_template(item_id) -revision latest] +} + +set current_url [ad_return_url -urlencode] + +set context_bar [ad_context_bar $one_folder(label)] + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-sort-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-sort-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-sort-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + redirect to folder-list-items +} { + folder_id:notnull,naturalnum + return_url:notnull +} + +ad_returnredirect "folder-list-items?folder_id=$folder_id&return_url=$return_url" Index: openacs-4/contrib/packages/bcms-ui-wizard/www/folder-sort-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/folder-sort-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/folder-sort-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + wizard to sort a folder +} { + +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "folder-sort-wizard" -params { + folder_id return_url +} -steps { + 1 -label "Select Section to Sort" -url "folder-list" + 2 -label "Sort Section" -url "folder-sort-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Sort Section" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-create-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-create-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-create-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + wizard for uploading a image + +} { + {content_type image} +} + +template::wizard create -action "image-create-wizard?content_type=$content_type" -params { + content_type folder_id relate_to return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Upload Image" -url "file-upload" +} + +template::wizard get_current_step + +set wizard_title "Add Image" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-delete-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-delete-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-delete-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + Delete a image +} { + image_id:notnull,naturalnum + return_url:notnull +} + +array set one_image [bcms::item::get_item -item_id $image_id -revision latest] + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Image to delete"} {value $one_image(title)}} + +} -on_submit { + + bcms::item::delete_item -item_id $image_id + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-delete-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-delete-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-delete-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for deleting images + +} { + +} + +template::wizard create -action "image-delete-wizard" -params { + folder_id image_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select Image" -url "image-list" + 3 -label "Confirm" -url "image-delete-finish" +} + +template::wizard get_current_step + +set wizard_title "Delete Image" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-edit-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-edit-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-edit-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + redirect to image-one passing in the correct image_id +} { + image_id:notnull,naturalnum + return_url:notnull +} + +ad_returnredirect "image-one?image_id=$image_id&return_url=$return_url" Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-edit-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-edit-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-edit-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for editing images + +} { + +} + +template::wizard create -action "image-edit-wizard" -params { + folder_id image_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select Image" -url "image-list" + 3 -label "Edit Image" -url "image-edit-finish" +} + +template::wizard get_current_step + +set wizard_title "Edit Image" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + List the pages under the images folder + +} { + folder_id:notnull,naturalnum + {image_id:optional,naturalnum ""} + return_url:optional +} + +set item_option_list [bcms::widget::option_list -list_of_ns_sets \ + [bcms::item::list_items -parent_id $folder_id \ + -content_type image -revision latest -return_list] \ + -value_column item_id -display_columns title] + +# create the form +ad_form -name wizard_form -form { + + {image_id:integer(select) {label "Images"} {options $item_option_list} {value $image_id}} + +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # set the item_id and more the wizard forward + template::wizard set_param image_id $image_id + template::wizard forward + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-one.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,25 @@ + + +@context_bar@ + + + + + + + + + + + + + + + + +
@one_image.title@
Image URL@one_image.name@Change Image
Description@one_image.description@
Parent Section@one_folder.label@Change Section
+ +
+ +
+ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-one.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,16 @@ +ad_page_contract { + display the available actions for image + +} { + image_id:notnull,naturalnum + return_url:notnull +} + +# get the information about this page +array set one_image [bcms::item::get_item -item_id $image_id -revision latest] +array set one_folder [bcms::folder::get_folder -folder_id $one_image(parent_id)] + +set current_url [ad_return_url -urlencode] + +set context_bar [ad_context_bar $one_image(title)] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-relate-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-relate-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-relate-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + relate an image to a page +} { + page_id:notnull,naturalnum + image_id:notnull,naturalnum + return_url:notnull +} + +bcms::item::relate_item -relation_type images -item_id $page_id -related_object_id $image_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-relate-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-relate-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-relate-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for relating images + +} { + page_id:notnull,naturalnum +} + +template::wizard create -action "image-relate-wizard?page_id=$page_id" -params { + image_id page_id folder_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select Image" -url "image-list" + 3 -label "Finish" -url "image-relate-finish" +} + +template::wizard get_current_step + +set wizard_title "Relate Image" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/image-revision-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/image-revision-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/image-revision-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + wizard for editing a image revisions + +} { + revision_id:notnull,naturalnum + content_type:notnull +} + +# we pass in revision_id rather than determine in a wizard step since as of now +# we are not yet exposing the revisions for images + +template::wizard create -action "file-revision-wizard?revision_id=$revision_id" -params { + revision_id folder_id content_type return_url +} -steps { + 1 -label "Edit Image" -url "file-upload" +} + +template::wizard get_current_step + +set wizard_title "Image" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/index.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,70 @@ + + + + + + + +
+ + + + + + + + + + +
+ + +
+ + +
+ +
+ + + + + + + + + + + +
+ + +
+ + +
+ +
+ + + + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/index.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,64 @@ +set root_folder_id [bcms::folder::get_bcms_root_folder] + +if { ( $root_folder_id == 0 ) } { + + ns_log notice "redirecting to admin pages to properly set this bcms UI package" + ad_returnredirect admin + ad_script_abort + +} + + db_transaction { + + # register the content types to the folders + # we register the content type to the root folder to be flexible + # even though we have created the default folders + if ![bcms::is_registered_content_type -folder_id $root_folder_id -content_type bcms_page] { + bcms::register_content_type -folder_id $root_folder_id -content_type bcms_page + } + if ![bcms::is_registered_content_type -folder_id $root_folder_id -content_type bcms_file] { + bcms::register_content_type -folder_id $root_folder_id -content_type bcms_file + } + + # create the default subfolders other wise get the current folder ids + array set pages_folder [bcms::item::get_item_by_url -root_id $root_folder_id -url "pages" -resolve_index false] + if ![array size pages_folder] { + set pages_folder_id [bcms::folder::create_folder -name "pages" \ + -folder_label "Pages" -parent_id $root_folder_id \ + -description "This folder holds web pages"] + # create the index page for the folder + set item_id [bcms::item::create_item -item_name index -parent_id $pages_folder_id \ + -content_type bcms_page -storage_type text] + + # create an initial revision that is blank + set revision_id [bcms::revision::add_revision -item_id $item_id \ + -title "Home Page" -content "" -description "Blank Home Page" \ + -mime_type "text/html" ] + + } else { + set pages_folder_id $pages_folder(item_id) + } + + array set images_folder [bcms::item::get_item_by_url -root_id $root_folder_id -url "images" -resolve_index false] + if ![array size images_folder] { + set images_folder_id [bcms::folder::create_folder -name "images" \ + -folder_label "Images" -parent_id $root_folder_id \ + -description "This folder holds images"] + } else { + set images_folder_id $images_folder(item_id) + } + + array set files_folder [bcms::item::get_item_by_url -root_id $root_folder_id -url "files" -resolve_index false] + if ![array size files_folder] { + set files_folder_id [bcms::folder::create_folder -name "files" -folder_label "Files" \ + -parent_id $root_folder_id \ + -description "This folder holds files"] + } else { + set files_folder_id $files_folder(item_id) + } + + + } + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/item-section-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/item-section-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/item-section-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + set the parent_id of an item_id +} { + folder_id:notnull,naturalnum + item_id:notnull,naturalnum + return_url:notnull +} + +array set one_folder [bcms::folder::get_folder -folder_id $folder_id] + +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "New Parent Section"} {value $one_folder(label)}} + +} -on_submit { + # set the new parent id of the content item + bcms::item::set_item -item_id $item_id -parent_id $folder_id + ad_returnredirect $return_url + +} + +template::wizard submit wizard_form -buttons { back finish } + +ad_return_template wizard-form-step Index: openacs-4/contrib/packages/bcms-ui-wizard/www/item-section-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/item-section-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/item-section-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,20 @@ +ad_page_contract { + wizard for changing folder of where the content items is contained +} { + item_id:notnull,naturalnum +} + +template::wizard create -action "item-section-wizard" -params { + item_id folder_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Confirm" -url "item-section-finish" +} + +template::wizard get_current_step + +set wizard_title "Edit Parent Section" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/item-sort-swap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/item-sort-swap.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/item-sort-swap.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,49 @@ +ad_page_contract { + swap the tree_sortkey of an item + need to rehash this so it portable to oracle + due to this feature bcms will be postgres specific like etp + taken from etp-swap +} { + item_id:notnull,naturalnum + swap_to:notnull + return_url:notnull +} + +array set sortkeys [bcms::item::get_sortkeys -item_id $item_id] +set next_sortkey $sortkeys(next_sortkey) +set current_sortkey $sortkeys(current_sortkey) +set prev_sortkey $sortkeys(prev_sortkey) + +# set the key that we will swap for the current item's tree_sortkey +if {![string equal $next_sortkey ""] && [string equal $swap_to "next"]} { + # if we will swap to the next key then we query from the current key + set swap_sortkey $next_sortkey + set sql "select item_id, tree_sortkey from cr_items where tree_sortkey >= :current_sortkey order by tree_sortkey" +} elseif {![string equal $prev_sortkey ""] && [string equal $swap_to "prev"]} { + # if we will swap to the prev key then start from the prev key + set swap_sortkey $prev_sortkey + set sql "select item_id, tree_sortkey from cr_items where tree_sortkey >= :prev_sortkey order by tree_sortkey" +} +if [info exists swap_sortkey] { + db_transaction { + db_foreach get_keys $sql { + if {[regsub "^$current_sortkey" $tree_sortkey $swap_sortkey new_sortkey] || + [regsub "^$swap_sortkey" $tree_sortkey $current_sortkey new_sortkey]} { + # we swap the keys from the start query defined on tope + db_dml update_current_item "update cr_items set tree_sortkey = :new_sortkey where item_id = :item_id" + } else { + # because of how we ordered the select, we're done. + # db_foreach will flush the remaining result rows. + break + } + # end db_foreach + } + # end db_transaction + } +} + +ad_returnredirect $return_url + + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/item-unrelate.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/item-unrelate.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/item-unrelate.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + remove a relation +} { + rel_id:notnull,naturalnum + return_url:notnull +} + +bcms::item::unrelate_item -rel_id $rel_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-create-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-create-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-create-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for creating a new page + +} { + +} + +template::wizard create -action "page-create-wizard" -params { + page_name folder_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Page Name" -url "page-name" + 3 -label "Page Content" -url "page-revision" +} + +template::wizard get_current_step + +set wizard_title "Add Page" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-delete-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-delete-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-delete-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + Delete a page +} { + page_id:notnull,naturalnum + return_url:notnull +} + +array set one_page [bcms::item::get_item -item_id $page_id -revision latest] + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Page to delete"} {value $one_page(title)}} + +} -on_submit { + + bcms::item::delete_item -item_id $page_id + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-delete-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-delete-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-delete-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for deleting pages + +} { + +} + +template::wizard create -action "page-delete-wizard" -params { + folder_id page_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select Page" -url "page-list" + 3 -label "Confirm" -url "page-delete-finish" +} + +template::wizard get_current_step + +set wizard_title "Delete Page" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + redirect to page-one passing in the correct page_id +} { + page_id:notnull,naturalnum + return_url:notnull +} + +ad_returnredirect "page-one?page_id=$page_id&return_url=$return_url" Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-name-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-name-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-name-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,29 @@ +ad_page_contract { + sets the page_name +} { + page_name:notnull,trim + page_id:notnull,naturalnum + return_url:notnull +} + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Page URL"} {value $page_name}} + +} -on_submit { + + bcms::item::set_item -item_id $page_id -name $page_name + + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-name-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-name-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-name-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + Edit the name of a page +} { +} + +template::form create folder_form + +# build the wizard +template::wizard create -action "page-edit-name-wizard" -params { + page_id folder_id page_name return_url +} -steps { + 1 -label "Edit Page URL" -url "page-name" + 2 -label "Confirm" -url "page-edit-name-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Edit Section Name" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-template-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-template-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-template-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,44 @@ +ad_page_contract { + edit a page template + +} { + page_id:notnull,naturalnum + template_id:notnull,naturalnum + return_url:notnull +} + +if {$template_id > 0} { + array set one_template [bcms::item::get_item -item_id $template_id -revision latest] +} else { + set one_template(title) "Use current section template" +} + +# create the form +ad_form -name wizard_form -form { + + {confirm_text:text(inform) {label "Template"} {value $one_template(title)}} + +} -on_submit { + + db_transaction { + # unregister all template for this item + bcds::unregister_template -item_id $page_id + + if {$template_id > 0} { + # set the template + bcds::apply_template -item_id $page_id -template_id $template_id -context "public" + } + } + + ad_returnredirect $return_url + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-template-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-template-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-template-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + edit a template form wizard +} { + template_id:notnull,naturalnum +} + +template::form create page_form + +# build the wizard +template::wizard create -action "page-edit-template-wizard" -params { + page_id template_id return_url +} -steps { + 1 -label "Select Page Template" -url "template-list" + 2 -label "Confirm" -url "page-edit-template-finish" +} + +# get the current step so we can know what to include in the adp +template::wizard get_current_step + +set wizard_title "Edit Page Template" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-edit-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for editing pages + +} { + +} + +template::wizard create -action "page-edit-wizard" -params { + folder_id page_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select Page" -url "page-list" + 3 -label "Edit Page" -url "page-edit-finish" +} + +template::wizard get_current_step + +set wizard_title "Edit Page" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + List the pages under the folder_id + set page_id wizard var +} { + folder_id:notnull,naturalnum + {page_id:optional,naturalnum ""} + return_url:optional +} + +set item_option_list [bcms::widget::option_list -list_of_ns_sets \ + [bcms::item::list_items -parent_id $folder_id \ + -content_type bcms_page -revision latest -return_list] \ + -value_column item_id -display_columns title] + +# create the form +ad_form -name wizard_form -form { + + {page_id:integer(select) {label "Pages"} {options $item_option_list} {value $page_id}} + +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # set the item_id and more the wizard forward + template::wizard set_param page_id $page_id + template::wizard forward + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-name.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-name.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-name.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,63 @@ +ad_page_contract { + page name form + +} { + folder_id:notnull,naturalnum + {page_id:optional,naturalnum ""} + {page_name:optional ""} + {return_url:optional} +} + +# if item_id is 0 then unset it, we need to do this since wizard sometimes +# set it to "" +if {[string equal $page_id ""]} { unset page_id } + +# lets get an existing item on that url +if {![string equal $page_name ""]} { + array set existing_page [bcms::item::get_item_by_url -root_id $folder_id -url $page_name -resolve_index false] +} + +# create the form +ad_form -name wizard_form -form { + + page_id:key + + {page_name:text(text) {label "Page URL"} {value $page_name}} + +} -edit_request { + # if the page_name is blank most likely this is ther first time + # this form is visited from a wizard, if the have value the user must + # step back + if {[string equal $page_name ""]} { + # get the current item + array set one_item [bcms::item::get_item -item_id $page_id] + set page_name $one_item(name) + + # set the form vars + ad_set_form_values page_name + } + +} -validate { + {page_name + {([array size existing_page] == 0) || ([info exists page_id] && ($existing_page(item_id) == $page_id))} + "Page URL already exists,
please use another Page URL" + } +} -on_submit { + + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + # save the page_name and move the wizard forward + template::wizard set_param page_name $page_name + template::wizard forward + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-one.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-one.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-one.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,99 @@ + + +@context_bar@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@one_page.title@
Page URL@one_page.name@Change Page URL
Parent Section@one_folder.label@Change Section
Page Revision + +

+ Title: @page_revisions.title@
+ Author: @page_revisions.first_names@ @page_revisions.last_name@
+ Date: @page_revisions.creation_date@
+ Status: + + published + + + not published + +
+ Description: @page_revisions.description@ +

+ +
+
+
+
Change Page Revision
Related Images + +

+ Title: @related_images.title@
+ Description: @related_images.description@
+

+ +
+
+
+
Change Related Images
Related Files + +

+ Title: @related_files.title@
+ Description: @related_files.description@
+

+ +
+
+
+
Change Related Files
Related Pages + +

+ Title: @related_pages.title@
+ Description: @related_pages.description@
+

+ +
+
+
+
Change Related Pages
Page Template + + Currently using the section template + + + @one_template_properties.title@ + + Change Page Template
+ +
+ +
+ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-one.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-one.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { + display the available actions for page + +} { + page_id:notnull,naturalnum + return_url:notnull +} + +# get the information about this page +array set one_page [bcms::item::get_item -item_id $page_id -revision latest] +array set one_folder [bcms::folder::get_folder -folder_id $one_page(parent_id)] +bcms::revision::revision_list -item_id $page_id -content_type bcms_page -multirow_name page_revisions + +# get the related items of this page +bcms::item::list_related_items -item_id $page_id -relation_tag images -revision latest -multirow_name related_images +bcms::item::list_related_items -item_id $page_id -relation_tag files -revision latest -multirow_name related_files +bcms::item::list_related_items -item_id $page_id -relation_tag pages -revision latest -multirow_name related_pages + +# get the template +array set one_template [bcds::get_template -item_id $page_id -context public] +if {[array size one_template] == 0} { + set one_template(item_id) 0 +} else { + array set one_template_properties [bcms::item::get_item -item_id $one_template(item_id) -revision latest] +} + +set current_url [ad_return_url -urlencode] + +set context_bar [ad_context_bar $one_page(title)] + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-feature.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-feature.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-feature.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,15 @@ + + Featured in Home Page + + + Yes + + Remove page from featured list + + + + No + + Add page to featured list + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-feature.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-feature.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-feature.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + add or remove an item to praesagus home page feature +} { + page_id:notnull,naturalnum + {operation:optional show_status} + return_url:notnull +} + +switch -exact $operation { + add { + db_dml add_page "insert into praesagus_featured_items (page_id) values (:page_id)" + ad_returnredirect $return_url + } + remove { + db_dml remove_page "delete from praesagus_featured_items where page_id = :page_id" + ad_returnredirect $return_url + } + default { + set page_featured_p [db_string check_page "select 1 from praesagus_featured_items where page_id = :page_id" -default 0] + } +} + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-protected.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-protected.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-protected.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,15 @@ + + Page Available to + + + Registered Users only + + Allow all to view page + + + + All Users + + Restrict page to registered users + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-protected.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-protected.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-praesagus-protected.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + add or remove an item to praesagus protected items +} { + page_id:notnull,naturalnum + {operation:optional show_status} + return_url:notnull +} + +switch -exact $operation { + add { + db_dml add_page "insert into praesagus_protected_items (page_id) values (:page_id)" + ad_returnredirect $return_url + } + remove { + db_dml remove_page "delete from praesagus_protected_items where page_id = :page_id" + ad_returnredirect $return_url + } + default { + set page_protected_p [db_string check_page "select 1 from praesagus_protected_items where page_id = :page_id" -default 0] + } +} + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-relate-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-relate-finish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-relate-finish.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + relate a page to a page +} { + relate_to:notnull,naturalnum + page_id:notnull,naturalnum + return_url:notnull +} + +bcms::item::relate_item -relation_type pages -item_id $relate_to -related_object_id $page_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-relate-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-relate-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-relate-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,22 @@ +ad_page_contract { + wizard for relating pages + +} { + relate_to:notnull,naturalnum +} + +template::wizard create -action "file-relate-wizard?relate_to=$relate_to" -params { + relate_to folder_id page_id return_url +} -steps { + 1 -label "Select Section" -url "folder-list" + 2 -label "Select Page" -url "page-list" + 3 -label "Relate Page" -url "page-relate-finish" +} + +template::wizard get_current_step + +set wizard_title "Relate Pages" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-file-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-file-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-file-list.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,28 @@ + + +@context_bar@ + +

Upload a new File

+

Select an existing File

+ + + + + + + + + + + + + + + + + +
File URLTitleDescriptionFileAction
@bcms_list_related_items.name@@bcms_list_related_items.title@@bcms_list_related_items.description@downloadunrelate
+ +
+ +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-image-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-image-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-image-list.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,28 @@ + + +@context_bar@ + +

Upload a new Image

+

Select an existing Image

+ + + + + + + + + + + + + + + + + +
Image URLTitleDescriptionImageAction
@bcms_list_related_items.name@@bcms_list_related_items.title@@bcms_list_related_items.description@unrelate
+ +
+ +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,34 @@ +ad_page_contract { + list the related to this content item with the relation_tag + right now the relation_tag can be images, files +} { + page_id:naturalnum,notnull + relation_tag:notnull + return_url:notnull +} + +bcms::item::list_related_items -item_id $page_id -relation_tag $relation_tag -revision latest + +set current_url [ad_return_url -urlencode] + +switch -exact $relation_tag { + images { + set context_bar [ad_context_bar "Related Images"] + set folder_id [bcms::folder::get_image_folder] + ad_return_template page-related-image-list + } + files { + set context_bar [ad_context_bar "Related Files"] + set folder_id [bcms::folder::get_file_folder] + ad_return_template page-related-file-list + } + pages { + set context_bar [ad_context_bar "Related Pages"] + ad_return_template page-related-page-list + } + default { + ad_return_complaint 1 "invalid relationship to page" + } +} + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-page-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-page-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-related-page-list.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,26 @@ + + +@context_bar@ + +

Select an existing Page

+ + + + + + + + + + + + + + + + +
TitleDescriptionPageAction
@bcms_list_related_items.title@@bcms_list_related_items.description@viewunrelate
+ +
+ +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-list.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,34 @@ +

">New Page Revision

+ + + + + + + + + + + + + + + + + +
TitleDescriptionAuthorDateAction
@bcms_revision_list.title@@bcms_revision_list.description@@bcms_revision_list.first_names@ @bcms_revision_list.last_name@@bcms_revision_list.creation_date@ + ">edit
+ + delete
+
+ + publish + + + unpublish + +
+ +
+ +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,12 @@ +ad_page_contract { + list the revision of a page +} { + page_id:naturalnum,notnull + return_url:optional +} + +bcms::revision::revision_list -item_id $page_id -content_type bcms_page + +set current_url [ad_return_url -urlencode] +set current_url_noencode [ad_return_url] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-wizard.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-wizard.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision-wizard.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,21 @@ +ad_page_contract { + wizard for editing a page revisions + +} { + page_id:notnull,naturalnum +} + +template::wizard create -action "page-revision-wizard?page_id=$page_id" -params { + page_id revision_id return_url +} -steps { + 1 -label "Pick Revision" -url "page-revision-list" + 2 -label "Edit Page" -url "page-revision" +} + +template::wizard get_current_step + +set wizard_title "Page Revision" +set context_bar [ad_context_bar $wizard_title] + +ad_return_template wizard-master + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/page-revision.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,79 @@ +ad_page_contract { + a form for adding content + +} { + {page_id:optional,naturalnum ""} + {revision_id:optional,naturalnum ""} + {page_name:optional ""} + {folder_id:optional,naturalnum ""} + return_url:notnull +} + +# if the revision_id is blank then unset it, its not a valid revision. Its likely that its requesting +# a new revision +if [string equal $revision_id ""] { unset revision_id } + +ad_form -name wizard_form -form { + + revision_id:key + + {title:text(text) {label "Title"}} + {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} + {content:text(textarea),optional {html {rows 20 cols 80}} {label "Text Content"}} + +} -edit_request { + + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set title $one_revision(title) + set content $one_revision(content) + set description $one_revision(description) + + ad_set_form_values title content description + +} -edit_data { + + bcms::revision::set_revision -revision_id $revision_id \ + -title $title -content $content -description $description + + ad_returnredirect $return_url + + +} -new_data { + set creation_user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + if {![string equal $page_id ""]} { + # just create the revision the page is existing + set revision_id [bcms::revision::add_revision -item_id $page_id \ + -title $title -content $content -description $description \ + -mime_type "text/html" \ + -creation_user_id $creation_user_id -creation_ip $creation_ip] + } elseif {![string equal $folder_id ""] && ![string equal $page_name ""]} { + # create the page and revision + db_transaction { + set page_id [bcms::item::create_item -item_name $page_name -parent_id $folder_id -content_type bcms_page \ + -storage_type text -creation_user_id $creation_user_id -creation_ip $creation_ip] + + set revision_id [bcms::revision::add_revision -item_id $page_id \ + -title $title -content $content -description $description \ + -mime_type "text/html" \ + -creation_user_id $creation_user_id -creation_ip $creation_ip] + } + + # when the page is created redirect to that page + ad_returnredirect "page-one?page_id=$page_id&return_url=$return_url" + } else { + ns_log notice "bcms: revision not created" + } + + ad_returnredirect $return_url + + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back finish } + +# return the common template +ad_return_template wizard-form-step + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/revision-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/revision-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/revision-delete.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + delete a revision +} { + revision_id:notnull,naturalnum + return_url:notnull +} + +bcms::revision::delete_revision -revision_id $revision_id + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/revision-set-status.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/revision-set-status.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/revision-set-status.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + set the status of a revision +} { + revision_id:notnull,naturalnum + status:notnull + return_url:notnull +} + +bcms::revision::set_revision_status -revision_id $revision_id -status $status + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/template-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/template-list.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/template-list.tcl 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,48 @@ +ad_page_contract { + list the templates of this bcms instance +} { + {template_id:optional,naturalnum ""} + return_url:optional + page_id:optional +} + +set template_folder_id [parameter::get -parameter template_folder_id] +set template_option_list [bcms::widget::option_list -list_of_ns_sets \ + [bcms::item::list_items -parent_id $template_folder_id \ + -content_type content_template -return_list -revision latest] \ + -value_column item_id -display_columns title] + +# if its a page offer to use the section template +# if its a folder offer to use the default template +if [info exists page_id] { + set template_option_list [linsert $template_option_list 0 {"Use current section template" 0}] +} else { + set template_option_list [linsert $template_option_list 0 {"Default Template" 0}] +} + +# create the form +ad_form -name wizard_form -form { + + {template_id:integer(select) {label "Template List"} {options $template_option_list} {value $template_id}} + +} -on_submit { + # save the return_url + if { [info exists return_url] } { + template::wizard set_param return_url $return_url + } + + # set the template_id + template::wizard set_param template_id $template_id + # move forward the wizard + template::wizard forward + +} + +# set the button for the form +template::wizard submit wizard_form -buttons { back next } + +# return the common template +ad_return_template wizard-form-step + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-form-step.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-form-step.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-form-step.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,3 @@ + + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-master.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-master.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,35 @@ + + +@context_bar@ + + + + + + + +
+ + + + +
@wizard_title@
+
+ + + + + + + + + + + + + + +
Steps:
@wizard.label@ @wizard.label@
+
+ + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-template.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/wizard-template.adp 14 May 2003 15:36:37 -0000 1.1 @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +    +
+
+
+ + + + + +
+ \@formerror.@elements.id@\@
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
@elements.section@
@elements.label@
+ + +
@elements.label@   + +
   +
+
+ + + + + + + + + + + + + + + +
 \@formgroup.widget@\@formgroup.label@  
+
+ \@formerror.@elements.id@\@ +
+
+
+ + + +
\@formerror.@elements.id@\@ +
+

+ + + + + + + + +
+
+ + + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.adp 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,4 @@ + + +Set the root folder
+Set the template folder Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/Attic/index.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.adp~ 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,2 @@ +Set the root folder id
+Set the template folder id Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/Attic/index.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/index.tcl~ 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,6 @@ +ad_page_contract { + this page is set the root_folder_id and template_folder_id of this package instance +} { +} + +bcms::folder::tree_folders -multirow_name folders Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_parameter.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_parameter.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_parameter.tcl 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + sets the package parameter based from the name and value +} { + parameter_name:notnull + value:notnull + return_url:notnull +} + +parameter::set_value -parameter $parameter_name -value $value + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_parameter.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/Attic/set_parameter.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_parameter.tcl~ 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + sets the package parameter based from the name and value +} { + parameter_name:notnull + value:notnull +} + +package::set_value -parameter $parameter_name -value $value Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.adp 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + + + +
+ + / @folders.label@ + + + + make this folder your root folder for this BCMS UI package + + + current root folder + +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/Attic/set_root_folder.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.adp~ 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + + + +
+ + / @folders.label@ + + + + make this folder your root folder for this BCMS UI package + + + current root folder id + +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_root_folder.tcl 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,12 @@ +ad_page_contract { + this page is set the root_folder_id and template_folder_id of this package instance + TODO revisit this page to make sure its able to handle multi level folders +} { +} + +bcms::folder::tree_folders -parent_id [bcms::folder::get_cr_root_folder] -multirow_name folders + +set current_root_folder_id [parameter::get -parameter root_folder_id] + +set current_url [ad_return_url -urlencode] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.adp 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + + + +
+ + / @folders.label@ + + + + make this folder your template folder for this BCMS UI package + + + current template folder + +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.adp~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/Attic/set_template_folder.adp~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.adp~ 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,21 @@ + + + + + + + + + +
+ + / @folders.label@ + + + + make this folder your root folder for this BCMS UI package + + + current root folder id + +
Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.tcl 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,12 @@ +ad_page_contract { + this page is set the root_folder_id and template_folder_id of this package instance + TODO revisit this page to make sure its able to handle multi level folders +} { +} + +bcms::folder::tree_folders -parent_id [bcms::template::get_cr_root_template_folder] -multirow_name folders + +set current_template_folder_id [parameter::get -parameter template_folder_id] + +set current_url [ad_return_url -urlencode] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.tcl~ =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/admin/Attic/set_template_folder.tcl~,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/admin/set_template_folder.tcl~ 14 May 2003 15:37:05 -0000 1.1 @@ -0,0 +1,12 @@ +ad_page_contract { + this page is set the root_folder_id and template_folder_id of this package instance + TODO revisit this page to make sure its able to handle multi level folders +} { +} + +bcms::folder::tree_folders -parent_id [bcms::folder::get_cr_root_folder] -multirow_name folders + +set current_root_folder_id [parameter::get -parameter root_folder_id] + +set current_url [ad_return_url -urlencode] + Index: openacs-4/contrib/packages/bcms-ui-wizard/www/display_revision/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/display_revision/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-wizard/www/display_revision/index.vuh 14 May 2003 15:37:37 -0000 1.1 @@ -0,0 +1,13 @@ +ad_page_contract { + +} { + item_id:optional,naturalnum + revision_id:optional,naturalnum +} + +if [info exists item_id] { + array set one_item [bcms::item::get_item_best -item_id $item_id] + set revision_id $one_item(revision_id) +} + +cr_write_content -revision_id $revision_id Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/files.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/files.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/files_icon.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/files_icon.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/images.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/images.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/images_icon.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/images_icon.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/pages.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/pages.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/pages_icon.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/pages_icon.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/sections.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/sections.gif,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-wizard/www/images/sections_icon.gif =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-wizard/www/images/sections_icon.gif,v diff -u Binary files differ