Forum OpenACS Q&A: Karl's Templating System

Collapse
Posted by G Fairbanks on
Has anyone been successful in using Karl's Templating System in
OpenACS?  I think someone posted a message about porting this, but now
I can't find it.  Pointers or BTDT's would be helpful.
Collapse
2: Original discussion found (response to 1)
Posted by G Fairbanks on
I found the discussion here:

https://openacs.org/forums/message-view?message_id=14329

under the heading "What should an architecture look like".  People talked about having the templating part of DPS working but I don't see any code.  I'll try to get the 0.5 version from ACS 3.3.0 working.  Undoing their new startup code seems like most of the work.

Collapse
Posted by David Richards on
I've been hitting my head against the issue for quite some time now.  tonight I'll be taking a fresh approach with it.  My biggest trouble has been getting ns_adp_parse to parse through the adp pages consistently.  (sometimes my vars aren't being parsed at all).

Also, I know that Michael Cleverly is working on this for Postgres and AOLserver 3.0.  He has it working on a site right now using 2.3 and a Solid db.

Collapse
Posted by David Richards on
Let me tell you what I think I know.

The DPS isn't ported.  I've worked on that, want it, but it keeps getting bumped down my priority list.  Right now I'd be happy to just have the templating system working correctly, let alone all the other bells and whistles available.

The parser doesn't work in AOLserver 3.0.  It was supposed to work with the latest ACS version of AOLserver, but I couldn't get it to work.

My problem has been that my variables are not being parsed.  With the server logs, I have traced the templating system through the different tcl procedures.  It stores the variables into cache correctly (as near as I can tell), but then when it is parsing through my multiple tag, for instance, ns_adp_parse returns the same code it receives.  Somehow either ns_adp_parse isn't finding the variable name in the cache, so it's just returning the string as it found it, or it's not recognizing the tags (although they are registered through ns_tags_register, or something with a similar name).

Anyway, I've poked around a lot with this.  If I can't get things running really soon on 3.0, I'm going to go back to 2.3 and see what I can do with that.  I asked Karl to send me the patches this morning.  I'm going to try and apply them to my version of AOLserver to see if that does the trick.

Are you having similar problems getting it working, or do you have other problems?

Collapse
Posted by G Fairbanks on
I've been working on this steadily since I posted the message,
and I've gotten the DPS to work, mostly.  When it's stable I will
post the code -- should be soon now.

I'm using AOLServer 3.0 + AD5 patches.  I extracted the DPS code from
the ACS 3.3.0 release.  There appear to be significant packaging
errors for DPS there, but it's the only source of the DPS 0.5 code
I know of.  Essentially I'm having to "unpackage" it to go back to
OpenACS's non-package style.  Of course it makes references to new
procs in 3.3.0... etc.

Right now I've got all of the templating working including forms and
master templates, but not CLOB's (lztext) or validation or oracle-
specific error messages.

One thing I do not understand is that even in this OpenACS 3.2.2 "final" release, there's tons of non-ported code.  When I grep for
".nextval" or "sysdate" across OpenACS 3.2.2 there are a large number of hits.  I've had to change some of these to get DPS working, and that's the
part I don't understand.  Perhaps the inclusion of DPS makes some of the modules take different paths through the code, thus revealing the cruft.  To be sure, this is not intended as a flame on those people who are slaving away to port this code -- I just don't understand how it's still there yet not causing problems sans DPS.

If we start discussing this last point then it should probably be in a new thread, eh?

Collapse
Posted by Roberto Mello on
I was going to suggost Dave to download the ArsDigita ptched version of AOLserver (arsdigita.com/download) since it has the patched adp.c to Karl's DPS.

"One thing I do not understand is that even in this OpenACS 3.2.2 "final" release, there's tons of non-ported code. When I grep for ".nextval" or "sysdate" across OpenACS 3.2.2 there are a large number of hits. I've had to change"

The sysdate and nextval hits don't mean that it hasn't been ported. Pay closer attention and you'll notice that you'll find these in modules that work just fine (e.g. classifieds). How? We added functions and other PG gizmos to eaese porting. Look at postgres.sql.

But there are things that could be fixed or enhanced. Unlike ACS classic of little time ago, the OpenACS project has been wide open from start. The community needs to send patches, bug fixes and feature requests if they want an even more butt-kicking free toolkit.

This will be even more true when 3.4 comes out (if we decide not to port 3.4) because the porting effort will be nothing small.

Collapse
Posted by David Richards on
It sounds like you've really got the ball rolling.  I'll be interested to see what you've done that I missed.  It seems I took the same route--got the latest ACS version of the AOLserver, had to get more up to date versions of the software, etc.  Once you're ready, I'll be terribly interested in getting my systems working correctly.

Unfortunately, I also spent a lot of time working on nextval stuff.  I had read about the sysdate fixes in the openACS, but I spent a whole evening getting those nextvals 'ported'.  Oh well.  It sounds like we're both anxious to jump in with both feet, but we're not quite fully initiated yet.

Collapse
Posted by Janine Ohmer on
FWIW, a quick diff of the standalone version of Karl's stuff and the version from ACS 3.3 looked to me like the majority of the changes were scoping and other things needed to fold it in to the ACS.  I asked on web/db whether there were other changes in the ACS version to make it worth the pain of extracting it to use with a pre-3.3 site, and got no response.

I had no trouble getting version 0.4 (the standalone version) to work with Oracle and AOLserver 2.3.3.  The bonus is that it includes a Publishing System as the last tutorial;  this was left out of the ACS version for some reason.

The point of all this is that I think you might have an easier time getting it to work if you use version 0.4;  you can spend your time porting it to Postgres instead of trying to surgically extract it from ACS 3.3.  That was my decision, anyway.  As always, your mileage may vary. :)

Collapse
Posted by G Fairbanks on
Despite my earlier assertion that I'd have something stable running soon, I haven't done any further work on gettting DPS working.  (My project is a prototype and so 100% finished isn't necessary).  It does seem to work correctly but my testing isn't extensive.

I had hoped that the packaging of DPS 0.5 would be better in the newer versions of oracle-ACS but it appears to be the same.  The bugs with my port seem to be packaging related -- lots of duplicate definitions of procedures for example.

1)  I'd like to make the code available for others to take a look at.  What's the best way for me to do this?

2)  There was a thread, probably in the ArsDigita forum, on the even newer version of DPS that Phil is working on for 4.0.  I can't find that thread or the document it referred to.  Any help?

Collapse
Posted by Janine Ohmer on
There was a thread, probably in the ArsDigita forum, on the even newer version of DPS that Phil is working on for 4.0. I can't find that thread or the document it referred to. Any help?

You probably want http://www.arsdigita.com/bboard/q-and-a-fetch-msg?msg_id=0008ku&topic_id=155&topic=Publishing%20System. This is in the Publishing System Forum, not in web/db, which is probably why you couldn't find it. I've lost it a couple of times myself. :)

If you also look at http://www.arsdigita.com/bboard/q-and-a-fetch-msg?msg_id=0008wl&topic_id=155&topic=Publishing%20System you'll see that I asked some questions about the changes in 3.3/3.4 and the future of the content management piece of DPS, but they weren't answered. My impression is that Karl didn't do the integration into ACS 3.3 and doesn't know the answers, and whoever did isn't reading this forum.

If anyone does come across more information please post it! I'm working on a client proposal that includes DPS and it's very frustrating to not have a good handle on it's current state or future direction.

Collapse
Posted by G Fairbanks on
This is related to the ACS40 stuff I remembered, although I recall the original document being written by Phil. This one is more concrete, however. I found this by searching for XML, not through any link on a page. Interesting reading:

http://www.arsdigita.com/doc/acs40/templating-spec.html