Forum OpenACS Q&A: 4.5 newbie questions

Collapse
Posted by Jonathan Ellis on
A couple stupid questions...
  • www/index.tcl has two db_ queries, one of which is also in the corresponding .xql file. Oversight?
  • I can't find any documentation on what kind of custom tags OACS provides for ADP pages. I looked in the various packages, starting with templating, but couldn't find any such list. (Though I _did_ find a SCARY number of undocumented public procs. :)
Collapse
Posted by Stan Kaufman on
An excellent question, and as another recent arrival from 3.2.5 land, one that was bugging me as well. Particularly since I found comments by Don here and there about how all queries should be removed from .tcl files.

Further info is in this thread: https://openacs.org/bboard/q-and-a-fetch-msg.tcl?msg_id=0005OL&topic_id=12&topic=OpenACS%204%2e0%20Design and in Don's Porting WP.

As best I can understand, the Query Dispatcher will look, in order, at the db-specific.xql files, the file.xql files and then the file.tcl files for the query spec. So you can comment out or delete the query itself from within the db_foo call (but not the db_foo call itself) in the .tcl file and all works fine.

I finally realized also that the .xql files are generated by the Query Extractor and aren't hand-written (though they need to be scrutinized and possibly edited). All this is in the Porting Resources section, not the first place I would have thought to look for it.

Collapse
Posted by Jonathan Ellis on
I get it.... the sql is left in the .tcl b/c in a holdover from the ad acs, the db_ api doesn't allow you to leave out the $sql argument.  Duh. :/

Anyone know anything about the custom tags?

Collapse
Posted by Dave Bauer on
Jonathan,

You can pass and empty string "" or {} as the sql argument. Makes it clear the query is in an XQL file.

Custom tags? I am not sure what you mean.

Try this: http://dev.openacs.org/doc/acs-templating/tagref/

This doc is also installed on your local copy of OpenACS 4.

Collapse
Posted by Jonathan Ellis on
thanks, that's exactly what I was looking for.