Project Editing | Environment, FDL, InitValueDefiniton

Environment

Environment is designed to define the settings for individual screens, existing separately from Application Information. You can specify screen definitions, variables and cookies while you can write the script of an Environment file.

ScreenDefinition

With a ScreenDefinition file, you can add new entries to a piece of screen information specified in the process of creating a project. You can also modify or delete existing entries. A ScreenDefinition file is saved in the form of an XML file. Preview relation with App presents a intuitive diagram of the relations between screens and applications.

The environment-related properties set for individual screens can override the same properties specified in Environment as the former has priority.

Screen Refactoring

Screen refactoring is conducted when you change the ID of an existing screen. Nexacro Studio will find the applications that adopt the changed screen and then automatically replace the old ID with the new one.

Variables

You can add, modify and delete variables defined in Environment. The variables here can be used globally, regardless of Application Information objects.

The below syntax set can be used to employ, modify and delete variables in a script.

nexacro.getEnvironmentVariable("Env_Variable0");
nexacro.setEnvironmentVariable("Env_Variable0", 30);
nexacro.removeEnvironmentVariable("Env_Variable0");

Cookies

You can add, modify and delete cookies defined in Environment.

The below syntax can be used to employ a cookie in a script.

var vCookie0 = nexacro.getCookieVariable("Cookie0");
var vCookie1 = nexacro.getCookieVariable("Cookie2", true);

nexacro.setCookieVariable("Cookie0", "test");
nexacro.setCookieVariable("Cookie1", "test", true);

As for a cookie whose secure is set to "true", the cookie will be sent only in response to an encrypted request if the transaction is conducted under the HTTPS protocol.

HTTP Header

You can add, modify and delete an HTTP header defined in Environment. You can add variables to the header of an HTTP transaction.

As described below, you can add, check or delete variables to a script.

nexacro.setHTTPHeaderVariable("Server", "nginx/1.4.6 (Ubuntu)");
nexacro.getHTTPHeaderVariable("Server");
nexacro.removeHTTPHeaderVariable( "Server" );

Accessibility

If you want to activate the accessibility features in an app, you need to set the enableaccessibility property of the Environment object to "true" and add the Accessibility.json file to Modules in TypeDefinition. If you only set enableaccessibility to "true" and launch the app, accessibility will not be activated with an alert popping up to inform you of the need to add Accessibility.json.

FDL (Form Definition Language)

You can launch form-related editors by accessing [Edit], [Edit Source] or [Edit Script] in the context menu opened from the Project Explorer.

Design

In this tab, you can design components, edit their properties and bind Datasets to them. You can zoom a current form by adjusting the zoom bar on the bottom-right side of the pane.

A zooming feature is supported in the Design tab.

You can move the base coordinate of a Form by selecting the Move icon on the component toolbar. For example, if you want to draw a component outside a Form, you can do so after selecting the Move icon and then moving the base coordinate. As the result of moving a base coordinate, the rulers will display negative areas of their measuring units.

Register TypeDefinition

When you import a Form from a different project, some components may not be registered in the TypeDefinition of the current project. In that case, Nexacro Studio will indicate such an absence and help you to register relevant components immediately.

If such a component is visible, its name will be displayed with the word "undefined," all in red. Although you can select the component in this case, you cannot resize it while Studio does not show the properties of the component.

For those that appear in the Invisible Object pane, they will be marked with a question mark icon. Moreover, no information will be displayed in the Properties pane when you select those objects.

If you right-click a component that is not registered in TypeDefinition, you will see the pop-up menu [Register TypeDefinition]. Click it and then select a class name from the combo list opened from the pop-up box in order to register the relevant component.

Source

You can see a Form's source code and edit it.

Script

You can see the script of a Form and edit it.

Go to Declaration

You can find the item [Go to Declaration] from the context menu that you can open by right-clicking a method of an object in the script editor.

Upon clicking the menu, you will be led to the location where the relevant function is declared. If the function is located in an included script, Nexacro Studio will open the file that the script originates from and bring you to the location of the function. If more than one function are found to have the same name, the list of those functions will be displayed.

If you choose one, Nexacro Studio will show the relevant codes.

If you try This function over something that is not a method—for example, a property—the below warning message will pop up.


Open Include File

This function will open a script that is referred to in another script through an include statement. Right-click an include statement and select [Open Include File - XX.xjs] from the context menu.

InitValueDefiniton

An InitValueDefiniton file, which takes an XML file format, contains the information on the initial values of a certain object in a certain app. You can open the editor for an InitValue file by choosing the file in the Resource Explorer and then selecting [Edit] from the context menu.

The left pane of the InitValue Editor shows a list of the objects registered in the TypeDefinition file. You can add an initial value by choosing an object and then selecting [Add] from the context menu. Afterwards, you can set initial values of the object through the right-handed pane.

The added initial values will be formatted in XML and saved. You can check the source codes of the InitValue file by clicking the [Source] tab.

If you want to apply an InitValue file, you are required to specify the initvaluefileid property in Environment at first.

Then, select a component to apply the file to and specify the initvalueid property in the Properties window. After all, the property values saved in the InitValue file will apply to the component, with such values italicized.