HOWTO make your first bond application
Create a directory or go to bond/example/simple.
$mkdir simple
Create a postgres database.
$createdb -U postgres bondsimple
This example use the superuser postgres but you can create your own user.
You may have also to edit postgresql.conf to enable tcp connection.
tcpip_socket = true
And pg_hda.conf to enable connection from localhost.
The next line alow every connection from localhost for any user to connect without password, quite safe for personal linux box.
host all all 127.0.0.1 255.255.255.255 trust
Create your database stucture file.
Or copy it from 'bond/example/simple/simple.sql'.
A simple one look like:
CREATE TABLE "paymenttype" (
"id" serial primary key,
"description" text,
);
CREATE TABLE "payment" (
"id" serial primary key,
"paymenttypeid" integer NOT NULL
constraint ref_paymenttype references paymenttype (id),
"paymentdate" date default date(now()),
"amount" double precision default '0',
"note" text
);
Insert it into your database.
$psql -f simple.sql -U postgres bondsimple
Modify the 'bondfronted.conf'.
Important values are :
#to connect to postgres db_host = localhost db_username = postgres db_password = db_name = bondsimple #to enable debug debug_enabled = true debug_stream_stdout = stdout debug_stream_stderr = stderr debug_breakonerror = false debug_breakonwarning = false debug_level = 90 #to use gtk uiplugin = gtk #the name of your main xml file bondxml = simple.xml #dtd validation is a good idea to find error in xml dtd_validation = true
Create your xml main file.
Or copy it from 'bond/example/simple/simple.xml' for the full code which is explained in the next pages.
A realy simple one looklike:
<!DOCTYPE bond SYSTEM "../../bond-2.1.dtd">
<bond
xmlns="http://bond.treshna.com/ns/v2.0"
xmlns:xi="http://www.w3.org/2003/XInclude">
<project name="Simple bond example" defaultvisible="false"
author="treshna Enterprises Ltd"/>
<window name="payment-win"
title="Payment details" visible="true">
</window>
</bond>
Now you are ready to see your first blank window, run bondfronted in the directory.
$bondfronted

Next page