Hello World!

This Hello World tutorial shows you how to create a Hello World web application using the Uniface IDE.

Install the Uniface IDE. If you have not yet done so, request and download the Uniface free trial from uniface.info. When you install it, choose the Development Environment when prompted to do so. This installs the Uniface IDE, and a pre-configured web test environment.

To create an application, we define a project and construct a component to display a web page with data. These are development objects which can be compiled into a deployable application.

  1. Start the Uniface IDE.
  2. Choose Create project from the Main Menu ( ≡ ).

    Create Project

    This creates a new project called MYPROJECT and opens it in its own editor.

    Project Editor for MYPROJECT

    Projects enable you to organize the development objects of an application.

  3. Create a Dynamic Server Page component.
    1. In the MYPROJECT project, click the Templates tab of the Resource Browser.

      Resource Browser of Project Editor.

      The Resource Browser lets you choose objects to add to your project.

    2. Drag the Component: Dynamic Server Page template from the Resource Browser and drop it on the project in the Structure Editor, which is in the middle of the Project Editor.

      This creates a new dynamic server page (DSP) called UCDSP_1 that is based on the template. All the properties, script, and layout of the template are copied to the new component.

      Tip: If the new object is called UMDSP_1, you have selected the Modeled Component object, which is something different. In this case, right-click it and choose Delete, and choose the correct template.

    3. Click the UCDSP_1 component and rename it to HELLO_WORLD.

      Tip: Uniface is case-insensitive, so you should not rely on differences in letter case when creating unique names. Uniface converts object names to uppercase. For more information, see Naming Rules for Uniface Development Objects.

    4. Right-click the HELLO_WORLD component and in the resulting context menu, select Open to open it in its own editor.

      The Component Editor contains three worksheets, each designed to complete a specific task—defining the component data structure, designing the layout., and scripting business logic.

      Structure Editor of the Project Editor.

  4. Define the component's data structure.

    The data structure defines the data that the component uses or displays. This component does not need to access any data, but it needs to contain an entity to ensure the component can be compiled.

    1. In the Resource Browser, drag the Empty non-dbms entity entity from the Templates tab, and drop it on the HELLO_WORLD component in the Component Structure Editor.

      This adds an entity based on the template.

    2. Rename it to GREETING.MY.

      The entity name is the identifier and has the format EntityName.ModelName.

      Component Structure for Hello World component

  5. Create the component layout.

    The component layout is defined as an HTML document.

    1. Click Design Layout to go to the Design Layout worksheet.

      A basic layout is already visible in the Layout Editor.

      Default HTML layout for Dynamic Server Page

    2. Replace the text Your content here... with some other text.

      For example:

      <h1>Hello World! <br/>
      Welcome to Uniface 10</h1>
  6. Compile and test the component.
    1. Click Compile to compile the component. The compile results are displayed in the Compile Output tab at the bottom of the main Uniface IDE window. You can ignore the warning.

      Compile output for HELLO_WORLD

    2. Choose Actions>Test or click Compile & Test.

      This runs the component in Uniface's pre-configured web server environment. When the request for the URL is received, Uniface uses the component definitions and default script to generate the HTML page that is displayed in the browser.

      The Hello World component should run and look something like this:

      Hello World application

Uniface Logo A

Send feedback about this topic to Uniface.