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.
- Start the Uniface IDE.
This creates a new project called
MYPROJECTand opens it in its own editor.
Projects enable you to organize the development objects of an application.
from the Main Menu ( ≡ ).
- Create a Dynamic Server Page
In the MYPROJECT project, click the
Templates tab of the Resource Browser.
The Resource Browser lets you choose objects to add to your project.
Component: Dynamic Server Pagetemplate 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_1that 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.
UCDSP_1component and rename it to
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.
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.
- In the MYPROJECT project, click the Templates tab of the Resource Browser.
- Define the component's data
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.
In the Resource Browser, drag the
Empty non-dbms entityentity 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.
Rename it to GREETING.MY.
The entity name is the identifier and has the format EntityName.ModelName.
- In the Resource Browser, drag the
- Create the component layout.
The component layout is defined as an HTML document.
Click Design Layout to go to the
Design Layout worksheet.
A basic layout is already visible in the Layout Editor.
Replace the text
Your content here...with some other text.
<h1>Hello World! <br/> Welcome to Uniface 10</h1>
- Click Design Layout to go to the Design Layout worksheet.
- Compile and test the component.
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.
Choose Compile & Test.or click
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: