Projects/Projects:Datasource Based Tables/Specifications
Contents |
Datasource based Tables - Functional Specifications
Overview
Currently Tables are based on tables or views that have to be defined in the database. This project will add a new option: creating tables based on a datasource defined by the user.
This will give more flexibility in the way data is fetched. This flexibility could be used to improve some performance problems that affect some Pick and Execute windows.
Purpose
The aim of this project is allow defining Tables based on Datasources defined by the user.
Design Considerations
Two different approaches have been considered:
- Selecting the datasource in the header tab of the Tables and Columns window. This approach allows defining the columns that the datasource will provided when data is fetched from it.
- Selecting the datasource in the Tab tab of the Windows, Tabs and Fields window. This might be a less confusing way of selecting the datasource that will feed the tab, but would require to define references at field level, which currently cannot be done.
Java classes are automatically generated for Tables based on tables and views defined in the database. Those classes should not be generated for Tables based on datasources.
If the datasource is called with an ADD, UPDATE or REMOVE operation, the datasource can be able to compose the data and insert, update or remove data from several tables.
Proposed flow
In order to define a table based on a datasource, the user should follow these steps:
- Define a Java based datasource (see http://wiki.openbravo.com/wiki/Datasources).
- Create a new entry in the header tab of the Tables and Columns window. There will be a combo box to select the source of the Table, which can be a physical table (or view) or a user defined datasource.
- If the user selects the second option, a combo with all the defined datasources will be shown. The user will have to select the datasource that was defined in the previous step.
- After that, the user should define the columns that will be retrieved from the datasource when data is fetched from it.
- Once the table and its columns are defined, the user should be able to define the new tab in the same way that with physical table defined Tables.