Index: openacs-4/packages/acs-core-docs/www/tutorial-advanced.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-advanced.html,v diff -u -r1.19.2.3 -r1.19.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-advanced.html 1 Nov 2004 23:40:15 -0000 1.19.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-advanced.html 27 Dec 2004 20:38:03 -0000 1.19.2.4 @@ -1,4 +1,4 @@ -Chapter�10.�Advanced Topics

Chapter�10.�Advanced Topics

Table of Contents

Write the Requirements and Design Specs
Add the new package to CVS
Adding Comments
Admin Pages
Categories
Profile your code
Prepare the package for distribution.
Notifications
Hierarchical data
Using .vuh files for pretty urls
Laying out a page with CSS instead of tables
Sending HTML email from your application
Basic Caching
Scheduled Procedures
Future Topics

by Joel Aufrecht

+Chapter�10.�Advanced Topics

Chapter�10.�Advanced Topics

by Joel Aufrecht

OpenACS docs are written by the named authors, and may be edited by OpenACS documentation staff.

This tutorial covers topics which are not essential to Index: openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html 1 Nov 2004 23:40:17 -0000 1.2.2.3 +++ openacs-4/packages/acs-core-docs/www/tutorial-future-topics.html 27 Dec 2004 20:38:03 -0000 1.2.2.4 @@ -1,6 +1,6 @@ -Future Topics

Future Topics

  • How to enforce security so that users can't +Future Topics

    Future Topics

    • How to enforce security so that users can't change other users records

    • How to use the content management tables so that ... what?

    • How to change the default stylesheets for Form Builder HTML forms.

    • How to make your package searchable with OpenFTS/Oracle

    • How to prepare pagelets for inclusion in other pages

    • How and when to put procedures in a tcl procedure library

    • More on ad_form - data validation, other stuff. (plan to draw from Jon Griffin's doc)

    • partialquery in xql

    • How to use the html/text entry widget to get the - "does this look right" confirm page

    • APM package dependencies

    See also the OpenACS Programming FAQ

    View comments on this page at openacs.org
    + "does this look right" confirm page

  • APM package dependencies

See also the OpenACS Programming FAQ

View comments on this page at openacs.org
Index: openacs-4/packages/acs-core-docs/www/tutorial-schedule-procs.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-schedule-procs.html,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/acs-core-docs/www/tutorial-schedule-procs.html 1 Nov 2004 23:40:17 -0000 1.1.2.2 +++ openacs-4/packages/acs-core-docs/www/tutorial-schedule-procs.html 27 Dec 2004 20:38:03 -0000 1.1.2.3 @@ -1,6 +1,6 @@ -Scheduled Procedures

Scheduled Procedures

Put this proc in a file /packages/myfirstpackage/tcl/scheduled-init.tcl. Files in /tcl with the -init.tcl ending are sourced on server startup. This one executes my_proc every 60 seconds:

ad_schedule_proc 60 myfirstpackage::my_proc
+Scheduled Procedures

Scheduled Procedures

Put this proc in a file /packages/myfirstpackage/tcl/scheduled-init.tcl. Files in /tcl with the -init.tcl ending are sourced on server startup. This one executes my_proc every 60 seconds:

ad_schedule_proc 60 myfirstpackage::my_proc
 

This executes once a day, at midnight:

ad_schedule_proc \
     -schedule_proc ns_schedule_daily \
     [list 0 0] \
     myfirstpackage::my_proc
-

See ad_schedule_proc for more information.

View comments on this page at openacs.org
+

See ad_schedule_proc for more information.

View comments on this page at openacs.org
Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-core-docs/www/tutorial-second-database.html'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml,v diff -u -r1.19.2.3 -r1.19.2.4 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 5 Jul 2004 19:47:36 -0000 1.19.2.3 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 27 Dec 2004 20:29:16 -0000 1.19.2.4 @@ -1025,9 +1025,89 @@ See ad_schedule_proc for more information. + + Connect to a second database + It is possible to use the OpenACS TCL database API with + other databases. In this example, the OpenACS site uses a + PostGre database, and accesses another PostGre database called + legacy. + + + Modify config.tcl to accomodate the legacy database, and to + ensure that the legacy database is not used for standard + OpenACS queries: + ns_section ns/db/pools +ns_param pool1 "Pool 1" +ns_param pool2 "Pool 2" +ns_param pool3 "Pool 3" +ns_param legacy "Legacy" +ns_section ns/db/pool/pool1 +#Unchanged from default +ns_param maxidle 1000000000 +ns_param maxopen 1000000000 +ns_param connections 5 +ns_param verbose $debug +ns_param extendedtableinfo true +ns_param logsqlerrors $debug +if { $database == "oracle" } { + ns_param driver ora8 + ns_param datasource {} + ns_param user $db_name + ns_param password $db_password +} else { + ns_param driver postgres + ns_param datasource ${db_host}:${db_port}:${db_name} + ns_param user $db_user + ns_param password "" +} +ns_section ns/db/pool/pool2 +#Unchanged from default, removed for clarity +ns_section ns/db/pool/pool3 +#Unchanged from default, removed for clarity + +ns_section ns/db/pool/legacy +ns_param maxidle 1000000000 +ns_param maxopen 1000000000 +ns_param connections 5 +ns_param verbose $debug +ns_param extendedtableinfo true +ns_param logsqlerrors $debug +ns_param driver postgres +ns_param datasource ${db_host}:${db_port}:legacy_db +ns_param user legacy_user +ns_param password legacy_password + + +ns_section ns/server/${server}/db +ns_param pools * +ns_param defaultpool pool1 + +ns_section ns/server/${server}/acs/database +ns_param database_names [list main legacy] +ns_param pools_main [list pool1 pool2 pool3] +ns_param pools_legacy [list legacy] + + + To use the legacy database, use the + -dbn flag for any of the + db_ API calls. For + example, suppose there is a table called "foo" in the legacy + system, with a field "bar". List "bar" for all records with + this tcl file: + db_foreach -dbn legacy get_bar_query { + select bar from foo + limit 10 +} { + ns_write "
$bar" +}
+ +
+
+
+ Future Topics