Development Project Structure
IMPORTANT: THIS IS A BETA VERSION
It is under active development and may contain unstable or incomplete features. Use it at your own risk.
Overview
This section describes the structure of an Etendo development project. Etendo has a tree directory structure that logically divides different core components (XmlEngine, SQLC, HttpBaseServlet) and WAD (Wizard for Application Dictionary) from Etendo itself (forms, reports, call-outs, combos, processes and so on).
Project Structure
The following is a snapshot of the Etendo development project structure.
etendo
|-build
|-config
|-docs
|-legal
|-lib
|-modules
|-referencedata
|-src
|-src-core
|-src-db
|-src-gen
|-src-test
|-src-trl
|-src-util
|-src-wad
|-srcAD
|-temp
|-web
|-WebContent
Build
The build directory contains the classes sub-folder where all of the compiled Java classes are copied to after executing the ant compilation build tasks . Also, the Java source code that is generated from the applications .xsql files during the sqlc phase of the project build is written to the javasqlc sub-folder.
config
The config directory contains the Etendo configuration files. The config directory is where the setup script is downloaded to and executed from. Other configuration files in the config directory include the application properties file, Openbravo.properties, which is generated after running the
./gradlew setup process, and logging and scheduling properties files (log4j.lcf and quartz.properties). In this folder, there are several .template files (Openbravo.properties.template, Format.xml.template, log4j.lcf.template, etc), which need to have their corresponding files (Openbravo.properties, Format.xml , etc) for Etendo to work correctly.
docs
The docs directory contains Etendo's API documentation, which can be generated using the Javadoc tool. This documentation can be generated by executing the command ant generate.java.doc.
legal
The legal directory contains a collection of licenses for the various libraries that Etendo utilizes.
lib
The lib directory contains all of the Java jar libraries used throughout the application. It is split into build and runtime, build containing the libraries used during compilation of Etendo, and runtime containing the jar files that are used during the application's execution.
Modules
The modules directory is where any modules that you may have installed or developed are located. Each module has a top level directory named according to the Java package specified in its module description, and then below, a similar layout to the core development structure, which is in itself a module. When developing a module in the application dictionary, when the module is exported, it will be exported here to the modules directory.
Next, there is the structure of a sample module.
|-modules
|-com.etendoerp.examples.helloworld
|-src
...
|-src-db
|-database
|-model
|-sourcedata
|-web
...
|-lib
|-runtime
|-build
In Etendo, there are several modules inside the modules/folder which are now part of the standard distribution.
referencedata
The referencedata directory contains implementation specific reference data such as accounting structures, reports, product lists or price lists etc. Reference data modules are a convenient way to load reference data into Etendo. More information about this can be found here.
src
The src directory is the top level directory of the main source code base for the Etendo project. It contains the source code for all of the components that make up the core Etendo classic web application windows, and also services, including forms, reports, call-outs, combos, Data Access Layer (DAL), processes, manual windows, xsql and HTML files, reports etc.
|-src
|-org
|-etendo
|-authentication
|-base
|-dal
|-erpCommon
|-ad_actionButton
|-ad_callouts
...
|-ad_reports
|-erpReports
|-scheduling
|-services
The ad_ prefix (in erpCommon folders/packages) denotes Application Dictionary. The directory name endings are pretty much self-explanatory. The difference between ad_reports and erpReports lays in the way we access a report within the application. If it is accessible directly through the menu, then it should be in ad_reports. On the other hand, some windows (Invoices, orders, etc.) have a Print icon in the toolbar, which generates a report. These reports should be stored in erpReports.
src-core
The src-core directory contains the source code of the core components: XmlEngine (View), SQLC (Model), HttpBaseServlet (Controller) and ConnectionPool.
|-src-core
|-src
|-org
|-openbravo
|-base
...
|-HttpBaseServlet.java
|-HttpBaseUtils.java
...
|-data
|-Sqlc.java
|-database
|-exception
|-utils
|-xmlEngine
src-db
The src-db directory contains the dbsourcemanager library. It also contains the database directory which is where all of the model data (structure: tables, constraints, procedures and triggers), sample data (Etendo data such as products, business partners and so on) and source data (windows and tabs metadata) in plain *.xml files are located.
src-util
The src-util folder contains the diagnostics tool, the buildvalidations, and the modulescripts. The diagnostic directory contains the code/tool to execute a diagnostic test on your configuration and report any problems or items you have not configured correctly. The diagnostic tool is executed using
the ant diagnostic task from the root Etendo directory. You can find more information about what build validations and modulescripts are, and how to create one, here.
src-gen
The src-gen directory contains the DAL model objects generated from the Etendo model (tables, columns, references etc.) during the ant generate.entities task.
src-test
The src-test directory contains the test source code, such as JUnit test and suites.
src-trl
The src-trl directory contains the source code of the code which generates entries in the database for every translatable string in html, jrxml, fo and srpt files.
src-wad
The src-wad directory contains the source code of WAD (Wizard for Application Dictionary), which is used to generate classic window files from Application Dictionary window definition information.
srcAD
The srcAD directory contains all of the automatically generated code from the Application Dictionary.
temp
Temporary folder containing files which are not committed to Mercurial. It is created only when needed, for example, when obx files are downloaded from the Central Repository.
web
The web directory contains all of the web resources such as cascading style sheets (CSS), Javascript code, images and pop-up windows.
WebContent
Is the web output folder for IntelliJ, the output folder defines the webapp used by the IntelliJ Tomcat integration. Contains WEB-INF (with web.xml and other important files) and META-INF.
This work is a derivative of Development Project Structure by Openbravo Wiki, used under CC BY-SA 2.5 ES. This work is licensed under CC BY-SA 2.5 by Etendo.