Forum OpenACS Development: Problems with CR-TCL-API

In the following functions that I describe to you, they are created with the name of "delete" instead of "del"

ad_proc -public content::revision::del {
-revision_id:required
} {
@param revision_id
} {
return [package_exec_plsql -var_list [list \
[list revision_id $revision_id ] \
] content_revision del]
}

ad_proc -public content::template::del {
-template_id:required
} {
@param template_id
} {
return [package_exec_plsql -var_list [list \
[list template_id $template_id ] \
] content_template del]
}

In the following function the parameter that return, it is created like 'item_id' when is 'revision_id'

create or replace function content_item__set_live_revision (integer) returns integer as '
declare
set_live_revision__revision_id alias for $1;
set_live_revision__publish_status cr_items.publish_status%TYPE default ''ready'';
begin
update
cr_items
set
live_revision = set_live_revision__revision_id,
publish_status = set_live_revision__publish_status
where
item_id = (select
item_id
from
cr_revisions
where
revision_id = set_live_revision__revision_id);
update
cr_revisions
set
publish_date = now()
where
revision_id = set_live_revision__revision_id;
return 0;
end;' language 'plpgsql';
select define_function_args('content_item__set_live_revision','revision_id,publish_status;ready');

The following function content::get_content_value, I obtain the following error when I want to see a file that upload with evaluation

Here is a detailed dump of what took place at the time of the error, which may assist a programmer in tracking down the problem:

Selection did not return a value, and no default was provided
while executing
"db_string gcv_get_previous_content """
invoked from within
"set content [db_string gcv_get_previous_content ""]"
("uplevel" body line 9)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 39)
invoked from within
"db_transaction {
db_exec_plsql gcv_get_revision_id {
begin
content_revision.to_temporary_clob(:revision_id);
end;
}

# Qu..."
(procedure "content::get_content_value" line 3)
invoked from within
"content::get_content_value $info(template_id)"
(procedure "content::init" line 68)
invoked from within
"content::init the_url the_root $content_root $template_root public $revision_id $content_type"
(file "/var/lib/aolserver/openacs/packages/evaluation/www/view/index.vuh" line 1)
(procedure "rp_handle_tcl_request" line 1)
invoked from within
"$handler"
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
$handler
} ad_script_abort val {
# do nothing
}"
invoked from within
"rp_serve_concrete_file [ad_conn file]"
(procedure "rp_serve_abstract_file" line 60)
invoked from within
"rp_serve_abstract_file -noredirect -nodirectory -extension_pattern ".vuh" "$root$prefix""
("uplevel" body line 3)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
ad_conn -set path_info [string range $path [expr [string length $prefix] - 1] end]
rp_serve_abstract_file -noredirect -nodirectory -e..."

Good these are the errors that I have with the tests that I have made.

Collapse
Posted by Dave Bauer on
The procedure names were changed to ::delete to make the Tcl API more clear. There is no restriction to using the word "delete" in Tcl as there in in Oracle.
Collapse
Posted by Dave Bauer on
I am not sure what your question is with the procedure content_item__set_live_revision. It accepts a revision_id as a parameter, but always returns 0.

With the get_content_value procedure it appears that is not supported by postgresql. We will have to look into making that procedure smarter to correctly return the content if it is a file or text or a binary object.