Logo

    Home

    Documentation

    Use Cases

    Training

    Applications

    Release Notes

    OE-DB Table-Definition files

    OE-DB Table-Definition files

    icon
    Short Description of the Use Case
    • 1. Summary
    • Technical Details
    • 2. Result
    • 3. Step by Step Guide
    • 4. Documentation

    1. Summary

    In this Use Case we explain how you can create or change the Table-Definition files from your OpenEdge database within Build.One, which are necessary to manage and create new SelfHdls for all the records, which are created through the Build.One application.

    There are two use cases:

    1. Within Build.One
      1. Described below in this article.
    2. Outside of Build.One in an external application
      1. For that please have a look to SelfHdl/GuID management in external applications with OE databasesSelfHdl/GuID management in external applications with OE databases

    Technical Details

    Part of SWAT Framework's handle format is the table ID, namely, the first 3 digits portion, which has the function to specify which table contains the corresponding record. To make use of the handle system, the application's tables need to be registered in the framework.

    The pasoe config-xml contains a field 'TableDefinitionsDumpFile' in which the name of the XML-File is specified. This XML file contains a record for each table.

    To create/update this File, the Akioma/Swat/Util/buildTableDefinitionFile.p procedure has been implemented to register the tables of a given database.

    2. Result

    You’ll have the necessary Table-Defintion files included in your code repository, which are matching the tables of your OpenEdge database

    3. Step by Step Guide

    1. Declare the table-definition:
      1. Modify the .restapplicationsettings in src/backend
      2. Create a property database.definitionFiles.tables if it doesn't already exist
      3. "database": {
            "definitionFiles": {
              "tables": "DB/it4main/table-definitions-swatdb.xml,DB/<your_db>/table-definitions-<your_db>db.xml"
            }
          }

        The swatdb entry is mandatory.

    2. Open wurmel screen from the screen repository
    3. Use the following command to create the table definitions, following we have an explanation of the parameter
    4. Parameter name
      Type
      Description
      pcSourceFile
      CHARACTER
      Already existing tableDefinition-file, in our example empty because we will create the first time a tabledefinition A file containing the serialized representation of a dataset containing the currently registered tables. Can also point to a non-existing file, in which case it will be ignored.
      pcTargetFile
      CHARACTER
      A valid location in the file system, where the result of the procedure will be exported to an XML file. The resulting file, similar to the source file, will be the XML serialization of the dsTableDefinition dataset.
      pcDatabaseList
      CHARACTER
      A comma-separated list of databases which will be processed. If unknown or empty, it will be ignored and it will import the first database in the connection list.
      piStartingId
      CHARACTER
      An integer signifying the hexadecimal representation of the first available ID. If unknown, it will automatically start the count past the SWAT-reserved IDs. Because of this, it is recommended that any calls to the procedure are done with the unknown value for this parameter.
    RUN Akioma/Swat/Util/buildTableDefinitionFile.p("", "/workspace/app/backend/DB/customerdb/table-definition-customerdb.xml", "customerdb", ?).
    1. Check if table-definition file was generated
    ⚠️
    If you need to change the file you need to modify the rights of the file from root to editable
    1. Click on container overview and open a shell for the pasoe container
    2. Execute
    cd workspace
    cd app
    cd backend 
    cd DB
    cd <coressponding db folder>
    chown 33333:33333 *
    1. Now is the table-definition file editable for you

    4. Documentation

    To find more information, you can check the following documentation.

    DB CLI - Working with Databases in Development WorkspacesDB CLI - Working with Databases in Development Workspaces

    Back to Use CasesUse Cases

    Back to Home Page

    Logo