Resources (Magic xpi 4.5)
The Resources section in the Settings dialog box provides you with a central location for defining the external systems that your Magic xpi project needs to access during project execution. These external system definitions are saved in an XML file (Resources.xml) in your <project name> folder. The definitions can be modified easily, and can take effect at any stage of the project (development or deployment) without the need to rebuild your project.
Magic xpi’s environment variables can be used in this dialog box with the following syntax: %environment variable name%. You can reuse predefined environment settings in different projects, and therefore switch execution environments quickly and easily. For example, when you activate a component's method or XML interface, you need to specify environment properties such as server, user, and port. To do this, you define a resource in the Resources section and refer to it from that component.
These resource settings can be used with:
You can define the following resources in the Settings dialog box's Resources section:
To define a new resource:
-
From the Project menu, select Settings to open the Settings dialog box.
-
In the left hand pane of the Settings dialog box, park on Resources.
-
Click Add. The New Resource dialog box opens.
-
Select one of the resources from the Resource Type drop-down list. In the Resource Name field, enter a name for your new resource, and click OK. Note that the resource name can contain up to 30 characters and can only contain English characters.
-
Your new resource now appears in the Settings dialog box's Resources section, either under the name that you entered or under a generic file carrying the same resource type name.
-
Click on the new resource in the left pane. You can enter a description for the resource in the field above the resource's parameters.
-
Next, enter the resource's parameters. These parameters are different for each resource. The parameters that you define here also appear in the Setting section of the component's Properties pane when you drag the component to the trigger area. For more information on specific resource parameters, click on the resources above.
-
Each resource has additional buttons that are specific to the resource and are used to configure the resource. For more information on these buttons, click on the resource links above.
-
When you have finished defining your resource, click Apply or OK to save your resource. You can then close the Settings dialog box. Alternatively, you can close the Settings dialog box without saving your new resource.
If you right-click a resource, a context menu with the following options opens:
-
Delete
-
Rename
-
Select as Default: If you create more than one resource under a specific resource type, select this option to define one of these resources as the default resource for that type. The default resource will be selected automatically for any new step of that type that is used in the project. This option is available when you right-click from a resource that is not the default. The default resource is identified by its bold font.
Magic xpi saves the defined resources in two separate XML files. These are:
-
The Resources.xml file: Each new project copies the Resources.xml template file, located in the <Magic xpi>\Studio\Templates\ProjectTemplates\Magic xpi Projects\Magic xpi Project\Magic xpi Project.zip file, and places the file under the project folder. Then, the specific configuration for each project modifies the Resources.xml file under the project folder. Be very careful when making changes to the zip content as you may wind up without the ability to create new projects. Before making changes, make sure to back up the zip file.
-
The resource_types.xml file: This holds general predefined resource type definitions, and is saved in the Magic xpi installation folder in the Runtime folder. There is only one resource type definition file for each Magic xpi Studio installation. Connectors created in the Connector Builder will not be saved in this file, but loaded dynamically.
Note:
|
-
At deployment, when you execute the Magic xpi server, the resource settings files are loaded automatically. When resources are used in the project, they are based on the resource settings that were loaded when the server was executed. If a resource settings file is not found, the server shuts down and an error message appears in the Monitor.
-
When you create a new resource, it cannot have the same name as its type name.
-
Magic xpi components that require resource settings have a Setting section in the component's Properties pane.
-
If you change an existing resource's name, any components that point to that resource lose their resource configurations. This is because the resource's name is the reference that the components use for resource configuration. To remedy this, open the relevant component's Properties pane. In the Setting section, select the resource's new name from the Resource Name property's drop-down list.
|