Virtual Pages

A Morfik application is always composed of a single Web page, from the perspective of the Web browser. This page, through Ajax-based techniques morphs itself as it's state changes. In Morfik the state of an application user interface at any given point in time is considered to be a virtual page. Whenever the state of an application user interface changes in response to user input, the new state is thought of as a new virtual page.

What are Virtual Pages?

In Morfik a virtual page is an abstract entities representing the state of an application or website at one particular moment. Specific states that define how information will be presented to the end user can be visually designed and published as Pages.

These Pages can made identifiable by defining a URL for them. There are many virtual pages that are the result of transformations applied to a Page and are considered as internal to the application (not visible to the outside world). On the other hand the virtual pages that are published are extremely important as they expose points of interest, i.e. a functionality, within your application space to the outside world.

form-with-subform.png
Figure 1: Schematic diagram of a form with a subform control.


The diagram in Figure 1 shows a Form which contains a SubForm control into which another Form can be opened. This Form is the basis for the creation of two published virtual pages (URLs) which are shown in Figures 2.

two_virtual_pages_same_base.png
Figure 2: Diagram of the form shown in Figure 1 with two different forms within a subform.

Pages and URLs

Pages that are visually designed in the Morfik Development environment are still, technically, virtual pages. They are virtual pages that have significant meaning within your application, i.e. they are states that you wish to be reachable or addressable either from within your application or from the Web and thus need to be published as URLs. Once published a virtual page can be referenced through the use of the Hyperlink property of certain Morfik controls and may be bookmarked by users that want to return to that specific state within your application or Website.

virtual-pages-parametric-urls.png
Figure 3: Diagram of how a single parametric URL can lead to two different virtual pages,
based on different parameter values.


Pages and thus their URLs can take parameters which allows you to use the same page to display different data sets from the same data source. Figure 3 shows an example of a Page displaying different content based on a parameter.

Published URLs are very important in a Morfik application as they enable you to create the application's navigation structure virtually without coding while at the same time laying down the information required for search engines to index your content.

Published URL Parameters

Morfik web development methodology is heavily geared towards using parameters. Parameters are defined for forms and queries when they are created. Subsequently specific values need to be supplied whenever such forms or queries are invoked. This pattern and its requirements do not change with the new model of hyperlinks and Published URLs.

In the new system, parameter definition remains the same so far as forms and queries are concerned. However, there is a need for explicit representation of these parameters within a published URL.

A full URL has many parts including standard parameters that appear after the “?” delimiter as a sequence of name=value pairs separated by “&” in accordance with various web standards. A clean URL on the other hand is a non-technical term that is used to refer to URLs that do not have such parameters. A published URL in Morfik is a clean URL and does not use the notation above for parameter passing. Clean URLs use an implicit way of mapping values that appear in the main body of the URL to the corresponding parameters defined for the URL. This approach is often referred to as URL rewrite and normally is performed at the web server level. In Morfik this process happens within its framework.

Parameter mapping in Morfik occurs at the time that a URL is being published. Segments of a URL can be marked as representing a parameter value through the use of square brackets as shown below:

products/[prmCategory]/[prmProductName]

Given the above definition a given instance of a clean URL such as:

http://www.morfik.com/products/software/MorfikFX

can be mapped to a full URL as shown below:

http://www.morfik.com/products?prmCategory=software&prmProductName=MorfikFX

It is important to note that when publishing a URL no new parameter is being defined. Publishing of a URL only involves the mapping of segments of a URL to parameters that are already defined by the underlying forms. Using the mapping information, parameter values that are present in a clean URL are passed through to all forms that happen to have a parameter defined by the same name.

Mapping Ambiguity

It is important to mention that the process of parameter mapping is not perfect. There may be occasions where it is not possible to perform the mapping due to ambiguous definition of published URLs. Under these circumstances parameter mapping may not produce the expected result. Ambiguity results when two or more published URLs have overlapping paths with parameters that can be interpreted in multiple ways.

An example of this scenario is shown below:

http://www.morfik.com/products/software/[prmFeature]   
http://www.morfik.com/products/[prmCategory]/[prmProductName]   


In the example above the two Published URLs create ambiguity. If the following URL is supplied, both of the above Published URL definitions can be selected by the system to perform the required mapping.

http://www.morfik.com/products/Software/auto-deployment   


In the case where the first definition is selected, the mapping would produce the following full URL which is the correct mapping:

http://www.morfik.com/products/software?prmFeature=auto-deployment  


Using the second definition, the mapping would produce the following erroneous full URL:

http://www.morfik.com/products?prmCategory=Software&prmProductName=auto-deployment  


To resolve ambiguity Morfik uses the simple formula of selecting the published URL definition whose fixed portion (URL minus parameters) is the greatest in length.

Using the above formula the right result is obtained for the given instance of the supplied URL. However, if the following URL is encountered the wrong definition would be selected.

http://www.morfik.com/products/Software/MorfikFX 


The resultant full URL will be:

http://www.morfik.com/products/software?prmFeature=MorfikFX


instead of:

http://www.morfik.com/products?prmCategory=Software&prmProductName=MorfikFX


The above scenario highlights the need for careful selection of paths and a valid range of parameter values when defining parameters in a Form or Publishing URLs so as to eliminate potential for ambiguity.

Ambiguity can be totally removed from the above definitions if the first published URL definition was changed to:

http://www.morfik.com/products/softwareProduct/[prmFeature]   


And that “SoftwareProduct” was never chosen as a label for a product category.

Using Published URLs in Hyperlink properties

So far it is the definition of a URL that has been discussed. Referencing a published URL in the new hyperlink property is straightforward if constant parameter values were to be passed. This is rarely the case when working with data-bound forms. To pass parameter values, Morfik allows for a special notation to be used in a URL reference to signify a data source with the following syntax:

[$DatabaseFieldName]


Examples of valid hyperlink property values are:

  • Products/[$ Product]
  • FAQ/[$FAQID]
  • About/Public/[$Category]News/[$Title]
  • http://ww.mywebsite.com/uses/[$UserID]


Please note that this notation is only valid for internal navigation. Another important point is that if a reference is created in this manner then the resultant URL would have high dependency on the data content which may change and render the URL as a broken link. This is particularly important if the URL is likely to be bookmarked externally. For situations like that it’s best to define a URL field in a table rather than a simple text field. This way the URL value can remain the same while the description data changes.

Setting Up Hyperlinks

In general you will be using either a TextLabel, a Button or an Image control to act as the visual representation of a hyperlink in your application. All of the controls have a Hyperlink property which can be set to point either to a published URL for navigation within your own application or website, or to an external application which will take the user to another website. They an be set to point to other protocols such as mailto which will be handled by the browser and should bring up the user's email client to send an email to the specified address.

You can set the Hyperlink property of a control either by selecting a URL in the drop down that is displayed when you click on the small arrow by the editor for this property in the Properties panel, or by clicking the Link button in the Home tab of the ribbon when the appropriate control is selected. If you click on the Link button you will get a dialog for selecting a previously published URL or manually entering one. This dialog is shown in Figure 4.

binding-data-to-interface-edit-hyperlinks.png
Figure 4: Dialog for selecting or entering the URL which you want to assign to the selected control.


You can use hyperlinks for creating an isolated link just as you can to create a menu, through the usage of a group of controls you can create navigation menus for your application.


Huperlink Sub-Properties

There are two sub-properties that can be set for the Hyperlink property: Target and Title. These properties allow you to have a more fine-grained level of control of how the hyperlink behaves and is interpreted by search engines.

Target - This sub-property allows you to choose one of four options for how the browser will open the hyperlink: _blank, _self, _top, _parent.
Title - While the actual text that will appear on the screen is given by the caption of whatever control for whom the Link is being set, the Title property is looked at by search engines to evaluate the relevancy of the link.

See Also

Back to top