The Reset Unit is a Session Unit and is used to change the values stored in the Context Parameters or to remove them from the session context. It is also an Operation Unit.
For more information about Context Parameters you can find further details in the Context Parameters article.
Properties
These are the available properties of a 'Reset Unit'
The Properties View of the Reset Unit
Id: The unique key automatically assigned by WebRatio to identify the Unit (e.g. rstu1r).
Name: A meaningful name for the Unit, used as label (e.g. Reset Language).
Context Parameters: The list of Context Parameters whose values must be retrieved by the Unit.
Home: A flag stating that the Reset Unit must be executed as the first operation when the user enters in the related Site View.
Default: A flag stating that the Reset Unit must be executed as the first operation when the user enters the Area containing the Unit.
Landmark: A flag stating that the link shown in the corresponding Landmark menu that will activate the Unit. If the operation or the operation chain has no outgoing link, the final target page will be the last page visited.
Protected: A flag stating that the access to the Reset Unit is granted only to users belonging to groups entitled to access to it.
Secure: A flag stating that all the links that can activate the Reset Unit are implemented using the Secure HTTP protocol, instead of the HTTP protocol.
Custom Descriptor: A flag stating that the Unit uses a Custom Descriptor.
Custom URL Name: The Custom URL Name of the Unit. It is possible to define a custom name that will be used as URL to reach the Reset Unit, instead of the standard Id (used by default). The custom URL name must not contain whitespaces, non-ascii characters or other special characters like /, ?.
Configuration
A Reset Unit can be configured through a context menu that can be reached right clicking on the Unit either in the Work Area or in the Outline View. The context menu contains the following options:
The Context Menu of the Reset Unit
Add OK Link: Adds an outgoing OK Link to the Unit. The OK Link is activated when the Unit performs its operation correctly and can be used to transport information. Moreover, the OK Link will cause the execution of its target element (opens a target page or activates other Operation Units).
Add Property: Adds a custom property to the Unit. A Property is composed by Name and Value and permits to mark the element for different purposes.
The output of the Reset Unit consists of all the Context Parameters defined in the "Context Parameters" property of the Unit. To access Output Parameters, open the Parameters Coupling dialog with a double click or by selecting the "Coupling" property on an outgoing link from the Reset Unit .
Here all the Output Parameters can be coupled with the Input Parameters of the target elements.
Output
The Reset Unit doesn't support outgoing links.
Examples
This example is based on the Data Model shown in the following image.
The Data Model used in the example
This Data Model consists of one Entity: "Language". The "Language" entity has many attributes, such as "language", "languageISOCode", "countryISOCode", and so on.
Example 1 Choose Language
Our goal is to give to the user the possibility to change the language used to browse the Web application. In this example only the current page is localized using the language chosen by the user.
In order to accomplish this example, it is necessary to go through the following steps:
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 "Choose Language") and other properties in the Properties View (such as "Home" or "Landmark" properties) to make the page accessible.
Localize the page: In order to make the page use the language chosen by the user, enable the flag "Localized" in the Properties View of the page.
Add an Index Unit to the page: select the Index Unit icon from the palette and place it inside the page. Change the "Name" property in "Languages".
Set the Entity on which the Index Unit is based: click on the "Edit" button next to the "Entity" property in the Properties View. Then choose the "Language" Entity from the opened dialog pane.
Choose which attributes of the selected Entity must be shown: click on the "Edit" button of the "Display Attributes" property. Then choose the "language", "languageISOCode" and "countryISOCode" attributes from the opened dialog.
Define the sort criteria of the Index Unit: click on the "Edit" button next to the "Sort Attributes" property, then choose the "language" attribute and the "ascending" sort criteria.
Add a Reset Unit to the page: select the Reset Unit icon from the palette and place it outside the page. Change the "Name" property in "Reset Language".
Set the Context Parameter on which the Reset Unit is based: click on the "Edit" button next to the "Context Parameter" property in the Properties View. Then choose the "LanguageISOCtxParam and CountryISOCtxParam" Context Parameter from the opened dialog pane.
Draw a normal link between the "Languages" Index Unit and the "Reset Language" Reset Unit: select the Link button from the palette and click on the "Languages" Index Unit (the Source of the Link) and then on the "Reset Language" Reset Unit (the Target of the Link). Set the Name property of the newly created Link to "Select" and the Type property to "normal".
Define the parameters coupling: open the Parameters Coupling window of the newly created link in order to define the coupling between the output parameters of the source Unit and the input parameters of the target Unit.In the Parameters Coupling dialog, couple the "languageISOCode" Attribute of the Index Unit with the "LanguageISOCtxParam" Context Parameter of the Reset Unit and the "countryISOCode" Attribute of the Index Unit with the "CountryISOCtxParam" Context Parameter of the Reset Unit.
Draw an OK link between the "Reset Language" Reset Unit and the "Choose Language" page: select the Link button from the palette and click on the "Reset Language" Reset Unit (the Source of the OK Link) and then on the "Choose Language" page (the Target of the OK Link). Set the Name property of the newly created OK Link to "Language Set".
Add supported language: right click in the Work Area and select the Localize item. In the opened dialog right click on "Locales" and add as many locales as you want (e.g. italian and english). Set the messages for all the labels of the page and confirm with the OK button.
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.