The WebRatio variables allow to configure the folder in which the Web Application of a Web Project will be generated when one of the following commands is used:
- Generate Full Web Project.
- Generate Selection.
- Generate Logic Descriptor Only.
- Generate Layout Pages Only.
The variables are used in the "Output Path" property of the Web Project to define the folder of the generated Web Application. The list of WebRatio variables can be found in Window -> Preferences -> WebRatio -> Variables menu tab or in the Web Project Properties View, in the "Output Path" property, selecting the "Variables" button.
WebRatio provides a default set of variables that can be used to define the output paths, to make projects more portable. Default WebRatio variables are:
- "webapps_loc": it locates the Tomcat webapps folder. It can be modified but not deleted. Default value is "<Tomcat_installation_folder>/webapps". If you do not install the standard Tomcat, then you have to set the value of this variable the very first time you attempt to generate a Web Project.
- "deploy_loc": it contains the location of the Web Application's Deploy directory. It is used by WebRatio to separate the Tomcat webapps folder and the folder to be used during the deploying process in a Deployment Plan. It can be modified but not deleted. Default value is the "<WebRatio_installation_folder>/deploy".
- "project_name": it contains the Web Project name. In order to have a valid webapp folder name be sure to not use white spaces in the Web Project name. This variable cannot be directly edited or removed.
WebRatio variables usage
The very first time you generate a Web Project from the WebRatio installation, WebRatio asks you to configure the variables if not yet defined.
It's possible to use variables:
Manage the WebRatio variables
It's possible to create and manage custom WebRatio variables. All these operations are available in the WebRatio Variable Preferences. Defining custom variables allows to have a list of the Web Application Server directories in which it's possible to test or deploy the Web Project. For example:
- "resin_loc": containing the path of the webapps directory of a Resin Application Server.
- "tomcat5.5.27_loc": containing the path of the webapps directory of a Tomcat (version 5.27) Application Server.
- "tomcat5.5.28_loc": containing the path of the webapps directory of a Tomcat (version 5.28) Application Server.
- "jboss_loc": containing the path of the webapps directory of a jBoss Application Server.
Add a variable
To create a new variable:
- Press on "Add Variable..." button.
- Insert the name of the new variable.
- Select, through "Browse File System..." button, the directory path to store into variable or simply insert a value.
- Press on the "OK" button and then on the "Apply" main window's button.
Edit a variable
In order to edit a variable:
- Select the desired variable.
- Press on "Edit Variable...".
- Modify the data.
- Save the changes pressing on "OK" button and then on "Apply" main window's button.
Delete a variable
The delete operation is only available for custom variables. In order to remove a custom variable:
- Select the desired variable.
- Press on "Remove" button (the selected variable disappear from the list).
- Press on "Apply" button.