Forum OpenACS CMS: Figuring out CMS
in foo.adp:
@content.title@<br>
<content>
in foo.tcl:
content::get_content
Also you can find different examples in directories:
packages/cms/demo/templates/ and packages/cms-news-demo/templates/
Here is my exact template:
<html>
@content.title@<br>
<content>
</html>
And here is the error I get:
Request Error
can't read "content(title)": no such variable
while executing
"append __adp_output "<html>
$content(title)<br>
""
("uplevel" body line 3)
invoked from within
"uplevel {
set __adp_output ""
append __adp_output "<html>
$content(title)<br>
"
append __adp_output [publish::get_html_body [publish::handle_it..."
(procedure "template::code::adp::/web/drrdemo/templates/research_topic" line 2)
invoked from within
"template::code::${template_extension}::$__adp_stub"
(procedure "template::adp_parse" line 57)
invoked from within
"template::adp_parse "/web/drrdemo/templates/research_topic" [list ]"
("eval" body line 1)
invoked from within
"eval "template::adp_parse \"$file_stub\" \[list $adp_args\]""
(procedure "publish::merge_with_template" line 38)
invoked from within
"publish::merge_with_template 8439 -revision_id 8467 -embed"
("eval" body line 1)
invoked from within
"eval $code"
(procedure "::publish::handle::text" line 15)
invoked from within
"::publish::handle::text 8439 -revision_id 8467 -embed"
("eval" body line 1)
invoked from within
"eval $code"
(procedure "handle_item" line 58)
invoked from within
"handle_item $item_id -revision_id $revision_id -embed"
(procedure "publish_revision" line 14)
invoked from within
"publish_revision $revision_id -root_path [publish::get_publish_roots]"
("live" arm line 9)
invoked from within
"switch $new_status {
production - expired {
# Delete the published files
publish::unpublish_item $item_id
}
ready {
# ..."
(procedure "publish::set_publish_status" line 4)
invoked from within
"publish::set_publish_status $item_id $publish_status"
("uplevel" body line 2)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 1)
invoked from within
"db_transaction {
publish::set_publish_status $item_id $publish_status
set start_when [template::util::date get_property sql_date $start_w..."
invoked from within
"if { [form is_valid publish_status] } {
form get_values publish_status publish_status start_when end_when item_id
db_transaction {
publish..."
("uplevel" body line 86)
invoked from within
"uplevel {
# Build an appropriate form to edit the publishing status for an item.
request create
request set_param item_id -datatype integer
req..."
(procedure "code::tcl::/web/drrdemo/packages/cms/www/modules/items/statu..." line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {
if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare "
(procedure "template::adp_parse" line 30)
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 7)
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 "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."
Looks that you don't have file research_topic.tcl in directory /web/drrdemo/templates/
You should create this file with content:
content::get_content
I'm have another error in trying to relate 2 different content items together via a relationship. I followed the following steps:
- went to the content type page for my custom content type (research_topic).
- on the relation types page, I registered a new item relationship type. I want to relate (research_topic) to (research_topic), with the relation tag (child_topic).
- i put one research_topic item on the clipboard
then I went into another topic item and the add related items page.
- on the following page (Type:Item Relationship, Topic: child_topic)hit next and then got the error below
I think that I'm probably missing a step but I can't figure out where.
Request Error
ora8.c:3908:ora_tcl_command: error in `OCIStmtExecute ()': ORA-00904: invalid column name
SQL:
select
!>>>!coalesce(max(order_n) + 1, 1)
from
cr_item_rels
where
item_id = :item_id
while executing
"ns_ora 0or1row nsdb0 {
select
coalesce(max(order_n) + 1, 1)
from
cr_item_rels
where
item_id = :item_id
}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_ora $type $db $sql] $args"
invoked from within
"db_exec 0or1row $db $full_name $sql"
invoked from within
"set selection [db_exec 0or1row $db $full_name $sql]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle db {
set selection [db_exec 0or1row $db $full_name $sql]
}"
(procedure "db_string" line 7)
invoked from within
"db_string get_order """
("for" body line 9)
invoked from within
"for { set i 1 } { $i <= ${rel_attrs:rowcount} } {incr i} {
upvar 0 "rel_attrs:$i" row
template::util::array_to_vars row
..."
("uplevel" body line 5)
invoked from within
"uplevel 1 $transaction_code "
(procedure "db_transaction" line 1)
invoked from within
"db_transaction {
unset row
for { set i 1 } { $i <= ${rel_attrs:rowcount} } {incr i} {
upvar 0 "rel_attrs:$i" row
te..."
invoked from within
"if { [form is_valid rel_form_2] || $form_complete } {
# sort order_n for all related items for consistency
form get_values rel_form_2 item_id
..."
("uplevel" body line 97)
invoked from within
"uplevel {
# Step 2 in the relate item wizard - presents a custom form
# for each relation
request create -params {
item_id -datatype int..."
(procedure "code::tcl::/web/drrdemo/packages/cms/www/modules/items/relat..." line 2)
invoked from within
"code::tcl::$__adp_stub"
invoked from within
"if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and is up-to-date
adp_init tcl $__adp_stub
..."
("uplevel" body line 3)
invoked from within
"uplevel {
if { [file exists $__adp_stub.tcl] } {
# ensure that data source preparation procedure exists and is up-to-date
adp_init t..."
(procedure "adp_prepare" line 2)
invoked from within
"adp_prepare "
(procedure "template::adp_parse" line 30)
invoked from within
"template::adp_parse [file root [ad_conn file]] {}"
(procedure "adp_parse_ad_conn_file" line 7)
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 "$root/$path""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"ad_try {
rp_serve_abstract_file "$root/$path"
set tcl_url2file([ad_conn url]) [ad_conn file]
set tcl_url2path_info([ad_conn url]) [ad_conn path_inf..."
I repeated your steps and in my case everything works OK but I tested it with PostgreSQL version of OACS. I don't have any Oracle installation so I can't test it with Oracle.
But it looks that you have problems (ORA-00904: invalid column name) with following sql code:select
coalesce(max(order_n) + 1, 1)
from
cr_item_rels
where
item_id = :item_id
My results from psql (PostgreSQL interactive terminal) session:
openacs-4-6-2=# select * from cr_item_rels;
rel_id | item_id | related_object_id | relation_tag | order_n
--------+-----------+---------------------+----------------+-----------
429 | 417 | 344 | child_topic | 0
453 | 417 | 432 | child_topic | 1
(2 rows)
openacs-4-6-2=# select coalesce(max(order_n)+1,1) from cr_item_rels where item_id = 417;
case
------
2
(1 row)
IMO You should type following sql code in sqlplus terminal:
select * from cr_item_rels
and
select coalesce(max(order_n)+1,1) from cr_item_rels where item_id = your_item_id
and look what you get.Unfortunately I can't help you more with this problem because I have only little experience with Oracle.
Just my 2 cents