Add a meta-schema to the project (4dbx)

Your application will access the sample officestore database. You must create a meta-schema file based on this database, and you will set the DBPATH environment variable to the directory containing the database file.

About this task

The SQLite database named officestore.db, is located in My Genero Mobile Files/samples/OfficeStoreRes/database-sqlite/. From this database, you create a .4dbx schema file. It will later be used to create items in your Business Application Diagram (4ba).

  1. Select the officestore.db file located in the My Genero Mobile Files/samples/OfficeStoreRes/database-sqlite/ directory and copy it to the database directory of your project directory.
  2. Select Database > Extract Schema....
    The New Meta-schema dialog opens.
  3. Complete the Meta-schema file step.
    1. Click on the File Browser icon next to the Meta-schema file path field.
      The Save File As dialog opens.
    2. Navigate to your project directory and select the database directory. Enter "officestore" in the File name field. Select "Genero Database Schema Files (*.4dbx)" in the Save as type combobox. Click Save.
      Note: Make sure the file created is a .4dbx file, as this is the database meta-schema file for generated applications.
    3. Ensure the Insert the file in the project check box is selected.
    4. Select the Database node.
    5. Click Next.
  4. Complete the Connection information step.
    1. Select "SQLite" as the Database type.
      The Database driver defaults to "dbmsqt".
    2. Click on the File Browser icon next to the Database file field.
      The Save File As dialog opens.
    3. Select the officestore.db file located in the database directory of your project directory.
    4. Click Test Connection to verify that the connection is successful, then click OK to close the connection test dialog.
    5. Click Finish.
      The dialog closes, and the officestore.4dbx file is created.
  5. Add the DBPATH environment variable to the DB-SQLite environment set.
    The application needs to know where the database file sits at runtime. DBPATH is used to specify the path to the file.
    1. Select Tools > Genero Configurations
      The Genero Configuration Management dialog opens.
    2. Under Environment Sets, select "DB-SQLite".
    3. Click the green plus icon.
      The Environment Variable dialog opens.
    4. In the Type combobox, select "Directory List".
    5. In the Name field, enter "DBPATH".
    6. In the Value field, use the File Browser to locate the path My Genero Files/samples/OfficeStoreRes/database-sqlite/.
    7. Click OK.
      The DBPATH environment variable is added to the DB-SQLite environment set.
    8. Ensure the DB - SQLite environment set is selected (checked).
    9. Click OK.
      The Genero Configuration Management dialog closes.
  6. Open the Project node and right-click on the Application node. Select Advanced Properties from the menu.
    The dependencies for the Config, Database, Entities, and Resources nodes have already been set. Selecting these nodes as dependencies ensures that files they contain will be accessible for inclusion in your application.
  7. Select the fglprofile file located in the My Genero Mobile Files/samples/OfficeStoreRes/database-sqlite/ directory and copy it to the config directory of your project directory.
    The FGLPROFILE file contains the configuration information to access the sample databases.
  8. In the Advanced Properties dialog, add an FGLPROFILE environment variable to the Environment Variables page.
    1. Select Environment Variables.
    2. Under the User Variables section, click the green cross icon.
    3. In the Environment Variable dialog, add the FGLPROFILE user variable. Specify a type of "File List", and have the Value point to the location of the FGLPROFILE file provided in the config directory of your project directory.
    4. Click OK to close the Environment Variable dialog.
    5. Click OK to save and close the Advanced Properties dialog.
  9. Save the changes to your project.