Index: openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql 27 Apr 2001 02:27:09 -0000 1.1
+++ openacs-4/packages/acs-content-repository/tcl/filter-procs-oracle.xql 13 Sep 2001 04:59:26 -0000 1.2
@@ -57,4 +57,30 @@
+
+
+
+ select
+ item_id, content_type
+ from
+ cr_items
+ where
+ item_id = content_item.get_id(:url, :content_root)
+
+
+
+
+
+
+
+ select
+ content_template.get_path(
+ content_item.get_template(:item_id, :context),:template_root) as template_url
+ from
+ dual
+
+
+
+
+
Index: openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql 14 Jun 2001 00:23:21 -0000 1.2
+++ openacs-4/packages/acs-content-repository/tcl/filter-procs-postgresql.xql 13 Sep 2001 04:59:26 -0000 1.3
@@ -58,4 +58,29 @@
+
+
+
+ select
+ item_id, content_type
+ from
+ cr_items
+ where
+ item_id = content_item__get_id(:url, :content_root, 'f')
+
+
+
+
+
+
+
+ select
+ content_template__get_path(
+ content_item__get_template(:item_id, :context),:template_root) as template_url
+ from
+ dual
+
+
+
+
Index: openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 9 May 2001 05:15:58 -0000 1.3
+++ openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 13 Sep 2001 04:59:26 -0000 1.4
@@ -269,6 +269,90 @@
return 1
}
+
+ad_proc -public init_all { urlvar rootvar {content_root ""} {template_root ""} {rev_id ""} {context "public"}} {
+
+ upvar $urlvar url $rootvar root_path
+
+ variable item_id
+ variable revision_id
+
+ # if a .tcl file exists at this url, then don't do any queries
+ if { [file exists [ns_url2file "$url.tcl"]] } {
+ return 0
+ }
+
+ # Get the content ID, content type
+ set query "
+ select
+ item_id, content_type
+ from
+ cr_items
+ where
+ item_id = content_item.get_id(:url, :content_root)"
+
+ # cache this query persistently for 1 hour
+ template::query get_item_info item_info onerow $query \
+ -cache "get_id_filter $url $content_root" \
+ -persistent -timeout 216000
+
+ # No item found, so do not handle this request
+ if { ![info exists item_info] } {
+ ns_log Notice "No content found for url $url"
+ return 0
+ }
+
+ variable item_url
+ set item_url $url
+
+ set item_id $item_info(item_id)
+ set content_type $item_info(content_type)
+
+ # Make sure that a live revision exists
+ if [empty_string_p $rev_id] {
+ template::query get_live_revision live_revision onevalue "
+ select live_revision from cr_items where item_id = :item_id
+ " -cache "item_live_revision $item_id"
+
+ if { [template::util::is_nil live_revision] } {
+ ns_log Notice "No live revision found for content item $item_id"
+ return 0
+ }
+ set revision_id $live_revision
+ } else {
+ set revision_id $rev_id
+ }
+
+ variable template_path
+
+ # Get the template
+ set OFFquery "select
+ content_template.get_path(
+ content_item.get_template(:item_id, 'public'),
+ :template_root) as template_url
+ from dual"
+
+ set query "select
+ content_template.get_path(
+ content_item.get_template(:item_id, :context),
+ :template_root) as template_url
+ from
+ dual"
+
+
+ template::query get_template_url template_url onevalue $query
+
+ if { [string equal $template_url {}] } {
+ ns_log Notice "No template found to render content item $item_id in context '$context'"
+ return 0
+ }
+
+ set url $template_url
+ set root_path [get_template_root]
+
+ return 1
+}
+
# render the template and write it to the file system
ad_proc -public deploy { url_stub } {
Index: openacs-4/packages/acs-content-repository/tcl/filter-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-content-repository/tcl/filter-procs.xql 27 Apr 2001 02:27:09 -0000 1.1
+++ openacs-4/packages/acs-content-repository/tcl/filter-procs.xql 13 Sep 2001 04:59:26 -0000 1.2
@@ -61,4 +61,12 @@
+
+
+
+ select live_revision from cr_items where item_id = :item_id
+
+
+
+
Index: openacs-4/packages/acs-content-repository/tcl/search-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/search-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-content-repository/tcl/search-procs.tcl 10 Sep 2001 12:43:23 -0000 1.3
+++ openacs-4/packages/acs-content-repository/tcl/search-procs.tcl 13 Sep 2001 04:59:26 -0000 1.4
@@ -53,7 +53,7 @@
where n.object_id = :package_id
"
- return "[string trimright $root_url /]$url"
+ return "[string trimright $root_url /]$url?revision_id=$object_id"
}
ad_proc content_search__search_ids {
Index: openacs-4/packages/acs-content-repository/www/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/index.vuh,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-content-repository/www/index.vuh 10 Sep 2001 12:43:23 -0000 1.1
+++ openacs-4/packages/acs-content-repository/www/index.vuh 13 Sep 2001 04:59:26 -0000 1.2
@@ -1,10 +1,17 @@
################## KLUDGE BY STAS ###############
# Try and look up the item in the content repository
#################################################
+ad_page_contract {
+
+ @author Unknown
+ @creation-date Unknown
+ @cvs-id $Id$
+} {
+ { revision_id "" }
+}
# Get the paths
-
set the_url [ad_conn path_info]
set package_key [ad_conn package_key]
set the_root [ns_info pageroot]
@@ -18,7 +25,7 @@
# Serve the page
ns_log notice "RESOLVING URL: $the_root $the_url"
-if { [content::init the_url the_root $content_root $template_root] } {
+if { [content::init_all the_url the_root $content_root $template_root $revision_id] } {
set file "$the_root/$the_url"
ns_log notice "RESOLVED URL: $file"
rp_serve_abstract_file $file
Index: openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 1 Sep 2001 20:22:57 -0000 1.1
+++ openacs-4/packages/acs-service-contract/tcl/acs-service-contract-procs.tcl 13 Sep 2001 04:59:26 -0000 1.2
@@ -68,6 +68,7 @@
set proc_name [acs_sc_generate_name $contract $impl $operation]
+ ns_log Notice "ACS_SC_PROC: proc_name = $proc_name"
foreach {impl_alias impl_pl} [acs_sc_get_alias $contract $operation $impl] break
if ![info exists impl_alias] {
Index: openacs-4/packages/search/sql/postgresql/search-tables-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/search/sql/postgresql/search-tables-create.sql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/search/sql/postgresql/search-tables-create.sql 7 Sep 2001 03:01:57 -0000 1.2
+++ openacs-4/packages/search/sql/postgresql/search-tables-create.sql 13 Sep 2001 04:59:26 -0000 1.3
@@ -5,6 +5,7 @@
date timestamp default now(),
event varchar(6)
constraint search_observer_queue_event_ck
- check (event in ('INSERT','DELETE','UPDATE')),
- constraint search_observer_queue_oid_date_un unique(object_id,date)
+ check (event in ('INSERT','DELETE','UPDATE'))
+
+ -- constraint search_observer_queue_oid_date_un unique(object_id,date)
);
Index: openacs-4/packages/search/tcl/search-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/search/tcl/search-init.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/search/tcl/search-init.tcl 2 Sep 2001 18:11:39 -0000 1.1
+++ openacs-4/packages/search/tcl/search-init.tcl 13 Sep 2001 04:59:26 -0000 1.2
@@ -1,2 +1,3 @@
+
ad_schedule_proc [ad_parameter -package_id [apm_package_id_from_key search] SearchIndexerInterval] search_indexer