Forum OpenACS Q&A: Re: PostgreSQL/OACS Module Development

Collapse
Posted by Samir Joshi on
John,

I am bit hesitant as I write this , but this is the way I followed in my 'Intro. to OpenACS Programming' sessions, and it works.

Specificaly, I do not start with PL/pgSQL usage at all ! Instead I introduce participants to db api for invoking simple SQL commands and create those tables from psql interface. Note that this is not recommended long term practice, but works best if you want to get your hand dirty early on.

I am in process of creating some examples that will introduce tweaking OpenACS in what ol' Mr. Greenspun called 'gentle slope' way.

Collapse
Posted by Tilmann Singer on
Does this 'Intro. to OpenACS Programming' exist already? Where can we look at it?
Collapse
Posted by John Luong on
Thanks to everyone who replied.

I had already found/read PostgreSQL documentation for PL/pgSQL and the database API, so for the most part, I'm up to speed on those things.

What I am really after is something that resembles the OpenACS documentation that walks through the Notes example, but in the context of PostgreSQL.  After reading the documentation, the Note example makes perfect sense in the Oracle context and I have a good understanding of how to implement the same things in PL/pgSQL.  What I don't understand is the file:

/packages/notes/postgresql/notes-sc-create.sql

acs_sc_impl__new
function notes__itrg
trigger note_itrg

So far in my application, I've omitted these because in my case, the application is better done than good (for now), but I feel that in the long term scheme of things, it'd be a good thing to know.  That's mostly what I'm after and a more concrete example.

I'm also wondering if anybody is using OpenACS/PostgreSQL as an application interface while using Perl/DBI/DBDpg to feed data in.

Thanks again for all your replies.

Collapse
Posted by Vinod Kurup on
Hi John,
> What I don't understand is the file:
>
>/packages/notes/postgresql/notes-sc-create.sql
>
>acs_sc_impl__new
>function notes__itrg
>trigger note_itrg
That file is meant to set up search services for the notes package. Site wide search is set up through things called service contracts (sc). See the acs-service-contract docs for more info.

Basically the search package publishes a contract that other packages have to fulfill if they want their content to be available to site wide search. the ac_sc_impl* calls notify openacs that notes is fulfilling those contracts. The triggers run everytime you insert, update or delete a note and inform the search package of the change in the data.