Structured projects

A structured project starts with a default logical structure in the Projects view and a default physical structure on disk.

The exact structure depends on the type of project. Is it a desktop or mobile project? Are you generating your application using the Business Application Modeler (BAM)?

Once the project is created, you are responsible for saving new files into the nodes and directories. This topic provides you with guidelines for using the logical and physical structures provided.
Note:

These are recommendations. You can modify the structure or create your own rules regarding where you save your files. Such modifications may require you to examine and set external dependencies appropriately.

The logical structure in Project Manager

When you create a structured project, the Projects view displays a default structure consisting of group, application, library, and packaging nodes.

Figure 1 shows the default structure of a new Genero BAM Desktop project.

Figure: Default structure of a BAM desktop project


Note:

The icons on the Applicationflow, Config, and Resources nodes indicate that they are excluded from the build process.

For information about the Application_GAR package, see Package and directory nodes (GAS).

Figure 2 shows the default Projects view for a new Genero BAM Mobile project.

Figure: Default structure of a BAM mobile project


For information about mobile packages, see Package and directory nodes (mobile).

Figure 3 shows the default structure of a desktop project.

Figure: Default structure of a Desktop Project

Screen shot of Projects view displaying new Desktop Project.

For information about the Application_GAR package, see Package and directory nodes (GAS).

Table 1 provides guidelines regarding which files to save in which node.

Table 1. Default nodes in a structured project
Node What should it contain
Application This application node should contain all application source files. At a minimum, it must contain the source file that has the MAIN function.

It contains a child configuration node, which (by default) has the same name as the application node.

This node is created for non-BAM projects only.

Applicationflow This library node should contain the Business Application diagram (.4ba ).

This node is created for BAM projects only.

Config This library node should contain the configuration files, such as fglprofile.

The exception is external application configuration files, used with the Genero Application Server and the Genero Browser Client. External application configuration files should be saved in the Resources node.

Database This library node should contain the database meta-schema files.
  • For non-BAM projects, meta-schema files has a .4db extension.
  • For BAM projects, meta-schema files have a .4dbx extension.
Entities This library node should contain entities, such as form files.
  • For non-BAM projects, form files are created or imported and have a .4fd extension.
  • For BAM projects, form files are implemented from the Business Application diagram. The extension of the form file will depend on the form's function. For example, CRUD forms have a .4fdm extension.
Resources This library node should contain resource files. Genero BDL resource files are XML files that define user interface items:
  • presentation style files (.4st)
  • toolbars (.4tb)
  • topmenus (.4tm)
  • action defaults files (.4ad)
  • start menus (.4sm)

Resource files also include the external application configuration files (.xcf) used by the Genero Application Server.

Main_prg This application node must contain the implemented program file (.4prg) from the Business Application diagram.

It contains a child configuration node, which (by default) has the same name as the application node.

This node is created for BAM projects only.

Test

This application node should contain any test scenarios (.4gl).

For a new project, this node is empty. Dependencies for the node include the application node of the application being tested.

It contains a child configuration node, which (by default) has the same name as the application node. The Command line arguments property of the configuration must include the minimum command line arguments necessary for running a test scenario.

For more information, see GUI Testing.

The physical structure on disk

You provide the location of the project's root directory when creating a new structured project. The wizard creates several subdirectories within the root directory, with each subdirectory intended for a specific set of files.

For example, Figure 4 displays the directory structure on disk for a structured BAM desktop project created in the MySandbox\bam_desktop_project\ directory.

Tip:

To see the layout of directories on disk, right-click on a file or node in the Project Manager and select Locate in File Browser.

Figure: Default file structure on disk for a BAM desktop project


The specifics of the directory structure can vary based on the project type. Table 2 describes the intended content for each directory.

Table 2. Default directories for a structured project
Directory Files to be saved to this directory
appflow The Business Application diagram (.4ba).

The new project wizard creates this directory for BAM projects only (desktop and mobile).

bin Compiled executables.
config Configuration files: fglprofile, application configuration files (.xcf).
database Meta-Schema files; database files (such as a SQLite database) when creating mobile apps.
databaseMaintenance Database creation or update scripts.
dbbin Default target directory for database creation or update scripts.
distbin Genero archive files (.gar), package files, files to support OTA installation of mobile projects.

The new project wizard does not create this directory; Genero Studio creates this directory after building the first package.

images Image files, .ttf fonts and the mapping of these fonts (image2font.txt).
resources Resource files, to include the Genero BDL presentation (.4st), toolbar (.4tb), topmenu (.4tm), startmenu (.4sm), and action defaults (.4ad) files.
src Genero source files, to include source files (.4gl) and form files (.per, .4fd, .4fdm, and so on).
testbin Default target directory for GGC test scenarios.
tests GGC test scenarios (.4gl).
webcomponents Web component supporting files, such as the .wcsettings file and associated image files.

Managing TTF fonts

Structured projects are designed to manage the deployment of customer .ttf fonts and the mapping of these fonts. An empty image2font.txt file is written to the images directory, and the Images node has both *.ttf and image2font.txt listed in the list of files to include (set by the Include Files property).

For additional information, see the Fonts section in the Genero Business Development Language User Guide