App Studio Data Sources Pane
The Data Sources Docking Pane displays a tree view listing all the Data Sources and Custom Views you have defined in your Project. The Data Sources Pane is one of the App Studio main window docking panes.
A Data Source defines a database table which will store data for your Digitise app locally on the mobile device. The Data Source can be mapped to data items within a remote database, to a Web API, to a web service, or to Microsoft Outlook Contacts and Appointments to allow data to be downloaded and uploaded by your app. Only the data items required by your app need to be mapped, so that you don't have to download unnecessary information to the device. Alternatively, you can create a Custom Table Data Source where you define the columns within the database table yourself. Custom Tables can be used to hold data either downloaded from the back office or entered locally on the device but can't be used to upload data back to update back-office systems. However, where you are using a Custom Table and you want to upload data back to the back office you can define a separate Data Source to handle the upload. In addition, Custom Tables can be used to combine data from different remote sources within a single database table on the device, whereas other Data Source types must be mapped to a single remote source.
A Custom View defines a virtual table which can be used to hold data from the real tables in order to present data in a different way than it is stored in the real tables. For example, you can use a Custom View to display a subset of records from a table or as another way to combine data from different tables in a single ListView etc.
Each Data Source and Custom View in the tree view can be expanded to display all the data items defined or mapped for the Data Source or View.
Items are grouped under four headings within the tree view:
-
Data Sources - ADO databases and web services
-
Custom Tables - Developer-defined tables
-
Custom Views - Developer-defined views of the locally held data source tables
-
Predefined - PIM Contacts and Appointments
Items are listed within each group in alphabetical order but you can change the order of Custom Views if required (see below).
Data Items defined as Primary Keys in ADO Database, awi Web Service or Custom Table Data Sources are identified in the tree view by a small yellow key displayed over the icon to the left of the data item name in the tree view, e.g. . Foreign Keys have a similar icon but coloured grey: .
Single-click on an item in the tree view to display the Properties for that item in the Properties Pane.
Double-click on a Data Source or data item within the Data Sources Pane to display a graphical representation of the remote database, Web API, web service, Contacts or Appointments elements in the Workspace, called a Schema diagram. This diagram shows the data elements that are currently available to be included in your app and indicates relationships between them. You use the Schema diagram to choose which actual data items you want to include within a Data Source by selecting the items to include from the diagram.
Schema diagrams are available for all Data Source types except Custom Tables and Custom Views.
If you want to change the elements displayed on the Schema diagram right-click on the Data Source name in the tree view and choose Update Schema from the context menu displayed (see the context menu item descriptions below for more details).
The right-click context menu provides access to various features relevant to the item clicked on. Possible menu items are:
Clicking on an area of white space or on one of the 'headings': Data Sources, Custom Tables, Custom Views or Predefined:
New Data Source
Add a new Data Source.
Project Properties
Display the Project Properties in the Properties Pane.
Clicking on any other item:
Open
Opens the Schema diagram, appropriate to the item on which you clicked, in the Workspace or brings it to the foreground if already displayed, so you can view and edit it if required. Displays the Properties for the item in the Properties Pane.
Not available for Custom tables or Custom Views.
Update Schema
This option allows you to change the elements which will appear on the Schema diagram for the Data Source or view and edit the structure of Custom Tables or Custom Views.
For ADO Databases, it allows you to change which tables in the selected database are available to your app. You can add tables which were previously not included in your app or remove selected tables you no longer want to use in this app.
For Web APIs, it redisplays the schema diagram, showing the tables and data items for the Web API, allowing you to change the tables and data items available for use in the app, if required.
For SOAP Web Services, it allows you to change or update the WSDL definition for the Data Source.
For RESTful Web Services, it allows you to edit the parameters and the structure of the data within the parameters for the HTTP Post.
For awi Web Services, it allows you to change the URL of the web service, choose a different awi Transaction and change the format of the data to be sent to the specified Transaction.
For Custom Tables and Custom Views, it allows you to view and edit the columns you have defined within the table/view and for Custom Views it allows you to edit the SQL statement used to extract data for the View.
For Predefined Data Sources, the option is available at the Outlook node but it does nothing as these Data Sources cannot be changed.
Delete
Deletes the current item.
Create as Custom Table
Create a new Custom Table containing a column for each data item below the current element. The New Custom Table dialog box will be displayed showing the suggested column values allowing you to provide a name for the new table and edit or delete any of the columns if required.
This option is not available for Soap and Restful Web Service Data Sources but is available for existing Views.
Create as Custom View
Create a new Custom View containing a column for each data item below the current element.
A Custom View allows you to select a set of records from one or more of the local database tables used to store your app's data on the device and display and interrogate the resulting record set without having to physically store the records in a separate Custom Table.
Choosing this option will create a View which effectively mirrors the currently selected Data Source and which, if unmodified, will contain the data from all columns in all records of that Data Source.
The option displays the New Custom View dialog box which allows you to configure the Custom View. The dialog box will include a basic SQL Select Statement defining the record set and a list of data items which match the columns of the Data Source. You can edit the configuration as required, if you want to refine the record set contained in this View.
Because a Custom View only provides a view of records held locally on the device, you can create a Custom View from any Data Source.
You can use Custom Views to filter the record set held in a Data Source without affecting the actual records in that Data Source. You can also combine data from multiple Data Sources without having to store the combined data in its own separate Custom Table. Note that records cannot be edited, uploaded or downloaded using a View – to do this you need to use the Data Source tables directly.
Add XPath
Allows you to define your own XPath elements within a Web Service Data Source, in order to provide custom elements to map to Controls.
Generate CREATE TABLE Script
Generates a SQL script which if executed will create a copy of the current Table, e.g. within SQL Server Management Studio. The Script only replicates the table and doesn't populate the table with any data.
Not available with Custom Views.
Open in Data Source Tools
Allows you to perform some simple investigations into connections to ADO Database and Web Service Data Sources from within App Studio without having to resort to more complex tools.
Not available with Custom Views.
Move Up
This item is only enabled if you right-click on a Custom View, which isn't the first View in the tree, and allows you to change the position of the selected Custom View within the tree view by moving it up one position.
At runtime the Custom Views are created in the order in which they are listed in the tree view which may cause an issue if one View refers to another View which hasn't yet been created. This item, in conjunction with the Move Down menu item below, allows you to change the order of the Views to avoid this issue. You can also move Custom Views up within the tree by selecting a View and pressing Ctrl+Up Arrow.
Move Down
This item is only enabled if you right-click on a Custom View, which isn't the last View in the tree, and allows you to change the position of the selected Custom View within the tree view by moving it down one position.
At runtime the Custom Views are created in the order in which they are listed in the tree view which may cause an issue if one View refers to another View which hasn't yet been created. This item, in conjunction with the Move Up menu item above, allows you to change the order of the Views to avoid this issue. You can also move Custom Views down within the tree by selecting a View and pressing Ctrl+Down Arrow.
Properties
Display the relevant Properties for the current item in the Properties Pane.