Forum OpenACS Q&A: Learning ACS through OpenACS?

Collapse
Posted by Deirdre Lonergan on
I really like the idea of the problem sets for learning ACS (and a lot of other things). Are these completely impossible to do with Postgres as the RDBMS? I don't know enough to tell how Oracle-specific the SQL examples are (that's why I want to do the problem sets!). If the differences aren't too great, I could try to put together an OpenACS version as I go through the exercises. --deirdre
Collapse
Posted by Don Baccus on
I've never looked at the problem sets, to be frank, but at the very least you'll learn just as much as you would doing them using Oracle.  At best, you'll learn even more - where the examples include Oracle-isms you'll have to learn to translate them to Postgres, using the documentation on this site as a guide.

Along with the lessons learned by doing the problem sets you'll learn why those of us deeply involved with the OpenACS keep grumbling that keeping the port up to date would be a lot easier if the SQL were written using some Tcl to abstract out some of the differences (quite possible for all but outer joins and "connect by").

So I'd argue you'll learn MORE doing them in OpenACS.  Whether or not the extra knowledge is worth having depends on what you plan to do later.  If you go work for aD you'll work strictly with Oracle and expected to enjoy it, for instance.

Of course, instead of learning to install Oracle during the first problem set, you'll learn to install Postgres.  This is a great simplification.  You should probably go through the exercise of installing Oracle once just so you can have a proper appreciation for just how easy it is to install and configure Postgres, a strong argument for using OpenACS when a site doesn't really need the scalability of Oracle.

Collapse
Posted by Todd Gillespie on
Writing as someone who didn't actually write ACS, but had to use/is using the problem sets, I say the differences are small enough to use them, and you will learn a little extra Tcl and SQL (if adventurous, PL/pgSQL) on the translation.  If you want to put together an OpenACS version, hey cool, but keep in mind the effort involved in supporting it as philg updates the lessons, and openACS ports more code...

Anyway, the first SQL divergences you'll run across are:

1) any references to 'dual', namely sysdate.  For sysdate, use the tcl db_sysdate function.

2) sequences read like 'sequence.nextval' in Oracle, and nextval('sequence') in Postgres.  Nothing a regex can't handle.

3) outer joins.  The excellent people here have said it before; a: use unions, and b: god I wish postgres would include outer joins.

4) number is used in Oracle, numeric in postgres (was someone just pissy?)

5) something else bit me on the ass, but I'm on my first coffee for oday...

6) trees; eg. 'connect by'.  I haven't had to use trees yet, so I don't know how to work around the lack in postgres.  Watch this space.

I just started a new contract at a site with Oracle8.1, so I may not be as focused OpenACS for a while, but I'll be back.  Hope some of this helps.  As for documentation, PostgreSQL has a real lack, IMHO.  You should trundle down to the library and grab some Oracle books anyway, if just for concepts.  Good luck!

Collapse
Posted by Don Baccus on
<blockquote><i>number is used in Oracle, numeric in postgres (was someone just pissy?) </i></blockquote>
Good question.  Numeric is the SQL92 name for this type, and I do believe Oracle supports both their own legacy "number" and the SQL92 "numeric".
<p>
In part, small stuff like this is due to the fact that aD folks seem to have universally learned SQL via Oracle, and often believe that Oracle IS SQL and could care less about SQL92.
<p>
Certainly valid given their business goals...
<p>
You're right that PG docs generally are sketchy, I've read a lot of the Oracle docs for this reason.  Hopefully, Great Bridge (the new PG company) understands that they need to make solid documentation a priority.
<p>
As far as connect by - look at Intranet to see how these have been translated in the past before spending too much effort re-inventing the wheel...
Collapse
Posted by Todd Gillespie on
Well, that was enlightening.  I just gave a presentation about tight Web/DB integration to my local LUG (linux users' group).  It was very broad, but suprisingly, still very educational for about 2/3 the room.  So it looks like I'll be giving another presentation soon.
Most of my examples were from OpenACS, with counter examples from slashcode(MySQL), and had section like 'Fighting off interns with referential integrity'.  Since it was (suprisingly!) educational, it looks like my pathetic slides will become more permanent.  Which brings us too the question at hand.

Can we get wimpy point running on openACS?  Since I'm going to run a few more lectures centered around ACS-style devel, it would be a Good Thing to center some of the data here.  Also, if anyone has some god stuff left over(or not yet tried!) from a similar presentation, by all means I'd love to turn my lectures into a more-complete introduction to DB-backed sites; albeit one shorter than 'Philip & Alex', and more in line with public speaking.

Question 2:
Editing the psets to make them pgSQL compatible now sounds like a wonderful plan.  Deirdre, have you shelved this plan?  Anyone else, would this piss off aD; should I just write an addendum to the psets?
If I write it, I'd like to share.  So what can we do on OpenACS?

Collapse
Posted by Roberto Mello on
Well, that was enlightening. I just gave a presentation about tight Web/DB integration to my local LUG (linux users' group). It was very broad, but suprisingly, still very educational for about 2/3 the room.

That's very good. I gave a presentation abut databases on GNU/Linux to my local Free Software and GNU/Linux Club, somewhat directed for web/db and it was really good. Of course, the same questions and statements that we see here and on /. about MySQL came up and I was able to address them and convert about 10 people to switch from MySQL.

It still amazes me how MySQL gets this "free-pass" in the open source community. I guess the biggest reason for this would be PHP.

Can we get wimpy point running on openACS? Since I'm going to run a few more lectures centered around

Wimpy has been ported by Don quite a while ago. My presentation was made on it and you're free to uso it as long as you keep the credits (http://fslc.usu.edu). I'd be interested to take a look at your presentation too.

Question 2: Editing the psets to make them pgSQL compatible now sounds like a wonderful plan. Deirdre, have you

There have been talks about this but no one has actually done it AFAIK. IMHO this is a great idea and if you're up to do it, please do. I don't think aD would have any problems with it. Besides, this is free software arena. Have an itch? Scratch it. Spreading the ACS gospel only benefits aD.

Collapse
Posted by Don Baccus on
I can't imagine any reason for aD to be upset if the psets were made PG compatible.  We just need to credit them, to reference the version of the psets they're derived from (or better yet keep them up-to-date), etc.
Collapse
8: pset ports in progress (response to 1)
Posted by Todd Gillespie on
I'm porting the psets, as I plan to be using them for a small group (froup?) in Austin, TX. They can be found (as I post them) at http://www.math.utexas.edu/~toddg/docs/psets/.

In theory, only psets 1 & 2 require many changes. 3-5 only have conflicts on trees, intermedia, and a little SQL might need changing.

So could anyone here tell me what parts suck, and what needs to be changed before these ported psets are considered useable?

Collapse
Posted by Adam Farkas on
Todd -- great job with the pset1 port.  Have you been working on otherpsets as well?
Collapse
Posted by Todd Gillespie on
Todd -- great job with the pset1 port. Have you been working on otherpsets as well?

Matter of fact I have, but they've been shelved for the last few weeks whilst my free time converged to zero. Also, I've been writing the ports with notes drawn up while I did the psets on Postgres; and learning OpenACS has been a rather non-linear curricula. But I should kick out 2 soon, and 5 not long after that. I didn't see much in 3 that requires changes (but maybe a few words should be said about Postgres specifics on the audit trail, namely VACUUM & CLUSTER). Pset4 has a few odd things, and pset 5 is a bitch b/c of CONNECT BY.

Part of my impetus to finish the assimilation from my notes was that after giving my little web/DB talk at the local (Austin) LUG, I tried getting a sub-group going to teach/learn these things (curricula tuned towards aD's boot camp, but stretched out over a few months of rare meetings); about a dozen people signed up, but then things degenerated into 'my-favorite-language' -- shimattana kodomo! (damnable children)

Anyway, glad you like the first ported pset. These are beta - tell me if my writing/editing sucks.

Collapse
Posted by Todd Gillespie on
pset2 is on my web server: pset2

Sorry about this one -- it literally sat on my desk for a month whilst pursuing other things, err, everything. It's also not finished - I need to add some ground at the end about 'set transaction isolation level' and 'select .. for update'. Next week after I finish moving into my new place I should have a chance, and hopefully write 5.

(Not *all* that much chance, as I will be working on ACS classic henceforth...)

Collapse
Posted by Robert Schlaff on
Anyone who's planning on doing the Psets with OpenACS should be aware that the Database APIs in the current Psets have not been ported to to OpenACS. Therefore you'll get errors like the inability to execute db_foreach commands. The best workaround seems to use the older versions of the Psets.
Collapse
Posted by Robert Schlaff on
Sorry guys, the best solution is to use Todd's Psets (and sample files) at http://www.math.utexas.edu/~toddg/docs/psets/
Collapse
Posted by Ben Adida on
Actually, we here at OpenForce have begun the port of the DB APIs. I'll try to make it available ASAP for people to experiment with.
Collapse
Posted by Randy O'Meara on
Todd, the sample files are not available at http://www.math.utexas.edu/~toddg/docs/psets/6916.ps1-pg.tar.
Have they been moved to another (accessible) location?
Collapse
Posted by Todd Gillespie on
Randy O'Meara sayeth:
Todd, the sample files are not available at http://www.math.utexas.edu/~toddg/docs/psets/6916.ps1-pg.tar. Have they been moved to another (accessible) location?

Err.. yes. Good thing you noticed, I wouldn't have for the next several months. They're around here somewhere (I hope they're not still on my home machine in Texas). I currently being paid to work with ACS Classic, so I haven't monkeyed with OpenACS in a while. I'll find the files soon - maybe as soon as this evening.

On a totally unrelated note, does anyone here live in the Bay area, and need housing or tenants?

Collapse
Posted by Robert Schlaff on
The other pain in the psets, is that what Oracle calls a date, Postgres calls a timestamp. This is especially irritating because a Postgres date really is a date (i.e. it doesn't have a time part). So functions will appear to sort of work.