How to Use Generation Commands

by Ombretta Malinverno
8,520 views Published on Dec 04, 2013
Applies to: All versions
Table of contents

Introduction

To get the Web Application from your Web Project you have to generate it. When a project is generated, the Application Server loads the corresponding Web Application. WebRatio Platform uses Apache Tomcat as its default Application Server.

Tomcat implements the JavaServer Pages (JSP) and Sun Microsystems Servlet specification, thus providing a software platform for running Web Applications developed in the Java language.

When a generation is launched in the "webapp" folder in Tomcat, all layout references, descriptors and the JSP page of the project elements are created.

If you want to use a different Application Server, for example JBoss, you have to change to the WebRatio Platform settings. The settings are on the toolbar Windows -> Preferences -> WebRatio:

  • On the "Variables" dialog, you can change ${webapps_loc}, which refers to the path where the project will be generated.
  • On the "Runtime" dialog, you can change the Home directory of the Application Server that WebRatio used.

In the project, you can decide whether to generate the entire project or only a part of it. WebRatio Platform employs the following generation commands:

  1. "Generate Layout"
  2. "Generate Logic"
  3. "Generate Logic and Layout"
  4. "Generate Selection"
  5. "Generate Full Project"
  6. "Generate and Run"

You can find the generation commands in the WebRatio Platform Editor Toolbar Actions , or by right-clicking on one model element and selecting the generate item. Let’s see in detail how generation commands work and when to use them.

Generate Layout

The Generate Layout Command should be used when you change the layout of element; for example, when you modify a custom page template. The generation process creates the jsp pages and the layout descriptor and copies all the style resources used by the current style.

Generate Logic

The Generate Logic Command is used when you change the descriptors of an item; for example, when you add or modify a condition in a List, or associate the binding of flow. In this generation all the XML descriptors of the selected item will be compiled, which are files in the folder NameProject/WEB-INF/descr.

Generate Logic and Layout

The Generate Logic and Layout Command is used when adding/changing descriptors of an element and the templates applied to them. For example, if you change the page template and the structure of the layout grid, you need to generate both the logical and layout page. This generation does not imply re-uploading the application by the Application Server.

Generate Selection

The Generate Selection Command is used when you make complex changes, such adding Pages, adding a View Component, or chain operations. In these cases, the command will generate the complete code of the selected items:

  • Runtime XML descriptors that happen in the Logic Generation.
  • Page jsp layout, copying the file of the style that is used in the Layout Generation.
  • "WRResources" folder.
  • "WRAdmin" folder.
  • "WEB-INF" folder.
  • Domain Model descriptors.
  • Java classes.
  • The bundle of the selection.
  • "web.xml" file.
  • Utility libraries.
  • Login pages and errors.

This type of generation loses the session because many files are loaded and rewritten.

Generate Full Web Project

The Generate Full Web Project Command is used when the project has never been generated in the Tomcat webapp or when modeling changes have been made in different parts of the project. In this case  a complete and entire active project will be generated, with the code of the application in one shot including both the XML runtime descriptors and the layout template.

This command is for the generated selection but applies to the entire project.

Also in this case we lose the session.

Generate and Run

The Generate and Run Command is used when you want to generate the complete code of the Web Project, start Apache Tomcat, and open the Home Page in browser, all in one shot.