Template:ExampleShowACompany

From WebRatio WebML Wiki

Jump to: navigation, search

Example {{{1}}}: Show a company

Our goal is to show in a page the information of a specific company. In order to accomplish this example, it is necessary to go through the following steps:

  1. Add a Page to the Site View: select the "Page" icon from the palette, and place it on the Site View. Change the page name (setting "Company information") and other properties in the Properties View (such as "Home" or "Landmark" properties) to make the page accessible.
  2. Add a Data Unit to the page: select the Data Unit icon from the palette and place it inside the page. Change the "Name" property in "Company Data".
  3. Choose which attributes of the selected Entity must be shown: click on the "Edit" button of the "Display Attributes" property. Then choose the "name", "logo", "website", "email", "nationality", "province" attributes from the opened dialog.
  4. Remove the automatically added Key Condition: expand the Data Unit from the Outline View and right click on the Key Condition. In the Context Menu select on "Delete" and confirm the operation.
  5. Add the Condition for the Company name definition: right click on the Data Unit and choose "Add Attributes Condition" from the Context Menu. Select the newly added Condition from the Outline View and configure the properties as follow:
    • Name="Company name"
    • Attributes="name"
    • Predicate="Equal"
    • Boolean Operator="Or"
    • Value="Web Models"
    • Required="True"
  6. Generate the Web application: click on "Generate Full Web Project" on the WebRatio Menu Bar. Once the generation process has completed, it is possible to start the application server and test the Web application.
The Web Model of the example
The Properties View of the Data Unit
The generated Web application