|3.1. Creating CST 4.2 runtime||Screencast|
|3.2. Creating Cambridge session||Screencast|
|3.3. Running Cambridge session||Screencast|
|3.4. More session options||Screencast|
|3.5. Creating new Magik project||Screencast|
|3.6. Browsing session source files||Screencast|
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.
To complete this tutorial some requirements have to be fullfiled:
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.
Open Magik Development perspective (Window > Open Perspective > Other... > Magik Development) and go to Sessions view.
Select Runtime tab and open context menu. Select New Runtime command to open New Runtime wizard.
On the first wizard page select desired runtime type, in this case Smallworld™ GIS 4.2.x. Press Next to proceed.
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.
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.
In Sessions view select Sessions tab and open context menu. Select New > Session command to open New Session wizard.
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.
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.
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.
Go to Sessions view and select Sessions tab. Right click the session in the view and select Start from a context menu.
Go to Console view. The view contains session console which presents session outputs. The console also allows you to enter and execute commands.
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.
In the main menu select File > New > Magik Project to open the New Project wizard.
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.
On the next page select previously created session and press Finish to complete project creation.
Go to Product Explorer view. You can see your new project with assigned session.
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.
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.
In the Matching items list select a member. Click OK when you are done.
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.
Selected member source code is shown in opened editor. Parent module is available in Product Explorer view for later use.
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: