Forum OpenACS Development: different dbn pool for template::list pagination

Currently pagination does not support the data residing on any pool but the default one.

I wrote some code for that so you can get the ids for the pagination from a different database pool. If anyone finds this useful, ping me and I will provide the patch.

Collapse
Posted by Dave Bauer on
This makes sense. I think it would just accept a -dbn parameter?
Collapse
Posted by Malte Sussdorff on
I actually added a "page_dbn" switch to template::list::create as it is in line with the other switch namings and should not lead to a confusion about the actual data set which is being retrieved by the db_multirow, which can have a different database to call from.
Collapse
Posted by Malte Sussdorff on
Here is the CVS DIff. Please scrutinize and apply to OpenACS.

malte@toronto:/web/malte/packages/acs-templating/tcl$ sudo cvs diff
cvs diff: Diffing .
Index: list-procs.tcl
===================================================================
RCS file: /web/cvsrep/dotalf/packages/acs-templating/tcl/list-procs.tcl,v
retrieving revision 1.1.1.5
diff -r1.1.1.5 list-procs.tcl
48a49

{-page_dbn ""}
320a322
page_dbn
584a587
-page_dbn $list_properties(page_dbn) \
Index: paginator-procs.tcl
===================================================================
RCS file: /web/cvsrep/dotalf/packages/acs-templating/tcl/paginator-procs.tcl,v
retrieving revision 1.1.1.2
diff -r1.1.1.2 paginator-procs.tcl
92c92
< upvar #$level pq:$name:properties opts
---
upvar #$level pq:$name:properties opts
100a101
126c127
< init $statement_name $name $query 1
---
init $statement_name $name $query 1 $opts(page_dbn)
150c151
< init $statement_name $name $query
---
init $statement_name $name $query 0 $opts(page_dbn)
162c163
< ad_proc -private template::paginator::init { statement_name name query {print_p 0} } {
---
ad_proc -private template::paginator::init { statement_name name query {print_p 0} {page_dbn ""} } {
172a174,177
if {$page_dbn eq ""} {
set page_dbn [nsv_get {db_default_database} .]
}

181c186,187
< db_with_handle db {
---
db_with_handle -dbn $page_dbn db {
cvs diff: Diffing test