Index: openacs-4/packages/acs-templating/www/doc/demo/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/index.html,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/www/doc/demo/index.html 4 Feb 2006 19:09:15 -0000 1.4 +++ openacs-4/packages/acs-templating/www/doc/demo/index.html 4 Feb 2006 23:07:19 -0000 1.5 @@ -336,7 +336,11 @@ Add some columns - View + + View .tcl
+ postgres query
+ oracle query + View View View Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index-oracle.xql 4 Feb 2006 23:07:19 -0000 1.1 @@ -0,0 +1,42 @@ + + + oracle8.1.6 + + + + select + n.template_demo_note_id, + n.title, + to_char(o.creation_date, 'HH12:MI Month DD, YYYY') as creation_date, + p.first_names || ' ' || p.last_name as creation_user_name, + decode(acs_permission.permission_p(template_demo_note_id, + :user_id, + 'write'), + 't', 1, + 'f', 0) as write_p, + decode(acs_permission.permission_p(template_demo_note_id, + :user_id, + 'admin'), + 't', 1, + 'f', 0) as admin_p, + decode(acs_permission.permission_p(template_demo_note_id, + :user_id, + 'delete'), + 't', 1, + 'f', 0) as delete_p + from + template_demo_notes n, + acs_objects o, + persons p + where n.template_demo_note_id = o.object_id + and n.template_demo_note_id = p.person_id + and exists (select 1 + from acs_object_party_privilege_map + where object_id = template_demo_note_id + and party_id = :user_id + and privilege = 'read') + order by creation_date + + + + Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index-postgresql.xql 4 Feb 2006 23:07:19 -0000 1.1 @@ -0,0 +1,28 @@ + + + postgresql7.1 + + + + + select + n.template_demo_note_id, + n.title, + to_char(o.creation_date, 'HH12:MI Month DD, YYYY') as creation_date, + p.first_names || ' ' || p.last_name as creation_user_name + from + template_demo_notes n, + acs_objects o, + persons p + where n.template_demo_note_id = o.object_id + and o.creation_user = p.person_id + and exists (select 1 + from acs_object_party_privilege_map + where object_id = template_demo_note_id + and party_id = :user_id + and privilege = 'read') + + + + + Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index.adp 4 Feb 2006 23:07:19 -0000 1.1 @@ -0,0 +1,3 @@ + + + Index: openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/www/doc/demo/list2/index.tcl 4 Feb 2006 23:07:19 -0000 1.1 @@ -0,0 +1,38 @@ +# main index page for notes. + +ad_page_contract { + + @author rhs@mit.edu + @creation-date 2000-10-23 + @cvs-id $Id: index.tcl,v 1.1 2006/02/04 23:07:19 jiml Exp $ +} -properties { + notes:multirow +} + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] + +db_multirow template_demo_notes template_demo_notes {} + +# don't worry too much if you don't understand the query's details; +# the point here is several columns can be displayed. +# +# Look at the query; notice how you can have a complex expression +# come in as any name (like for creation_user_name and creation_date) +# using " as " + +template::list::create -name notes \ + -multirow template_demo_notes \ + -elements { + title { + label "Title of Note" + } + creation_user_name { + label "Owner of Note" + } + creation_date { + label "When Note Created" + } + } + +ad_return_template