This article is not up to date and it has been substitute with new up to date content.

Please look the new up to date content.

Links and coupling

by Laura Cigardi
5,403 views Published on Oct 24, 2011
Applies to: All versions
Table of contents

Introduction

Links abstract and generalize the fundamental notion concept of anchor of hypertexts. An anchor is an active device, whereby the user can interact with the hypertext. The notion of anchor must be considered in a broad sense. The following practical cases, referred to an HTML-based hypertext, are all examples of what can be considered an anchor:

  • An HTML anchor tag, with an href attribute that refers to another page. Clicking on the anchor makes the currently visualised page being replaced by the page referred by the tag anchor.
  • An HTML anchor tag, with an href attribute that refers to same page. Clicking on the anchor makes the currently visualised page being re-displayed, possibly with some new content, for example, due to a selection in some index, which causes the details of a new object to be displayed.
  • The confirmation button of an HTML form used for searching. Inserting input in the form and pressing the button causes a new page or the same page to be re-displayed with the search results.
  • The confirmation button of an HTML form used for sending input to an operation, for example for logging into a password-protected site.

As the abovementioned examples suggest, the essence of links is twofold:

  1. They enable the navigation of the hypertext, by letting the user move the focus from a source page to a destination page.
  2. They transport information from one unit to another one, for example the identifier of the object selected from an index to the data unit displaying the object details, or the input entered in a form to the index unit showing the result of the search, or to the operation performing password verification.

Link Types

In IFML links are represented by oriented arcs, which connect the source unit or page to the destination unit or page and can be categorized in different ways. They can be divided in different types according to the parameter of the categorization.

Considering the page boundaries as parameter links are inter-page or intra-page

Inter-page links

A inter-page link is a link crossing the boundaries of pages. It can connect one page to another or one unit of the source page to one unit (or to the) destination page.

Intra-page links

A inter-page link is a link having the source and destination inside the same page.

 

Considering the page information that flows on the link they can be contextual or non-contextual

 

 

 

 

Contextual links

A contextual link is a link which transport information.

Non Contextual links

A non-contextual link is a linkwhich do not transport information.

Normal Links

A Normal link is an anchor or a button that the user has to activate in order to change the page content or to move to another page. Consider as example the image on the right. When the page is accessed only the index unit is displayed; then, if the user selects one of the entries of the index, the page is re-displayed and the data unit shows the details of the selected object. Prior to the user's click in the index, the data unit is not shown, because the OID of the selected object needed for computing the data unit is unavailable.

Automatic Links

In some applications, it may be necessary to specify a behaviour different from the one provided by the Normal link, whereby the content of some unit is displayed as soon as the page is accessed, even if the user has not navigated its incoming link. This effect can be achieved by using automatic links. An automatic link is a link that is "navigated" in absence of user's interaction, when the page that contains the source unit of the link is accessed. This link type has the same graphical representation of the Normal link since it is still an anchor. The difference is that at the first access the context is automatically propagated. You can see the type of the link in the Properties View.

Consider the same example of the previous section, revised to exploit an automatic link. The meaning of such a specification is that, when the Albums Page page is accessed, not only the index unit is displayed, but also the data unit, which shows the details of one object selected from the index. The selection of the object from the index can be based on some heuristic criterion, for example choosing the first object according to the order clause of the index unit. In other words, the access to page AlbumPage causes the "simulated" navigation of the automatic link, which propagates the automatically chosen context information from the source unit to the destination unit.

N.B. Only intra-page links can be set as automatic.

Transport Links

All the links seen so far are rendered by means of anchors or confirmation buttons. However, there are cases in which a link is used only for passing context information from one unit to another one, and thus is not rendered as an anchor. This type of link is called transport link, to highlight the fact that the link enables only parameter passing, and not user navigation.

The following image shows an example of transport link: page Celine Dion Albums contains the Artist Details data unit, which is filled with the details of the artist named Celine Dion, and the Published Albums index unit, which lists the albums she has published. Since the link is defined as a transport link, when the page is accessed, both the data unit and the index unit are filled with content and displayed, and no anchor for the link is made available. A transport link is represented in the graphic specification by means of a dashed arc.

OK and KO Links

OK and KO links are links used by WebRatio operation unit to specify which unit is the target of the operation depending on the operation results. If the operation executed by the unit ends with success, the OK link is followed; otherwise the KO link is used. Using these two concepts it is possible to define operation chains having complex structure.

The OK link is represented with a green arrow while the KO link with a red arrow.

Coupling

In order to be contextual, a Coupling must be defined on the link. The coupling is available for all link types (normal, automatic, transport, OK and KO). The coupling is composed by different Link Parameters. A Link Parameter is a value associated with a link between units, which is transported, as an effect of the link navigation, from the source unit to the destination unit. A link may be associated with as many link parameters as required by the destination unit. From a syntactic standpoint, a link parameter has a name, a target and a source. The target and the source denote the content of the parameter, which is either an attribute or a field of the source unit of the link; when the target refers to an attribute, it consists of the concatenation of the entity and attribute ids, separated by a dot. If the target refers to more than one attribute the concatenation is made with a '|'. Consider as example the image on the right in which is modeled a page for adding a new product in the catalog. The link pointing to the Create Unit is a Normal Contextual link and have different link parameters defined in its coupling. Each parameter is a field of the Entry Unit which is coupled with one input parameter of the Create Unit. In the following image, an example of the link parameter names, taken from the Outline.

Units may have multiple outgoing links, possibly associated with different parameters. The following example shows a Hierarchical Index Unit (All Artists), in which the top level of the hierarchy displays the instances of the Artist entity, and the second level of the hierarchy lists, for each artist, the albums connected to him/her by the relationship role ArtistToAlbum. Two links connect the hierarchical index unit and two data units placed in distinct pages: the link pointing to the Artist Details data unit is associated with a link parameter, which holds the key attribute value of an artist selected from the top level of the hierarchy; the link pointing to the Album Details data unit is associated with a link parameter, which holds the key attribute value of an Album selected from the second level of the hierarchy. When the user selects an artist or an album, the appropriate page is displayed.

Coupling Dialog

This dialog can be used to define the flow of parameters from the source unit to the destination unit of the link. It's possible to open this dialog in two different ways:

  • double-clicking on the link in the Web Model
  • clicking on the button next to the "Coupling" item in the Properties View

The left column of the dialog box shows the output parameters of the source unit; the right column shows the input parameter of the destination unit that receives the value mentioned in the left column.

If the Default Coupling property is checked, WebRatio infers automatically which output parameter of the source unit provides a value to which input parameter of the destination unit, and shows such coupling. The default parameter coupling is not modifiable; to change it, you must first uncheck the Enable Default Coupling property.

Deselecting the Enable default parameter coupling property makes the values in the Source column selectable. You can pick any of the output parameters of the source unit and set it as the value of an input parameter of the destination unit. It is also possible to define a constant as the fixed value of an input parameter of the destination unit. Write the desired value into the Source column and a pencil icon will be shown on the left of the constant.

There are also other operation available in the Coupling Dialog which allows to make this operation easier and faster.

Guess Coupling

When the parameters to manually couple are many, you can use the Guess Coupling action . It guesses the coupling comparing the names of input and output parameters. So, if you give rational names to Unit Selector Conditions and to Entry Units fields, you can use this feature to quickly make the coupling. Regarding the Entry Units fields, it can be also useful to use the Field Wizard.

Add Input Parameter

It is possible to duplicate an input parameter clicking on the button. Clicking the button makes the values in the Target column selectable.

Clear All Link Parameters

If you want to clear the coupled parameters, click on the button.

Passing Parameters

Selecting the Passing Parameters tab, the Coupling dialog permits defining an output parameter as passing. A passing parameter is a parameter received in input by the destination unit, which is re-emitted as-is in output by the same unit, even if it does not belong to unit's output parameters. To declare an output parameter as passing, check it in the corresponding row of the dialog box. It is possible to check all the parameters as passing clicking on the Select All Passing Parameters button selectAllButton.png.

 

 
 

This article is not up to date and it has been substitute with new up to date content.

Please look the new up to date content.