Defining portals

In MCS, a portal is a canvas with some specific attributes, and a region is a format that you define in a layout.

In MCS, a portal is a canvas with some specific attributes, and a region is a format that you define in a layout.

To support portals, MCS provides two distinct kinds of canvas. Top-level portal canvasses define complete pages in target markup, whereas included portlets define target page components only. See Types of canvas for details.

Note:

Mobile Portal Accelerator handles the aggregation of portlets. The examples in the section are for clarification purposes only.

Portal layouts

MCS supports two kinds of layout. Canvas layouts may be used for normal canvasses, portals and portlets. Montage layouts may not be used with portals.

If you construct a layout used with a portal canvas, you need to refer to and include layouts associated with the portlets that it includes. You do this by defining a Region format. Region formats are designed to contain complete layouts. At runtime, MCS uses the Name attribute entered in the region's Format Attributes view to associate the XDIME markup with the region.

Region formats are a little like panes, in that they cannot contain any other format definitions. Instead, they define areas that will contain content laid out according to some other layout or layouts.

In the example, the layout is named 'myPortal', so the region element refers to 'region1' within layout 'myPortal'.

<?xml version="1.0" encoding="UTF-8"?>
<canvas
  layoutName="/myPortal.mlyt"
  type="portal">
  <region name="region1">
    <include href="portletA.xml" parse="xml"/>
  </region>
</canvas>

It is possible to include multiple portlets within a single region, for example:

<?xml version="1.0" encoding="UTF-8"?>
<canvas
  layoutName="/myPortal.mlyt"
  type="portal">
  <region name="region1">
    <include href="portletA.xml" parse="xml"/>
    <include href="portletB.xml" parse="xml"/>
  </region>
</canvas>

In this case, both portlet pages are included sequentially, which normally causes the second portlet to appear after the first within the region. But you cannot specify any relative or absolute positioning of portlets or inclusions used in this way. To control relative positioning, you should use a separate region for each portlet or inclusion.

Portal themes

Each portal or portlet canvas can be associated with a theme that applies to the content in the canvas.

If you do not specify a theme for an included canvas, it will inherit its theme from its parent. For portlets, this means that they will inherit their theme from the enclosing portal. If a portlet has a theme and that theme defines a style with the same name as a style in the parent, the portlet's style attributes will be added to, and merged with, the parent style attributes.

Missing Regions

It is quite possible for a region tag to refer to a region that does not exist in the portal layout. This situation is analogous to that when a page refers to a pane that does not exist in its layout. In the case of the missing pane, MCS simply ignores content targeted to it and takes steps to avoid unnecessary generation of device dependent output.

Related topics