OpenWGA 7.10 - OpenWGA Concepts and Features

Design and development » WebTML » Features » Portlets

The portlet hierarchy and portlet paths

Portlets get registered in a hierarchical manner.

On every WebTML page there is an implicit root portlet. This is a portlet that is always there and just serves as a parent for your first self-created portlets.

When you include a portlet with <tml:include type="portlet"/> or <tml:portlet> then this portlet becomes the child portlet of this root portlet, so the root portlet becomes the parent portlet of this new portlet. 

Portlet may and should be cascaded. Inside the WebTML module that is included as portlet "userinfo" you may include other portlets, like for example of name "preferences". Then the portlet "preferences" becomes the child portlet of portlet "userinfo". Here is an example of cascaded portlets:

portlet-hierarchy.png


As you can see here is that WebTML identifies individual portlets by something called the portlet path, displayed at the top of every portlet here. It consists of the portlet name prefixed by the portlet path of the parent portlet. The root portlet has the path "/". Its child portlets have the path "/portletname", for example "/userinfo" for the portlet of name "userinfo". Child portlets of this one add their portlet name to the path, divided by a slash, "/userinfo/prefs" for example for the "prefs" portlet.

An important point to note about this is that every portlets name is only unique among all child portlets of its parent portlet. If you were to include another portlet named "preferences" directly on the root portlet then this would be a different portlet than the "preferences" portlet below the "userinfo" portlet. It would have the path "/prefs" instead of "/userinfo/prefs".