Introduction
In the
last article I told readers a brief history of ten years of development of the Openbravo POS project. For 7 years I took an active part in it and, together with other participants, developed an outlet source management system. But this year I decided to transfer all my accumulated achievements to the independent project
nordpos.mobi and develop them within the framework of my own fork, created on the basis of the open source code Openbravo POS.
Origins
The key reason for stopping the development of Openbravo POS, was the actual departure from the project of its founder Edrin Romer, he completely switched to the development of the commercial version of Openbravo Web POS and since 2010 has not touched the original code of the original version. Therefore, I didn’t have much hope for the revival of the project, and I had a need for the development of the application.
Almost from the first days in parallel with the public work on the localization of Openbravo POS, I led the development of an internal project for my family’s business called NORD POS. Since we have a family business connected with technical maintenance of cash and other trading equipment, we were quite interested in the further development of our own application that can work with this equipment. Which prompted me in 2012 to post the NORD POS source code first to the Mercurial repository on Bitbucket, and then to GitHub after switching to Git. Version numbering had to start right from the number 3 due to the fact that one of the main features of my application was the ability to migrate from the latest version of Openbravo POS. As a result, the first version of NORD POS was the version for the number 3.0.0, it included not only cosmetic interface changes and library version updates, but also changes affecting the structure of the entire project as a whole.
')
Separation of base and superstructure
By itself, the Openbravo POS application was generally self-sufficient for the tasks of organizing cash accounting. It contained a full range of functions performed at the cashier’s workplace, but all the time, users lacked the capabilities and flexibility to adjust them to the specifics of a particular business. Although something could be solved by writing embedded scripts, their scope was limited only to the sales panel. If you had to somehow change the business logic and connect new hardware, you had to make changes to the core of the application. And since it was initially monolithic and was developed as a matter of fact by only one person, these changes could affect a significant part of the source code. Although from version 2.10, where Adrian Romero singled out the generation of reports into a separate plug-in resource, a gradual transition to modularity and extensibility began by removing part of the resources from the application source code kernel, but unfortunately since 2009 the project was essentially frozen and this process did not get further development. Also, this direction did not find development in the forks based on Openbravo POS and it became interesting for me to try to implement it myself.

Current desktop version : NORD POS 3.0.1 Community Edition
System requirements : Windows or Linux OS with Java SE 7.
Interface : Java Swing in the desktop application and jQuery Mobile in mobile web applications.
Databases : Apache Derby and MySQL as basic but accessible to use PostgeSQL, HSQL, Firebird or Oracle DBMS.
Interface languages : English and Russian.
Source Code :
github.com/nordpos/nordposBinary builds :
sourceforge.net/projects/nordpos/files/app-platformLicense : GNU GPL v3.
Plug-in hardware in peripheral drivers
I spotted this decision in the commercial version of Openbravo Web POS, where the interfaces were rendered using
Java SPI into separate packages for each type of equipment. This made it possible to resolve the problem with the connection of equipment that was present only in our local market, for which now there is no need to make a separate fork of the entire system, and it is enough to make changes only to one driver that was installed in an independent library. In the same way, NORD POS implements connection to payment gateways of card processing.
The diagram shows the implemented interfaces for individual types of commercial equipment. At the same time, the customer’s display, fiscal registrar, check and printer etiquette are controlled by special XML templates, the structure of these templates is described in
Schema.Printer.xsd . Also, to implement work via plug-in drivers, the directory structure of the application has been changed to edit resources without having to compile the main package.
- ./services , files with the declaration of called services;
- ./templates , custom templates;
- ./lib-ext , the driver libraries themselves.
In addition, as in Openbravo POS, barcode scanners or magnetic cards can be connected to NORD POS without problems in the keyboard mode.
Business logic in mobile add-ons
I already described the idea in detail in the article
Compact Java servlet for the mobile web , in the future it could become the flagship of the development of Openbravo POS, but unfortunately, apart from me, it was not picked up by anyone, and today it is the main feature of the nordpos.mobi project . At the same time, it not only hosts the source code for creating your own Java servlets, but also has the opportunity to try out demos for
the product catalog and
the waiter’s workplace , which are already compiled and deployed on a virtual machine in the Windows Azure cloud. And now I have plans to make for NORD POS a mobile online store and a mobile data collection terminal for the warehouse.
From a technical point of view, these are standalone web applications that have only a common database with the desktop version of NORD POS, while the database is not much different from the original one, and web applications from NORD POS can be used in conjunction with other Openbravo forks POS. Unlike the desktop versions, where the interaction with the database management system was carried out through SQL queries, Java servlets use
ORMLite Java annotations to access information through the data model. The list of supported databases through the JDBC driver is quite extensive, and all you need to connect is in the servlet
/WEB-INF/web.xml to specify the connection parameters. In this case, the only condition is that in the
/ WEB-INF / lib folder there is a JDBC driver for the corresponding DBMS. Here is an example of settings for MySQL:
<context-param> <param-name>db.URL</param-name> <param-value>jdbc:mysql://localhost:3306/nordpos?useUnicode=yes&characterEncoding=UTF-8</param-value> </context-param> <context-param> <param-name>db.user</param-name> <param-value>nordposuser</param-value> </context-param> <context-param> <param-name>db.password</param-name> <param-value>nordpospassword</param-value> </context-param> <context-param> <param-name>db.application.id</param-name> <param-value>nordpos</param-value> </context-param>
Visual schemes for data synchronization
Another necessary feature of POS programs is the availability of means of integration with other software already implemented or planned for implementation. We usually have it 1C, abroad it is a different ERP system, also very often there are online stores built on popular CMS, as well as self-written ones. Most often, POS developers use upload and download to a text file as a universal solution, which the external system then processes. But I liked the solution, use specialized software for ETL. In the Openbravo POS 2.30 version, the
Pentaho Data Integration software package was used. Since this is a more universal approach, then it is possible both to adapt to the API of other systems, and to implement your own data exchange options. Pentaho Data Integration uses a visual approach to the process of extracting, transforming and uploading data. For example, the scheme for unloading tables of goods, categories and taxes from the NORD POS database will look as follows.

Pentaho Data Integration transformation schemes can be launched in several ways: from a graphical shell, from the command line, according to a schedule, via a web server or built into another API application. For NORD POS, I chose the latter option, since it is most convenient for users.
Implemented the integration of transformation schemes was similar to the integration of JasperReports report templates. In the visual editor creates a transformation scheme.
After that, a script is created in a text editor or IDE to call it from the application.
transformation = new com.nordpos.sync.panel.PanelTransformationBean(); transformation.setTitleKey("Menu.SyncImportProducts"); transformation.setTransformation("/com/nordpos/transformations/csv/IMPORT_PRODUCTS.ktr"); transformation.addTransVariable("db.URL", this.app.getProperties().getDBURL()); transformation.addTransVariable("db.driver", this.app.getProperties().getDBDriver()); transformation.addTransVariable("db.user", this.app.getProperties().getDBUser()); transformation.addTransVariable("db.password", this.app.getProperties().getDBPassword()); transformation;
In it, as the reference to the scheme is given, the parameters of the variables necessary for the conversion are also set. If the conversion will be associated with the processing of information from the database, then it is necessary to set the parameters for connecting to it. Then, in the resource
Menu.Root, the button and the call to the script execution panel in the application menu are set.
submenu.addPanel("/com/openbravo/images/database_imp.png", "Menu.SyncImportProducts", "/com/nordpos/transformations/csv/import_products.bsh");
And in the rights of the user's role access to it is allowed.
<class name="/com/nordpos/transformations/csv/import_products.bsh"/>
After restarting the application, it will be possible to directly download data from external files to NORD POS using the Pentaho Data Integration schemes.
Embedded servers
Database server
The default database in Openbravo POS was
Apache Derby , but not the network version, with the possibility of several simultaneous connections at once, but the embedded version from the JDBC driver with only one simultaneous connection. At the same time, in order to connect several POS systems to one database, it was necessary either to install the Apache Derby server, or select another DBMS in which the function for simultaneous connection of several connections was initially supported. Also, using multiple connections was necessary for exchanging data through the Pentaho Data Integration. Since the migration function from Openbravo POS to NORD POS was originally planned for me, I decided to use the embedded version of the
Apache Derby Network Server as a convenient means of updating the database. Now for updating it is enough to copy the folder with the database from Openbravo POS to the folder
.derby-db of the user's directory, register its names in the URL of the JDBC driver, and the update will take place automatically. If another DBMS is used as storage, then the launch of the built-in server can be disabled.
Web application server
Since the main audience of NORD POS will still be simple users who are inexperienced in installing web servers and deploying web applications in servlet containers, similarly to the embedded database server, the
Jetty 9 web server was integrated into the application. It is launched optionally, if it is set in the settings.
Web applications are installed in the
./webapps folder directly in the NORD POS directory; during installation, the precompiled contents of the war file must be unpacked into the folder with the corresponding name. After launching NORD POS, the installed web application will be available according to the name of this folder in the browser line.
More changes and plans
In addition to the above, global changes are enough, there is in NORD POS and not so drastic:
- all libraries have been updated completely, including RXTX replaced with Neuron Robotics Java Serial , and JasperReports updated to 4.8.0;
- support for two-dimensional DataMatrix barcodes and a QR code;
- the ability to use discounts on the entire amount of the check or on individual items;
- new reports;
- syntax highlighting in resources and scripts;
- Faenza icon set and stream theme by default.
It was also planned, but for the time being it was left unrealized, to transfer work with the database to ORMLite, and to make calculations in BigDecimal, just as it has already been done in mobile web applications.
Otherwise, I now want to concentrate more on working out what has already been done and creating extensions to the basis that I managed to create in the first public version of NORD POS (for example, there is already a branch for implementing payment with Bitcoin in it). But at the same time, I am most interested in attracting new participants to work on the project. So, if after reading this article you have questions about automation in trade, you are always happy to help and tell more about how this can be done using the open source NORD POS.