Data surfing allows you to easily navigate a tree of related data by resolving foreign keys and loading data from a target table. For example, you might start with a contact, then you could find the contact's addresses or find any transactions that the contact has been involved in.
Data Surf makes it easy for you to achieve this task, without having to write repetitive boiler plate code, which can lead to mistakes. Simply create a new surf in the database that you want to surf, and specify the starting point. Then, from there, click on the row that you want to find related data for, and you can easily find the linked data.
As you surf, a 'graph' is created which lets you track where you have been and which way the loaded entities relate. You can select any node to view its data, or you can color nodes or groups of nodes to make your graph clearer, or you can remove a node or group of nodes easily. You can also re-load the data related to a node (useful when fixing broken relationships between data), and then save your surf and re-load it later.
If you want to apply your surf to a new set of data, you can use the re-targeting feature to re-load the graph based on a new initial data set. You can also re-target a graph while loading it, effectively creating a 'surf template'.
You can even export the image of your graph so that you can include it in reports.
• Data Surf enables users to view data in a table and also see how that data relates to other tables.
• Export your customized graph at any resolution
Creating a new surf
• Use the 'new surf' option on the toolbar or menu
• Right click on a database in the databases pane and click 'Start Surfing...'
• Right click on a table in the object browser and click 'Start Surfing...'
1. After doing one of those, the new surf dialog appears.
Some of the panes may not be present (for example, if you right click on a table in the object browser, then the new surf dialog does not ask you to specify the database or table).
2. The first pane allows you to select the database in which you want to surf:
3. After entering the server, choosing your authentication method and choosing a database, click on 'Next'. You can also click on 'Find Local Servers' to find any additional local servers on your network. Note that Data Surf starts a search for servers when it first starts up, so it is usually not necessary to find additional local servers.
4. After clicking next, we select the table that we want to use as our surf start point:
5. We can type in the search box at the top to narrow down the list of shown tables. When we have selected a table, we then click 'Next', and we are given the opportunity to enter criteria for the data in the table:
6. We can select a column, and enter a match value, or we can uncheck the 'Select rows based on criteria' check box in order to select all rows from the table. Note that the match is always an exact match, in that what you enter in the box then becomes part of the query run against the server.
7. To select a node, simply click on it.
8. When the node is selected, the rows which are loaded for that node are displayed in the grid in the lower half of the display. The selected node is highlighted using a dashed line surrounding it:
9. To find related data for one or more rows, you can either make a selection in the grid and use the navigation control to the left, or right click on a row or selection.
10. When right-clicking, we are shown a menu allowing us to find parent rows or child rows.
o Parent rows are ones where a foreign key points from the current table to the other table. Child rows are ones where a foreign key points from the other table to the current table. For example, consider a hierarchy Towns -> Streets -> Houses. Towns contain many streets, and streets contain many houses. If we were exploring from a Street row, then Towns would be parent rows, and Houses would be child rows.
11. The menu that is shown is as follows:
12. As we hover the mouse over individual tables, a tooltip shows us the name of the foreign key being followed, the name of the related table, and the column names that match.
13. Using the navigation control on the left hand side is very similar. We can make a selection of single or multiple rows, and then use the navigation list on the left to navigate to those rows:
14. When navigating based on multiple rows, multiple new data nodes are created in the graph. This is based not on the number of selected rows, but the number of unique key values in the selected data. For example, in the above picture, 5 rows are selected, but they all have a PersonType value of 'EM'. A key which was followed based on that column would result in one data node.
15. To change the color of a node, we right click it, and using the 'Color node' option, we can either select a pre-defined color, or select a user-defined color.
16. As we roll over the colors, the node shows a preview of itself in that color. If we select the 'Color node and all dependents' option, then as we roll over the colors, all nodes that that will be colored show a preview of themselves in that color, as follows:
17. Similarly to coloring nodes, we can remove nodes simply by right clicking on them. To remove an individual node, select the 'Remove Node' option. To remove a node and all its dependent nodes, select the 'Remove Node & All Dependents' option. Note that the nodes that will be removed are highlighted with the usual dashed outline as we roll over this option. Individual nodes can also be deleted by selecting them and pressing the 'Delete' key.
18. To re-load the data for a particular node, select the 'Refresh Node Data' option. The data for that node is then re-loaded from the database.
Saving and Loading
1. To save a surf, simply go to the File menu and select 'Save Surf', or use the save button on the toolbar.
2. To load a surf, you can select the option from the file menu or toolbar, or you can double click the surf file or drag it onto the Data Surf window.
3. If you want to load a surf, but base it on a different data set, you can use the 'Open and Retarget' function, which allows you to specify a new initial node for the graph. See the topic on retargeting surfs for more information.
4. To export an image of a surf graph, use the 'Save Surf Image' option. This brings up the export dialog:
Here we can enter the width and height (which remain in the correct ratio) and select from BMP, JPEG or PNG formats.
A common scenario is that we have looked at some initial data, and we have then followed the relational paths present in the database to find the relations of that data.
However, it is possible that you would want to take that same relational exploration, and apply it to a new starting point. This is what the retargeting function does. It allows you to specify a new column/value for the starting point of the surf, and it iteratively refreshes all parts of the surf.
Note that the surf can change shape significantly after retargeting for one of the following reasons:
• A relation that previously held data now does not hold any data, and therefore further relations cannot be explored
• A relation that previously held a single row now holds multiple rows, and therefore the relations are explored for each key in the available data
The second point is important. For example, imagine looking at a Contact, then Orders. There is 1 order, so we look at items for the order.
We then retarget the surf to a new contact, which has 100 orders. In this case, there would be items for 100 orders, and so the shape of the graph would be significantly different. In fact, the number of paths which will be followed during retargeting is limited by the 'Load error limit' in the preferences screen. However, after retargeting it can be possible that a previously small graph ends up with hundreds or thousands of data nodes. In this case, application performance will suffer.
Retargeting can be achieved in one of three ways:
• By opening a saved surf with the 'Open Surf & Retarget...' option
• By retargeting an existing open surf with the 'Retarget Surf In Current Tab...' option
• By creating a new surf from an existing open surf with the 'Retarget Surf To New Tab...' option
Each of these options are available both in the menu and on the toolbar.
Data Surf constantly arranges the nodes in the surf graph according to the currently specified layout algorithm. This algorithm can be changed by clicking on the down arrow on the right hand of the layout button, and you can re-apply a layout by clicking on the left hand side of the layout button. The default layout algorithm for surf displays can be specified in the preferences screen.