Steve Jobs Project/POS/Documentation:en
This is a project under Cm:Cameroon User:TheD is translating from the French version original by User:Trigger.
Technical Documentation
Do you know anything about Point Of Sale?
This is an essay about the technical documentation of the source code of OpenBravo Point Of Sale (OBPOS) using Netbeans IDE.
Feel free to use another compatible compiler.
Default Database Configuration Properties
![]() |
Let's start by describing the data model and show, into the code, I suppose you have imported the project source code successfully. |
Now take a look at the IDE console. We can see that the class responsible to application configurations is com.openbravo.pos.forms.AppConfig.
The following is an UML Class diagram for com.openbravo.pos.forms.AppConfig
Try to open the file into your IDE and focus on the part of code in which database parameters are configured. Into this class, the method in charge to initialise the default value of configuration parameters is loadDefault.
private void loadDefault() {
m_propsconfig = new Properties();
String dirname = System.getProperty("dirname.path");
dirname = dirname == null ? "./" : dirname;
m_propsconfig.setProperty("db.driverlib",
new File(new File(dirname), "lib/derby.jar").getAbsolutePath());
m_propsconfig.setProperty("db.driver", "org.apache.derby.jdbc.EmbeddedDriver");
m_propsconfig.setProperty("db.URL", "jdbc:derby:" +
new File(new File(System.getProperty("user.home")),
AppLocal.APP_ID + "-database").getAbsolutePath() + ";create=true");
m_propsconfig.setProperty("db.user", "");
m_propconfig.setProperty("db.password", "");
...
}
For those who wish to go further, you can see the
value of these variables using the debugger by placing a breakpoint, launching the debugger
and verifying the state of the various variables.
On my pc, I have the following outcome of which it is important to note that this result depends on the platform used
(Windows, Mac, Linux,...).
kkkkkkkkk
You certainly noticed!!! The method has as aim to initialise other configuration parameters of the application. Once the parameters initialised, watch the script create the data base.
How does POS automatically create the data base by default?
The class responsible for creating tables in the data base iscom.openbravo.pos.forms.JRootApp.The method in which are
interested in, in this class initApp has as role, to create a session and a schedule of the data base.com.openbravo.pos.JRootApp uses the classe com.openbravo.pos.forms.AppViewConnection to connect into the data base by the method getSession(). Then JRootApp calls the method magic!!! the interior of which the creation of the data base is as such created: getBean.
kkkkkkkkk
The method getBean creates an object of type com.openbravo.pos.forms.DataLogicAdmin, which is inherited from the class
com.openbravo.pos.forms.BeanFactoryDataSingle, which in turn implements the interface com.openbravo.pos.forms.BeanFactoryApp,
then calls the initial method declared in the interface BeanFactoryApp. It is this which then automatically creates the schedule for the data base.
kkkkkkkkk
Before looking at how to connect to the data base through Netbeans IDE, I will partially present the content of the initial method of the class
com.openbravo.pos.forms.DataLogicAdmin.
public void init(Session s){
this.s = s;
m_tpeople = new TableDefinition(s,
"PEOPLE"
, new String[] {"ID", "NAME", "APPPASSWORD", "ROLE", "VISIBLE", "CARD", "IMAGE"}
, new String[] {"ID", AppLocal.getIntString("label.peoplename"),
AppLocal.getIntString("Label.Password"),
AppLocal.getIntString("label.role"),
AppLocal.getIntString("label.peoplevisible"),
AppLocal.getIntString("label.card"),
AppLocal.getIntString("label.peopleimage")}
, new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING,
STRING, Datas.BOOLEAN, Datas.STRING, Datas.IMAGE}
, new Formats[] {Formats.STRING, Formats.STRING, Formats.STRING,
STRING, Formats.BOOLEAN, Formats.STRING, Formats.NULL}
, new int[] {0}
);
m_troles = new TableDefinition(s,
"ROLES"
, new String[] {"ID", "NAME", "PERMISSIONS"}
, new String[] {"ID", AppLocal.getIntString("Label.Name"), "PERMISSIONS"}
, new Datas[] {Datas.STRING, Datas.STRING, Datas.BYTES}
, new Formats[] {Formats.STRING, Formats.STRING, Formats.NULL}
, new int[] {0}
);
We shall now see how to connect in to this data base through Netbeans and as such we can have a better idea of the
relational schedule ...




