Forum OpenACS Q&A: dynamic pages and subdirectories

Collapse
Posted by Fred Yankowski on

After installing OpenACS 4.5.0b1 I tried to make a copy of the original home page by creating a new ROOT/www/orig directory and copying all five of the index* files into there from ROOT/www/. But when I access http://mysite.com/orig from a browser I get an error page that shows that the system is trying to run the Oracle SQL for the site_node query. Since I'm running PostgreSQL, that fails.

I tried changing the fullquery name attribute in each of the *.xql files and restarting nsd, but that makes no difference. I could not find any documentation on exactly how fullquery names must be constructed, and I wasn't able to understand how db_qd_get_fullname works. I turned on QD logging and I see this message:

Debug: QD_LOGGER = NO FULLQUERY FOR dbqd.www.orig.index.site_nodes --
> using default SQL

But that name is exactly what I put in the www/orig/index-postgresql.xql file as the value of the name attribute. Is there something about having these files in a new subdirectory, orig/, that violates the conventions of the request processor and/or query dispatcher? I did the above without ever using the site map administration page -- or any admin page for that matter.

Collapse
Posted by Jun Yamog on
Hi Fred,

I think QD does not really support files in www/.... .  It not runs because of the tcl/zz-postload.tcl get the xql files.  I think not too sure it has been a long time since I have done this.

What you need to do is to edit the tcl/zz-postload.tcl file and include your ORIG directory in a list there.  Then name your query as "dbqd.www.orig.[file].[query name]".  I hope this helps most of this are from memory.  I do encourage you to not to put xql files under www try to use packages.

Collapse
Posted by Fred Yankowski on
I see how the zz-postload.tcl file arranges to load only those .xql files directly under ROOT/www (and ROOT/tcl).  Jun suggests using a package rather than putting xql files under www.  What package would I use for that when I just want to add some simple pages to the site, where those pages need xql files?

Perhaps I am missing some fundamental assumption about how sites are to be built in OpenACS 4.x.  Why can't I just build up an arbitrarily complex set of directories and files under ROOT/www, where some (many) of those files access the database and therefore need XQL files?  Could zz-postload.tcl traverse all directories under ROOT/www and load all the .xql files found there, rather than only loading files found at the top level?

Collapse
Posted by Jun Yamog on
Hi Fred,

I don't really know 100% for sure if QD does not support www.  I hope someone can respond to this.  You can actually opt NOT to use xql files since it will still get your query in tcl files like the old ACS 3 days.

In my experience with some production OpenACS 4 sites I have yet to encounter an xql file in my www.  I encountered this problem when I was first trying out OpenACS 4.  Most of the time I use packages or if the files are in www it just uses a tcl DB api that originates from one of the packages.

If you would be doing some complex stuff in www I suggest try looking at extending an existing package or creating a new one.

Collapse
Posted by Dan Wickstrom on
This question came up quite a while ago on another thread, and it was decided not support qd operations in the top-level directories.