wiki:pgTEC

Using the pgTEC interface

Note that pgTEC and infTEC are now deployed onto DICE. The following is for reference.

The pgTEC interface is a basic port of the existing School database user interface to PostgreSQL. From the user perspective it operates in the same way. There are some differences in the build and installation process outlined here. It is held in the Theon subversion repository here: source:legacy/pgTEC. To build and install from this directory:

  • cd EXE
  • ./makerpm - this will build an rpm from the HEAD in your normal RPMROOT
  • nsu; rpm -i pgTEC-3.10-1.*.rpm

Now the interface is installed run a script as part of the package that initialises the "tecdb" database structures and content:

  • /usr/bin/pgTECinit

The above needs suitable permissions to create the database as yourself.

See source:legacy/pgTEC/README for more details.

Now you should be able to run:

  • /usr/bin/pgTEC

and browse the internal structures in the database.

By default it is built to talk to PostgreSQL on the localhost (must be v8.4 or greater). The interface will prompt for a username/password which for Kerberos is unecessary, just leave blank and click on Ok. These prompts can get annoying - you can turn them off by choosing Customize-->Preferences from the menu, scrolling down the list to near the bottom to find tecUseConnectionIdentity, enter 1 in the value box, press Return and the click on Ok to set the value. Note that the value should be 1 and NOT -1 as is the default value and as is suggested in the description box. Then exit and restart and you shouldn't get prompted anymore. To use the interface to talk to a database other than on localhost then that database needs to be set up with suitable connection parameters - note that the "tecdb" database does not need to be on the same server, it could still be on localhost. To change the server for the "tecdb" database for now you must manually as root edit the file: /usr/lib/pgTEC/1-3.09/BSC/dat_row.tecdb.adf, and replace the

"PostgreSQL
"tecdb
-

lines with

"PostgreSQL
"tecdb
"hostname.inf.ed.ac.uk

The infTEC package we ship onto Informatics machines includes both of the above modifications.

To load the Informatics dictionary/artifacts data built from the XML Schema do the following:

  • cd dev/scripts
  • python schematic.py -t ../xslt/gui.xsl -e TheonXSLT.py http://schema.theon.inf.ed.ac.uk/live/inf/infdb.xsd | psql tecdb

You should only get a few relation errors (due to UI mapping type relations not represented correctly in the schema). The command above can be repeated as necessary (it first deletes content it owns).

Now load the Informatics DDL:

  • cd dev
  • echo "create database infdb;" | psql postgres
  • psql infdb < schema/basic.ddl OR python scripts/schematic.py -t ../xslt/ddl.xsl http://schema.theon.inf.ed.ac.uk/live/inf/infdb.xsd | psql infdb

You should not get any errors loading the Informatics DDL.

Within pgTEC you should then be able to open any of the Informatics tables and run a query. There won't be any data to query but you should be able to add some, modify it and delete it to test (including integrity constraints).

To use the custom forms you need access to the custom form objects. To do this you should install the Informatics modified version of pgTEC (this can be installed in parallel with pgTEC). This includes fixes for the login prompt and other minor tweaks and includes all the custom form objects. It is held in the Theon subversion repository here: source:legacy/infTEC. To build and install from this directory (assuming you have already built pgTEC as above):

  • cd EXE
  • ./makerpm ${RPMROOT}/SRPMS/pgTEC-3.10-1*.src.rpm
  • nsu; rpm -i infTEC-3.10-1.*.rpm

Since the infTEC package is built to talk to the new Informatics database server (pginfdb) you then need to tweak the cache file to point at localhost (or whatever pgTEC was modified to point to if not locahost). To do this you must manually as root edit the file: /usr/lib/infTEC/1-3.10/BSC/dat_row.tecdb.adf, and replace the

"PostgreSQL
"tecdb
"pginfdb.inf.ed.ac.uk

lines with

"PostgreSQL
"tecdb
-

You should now be able to run /usr/bin/infTEC and open any of the Informatics custom forms and run a query. There won't be any data to query but you should be able to add some, modify it and delete it to test.

Last modified 10 years ago Last modified on Nov 5, 2009, 4:11:23 PM