Data sources and lookups overview
A data source is external data that can be accessed and used by an App. For example, you can search a data source, and return the results to a page. Apps such as the Warehouse App come with data source connections to Compliance Engine data sources. You can configure any number of data source connections, and map or bind them to the controls that will use them. Numerous types of connection are available.
All of this is configured and managed using the Data Sources panel. On the canvas, icons show you that something is bound to a data source, and the actual mapping can be done using and the mouse.
Note for Composer 6 users
Architecturally, compared to previous versions, Composer 8 adopts a new approach to data source integration. It is now design driven not data driven. Previously, you created controls from data elements. Now you add controls, and then bind them to their data source. The same design-driven project can later be bound to different data sources without any complex migration.
This topic goes on to cover general aspects of data sources (the Data Source panel and different connection types). If you are looking for content on a specific task, the following are available:
- Add a data source connection covers adding a new connection in the Data Sources panel. It uses a Microsoft SQL Server connection as an example.
- Map data source searches (Data Engine Lookup) covers adding a 'search' control that then populates other controls with the results of a search on a specific data source (like Search for Order # in the Warehouse App).
- Map a Dropdown to a data source covers mapping a Dropdown control to a data source, so that its contents come from the data source.
- Use lookups with tables covers populating a Table control from a data source lookup.
- Use a data source join covers populating a Table control with a table relationship, such as 'order header 1:1M order detail'. Joins let you create relationships between tables in your data source, and display the result.
- Use a stored procedure covers incorporating RDBMS stored procedures in Apps. When you link to a stored procedure, Designer creates an XML representaton of its IN and OUT parameters, so that you can map to them.
Structural changes to data sources used by existing connections
Once a data source connection exists, if the structure of the data source itself then changes, for example a new column is added to a database table, you may have to add the connection again. In such cases, at runtime, Transtream will return and log an error stating that there is no key set for the update in the data source. Changes to data sources should be investigated for their potential impact on existing Apps. For example, if you have Data Engine Modify actions (on Buttons) that target a data source that has changed.
The Data Sources panel's UI
The Data Sources panel expands and collapses – use Show Details/Hide Details. The left (or collapsed) side lists your connections (data sources). Each connection has an appropriate nesting structure. For example, for a database, database > table > column. Columns are also distinguishable by having the icons for mapping purposes. If a column also has a icon against it, it means the column is used by a search control (a Textbox with Action set to Data Engine Lookup). Map data source searches (Data Engine Lookup) covers this scenario.
The Data Sources panel includes the following buttons:
- + New Connection to add a new data source connection to the list.
- to remove the selected part of the data source.
- to remove all mappings between the selected item and controls in the project.
When expanded, the right side shows details (and is labeled) for whichever part of the connection is selected on the left. Hence, for a database, this can be the connection, database, table, or column. These four are illustrated next. Where possible, fields list possible choices in the data source and support 'contains' type ahead.
When labeled Connection Details You have:
|
|
When labeled Data Source You have:
The Name fields for both Add buttons support type ahead discovery (‘contains’ not just ‘starts with’). Start typing to display possible choices. |
|
When labeled Table You have:
|
|
When labeled Table Column You have:
|
Connection Type
Connection Type lets you choose from several types of data source grouped under categories that relate to the their location how they will be accessed:
- Data Engine. Sources that are on the same server as the Compliance Engine (Logistics Server).
- HubCapp. Sources that are remote, and accessed via a HubCapp Server and HubCapp Data Agent communication.
- Beneship. This includes a connection for the Magento eCommerce platform.
- Url. If the data source is a Url or Form POST submission.
Each connection type just gathers the detail needed to establish that connection, and you have to to verify. Once connected, if relevant, you can select from data drawn directly from the source (a list of databases for example). However, Connection Type reference details each connection type, if required.
Add a data source connection covers adding a new connection in the Data Sources panel. It walks through adding a Microsoft SQL Server connection.