Forum OpenACS Development: Response to What does using acs-templating give me?

Collapse
Posted by Dan Wickstrom on
The templating db api as released from aD was a non-starter for openacs, since it did not support named queries, and it had its own transaction control and handle allocation mechanisms.  Not having named queries was a big problem, because this did not give us any hooks for tying into the query dispatcher.

For openacs, we rewired the template::query api to use the standard db api for its internal implementation, and the template::query api was changed to include a statement name so that it could be hooked into the QD.

When porting template queries, you need to first modify all of the template::query calls and add a statement name(look at the content-repository code for examples).  You also need to delete any references to passed in db handles and eliminate the code for allocating handles, as it is not needed any more.  template:queries that make use of the templating transaction mechanism, need to be converted to use the standard db api transaction method (e.g. db_transaction { ...}).

Don had mentioned adding support to the query extractor for supporting the templating db interface, but I'm not sure if that work is done yet.