Forum OpenACS Q&A: Response to Guidelines for new modules

Collapse
Posted by Ryan Campbell on
I've also gotten the ATS running with OpenACS 3.2.4. The biggest problem I had was knowing which version was the latest offical release. I downloaded the latest non-apm version of CMS from cms.arsdigita.com that I could find. Really, I think that you could download the apm from the ACS repository and just grab the ATS out of it after untar | ungzipping the apm, though I personally haven't tried this.

I put the ATS directory in my serveroot directory and symlinked it's subdirectories (tcl, demo, doc) to the appropriate directories. I was really slowed down because I didn't read the part of the installation guide where it tells you what settings you need to have in your nsd.tcl. They are very important!

I still haven't gotten ATS Forms to work correctly (running the form demo pages causes Aolserver to crash), though I suspect that it's because I'm running an older, buggier version. I'll probably upgrade to the latest APM once I have a need for the form generating functionality.

P.S. One of the nice things about the templating system is that you can source templates programmatically, since the internal API is fairly well documented. For instance, I have a file called header.adp (and it's corresponding data file, header.tcl) which contains the header I want to use across the site. Unfortunately, since none of the vanilla ACS pages use the master template, I was going to have to put my HTML both in the header.adp template as well as ad_header.

Being the lazy hacker that I am, I wasn't interested in maintaining the HTML in two different places. So I came up with this for ad_header_with_extra_stuff:

    set root_path [ns_info pageroot]

    set url_stub /header

    template::filter exec url_stub root_path

    set file_stub $root_path/$url_stub

    return [template::adp_parse $file_stub title $page_title]

So now, whenever I change header.adp, all the pages on my site are updated, not just the templates. I'm not sure that I need to apply the filter to this, but I thought it best until I understood filters better; it might be unnecessary overhead.