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 @@
+
+
+
+ postgresql 7.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 @@
+
+
+
+ postgresql 7.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 @@
+
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@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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.
+
+
+
+
+
+
+
+
+
+
+
+ @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 @@
+
+
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 @@
+
+
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 @@
+
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@
+
+
+
+
+
+
+
+
+
+