32
1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

Embed Size (px)

DESCRIPTION

© 2011 ASTEC Sp. z o.o. 3 ESSENTIAL CONCEPTS Environment variables Runtime Session IDE Execution flow

Citation preview

Page 1: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

1© 2011 ASTEC Sp. z o.o.

Migrating from Emacs to MDT®

Migrating Smallworld™ session

Page 2: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 2

TOPICS

• Essential concepts• Understanding Smallworld session• Running session in Emacs• Running session in MDT• Key to successful migration

Page 3: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 3

ESSENTIAL CONCEPTS

• Environment variables• Runtime• Session• IDE• Execution flow

Page 4: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 4

Environment variables

• Set of dynamic named values that can affect the way running process will behave

• Can be inherited and overriden while running another process from its parent process

• It is important to know that variables can be set for Runtime, Session and IDE level in different order and therefore inheritance manner

Page 5: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 5

Runtime

• Specifies common environment and behavior for running dedicated processes (i.e. Session, IDE)

• Indicates location of Smallworld Core product installation and its configuration files

• Generally speaking – Smallworld GIS installation

Page 6: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 6

Session

• Process of running Smallworld image with the use of dedicated executable appropriate for host operating system (sw_magik_win32 or sw_magik_motif)

• Uses runtime and its environment to run an image• Session executable can be run by other process and

therefore inherits its environment variables• Generally speaking – sw_magik_win32.exe + image

Page 7: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 7

IDE

• Development environment for running sessions• Needs ”co-operation” with runtime to start the session• Important thing to understand is how runtime is related to

IDE before starting session

Page 8: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 8

Execution flow

• Possible order for setting up and using runtime, IDE and session processes

• There are two general orders, which can be described as follows:o Setting up runtime, starting IDE on it and therefore

running chosen session (Emacs default)o Starting IDE, setting up runtime and therefore running

chosen session on it (MDT default)

Page 9: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 9

Execution flow

RUNTIME Environment Variables

IDE Environment Variables

SESSION Environment Variables

RUNTIME Environment Variables

IDE Environment Variables

SESSION Environment Variables

OR

Page 10: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 10

UNDERSTANDING SMALLWORLD SESSION

• Most common configurations for starting session: Direct – sw_magik_win32.exe + image Alias – gis.exe + alias + environment.bat Complex – *.bat, *.cmd batch files

• As we can imagine, there is a lot of possible ways to set up and run a session

• Let’s focus on the aforementioned…

Page 11: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 11

UNDERSTANDING SMALLWORLD SESSION

Direct Runs image with the use of sw_magik_win32

executable and additional switches if necessary Easy to understand and maintain Example command line for starting session:

> sw_magik_win32.exe –image <image_file> [switches]

Page 12: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 12

UNDERSTANDING SMALLWORLD SESSION

Alias Runs gis.exe application launcher, sets up additional

data (environment variables, switches , etc.) and at the end runs image with sw_magik_win32 executable

More complex and flexible than direct way Example command line for starting session:

> gis.exe –e <environment_file> -a <gis_aliases> alias

Page 13: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 13

UNDERSTANDING SMALLWORLD SESSION

Complex Runs *.bat or *.cmd batch file which sets up a complex

environment and at the end runs Smallworld session with the use of gis.exe or sw_magik_win32.exe

Most flexible in comparison to previous ones Example command line for starting session:

> start_session.bat [switches]

Page 14: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 14

RUNNING SESSION IN EMACS

• As it was mentioned before, gis.exe is an application launcher so it can run any application

• After installing Smallworld, Emacs environment can be started with the use of a shortcut that runs gis.exe and an emacs alias

• What is important to know is that gis.exe uses environment.bat file from Smallworld installation configuration to set up RUNTIME before starting Emacs

Page 15: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 15

RUNNING SESSION IN EMACS

• Sessions are being started in Emacs with the use of console command line

• Let’s take a look how to run direct, alias and complex type of session in Emacs and what is the simplified execution flow…

Page 16: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 16

RUNNING SESSION IN EMACS

Direct Emacs runs sw_magik_win32.exe and passes its

environment variables (so the RUNTIME data as well) Example command line for starting session:

> sw_magik_win32.exe –image <image_file> [switches]

Page 17: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 17

RUNTIME IDE SESSION

Run gis.exe

Resolve environment variables from

environment.bat

Run emacs.exe from related alias

Run sw_magik_win32.exe Interpret switches

and run image

Page 18: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 18

RUNNING SESSION IN EMACS

Alias Emacs runs gis.exe with alias for running session and

passes environment variables to it (so the RUNTIME data as well)

Example command line for starting session:

> gis.exe –e <environment_file> -a <gis_aliases> alias

Page 19: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 19

RUNTIME IDE SESSION

Run gis.exe

Resolve environment variables from

environment.bat

Run emacs.exe from related alias

Run gis.exe Resolve environment variables from

environment.bat

Run sw_magik_win32.exe

from related alias

Interpret switches and run image

Page 20: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 20

RUNNING SESSION IN EMACS

Complex Emacs runs *.bat or *.cmd batch file with some set of

switches for running session and passes environment variables to it (so the RUNTIME data as well)

Example command line for starting session:

> start_session.bat [switches]

Page 21: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 21

RUNTIME IDE SESSION

Run gis.exe

Resolve environment variables from

environment.bat

Run emacs.exe from related alias

Run *.bat, *.cmdDo all complex processing (set environment,

interpret switches, commands, etc.)

Run sw_magik_win32.exe

Interpret switches and run image

Page 22: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 22

RUNNING SESSION IN MDT

• MDT use sophisticated elements that describe and store data about runtimes and sessions RUNTIME – specifies Smallworld installation,

configuration and environment variables SESSION – corresponds to “Direct” kind of session SESSION LINK – corresponds to “Alias” kind of session COMMAND LINE SESSION – corresponds to “Complex”

kind of session

Page 23: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 23

RUNNING SESSION IN MDT

• As we probably noticed, RUNTIME is being created and used after running MDT

• Having additional elements describing runtimes and session in MDT gives user possibility to set up additional levels of environment variables and easy way to change connection between runtime and session

• Let’s take a look how to run direct, alias and complex type of session in MDT and what is the simplified execution flow…

Page 24: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 24

RUNNING SESSION IN MDT

Direct MDT runs SESSION on associated RUNTIME what

corresponds to command line for starting session:

> sw_magik_win32.exe –image <image_file> [switches]

Page 25: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 25

RUNTIMEIDE SESSION

Run cmd.exe

Resolve environment variables from

environment.bat

Run sw_magik_win32.exe

Run SESSION component Interpret switches

and run image

Page 26: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 26

RUNNING SESSION IN MDT

Alias MDT runs SESSION LINK on associated RUNTIME what

corresponds to command line for starting session:

> gis.exe –e <environment_file> -a <gis_aliases> alias

Page 27: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 27

RUNTIMEIDE SESSION

Run cmd.exe

Resolve environment variables from

environment.bat

Run gis.exe

Run SESSION LINK component

Resolve environment variables from

environment.bat

Run sw_magik_win32.exe

from related alias

Interpret switches and run image

Page 28: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 28

RUNNING SESSION IN MDT

Complex MDT runs COMMAND LINE SESSION on associated

RUNTIME what corresponds to command line for starting session:

> start_session.bat [switches]

Page 29: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 29

RUNTIMEIDE SESSION

Run cmd.exe

Resolve environment variables from

environment.bat

Run *.bat,*.cmd or any *.exe

Run COMMAND LINE SESSION component

Do all complex processing (set environment,

interpret switches, commands, etc.)

Run sw_magik_win32.exe

Interpret switches and run image

Page 30: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 30

RUNNING SESSION IN MDT

• There is also possibility to run MDT after setting up RUNTIME, like it is for Emacs

• To do so, we have to create an alias for starting MDT (reflect alias for starting Emacs)

• In this case we can start MDT with the use of dedicated shortcut in the same way as it is for Emacs

• While running MDT in this way, we have to assign so called DEFAULT runtime to a SESSION that we want to start

Page 31: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 31

KEY TO SUCCESFUL MIGRATION

• After all, most important thing while migrating your session configurations from Emacs is to know where you have Runtime, IDE and Session parts

• Second thing is to know how all of the environment variables are being resolved before starting session and to which parts are they related

• At the end we have to establish which kind of session (direct, alias or complex) we use and then create the corresponding runtime and session in MDT

Page 32: 1 © 2011 ASTEC Sp. z o.o. Migrating from Emacs to MDT® Migrating Smallworld™ session

© 2011 ASTEC Sp. z o.o. 32

The End