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:
- Within Build.One
- Described below in this article.
- Outside of Build.One in an external application
- For that please have a look to SelfHdl/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
- Declare the table-definition:
- Modify the
.restapplicationsettings
insrc/backend
- Create a property
database.definitionFiles.tables
if it doesn't already exist - Open
wurmel
screen from the screen repository - Use the following command to create the table definitions, following we have an explanation of the parameter
"database": {
"definitionFiles": {
"tables": "DB/it4main/table-definitions-swatdb.xml,DB/<your_db>/table-definitions-<your_db>db.xml"
}
}
The swatdb entry is mandatory.
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", ?).
- Check if table-definition file was generated
- Click on container overview and open a shell for the pasoe container
- Execute
cd workspace
cd app
cd backend
cd DB
cd <coressponding db folder>
chown 33333:33333 *
- 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 Workspaces
Back to Use Cases
Back to Home Page