Contents
Application Development Overview
The xTuple application suite contains the following applications:
PostBooks: a free, open source package for Accounting, ERP, and CRM
Standard: a more feature-laden package that shares much of the PostBooks source code
OpenMFG: the complete feature set package provided by xTuple
OpenRPT: a free, open source report writer that can be used on its own or embedded in other applications and is embedded in PostBooks and OpenMFG
CSVimp: a free, open source tool for importing data into a database from comma-separated text files
Updater: a free, open source tool for upgrading databases by applying SQL statements to the database and importing reports created with OpenRPT
The source code for the open source applications above is available through the PostBooks project on the SourceForge website. The additions to PostBooks which implement the Standard and OpenMFG features can be obtained from xTuple's source code repository.
This document outlines basic information you need to know to get started with xTuple application development. Details on setting up your development environment are described in xTuple's DevelopmentEnvSetup.
Source Code Management
The source code for the xTuple applications is managed using either Subversion (SVN) or the Concurrent Versioning System (CVS). The latest versions for each of the open source applications can be obtained directly from the source code repositories.
xTuple maintains a separate CVS server accessible to VARs and paying customers for the Standard and OpenMFG additions. The contents of this server are updated at the time of each release. Access to this CVS server requires authentication with a username and password.
Both SVN and CVS can be used from the command line or through GUI tools. Most Linux versions come with a command line version of CVS installed by default and some come with SVN as well. On the Macintosh CVS command line tools are installed as part of the Xcode software development environment; newer versions of Xcode also install SVN. For Windows you'll need to get CVS and SVN on your own. There are several GUI tools for accessing CVS and SVN for the various platforms, such as WinCVS (http://www.wincvs.org) on the Windows platform and RapidSVN.
OpenRPT in Subversion
The code base for OpenRPT, the Open Report Writer and Open Report Renderer (RPTRender) and other support tools, is under Subversion control. This project is housed at SourceForge.net (http://sourceforge.net/projects/openrpt) where you can find binary and source downloads, project management tools, and information on how to access the Subversion repository (http://sourceforge.net/svn/?group_id=132959).
There are two modules in the OpenRPT repository: openrpt and docs. The openrpt module is the core code for the OpenRPT application. The docs module has the documentation that we have created. To compile OpenRPT, only the openrpt module is required.
Once you have downloaded the source code for OpenRPT, you may compile it using Qt and an appropriate C++ compiler.
Qt is required to compile OpenRPT. To successfully compile OpenRPT, you must download either a Qt binary package or download and build a Qt source package.
PostBooks in Subversion
The code for the core PostBooks application is stored in a Subversion repository managed by SourceForge. The two key modules are xtuple and xtupleserver. The xtupleserver module contains all the database-related scripts used during development and for the upgrades from each database version of the application. The xtuple module contains all the C++ code and supporting files required to actually build the GUI application.
The xtupleserver module has three significant sub-folders:
dbscripts: This directory holds the stored procedure, metaSQL, view, and trigger definitions used by the PostBooks application. These can be changed and loaded directly into a database. This is where the majority of the PostBooks business logic is contained.
updateScripts: This directory has one subdirectory for each past release and one for the next upcoming release. Each of these subdirectories holds a collection of SQL scripts that define changes to the database required for the following release. Some scripts might change the database structure while others might add or delete data or be copied from the dbscripts directory.
packages: This directory holds the upgrade packages for migrating a database from one release of the application to the next. Each package is built either from a corresponding updateScripts directory or a collection of previous update packages, plus some additional support files needed to perform operations in the correct sequence and load modified reports.
The xtuple module contains all the GUI client code for the PostBooks, Standard, and OpenMFG applications. The most significant of subdirectory is named guiclient. This is where the majority of the source code is located for the application. In addition, there is the widgets directory, which holds the source code for custom widgets used in the application and as plugins for the Qt Designer application. See DevelopmentEnvSetup for details on how to compile the xtuple module.
Both Qt and the OpenRPT code are required to compile the xtuple module. To successfully compile PostBooks or OpenMFG, you must first download and install Qt and download and compile OpenRPT.
In addition to the application source code, the xtuple module contains report definitions, translation files, and other support files. These files are not compiled but are an important part of the xTuple applications.
Updater in Subversion
The Updater tool is used for loading packages which update a databases schema and data. The command and loader directories contain all the code for the Updater tool. In order to compile the updater you will need to have the xTuple client code.
There is some initial work for a client to create update packages however it is incomplete at this time.
CSVimp in Subversion
The CSVimp tool is used for importing data into a database from a CSV file. Currently three modes exist: Insert, Append, and Update; however only Insert is functional at this time.
Qt Development Tools
Overview
Qt is an application framework written in C++ and used to develop multiplatform applications. By using an application framework, we are able to build applications without the need to worry about platform or system specific coding or scenarios. In addition, Qt provides a number of additional tools and libraries that are often needed by applications. Some of the tools provided, like Qt Designer, allow the creation of GUI screens with a WYSIWYG tool, while others, like Qt's Linguist, allow you to create and support multilingual applications. On top of all this, Qt's framework also helps speed up the development process.
More information about Qt and its features and tools can be found at Trolltech's website: http://www.trolltech.com.
Designer
Qt's Designer application allows you to create the forms or GUI screens required for a WYSIWYG environment. Its drag-and-drop functionality makes it easy to create layouts without any coding required. Forms created using Designer are saved with a .ui extension. Compiler tools are then used to convert the .ui form into a C++ file. The generated C++ files can then be sub-classed to add the required business logic to make them functional.
Linguist
Qt also allows you to load language translation files into an application at run-time. The result is that application text (i.e., screen titles, field labels, help files, etc.) will be displayed in the language of the translation file. Qt handles this internally by using a tr() function. This function wraps any literal text found in an application and allows for dictionary lookup and replacements to be performed at run time. These tr()'s are also used to identify text needed to build the translation files.
There are two files used for the translation process. The first is a .ts file, and the second is a .qm file.
The .ts file is the translation source files. This file is an XML based file which can be updated and edited using the lupdate and Qt Linguist tools. Every instance of text in an application that is translated has its own context, source, and translation field. The context changes usually from screen-to-screen and allows you to have two identical texts translated differently in different contexts. The translation field includes the text you want to show in place of the source text for a given context.
The .qm file is created from the .ts file using the lrelease tool and is a more compact and efficient file used by the application at run-time. Once the .qm file is generated, the OpenMFG application can be made to use it simply by using the system's Locale configuration. In practice, when a user logs into OpenMFG using a specified Locale, the language (i.e., translation) corresponding to that Locale will be displayed. In addition, the application supports the placement of a translation file called default.qm in the same directory as the executable. If a system is set up this way, OpenMFG will use that default file and no additional configuration will be required.
