MDT on Facebook MDT on Twitter

1. Introduction

This tutorial presents steps required to configure MDT® to run Smallword™ Cambridge Database available in Smallworld™ CST. The Smallworld™ Cambridge Database is an example of a well-defined layered product, delivered with its own data. It is designed for use in trainings and for demonstration of Smallworld™ Core Spatial Technology features.

This tutorial does not present all MDT features and possible developing techniques. It focuses only on running Smallworld™ Cambridge Database product and briefly browsing its source code. For more information refer to MDT User Manual.

2. Prerequisites

To complete this tutorial some requirements have to be fullfiled:

  • Cambridge Database product is installed.
  • Cambridge Database image file is available.

Note: Cambridge Database product installation is described in Smallworld™ Core Documentation (Smallworld™ Core 4.2 Main Documentation > Cambridge Database > The Cambridge Database layered product > Installing and configuring the Cambridge Database > Installing the Cambridge Database on Windows). We recommend using Build Magik Images tool to create Cambridge Database image file. For the purpose of this tutorial Cambridge Open SWAF image file should be built.

3. MDT configuration

3.1. Creating CST 4.2 runtime

Step 1

Open Magik Development perspective (Window > Open Perspective > Other... > Magik Development) and go to Sessions view.

Step 2

Select Runtime tab and open context menu. Select New Runtime command to open New Runtime wizard.

Step 3

On the first wizard page select desired runtime type, in this case Smallworld™ GIS 4.2.x. Press Next to proceed.

Step 4

On the second page enter desired runtime name in the Name field then click first Browse... button (next to Core product directory field). In Core Product Directory Selection dialog browse for core product directory. Rest page fields will fill in automatically with the appropriate values. Press Next to proceed.

Step 5

On the third page click Browse... button (next to Environment file field). In the Environment File Selection dialog browse for core product environment file. Press Finish to complete runtime creation.

Note: The environment file name is environment.bat and it is located within config subdirectory of core product directory.

3.2. Creating Cambridge session

Step 1

In Sessions view select Sessions tab and open context menu. Select New > Session command to open New Session wizard.

Step 2

On the first wizard page enter desired session name in the Name field then select session type, in this case Smallworld™ GIS 4.2.x. Previously created runtime will select automatically in Runtimes combo. Press Next to proceed.

Step 3

On the second page click first Browse... button (next to Image file field). In Image File Selection dialog browse for Cambridge Database image file.

Note: Remember to use Cambridge Open SWAF image file. The file name is cam_db_open_swaf.msf and it is located within images subdirectory of Cambridge Database product directory.

Step 4

On the page press second Browse... button (next to Working directory field). In the Working Directory Selection dialog browse for Cambridge Database product folder. Press Finish to complete session creation.

3.3. Running Cambridge session

Step 1

Go to Sessions view and select Sessions tab. Right click the session in the view and select Start from a context menu.

Step 2

Go to Console view. The view contains session console which presents session outputs. The console also allows you to enter and execute commands.

3.4. More session options

New session wizard allows you to configure only basic session options. Advanced options can be set in session editor. The options allows you for example to run particular application and automatically login to a database when starting a session. To edit a session right click it in Sessions view and select Edit command from the context menu.

3.5. Creating new Magik project

Step 1

In the main menu select File > New > Magik Project to open the New Project wizard.

Step 2

On the first page enter desired project name in the Project name field then select project type, in this case Smallworld™ GIS 4.2.x. Press Next to proceed.

Note: Avoid using spaces in the project name field. Otherwise project source files will not be accessible while browsing the code.

Step 3

On the next page select previously created session and press Finish to complete project creation.

Step 4

Go to Product Explorer view. You can see your new project with assigned session.

3.6. Browsing session source files

Step 1

In the main menu select Navigate > Open Magik Member command.

Note: Open Member dialog allows browsing source code from a session and workbench and opening it in Magik editor. To use this dialog you must have a session assigned to a project and the session must be running.

Step 2

In the Enter member name or prefix and Enter class name or prefix fields type method and exemplar name to narrow the list of available members. Use wildcards if needed. As you type, the list is filtered to display only members that match the current expressions.

Step 3

In the Matching items list select a member. Click OK when you are done.

Step 4

In External File wizard select Add module ... to project dependencies and click Finish.

Note: Add module ... and Add product ... commands may not be available if selected member source file is not hosted by any module or product. In this case select Open file to open member source file as external file.

Step 5

Selected member source code is shown in opened editor. Parent module is available in Product Explorer view for later use.

4. Additional information

More extensive Basic Tutorial which present major MDT features is available in MDT Help.

For more information about configuring and running sessions, using Magik projects and browsing project source code refer to following MDT Help topics: