Scaffold Unisys Controller for ePortal Data Source with Views Dialog

Note: This topic applies to the MVC Web Application project type only. Refer to Creating an MVC Web Application for more information.

Scaffolding is the technique used to generate the presentation code that the application can use at runtime. The generated code represents a useful starting point for your application that you might want to further modify to refine the application.

Refer to the following topics for more information:

To scaffold one or more data sources in your presentation project, perform the following:

  1. Click Build and select Build Solution to build the solution.

  2. In Solution Explorer, navigate to an MVC project. If you are using MVC areas, navigate to the correct area folder (for example Areas/<areaname>, where <areaname> is the name of your area).

    Note: An Area is a logical grouping of Controller, Models, and other related folders in a Web API application. Areas are an optional feature in ASP.Net MVC. For an example, refer to https://msdn.microsoft.com/en-us/library/ee671793(v=vs.100).aspx.

  3. Right-click the project or area folder and select Add, then select New Scaffolded Item.

    The Add New Scaffolded Item dialog box appears.

  4. On the Add Scaffold dialog, select Unisys Controller for ePortal Data Source with Views and click Add.

    The Scaffold Unisys Controller for ePortal Data Source with Views dialog box appears.

  5. Enter the details in the dialog box as described as follows.

  6. Click OK to start scaffolding.

    Notes:

    • If scaffolding would overwrite any existing files, you are given a chance to confirm before overwriting.

    • This step scaffolds all client messages in a particular data source. Later, you can choose to scaffold one individual client message. Refer to Scaffold Unisys View Dialog for more information.

    Dialog Fields

    The dialog fields are described as follows:

    • ePortal Data Source

      Select the name of the data source to scaffold from the drop down list.

      Note: If you do not see the data source project you are looking for, ensure that the data source project is opened in the current solution and a reference has been added. Refer to Using Multiple Data Source Projects for more information.

    • Controller name

      Specify a name for the controller. This name is used as follows:

      • The name of the controller class is formed by appending “Controller” to the name you specify.

      • A file named <controllername>Controller.cs is created in the Controllers folder, where <controllername> is the controller name that you specify.

      • Any views that you scaffold appear under the Views/<controllername> folder, where <controllername> is the controller name that you specify.

      • The URL to reference this controller at runtime is of the form http://<host>:<port>/<controllername>, where <host> is the IP address or DNS name of the server hosting your application (for example, localhost for local testing), <port> is the port number for the Web server, and <controllerame> is the controller name that you specify. Refer to Testing an MVC Web Application for more information.

    Generate Web Application as a Single Page Application (AJAX)

    Select this option if you want to use the ePortal Single Page Application architecture for your application. Refer to the topic Choosing a Traditional or Single Page Application.

    Controller scaffolder

    Select the scaffold template to generate the controller code from the drop down list, or none to omit scaffolding the controller. Refer to Scaffold Templates and Creating Custom Scaffold Templates for more information.

    Entire application requires HTTPS

    Select this option if the entire application requires HTTPS (for example, a secure connection using SSL or TLS).

    Require HTTPS on specified messages

    Select this option if you want to override the previous setting for individual client messages. In this case, you should configure the property RequireHTTPS on individual client or server messages. Refer to Message Editor Root Node Properties for more information.

    Preserve Screen Layouts and Styles

    If the corresponding data source is MCP T27, OS 2200 UTS, or OS 2200 TIP from imported DPS forms, or AB Suite/EAE, you can generate views that closely resemble the original terminal screens or AB Suite/EAE pages. Select this option to preserve the terminal screens and styles, or the AB Suite/EAE painter styles. Clear the option to sort controls on the form by using tab index.

    Note: Selecting this option typically results in a Web application that is not optimized for mobile devices. For more information, refer to Modifying the Styles for T27 and UTS Projects.

    Advanced

    If you select the Preserve Screen Layouts and Styles option, you can click on the Advanced button to configure advanced options. If you click on the Advanced button, either the Terminal Options Dialog Terminal Options dialog or AB Suite/EAE Options Dialog to Preserve Screen Layouts and Styles AB Suite/EAE Options dialog box opens, depending on the type of data source you are scaffolding. If you do not select the Preserve Screen Layouts and Styles option and then click on the Advanced button, the AB Suite/EAE Options dialog box opens with the Order controls by tab index option.

    Note: The Order controls by tab index option is applicable for AB Suite/EAE only.

    View scaffolder

    If you did not select the Preserve Screen Layouts and Styles option, select the scaffold template to generate view files, or none to omit scaffolding the views. Refer to Scaffold Templates and  Creating Custom Scaffold Templates for more information.

    Use a layout

    Select this check box to use a layout. A layout page allows you to specify the general layout of all of your pages, including common header and footer information, in a single file. Refer to Best Practices: Layouts in Best Practices for Scaffolded Presentation Projects and Modifying the Layout Page for more information.

    Layout file

    If you select the Use a layout option, specify the layout page file to use. You can click the browse button (ellipsis) to select the layout page.

    Notes:

    • If you leave the Use a layout check box blank, the file _ViewStart.cshtml in the Views folder specifies which layout page to use. By default, _ViewStart.cshtml points to the file Views/Shared/_Layout.cshtml. However, you can edit _ViewStart.cshtml to point to a different layout.

    • Ensure that you supply the correct layout for your situation. Refer to Best Practices: Layouts in Best Practices for Scaffolded Presentation Projects and Modifying the Layout Page for an explanation of the available layouts. Usually, the correct value is filled in automatically.