+

Search Tips   |   Advanced Search

Dynamic pages and portlets

The UX Screen Flow Manager not only supports redirecting users between static portal resources, but also between dynamic resources. The WebSphere Portal feature Dynamic UI Management is used. For more information, read Dynamic user interfaces.

Use the Dynamic UI Management feature to create pages and portlets at run time. We can also use it to modify a user's content model, and, implicitly, the navigation model, triggered by a user interaction. In most cases, a dynamic page is a transient copy of a template page, often referred to as base page. This transient copy behaves like a snapshot of the base page from the time when the copy was created. It contains all portlets of the base page and all its properties. A dynamic portlet is a transient copy of a portlet definition. We can add dynamic portlets only to dynamic pages.

The benefit of using dynamic pages instead of static pages is we can create multiple copies or instances of the base page. A user can then manually switch or be redirected between these instances.

Dynamic pages are always added under a so called extension node, a page to which a transformation is assigned.

During the processing of a dialog, single subdialogs can either be static or dynamic. If the subdialog is supposed to be dynamic, we can distinguish between the following two cases:

  • If the transition endpoint references a page, the redirect requires a dynamic page. The dynamic page needs to be a transient copy, of the referenced base page to be started and to be added under the extension node.

  • If the transition endpoint references a portlet, the redirect requires a dynamic portlet. The dynamic portlet needs to be a transient copy, of the referenced portlet definition to be started and to be added to an existing dynamic page. This case requires that a dynamic page is always created previously. The UX Screen Flow Manager ensures this requirement by starting an empty dynamic page. The dynamic portlet can then be added to that page.

Use the dialog definition to control whether a resource is to be started dynamically. We can also specify here under which extension node we want the dynamic copy to be added. Code sample 45 shows an example.

Code sample 45:

01 <dialog name="dialog1">
 02  <transition-endpoint name="page2">
 03      <resource uniquename="uniquename.page2"/>
 04      <invocation type="dynamic" extension-node="extensionNode1"/>
 05  </transition-endpoint>
 06  <transition-endpoint name="portlet1">
 07      <resource uniquename="uniquename.portlet1"/>
 08      <invocation type="static" extension-node="extensionNode1"/>
 09 </transition-endpoint>
 10  <transition-endpoint name="portlet2">
 11      <resource uniquename="uniquename.portlet2"/>
 12      <invocation type="dynamic" extension-node="extensionNode1"/>
 13  </transition-endpoint>
 14  <transition>
 15      <source>
 16          <transition-endpoint nameref="portlet1">
 17              <event qname="e1-1"/>
 18          </transition-endpoint>
 19      </source>
 20      <target>
 21          <transition-endpoint nameref="page2">
 22              <event qname="e2"/>
 23          </transition-endpoint>
 24      </target>
 25  </transition>
 26  <transition>
 27      <source>
 28          <transition-endpoint nameref="portlet1">
 29              <event qname="e1-2"/>
 30          </transition-endpoint>
 31      </source>
 32      <target>
 33          <transition-endpoint nameref="portlet2">
 34              <event qname="e2"/>
 35          </transition-endpoint>
 36      </target>
 37  </transition>    38 </dialog>

In this sample, we can see two transitions: In both cases, portlet1 exists on a static page. If the portlet emits the event e1-1, the user is redirected to page2. The page2 is in turn expected to be started dynamically underneath the extension node or page with the unique name extensionNode1. The dynamic page itself is a transient copy of the base page with the unique name uniquename.page2. If portlet1 emits the event e1-2, the user is redirected to portlet2, which is also expected to be started dynamically. As mentioned earlier, a dynamic page is required to which this dynamic portlet can be added. Therefore, the screen flow manager implicitly creates an empty dynamic page underneath the extension node or page with the unique name extensionNode1 to which the portlet is then being added.

The portal removes dynamic resources when they are no longer needed. For example, after a transition redirects a user from a dynamic page dpage1 to a dynamic page dpage2, dpage1 is removed and dpage2 is created.


Parent Advanced concepts