Preload notice JSP fragment

A preload notice is simply a set of JSP fragments defined in multiple markups.

All JSPs that go into preload notices are served by the WebSphere® Portal web module and are defined in the following directory structure:

wp_profile_root/installedApps/node_name/MPATheme.ear/MPATheme.war/preload/pln_fragment_name/xdime/default.jsp

where pln_fragment_name is the preload notice fragment name.

When you develop the JSP fragment, give it the name default.jsp and place it into this directory with a unique fragment name. The WebSphere Portal administrator will use the fragment name, in Manage Mobile Pages, to select a preload notice to configure for a particular page, URL, or portlet.

For example, the preload notice named GiveMeMoney can be found in this location: wp_profile_root/installedApps/node_name/MPATheme.ear/MPATheme.war/preload/GiveMeMoney/xdime/default.jsp

The JSP is an open canvas for whatever you want to fill, and default.jsp contains content for whatever type of preload notice you want to create. The following types of preload notice are defined:

Informational
Creates a JSP that displays an informational message. The user clicks OK to acknowledge the message.
Warning
Creates a JSP that displays a warning message. The user must choose to either accept or reject the warning.
Advertisement
Creates a JSP that displays text, images, and sounds to invite a user to buy a service or item. The user can click Yes to accept the offer.

Because preload notice fragment JSPs are included in the MPATheme EAR, you must update and redeploy the EAR if you add or modify a JSP fragment. See the topic Deploying updates to the MPATheme EAR in this information center.

WebSphere Portal provides you with some basic parameters for use in creating your JSP fragment. The following table describes the available parameters. You can use this code sample to pull the information out of the request.
<%
       String mwpTargetURL = (String)request.getAttribute("mwpTargetURL");
%>
Request Parameter Description
mwpTargetURL The URL of the target content that is the original URL where the user intended to visit.
mwpBackURL The URL of the page where the user came from before viewing the preload notice.
mwpTargetTitle An optional title that the administrator would like to appear on the preload notice. The preload notice must incorporate this title in order for it to be displayed.
mwpUser The user ID of whoever is currently logged in and is viewing this preload notice. If the user is anonymous then this value is null.
mwpContentOID The ObjectID of the content node containing the preload notice.
mwpPreloadNoticeID The preload notice ID.
mwpActionURL An optional URL to configure an action button. For an advertisement preload notice, it configures the Yes button. Custom preload notices may use this for any custom button.
mwpTimeOut Optionally defined timeout for the preload notices. Custom preload notices must add this capability to the custom JSP fragment and provide a URL to redirect to.
mwpDisplayDoNotPrompt Optionally defined Boolean to determine whether to allow a do not prompt check box. Custom preload notices must add this capability to the custom JSP fragment.
The XDIME aggregator provides a region in which to include XDIME preload notice JSP fragments. Therefore, the content of the JSP fragment must be contained within <canvas> tags:
<canvas layoutName="/wp_generic_preload_notice.mlyt" type="portlet">
  <pane name="T">
    <p>This is a preload notice!</p>
  </pane>
</canvas>

Within this <canvas> tag, you can add content for what is displayed to the user when the preload notice is shown. If you are including a title, you may want to hardcode a title or use the one defined by the administrator using the mwpTargetTitle request parameter. The example uses the /wp_generic_preload_notice.mlyt layout policy, which is available by default.

If custom policies are required, you must import new custom policies into the aggregator policies project.

Samples are provided and can be found in the following locations:
  • wp_profile_root/installedApps/node_name/MPATheme.ear/MPATheme.war/preload/sample_info/xdime/default.jsp
  • wp_profile_root/installedApps/node_name/MPATheme.ear/MPATheme.war/preload/sample_warning/xdime/default.jsp
  • wp_profile_root/installedApps/node_name/MPATheme.ear/MPATheme.war/preload/sample_ad/xdime/default.jsp



Terms of use
(C) Copyright IBM Corporation 2012. All Rights Reserved.