Environment Settings (Magic xpi 3.x)
Creating a project usually involves more than one environment: it will at least have the development environment and the deployment environment.
When creating a project, environment values should be set using dynamic elements that can be easily changed in one place for the entire project.
There are several areas that control the project environment:
When you move your project to a new environment you need to adjust the Resource Repository and Service Repository settings. You can access these files from the Monitor under the Environment menu. This option lets you edit the Resource and Service files that the project is using, such that references to resources will match the new environment.
Magic xpi achieves portability by translating the environment variables at runtime, according to the translations entered in the Environment Variables repository.
Save the Environment Variable values in your project’s ifs.ini file.
Environment variables allow you to easily move from the Magic xpi Suite's Windows-based development environment to a Unix, Linux, or IBM i deployment environment. This is because environment variables can be:
-
Changed in the configuration file ifs.ini after you deploy on the Magic xpi Server. This allows you to easily make changes to names of elements after you leave the development environment.
-
Used to create names and file paths that are recognized in both a Windows® environment and a Unix, Linux, or System i environment. For example, Magic xpi contains a standard environment variable called sl. This name translates to a forward or backward slash. When you replace all backslashes with this environment variable, you can deploy a project on a Unix, Linux, or IBM i machine without having to change the backslashes to forward slashes.
Environment variables can be used within other environment variables (nested environment variables). For example, you can have the environment variable, currentprojectdir, include the projects and sl environment variables as part of its translation and the projects environment variable include the Magic xpi environment variable as part of its translation (project = %Magicxpi%projects%sl%).