Re: What Programs Do You Use For PG?

From: "Neil D'Souza" <neil(dot)xavier(dot)dsouza(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: What Programs Do You Use For PG?
Date: 2010-12-22 10:45:33
Message-ID: AANLkTi=q6-K0MT8fbUpPPqs2t+6h-tBGtp1aeyZ4zwSf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

interesting project. do you have any documentation describing how it works?
merlin

Hi Merlin,

Thank you for your interest in the project.

Here is how to get it up and running so that you can try out the same
application that you see running on: http://173.230.133.34:8080/

0. To build the project you need boost, flex, bison, and wt and g++.
I'm doing this on GNU/Linux - it should be possible to build on Windows too.
1. Download and install the webtoolkit (http://www.webtoolkit.eu)
wt-3.1.6
2. Download extjs-2.1 here is one link I found on google:
http://olex.openlogic.com/packages/extjs/2.1
3. You need to follow the extjs deployment notes given in the Wt
documentation
for example:
my extjs-2.1 resides in "/home/nxd/dnld/extjs-2.1-src" ,
when deploying you will have to make a link to this directory
cd /home/nxd/dnld/extjs-2.1-src
ln -s adapter/ext/ext-base.js .
4. Clone the repository on sourceforge (version control tool is git)
/media/sda3/home/nxd/test2>git clone git://
proghelp.git.sourceforge.net/gitroot/proghelp/proghelp
5. Setup the build areas ( these steps might not be necessary as I
added dummy files to the directories, but just in case)
Prompt>cd proghelp
Prompt>mkdir make-build-dir bin
Prompt>cd inputs
Prompt>mkdir -p output/CppCodeGenerator
Prompt>cd ..
6. Build the compiler - actually I cant really call it one considering
how simple it is.
CustomMakefile is the makefile for doing a build.

/media/sda3/home/nxd/test2/proghelp>make -f CustomMakefile
Ignore compile warnings :)
The last output of the make file is to copy certain files to the
output folder - do it.
cp inputs/CalendarCell.C inputs/CalendarCell.h
inputs/TimesheetCalendar.C inputs/TimesheetCalendar.h
inputs/output/CppCodeGenerator
7. Build the sample application.
/media/sda3/home/nxd/test3/proghelp>cd inputs
/media/sda3/home/nxd/test2/proghelp/inputs> ../bin/csassist.exe
--database-name proghelpdemo1 emp2.sql

The generated code is written to output/CppCodeGenerator
It also creates a directory with the timestamp at which you
created the project - and all unified sql scripts are created there.

8. setup the sample database we used in step 7. Please note that
these commands are most probably not best practices and should not be used
in this way in a production environment. You may need to switch to user
postgres to run these commands. My postgres runs on port 5433 (because ... )

8.1 Database creation related stuff
/media/sda3/home/nxd/test2/proghelp/inputs>createdb -p 5433
proghelpdemo1

If the plpgsql language is not added to your template1 database
then you need to add the language to the database too.
/media/sda3/home/nxd/test2/proghelp/inputs>createlang -p 5433
plpgsql proghelpdemo1

8.2 unified scripts setup

1. Change to the timestamp directory where the unified scripts
reside. The name of the timestamp directory will be output in step 7.
/media/sda3/home/nxd/test2/proghelp/inputs>cd
output/CppCodeGenerator/2010-12-22-13:12:20

2. run the unified script creator shell scripts.
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator/2010-12-22-13:12:20>ls
unified_create_func_sql.sh unified_create_tables_sql.sh
unified_drop_func_sql.sh unified_drop_tables.sql
unified_load_rdg_data_sql.sh
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator/2010-12-22-13:12:20>sh unified_create_tables_sql.sh
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator/2010-12-22-13:12:20>sh unified_create_func_sql.sh
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator/2010-12-22-13:12:20>sh unified_load_rdg_data_sql.sh

3. execute the scripts on the database
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator/2010-12-22-13:12:20>psql -p 5433 proghelpdemo1
a. proghelpdemo1=> \i unified_create_tables.sql
b. proghelpdemo1=> \i unified_load_rdg_data.sql
step b will have some errors because my Random Data
Generator does not take care of foreign keys for master details tables.
These can be ingored.
c. proghelpdemo1=> \i unified_create_func.sql
d. There is one stored procedure that is not automatically
added to the unified scripts, you need to load this one manually.

proghelpdemo1=> \q
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator/2010-12-22-13:12:20>cd ..
/media/sda3/home/nxd/test2/proghelp/inputs/output/CppCodeGenerator>psql
-p 5433 proghelpdemo1
proghelpdemo1=> \i sp_User_Login_authenticate_login_postgres.sql
9. Build the generated app
/media/sda3/home/nxd/test2/proghelp/inputs/output/CppCodeGenerator>make
-f Makefile.emp2.sql -j 8
( for -j8: the recommendation is 2ice the number of processes as the
number of cores I read somewhere)
10. Deploy web related stuff.
1. the ext library
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator>ln -s /home/nxd/dnld/extjs-2.1-src/ ext

2. css
cp the not so great default css file - it resides in the
"inputs" dir

/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator>cp ../../good1.css .

3. Dummy company logo

/media/sda3/home/nxd/test3/proghelp/inputs/output/CppCodeGenerator>mkdir
images
/media/sda3/home/nxd/test2/proghelp/inputs/output/
CppCodeGenerator>cp ../../text-company-logo.png images/logo.png

/media/sda3/home/nxd/test2/proghelp/inputs/output/CppCodeGenerator>cp
../../good1.css .
If you did not follow the soft linking step at 3. you should do so now,
inside the extjs downloaded dir.

10. Test it

/media/sda3/home/nxd/test2/proghelp/inputs/output/CppCodeGenerator>
./test_ui
--http-address 192.168.1.1 --http-port 8081 --docroot . &

Point your browser to http://192.168.1.1:8081/
<http://192.168.1.1:8080/>and browse - this should be your nic address
, otherwise you can always use
127.0.0.1
Default logins and passwords are as given in my previous mail.

Any difficulties, please email me - i tried all the steps mentioned here -
but something could have gone wrong.

Kind Regards,
Neil

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vincent Veyron 2010-12-22 10:56:06 Re: Constraining overlapping date ranges
Previous Message Richard Broersma 2010-12-22 06:20:07 Re: Table inheritance foreign key problem