Tags used by the portal JSPs

 

+
Search Tips   |   Advanced Search

  1. Summary of the portal JSP tags
  2. Deprecated, prohibited, and obsolete tags
  3. Detailed descriptions of the portal JSP tags

 

Overview

This section describes the most commonly used tags in the portal JSPs. The corresponding taglib file is named engine.tld and can be found in...

wp_root/shared/app/WEB-INF/tld

Use these tags to modify the appearance and layout of the portal page.

The tags listed here should be used only in portal JSPs for themes, screens, and skins. Do not use portal engine tags in portlet JSPs.

 

Summary of the portal JSP tags

The following table provides a brief description of each tag.

Tag Description
<wps:answer/> Similar to the <wps:text> tag, where the key for the text in the bundle is taken from the answer indicator.
<wps:bidi/> This tag is used to support the display of bidirectional languages.
<wps:captureContent/> Makes the content of this tag available as a Java string in the PageContext.
<wps:component/> Makes the current component available with the name that is specified by the id attribute.
<wps:componentLoop/> Used by the aggregation components to iterate through all portlets that are defined for a container and write them to the page.
<wps:componentRender/> Calls the service() method of the component that is stored as attribute child in the page context.
<wps:compositionRender/> Indicates the starting point of aggregation for the portal.
<wps:constants/> Makes the <%= wpsBaseURL %> and <%= wpsDocURL %> constants available to the page.
<wps:date/>> Writes the current date depending on the user's locale and the style attribute.
<wps:favoritesLoop/> Makes the wpsFavoritesURL and wpsFavoritesTitle scripting variables available.
<wps:find/> Used to access the portal-wide find URL that is specified in Portal Settings.
<wps:if/> Through the attributes of this tag, several conditions can be checked. If the condition is true, the content of the tag is written to the page.
<wps:navigation/> Makes the wpsNavModel scripting variable available, which is used in the body of the tag to render navigation nodes.
<wps:navigationShift/> Prepares the URL for page shifts.
<wps:navigationLoop/> Cycles through navigation nodes (wpsNavNode) and children.
<wps:popupMenu/> Generates the markup for a pop-up menu.
<wps:popupMenuTemplate/> Defines the template that is used to define each pop-up menu item.
<wps:popupMenuItem/> Defines a single entry in the pop-up menu.
<wps:popupMenuParam/> Defines a parameter of a pop-up menu item.
<wps:portletBack/> Used in Control.jsp for rendering the back button in the title bar to allow the user to return to a previous mode.
<wps:portletConfigure/> Invoked when a portlet should be set to configure mode.
<wps:portletDelete/> Used in ShowTools.jsp for rendering the delete button to remove the portlet from the page.
<wps:portletEdit/> Used in Control.jsp for rendering the edit button in the title bar to allow the user to edit the portlet.
<wps:portletHelp/> Used in Control.jsp for rendering the help button in the title bar to take the given portlet to help mode.
<wps:portletID/> Inserts the instance ID of the current portlet (only works in Control.jsp) in the HTTP stream.
<wps:portletMaximize/> Used in Control.jsp for rendering the maximize button in the title bar to allow the user to maximize the portlet.
<wps:portletMinimize/> Used in Control.jsp for rendering the minimize button in the title bar to allow the user to minimize the portlet.
<wps:portletMoveDown/> Used in ShowTools.jsp for rendering the button that allows the user to move the portlet down on the page.
<wps:portletMoveLeft/> Used in ShowTools.jsp for rendering the button that allows the user to move the portlet to the left on the page.
<wps:portletMoveRight/> Used in ShowTools.jsp for rendering the button that allows the user to move the portlet to the right on the page.
<wps:portletMoveUp/> Used in ShowTools.jsp for rendering the button that allows the user to move the portlet up on the page.
<wps:portletRender/> Called when a portlet should be rendered by calling the render() method of the corresponding PortletHolder.
<wps:portletRestore/> This tag is used in Control.jsp for rendering the restore button in the title bar to allow the user to restore the portlet to its original state.
<wps:portletTitle/> Writes the title for a portlet.
<wps:problem/> Similar to the <wps:text tag, where the key for the text in the bundle is taken from the problem indicator.
<wps:screenRender/> Starts the rendering of the screen.
<wps:text/> Returns the text for a given key in the specified language. This is getting replaced by the <i18n:bundle/> and <i18n:message/> tags of the I18N tag library. See Use JSTL tags in the portal JSPs for more information.
<wps:textParam/> If the text that is retrieved contains placeholders in the form of "{0}", "{1}", "{2}", ..., these can be set using this tag.
<wps:time/> Writes the current time depending on the user's locale and the style attribute.
<wps:unless/> This tag operates in contrast to the <wps:if> tag.
<wps:url/> Creates a portal URL depending on the specified attribute.
<wps:urlBase/> Creates a URL to the WebSphere Portal base URI.
<wps:urlFind/> Generates a URL pointing to a file.
<wps:urlFindInSkin/> Similar to <wps:urlFind, this tag generates a URL pointing to a file in the /skins directory.
<wps:urlFindInTheme/> Similar to <wps:urlFind, this tag generates a URL pointing to a file in the /themes directory.
<wps:urlGeneration/> Creates a URL to pages or portlets.
<wps:urlParam/> This tag is used to add parameters to the parent URL. Parent tags include the <wps:url/> and <wps:urlGeneration/>.
<wps:urlParent/> Creates a URL that supports its surrounding parent tag.
<wps:user/> If the user is logged in, this tag returns one of the specified values of attribute.
<wps:width/> Determines the width of a component.

 

Deprecated, prohibited, and obsolete tags

The following tags are present in the engine tag library, but should not be used.

 

Detailed descriptions of the portal JSP tags

The following tags are used by the portal JSPs.

Some of the tags and attributes in the tag library are not listed here because they are either obsolete or should not be used for some other reason.

 

<wps:answer bundle="bundle">

Similar to the <wps:text> tag, where the key for the text in the bundle is taken from the answer indicator. This tag is used inside the <wps:portletRender> and <wps:compositionRender/> tags.

 

<wps:bidi dir="rtl|ltr" attribute="portlet" locale="locale">

This tag is used to support the display of bidirectional languages. Bidirectional languages are those that are typically read from right to left except when left-to-right text strings are displayed (for example, URLs, code samples, or directory and file names).

Attributes

  • dir

    Indicates the normal direction of text in the language.

    • For dir="rtl", the tag content is written only if the client's locale belongs to a bidirectional language. This is the default setting if dir is not specified.
    • For dir="ltr", the tag content is written only if the client's locale does not belong to a bidirectional language.

  • attribute="portlet"

    Indicates that the text is for the title of a portlet. This attribute is optional.

  • locale

    The tag content is written only if the language belongs to the bidirectional languages that are defined in LocalizerService.properties . If attribute is specified, locale is ignored.

 

<wps:captureContent contextKey="context_atribute">

Makes the content of this tag available as a Java string in the PageContext. The tag content is evaluated but does not appear in the page output unless explicitly written out by the developer. Any JSP or markup can be within the body of the tag. The contextKey attribute indicates the name of the attribute in the PageContext where the content will be available. This tag is useful in situations where you have content that is only accessible through JSP tags and you need that content in a Java scriptlet.
<wps:captureContent contextKey="com.yourco.myportlet.portlet.title">
    <wps:portletTitle/>
</wps:captureContent>
<%
    String portletTitle = (String) pageContext.getAttribute("com.yourco.myportlet.portlet.title");
%>

 

<wps:component id="identifier">

Makes the current component available with the name given through the id attribute.

 

<wps:componentLoop id="identifier">

This tag is used by the aggregation components to iterate through all portlets that are defined for a container and write them to the page. For example, if a user has two portlets that are defined for a page called News, those portlets' service methods are invoked within this loop and their output is written to the page when the user clicks the News tab. Do not change this tag or try to use it in any other context than as it is in the container JSPs. The id attribute is optional.

 

<wps:componentRender>

Calls the service() method of the component that is stored as attribute child in the page context. This tag can only be used within a <wps:componentLoop> tag and, as with <wps:componentLoop, should not be changed or used in any other context.

 

<wps:compositionRender>

Indicates the starting point of aggregation for the portal. It is also used to start the aggregation of a nested composition within a layered container. During aggregation, all pages that are available for the user are determined and the render() method of the root container of the active composition is called.

Attributes

  • includeBeginPage="yes|no"

    indicates whether the portlet container should invoke the portlets' beginPage() methods.

  • includeEndPage="yes|no"

    indicates whether the portlet container should invoke the portlets' endPage() methods.

  • skin="skin_name"

    overrides the skin definitions of the components of the composition (for example, containers or portlets). This attribute has special use in SelectPage.jsp and should not be used as a common method for setting skins in the portal.

 

<wps:constants>

Makes the following constants available to the page:

  • <%= wpsBaseURL %>

    Provides the fully qualified base URL of the portal site as specified during installation, for example, http://<hostname.yourco.com>:<port_number>/wps

  • <%= wpsDocURL %>

    Provides the URL to the product documentation located in the WebSphere Portal Web application directory, including the Information Center, Javadoc, and portal help. The URL returned includes the locale of the client, for example,...

    http://myserver.mydomain.com/wps/doc/locale/

    For example, the following code would generate a URL to the WebSphere Portal Information Center:

          <%= wpsDocURL %>/InfoCenter/index.html
          

 

<wps:date>

Writes the current date depending on the user's locale and the style attribute.

  • style=short: for example 8/30/01
  • style=medium: for example Aug 30, 2001
  • style=long: for example August 30, 2001

pattern="user_defined_pattern": Refer to the description of the SimpleDateFormat class in the JDK API documentation for details.

 

<wps:favoritesLoop/>

Makes the following scripting variables available inside the body of the tag. The body of this tag is executed for each favorite.

  • <% wpsFavoritesURL %> - the URL to access the favorite

  • <% wpsFavoritesTitle %> - the title of the favorite

 

<wps:find>

Used to access the portal-wide find URL that is specified in Portal Settings. The tag is conditional. If no URL is set, the body of the tag is not evaluated. A scripting variable called <% wpsFindURL %> is available inside the body of the tag for accessing the URL.

 

<wps:if attribute="value">

Through the attributes of this tag, several conditions can be checked. If the condition is true, the content of the tag is written to the page. Otherwise the content is skipped. More than one condition can be evaluated. For example, the user must be logged in and the user must have selected the Home page in order for the content of the following tag to be rendered:
   <wps:if loggedIn="yes" screen="Home">

      <!--  content area -->

   </wps:if>

Attributes of the <wps:if/> tag

 capableOf="capability"

indicates whether the client supports the specified capability. capability can be one of the following values:

  • HTML_2_0
  • HTML_3_0
  • HTML_3_2
  • HTML_4_0

  • HTML_CSS
  • HTML_FRAME
  • HTML_JAVA
  • HTML_JAVASCRIPT

  • HTML_NESTED_TABLE
  • HTML_TABLE
  • WML_1_0
  • WML_1_2
  • WML_TABLE

 locale="locale"

Indicates whether the locale of the client is that of the specified locale (or subtype of the specified locale). You can specify a comma-separated list, such as en, en_US .

 loggedIn="yes|no"

Indicates whether the user is logged in. For example, the following code will display a login link if the user is not logged in:

   <%-- login button --%>
   <wps:if loggedIn="no" notScreen="Login">

      <td class="wpsToolBar" valign="middle" nowrap>

      <a class="wpsToolBarLink" 
         href='<wps:url home="public" screen="Login" ssl="false"/>'>

            <wps:text key="link.login" bundle="nls.engine"/>

      </a>

      </td>

   </wps:if>

    

 navigationAvailable="yes|no"

Indicates if a navigation is available.

 newWindow="yes|no"

Indicates if the portlet is rendered in a separate browser window from the portal (HTML only).

 nodeInSelectionPath="yes|no"

Checks whether a page is selected. This means that the page is in the selected path by the user of which the content is shown.

 notLocale="locale"

Indicates if the locale is not of the specified value. This attribute operates in contrast to locale.

 notScreen="screen_name"

Indicates if the current screen is not of the specified value. This attribute operates in contrast to screen.

 pageAvailableNext="yes|no"

Checks if a subsequent set of pages are available to be accessed from the navigation. See <wps:navigationShift/> for an example.

 pageAvailablePrevious="yes|no"

Checks if a previous page is available. For example, this tag could be used in combination with a <wps:navigationShift to render a scroll icon when the number of user-defined pages exceeds the number of displayed page tabs.

 pageCompletelyActive="yes|no"

Indicates whether the page and its parents are active. The following example displays a message if the page is not active.
<wps:if pageCompletelyActive="no">
   <p align="center" class="wpsFieldErrorText"><b><br>
      &gt;&gt;&gt;
         <wps:text key="info.pagenotcompletelyactive" bundle="nls.engine"/>
      &lt;&lt;&lt;
   <br></b></p>
</wps:if>

 pageBookmarkable="true|false"

Renders its contents if the page can be bookmarked. A page can be set to bookmarkable using Manage pages. The following example provides an "Add to favorites" option in a select list to allow users to bookmark the current page, if the current page can be bookmarked.
     <wps:if pageBookmarkable="true">
       <option value='<wps:url command="AddBookmark" alias="Favorites"/>' >
       <wps:text key='link.favorites.add' bundle='nls.engine'/>
     </wps:if>
     

 portletMaximized="yes|no"

Indicates if the portlet is maximized.

 portletMode="edit|view|configure|help"

Checks if the portlet supports the requested mode. This tag is most useful in a customized skin. The skin JSPs are located in:

was_root/installedApps/hostname/wps.ear/wps.war/skins/markup/

 portletState="portlet_state"

Checks if the portlet is in the indicated state. Portlet states are normal, maximized, minimized, and solo. For example, in Control.jsp, the following code sets the tableHeight variable to 100%.

    <wps:if portletState="Normal,Maximized">
        <% tableHeight = "height=\"100%\""; %>
    </wps:if>

 portletSolo="yes|no"

Checks whether the portal is currently displaying a portlet in solo state. In the following example from Default.jsp, the toolbar is always displayed, but the placebar and pagebar are hidden when the current portlet is displayed in solo state.
   <td height="1" valign="top">                

      <%@ include file="./ToolBarInclude.jsp" %> 
             

      <%-- Don't show navigation in solo mode --%>

      <wps:if portletSolo="no">
          <%@ include file="./PlaceBarInclude.jsp" %>                              
          <%@ include file="./PageBarInclude.jsp" %>
      </wps:if>
             
   </td>

See Solo state for more information.

 problem="problem"

Indicates whether one of the following errors has occured.

  • userid.invalid
  • password.invalid
  • portlet.not.active
  • portlet.not.available
  • portlet.not.authorized
  • portlet.title.not.available

 resumeLevel="0|1|2"

Used in the Login.jsp screen to write the content of the tag if the value of this attribute is equal to the setting of the persistent.session.level key in ConfigService.Properties.

 resumeOption="0|1"

Used in the Login.jsp screen to write the content of the tag if the value of this attribute is equal to the setting of the persistent.session.option key in ConfigService.Properties .

 screen="screen_name"

Checks the value of the current screen name. Use a comma to separate multiple screen names. In the following example, this attribute is used to display a personal greeting if the screen is either Home or LoggedIn.
<wps:if loggedIn="yes" screen="Home,LoggedIn">

   <wps:text key="welcome" bundle="nls.engine">

      Welcome <wps:textParam>
          <wps:user attribute="givenName"/> 
      </wps:textParam>

      <wps:textParam>
           <wps:user attribute="familyName"/>
      </wps:textParam!>

   </wps:text>

</wps:if>

 showTools="yes|no"

Indicates whether additional controls for the portlet title bar and page tabs should be displayed. In the following example from ToolBarInclude.jsp, the show_tools_off.gif icon is displayed for the condition when showTools="no".
<wps:if loggedIn="yes">

  <wps:if showTools="no">

    <% if (firstButton) 
        { firstButton = false; } 
    else 
        { %> | <% } %>
     
    <a class="wpsToolBarLink" href='<wps:url command="ShowTools"/>'> 
     
        <img border="0" 
             align="absmiddle" 
             width="16" 
             height="19" 
             src='<wps:urlFindInTheme file="show_tools_off.gif"/>' 
             alt='<wps:text key="link.show.tools" bundle="nls.engine"/>' 
             title='<wps:text key="link.show.tools" bundle="nls.engine"/>'
    </a>

  </wps:if>

  <wps:if showTools="yes">

     <% if (firstButton) 
         { firstButton = false; } 
     else 
         { %> | <% } %>

     <a class="wpsToolBarLink" href='<wps:url command="ShowTools"/>'> 

     <img border="0" 
          align="absmiddle" 
          width="16" 
          height="19" 
          src='<wps:urlFindInTheme file="show_tools_on.gif"/>' 
          alt='<wps:text key="link.hide.tools" bundle="nls.engine"/>' 
          title='<wps:text key="link.hide.tools" bundle="nls.engine"/>'</a>

  </wps:if>

</wps:if>

For either condition, the <wps:url command="ShowTools"/> command is used to change the value of showTools, allowing the icon on the portal page to be used as a toggle. This condition is also checked in ShowTools.jsp to determine whether to render the move and delete portlet icons in the portlet title bar.

 

<wps:navigation>

Renders a navigation in a layered container (LayeredContainer-H.jsp or LayeredContainer-V.jsp). The navigation tag makes a scripting variable available called wpsNavModel. This object is used within the body of the tag to render the navigation nodes. The scripting variables that are created by the navigation tag, wpsNavModelUtil and wpsSelectionModel, are only accessible while within the body of the tag. The settings of the startLevel and stopLevel attributes determine whether the content of the navigation tag is evaluated. The navigation tag uses an "in-order" traversal of the navigation tree to select the nodes.

Attributes

  • startLevel

    (optional) The level on which this navigation is to begin showing information. If no start level is given, this tag will start at the navigation node after the levels that where shown by other JSPs . Default is level 1.

  • stopLevel

    (optional) The level on which this navigation is to stop showing information. Default is to render all levels.

  • computeNumLevelsToDisplay

    (optional) Compute the number of levels that will actually be shown by this navigation. When this attribute is set to "true", a scripting variable is made available inside the body of the navigation tag named wpsNavNumLevelsToDisplay of Java type java.lang.Integer.

 

<wps:navigationLoop>

This tag can only be used within the body of a <wps:navigation> tag. This tag indicates the part of the markup that will be repeated once for each navigation node. There are no attributes for this tag. The body of this tag is executed for each navigation node. This tag makes available the following scripting variables that are only accessible while inside the body of the tag:

  • <% wpsNavNode %> (internal class type))

    This variable is the current navigation node available for access.

  • <% wpsNavLevel %> (type java.lang.Integer)

    This variable is the current navigation level of the node relative to the startLevel. This value is affected by the startLevel attribute of the parent navigation tag and always starts at a value of 1.

  • <% wpsNavTreeLevel %> (type java.lang.Integer)

    This variable is the current navigation level of the node relative to the top of the navigation tree. This value is not affected by the startLevel of the parent navigation tag and will always represent the true level of the node within the hierarchy.

 

<wps:navigationShift by="number" maxPages="number">

Used in the navigation to create a URL that will scroll to the next set of page links when the number of available pages exceeds maxPages. The by attribute indicates the number of page links to scroll.

In the following example, a maximum of six page links can be shown in the navigation for the current level. If a user has more than six pages available, then the URL created by the nested <wps:urlParent/> tag scrolls to the next five page links, leaving one of the page links from the current set remaining. To create a link that scrolls to the previous set of 5 page links, the by attribute would be set to "-5".


<wps:navigationShift by="+5" maxPages="6" >
  <wps:if pageAvailableNext="yes" >
    <a href=' wps:urlParent/> '>
    <img alt="<wps:text key="link.next" bundle="nls.engine"/>" 
         src="<wps:urlFindInTheme file='<%="tab_next"+bidiImageRTL+".gif"%>' />" 
         border="0" align="absmiddle">
    </a>
  </wps:if>
  <wps:if 
pageAvailableNext="no">

    <img alt="<wps:text key="link.next" bundle="nls.engine"/>" 
      src="<wps:urlFindInTheme file='<%="tab_next_dis"+bidiImageRTL+".gif"%>' />" 
      border="0" align="absmiddle">
  </wps:if>
</wps:navigationShift

  • The scroll link uses a tab_next.gif icon when more pages are available and a disabled tab_next_dis.gif icon when there are no more pages available.

  • The pageAvailableNext attribute determines which icon to display.

  • The <%=bidiImageRTL%> scripting variable is used to invoke the appropriate icon, for example, tab_next_rtl.gif, when the locale belongs to a bidirectional language.

 

<wps:popupMenu maxItem="number">

Generates the markup for the pop-up menu. This tag is designed to work with WML clients that might require a customized pop-up menu for some screens. The contents of the menu are defined by other tags. The actual markup for the menu is produced by this tag. The basic method of producing the pop-up menu is as follows.

  1. Define the menu template (using the <wps:popupMenuTemplate> tag)
  2. Define each item in the menu (using the <wps:popupMenuItem> and <wps:popupMenuParam> tags)
  3. Generate the markup (using the <wps:popupMenu> tag)

By default, this tag produces markup for all menu items that have been defined. The optional parameter maxItem can be used to limit the markup to only the first number of items. As an example, the following tags could be placed in the <template/> section of a WML deck (in the /themes/wml/Default.jsp file):



     <template>

         <%-- basic template for the popup menu --%>
         <wps:popupMenuTemplate
             <do type="options" label="{0}">
                 {1}
             </do>
         </wps:popupMenuTemplate

         <%-- 1. Back --%>
         <wps:popupMenuItem item="1">
             <wps:popupMenuParam param="0">
                 <wps:text key="link.back.wml" bundle="nls.engine"/>
             </wps:popupMenuParam
             <wps:popupMenuParam param="1">
                 <prev/>
             </wps:popupMenuParam
         </wps:popupMenuItem

         <%-- 2. Home --%>
         <wps:popupMenuItem item="2">
             <wps:popupMenuParam param="0">
                 <wps:text key="link.home.wml" bundle="nls.engine"/>
             </wps:popupMenuParam
             <wps:popupMenuParam param="1">
                 <go href="<wps:url home="public" />"/>
             </wps:popupMenuParam
         </wps:popupMenuItem

         <%-- 3. LogIn --%>
         <wps:popupMenuItem item="3">
             <wps:popupMenuParam param="0">
                 <wps:text key="link.login.wml" bundle="nls.engine"/>
             </wps:popupMenuParam
             <wps:popupMenuParam param="1">
                 <go href="<wps:url screen="Login" />"/>
             </wps:popupMenuParam
         </wps:popupMenuItem

         <wps:if notScreen="Login" >
             <wps:popupMenu />
         </wps:if>

     </template>


  1. The <wps:popupMenuTemplate/> defines each item as a WML <do type="options" /> statement that has a variable label and body.

  2. The first item in the menu is defined to have a label of "Back" (link.back.wml in the nls/engine.properties bundle) and the body is mapped to the <prev/> command.

  3. The second item is defined to have a label of "Home" and is mapped to the home page by the <wps:url> tag.

  4. The third item is defined to have a label of "Login" and is mapped to the login page.

  5. The last <wps:if> tag generates the markup for the pop-up menu for all screen other than the login screen.

Because this is all defined in the WML template, all cards in the WML deck will use this menu definition. On an Openwave browser, the menu items are generated with numbers that can be pressed to invoke the option. This menu would be rendered

     1 Back
     2 Home
     3 Login

On other browsers (such as Nokia), the menu items are displayed without numbers. So on some phones the menu would be rendered

     Back
     Home
     Login

and the user would have to scroll down to select each item. However, on the Login screen, the third item should be mapped to the LoginUser command, rather than the Login screen, following these steps:

  1. Not generating the pop-up menu markup in the <template/> section (using <wps:if notScreen="Login"/>)
  2. Redefining the third menu item in the <card/> section
  3. Generating the markup in the <card/> section

In the file, /screens/wml/Login.jsp:



     <card id="Login" title="<wps:text key="link.login" bundle="nls.engine"/>">
         <wps:popupMenuItem item="3">
             <wps:popupMenuParam param="1">
                 <go href="<wps:url command="LoginUser"/>" method="post">
                     <postfield name="userid" value="$userid"/>
                     <postfield name="password" value="$password"/>
                 </go>
             </wps:popupMenuParam
         </wps:popupMenuItem

         <wps:popupMenu />

         ...

     <card />


 

<wps:popupMenuTemplate/>

Defines the template that is used to define each pop-up menu item. The body of this tag should be a message format pattern with up to five parameter substitutions (numbered {0} to {4}). For example,
     <wps:popupMenuTemplate
         <do type="options" label="{0}">
             {1}
         </do>
     </wps:popupMenuTemplate

defines a template that will use parameter 0 as its label and parameter 1 as its action.

 

<wps:popupMenuItem item="menu_item"/>

Defines a single entry in the pop-up menu. The body of this tag should be a series of <wps:popupMenuParam> tags that define the parameters for menu_item. The item parameter is required and ranges from 1 to 10.

 

<wps:popupMenuParam param="n" trim="true|false"/>

Defines a parameter of a pop-up menu item. The body of this tag should be a string to be substituted for the {n} parameter in the pop-up menu template. The param attribute is required and should only appear nested inside of a <wps:popupMenuItem> tag. By default, the body of the tag is trimmed before being substituted into the template. If trimming is not desired, it can be turned off by setting the optional trim attribute to "false".

 

<wps:portletBack>

This tag is used in the control for rendering the back button in the title bar to allow the user to return to a previous mode. The content of this tag includes a link (rendered as <%=wpsPortletBackURL%> or <wps:urlParent>) and an icon image. The link for taking the portlet back is generated depending on the portlet's current window state.
<wps:portletBack
   <td class="wpsPortletTitle">
      <a href='<%=wpsPortletBackURL%>'>
      <img border="0" align="absmiddle" width="12" height="12"
           src="<wps:urlFindInTheme file='<%= "title_back" + bidiImageRTL + ".gif" %>'/>"
           alt='<wps:text key="back" bundle="nls.titlebar"/>'
           title='<wps:text key="back" bundle="nls.titlebar"/>'></a></td>
</wps:portletBack

 

<wps:portletConfigure newWindow="true|false|yes|no">

This tag is used in the control for rendering the configure button in the title bar to allow the administrator to configure the portlet. The content of this tag includes a link (rendered using <%=wpsPortletConfigureURL%> or <wps:urlParent>) and an icon image. The newWindow attribute is not supported for this mode.

 

<wps:portletDelete/>

Used in ShowTools.jsp for rendering the delete button to remove the portlet from the page. Before showing the delete portlet button, the tag checks if the portlet can be deleted at all. The content of this tag includes a link (rendered as <wps:urlParent/>) and an icon image.

 

<wps:portletEdit newWindow="true|false|yes|no">

This tag is used in the control for rendering the edit button in the title bar to allow the user to edit the portlet. The content of this tag includes a link (rendered as <%=wpsPortletEditURL%> or <wps:urlParent>) and an icon image. The newWindow attribute is not supported for this mode.

 

<wps:portletHelp newWindow="true|false|yes|no">

This tag is used in the control for rendering the help button in the title bar to take the given portlet to help mode. The content of this tag includes a link (rendered as <%=wpsPortletHelpURL%> or <wps:urlParent>) and an icon image. The newWindow attribute indicates that, for HTML, the portlet help should be rendered in a new browser window. The default is "no" or "false".

 

<wps:portletID>

Inserts the instance ID of the current portlet (only works in the control) in the HTTP stream.

 

<wps:portletMaximize>

This tag is used in the control for rendering the maximize button in the title bar to allow the user to maximize the portlet. Before showing the maximize button, the tag checks if the portlet supports the maximize state or if the portlet is already in that state. The content of this tag includes a link (rendered as <%=wpsPortletMaximizeURL%> or <wps:urlParent>) and an icon image.

 

<wps:portletMinimize>

This tag is used in the control for rendering the minimize button in the title bar to allow the user to minimize the portlet. Before showing the minimize button, the tag checks if the portlet supports the minimize state or if the portlet is already in that state. The content of this tag includes a link (rendered as <%=wpsPortletMinimizeURL%> or <wps:urlParent">) and an icon image.

 

<wps:portletMoveDown/>

Used in ShowTools.jsp for rendering the button that allows the user to move the portlet down on the page. Before showing the move down button, the tag checks if the portlet can be moved down. The content of this tag includes a link (rendered as <wps:urlParent/>) and an icon image.

 

<wps:portletMoveLeft/>

Used in ShowTools.jsp for rendering the button that allows the user to move the portlet to the left on the page. Before showing the move left button, the tag checks if the portlet can be moved left. The content of this tag includes a link (rendered as <wps:urlParent/>) and an icon image.

 

<wps:portletMoveRight/>

Used in ShowTools.jsp for rendering the button that allows the user to move the portlet to the right on the page. Before showing the move right button, the tag checks if the portlet can be moved right. The content of this tag includes a link (rendered as <wps:urlParent/>) and an icon image.

 

<wps:portletMoveUp/>

Used in ShowTools.jsp for rendering the button that allows the user to move the portlet up on the page. Before showing the move up button, the tag checks if the portlet can be moved up. The content of this tag includes a link (rendered as <wps:urlParent/>) and an icon image.

 

<wps:portletRender>

Called when a portlet should be rendered by calling the render() method of the corresponding PortletHolder. This tag can only be used inside the control. Within this tag, the method to determine if the user is allowed to view, edit, or configure the portlet, is implemented. The render() method of the PortletHolder is called if the user is allowed to perform the requested mode. In this case the body of the tag is skipped.

If a portlet is not active or deactivated, the body of the tag is executed and a corresponding message can be shown with the problem tag, or other error handling can be implemented. The body of the tag could hold further JSP code.

See the <wps:problem> tag or <wps:if portletstate> for an example of how this tag is used in Control.jsp .

 

<wps:portletRestore>

This tag is used in the control for rendering the restore button in the title bar to allow the user to restore the portlet to its original state. The content of this tag includes a link (rendered as <%=wpsPortletRestoreURL%> or <wps:urlParent>) and an icon image.

 

<wps:portletTitle id="identifier">

Writes the title for a portlet. If the portlet is not available or disabled, a special title is written that indicates that the origin title is not available. The content of the tag is evaluated only if problems occur during the processing and can be used for error processing. When id is specified, the tag initializes a scripting variable with the value that is normally written out and nothing is written to the output stream. The value of the id attribute is the name of the scripting variable.

In this example in Control.jsp, the title is rendered in a table cell. Alignment is determined by the <%= bidiAlignLeft %> variable, which is set in the file BidiInclude.jsp.



<td class="wpsPortletTitle" nowrap align="<%= bidiAlignLeft %>" valign="middle">
    <wps:portletTitle
      <wps:problem bundle="nls.problem"/>
   </wps:portletTitle 
   <img alt="" border="0" width="1" height="12"
     src='<wps:urlFindInTheme file="title_minheight.gif"/>'>
</td>



 

<wps:problem bundle="bundle">

Similar to the <wps:text> tag, where the key for the text in the bundle is taken from the problem indicator. This tag is used inside the <wps:portletRender> and <wps:compositionRender/> tags.

Example



     <wps:compositionRender
         <P align="center">
         <B><wps:problem bundle="nls.problem"/></B>
         <BR>
         <wps:answer bundle="nls.problem"/>
         </P>
     </wps:compositionRender


 

<wps:screenRender/>

This tag is used in a theme JSP and indicates the location to render the current screen. Types of screens include Home (default), Login, and Error. This tag can only be used once in the portal.

Example

This part of the Default.jsp puts the screen in a row underneath the portal toolbar, place bar, and page bar.



    <table border="0" cellpadding="0" cellspacing="0" height="100%">
     <tr>
         <td height="1" valign="top">
             <%@ include file="./ToolBarInclude.jsp" %>
             <%@ include file="./PlaceBarInclude.jsp" %>
             <%@ include file="./PageBarInclude.jsp" %>
         </td>
     </tr>
     <tr>
         <td height="100%" valign="top">
             <wps:screenRender/>
         </td>
     </tr>
    </table>


 

<wps:text key="key" bundle="bundle">

Returns the text for a given key in the specified language. The key indicates a parameter in a resource bundle or properties file, indicated by bundle. Both attributes are required. See the description of <wps:textParam> for an example and further description of the attributes of <wps:text/>.

Where possible, the <i18n:bundle/> and <i18n:message/> tags of the I18N tag library should be used instead of <wps:text/>. See Use JSTL tags in the portal JSPs for more information.

 

<wps:textParam>

If the text that is retrieved contains placeholders in the form of "{0}", "{1}", "{2}", ..., these can be set using this tag. The text to be substituted for the placeholders needs to be entered as content for this tag. It can even be an expression.

Examples

The welcome parameter in a resource bundle is set as follows:


   welcome = Welcome {0}!

In the following example, the value of the <wps:textParam tag is written in place of the {0}.

<wps:text key="welcome" bundle="nls.engine">
    <wps:textParamWorld</wps:textParam
</wps:text

 

<wps:time style="style">

Writes the current time depending on the user's locale and the style attribute.

  • style=short: for example 2:42 PM

  • style=medium: for example 2:42:09 PM

  • style=long: for example 2:42:21 PM GMT+2:00

 

<wps:unless>

This tag operates in contrast to the <wps:if> tag. Through the attributes of this tag, several conditions can be checked. If the condition is true, the content of the tag is not written to the page. Otherwise, the content is written. More than one condition can be evaluated. The following attributes can be evaluated. For more information, see the <wps:if> tag.

 

<wps:url>

Creates a portal URL depending on the specified attribute. Only one of the screen, command, or home attributes can be specified in a single <wps:url/> tag.

Attributes

  • reqid="yes|no|true|false"

    In the logged-in mode, URLs carry a request ID to allow proper sequencing of the requests. Requests with outdated IDs are not executed anymore. To allow out-of-sequence requests, the value of "no" or "false" turns off sequence checking for this URL.

  • home="public|protected"

    Creates a URL pointing to the public or protected (logged in) page of the portal.

  • screen="screen_name"

    Creates a URL pointing to the screen name to be displayed.

  • command="LoginUser|LogoutUser|ShowTools"

    Creates a URL that issues the command to the portal. command="LoginUser" is used for the login panel and command="LogoutUser" is used for the logout button. The "userid" and "password" parameters have to be carried with a login URL. command="ShowTools" toggles the value of the showTools indicator.

  • commandParam="parameter_name"

    Directs the portal engine to obtain the actual command to execute from an HTTP request parameter instead of on the URL directly. The name of the parameter is the value of the commandParam attribute. This is useful in situations where different commands need to be conditionally executed yet only one URL can be specified. Such is the case when using a <form> tag with a <select>. This enables use of the HTML form without requiring JavaScript. For example:

    <form name="someFormName" method="GET" style="margin-bottom: 0"
             action='<wps:url commandParam="requestParamName"/>'>
      <select name="requestParamName" onchange="javascript: this.form.submit(); ">
        <wps:someLoop>
          <option value="<%= theUrl %>" >Some title goes here
        </wps:someLoop>
    
      </select>
      <noscript>
        <input type="image" border=0 align=absmiddle src='go.gif'/>Go
      </noscript>
    </form>
    

    The previous code example works both with and without JavaScript enabled.

  • ssl="yes|no|true|false"

    Creates a secure URL (HTTPS).

Example

This part of a user login form uses the <wps:url tag to process input fields, user ID, and password.



<FORM method="POST"
     action='<wps:url command="LoginUser"/>'
     enctype="application/x-www-form-urlencoded"
     name="LoginPage">


 

<wps:urlBase>

Deprecated. Creates a URL to the WebSphere Portal base URI. For example, if the default base URI was kept during installation, this tag would point to http://myserver.mydomain.com/wps. It could be used to include resources from a fixed location independent of themes and skins.

The alternative to this tag is to use the <%= wpsBaseURL %> constant, which can provide better performance for compiling. See the description of the <wps:constants> tag for more information.

 

<wps:urlFind>

Generates a URL pointing to a file. The resource is searched under different paths depending on the markup and locale supported by the client and the specified attributes of the tag.

Attributes

  • root="root"
  • path="path"
  • file="file"

    This attribute is required

The first place where the resource is found is used to construct the URL. The search order used is:

  1. root path
  2. markup name
  3. path
  4. markup version
  5. locale in diminishing sequence
  6. file name

 

<wps:urlFindInSkin file="file_name" id="identifer">

Similar to <wps:urlFind>, this tag generates a URL pointing to a file in...

was_root/installedApps/hostname/wps.ear/wps.war/skins

The skin is taken from the user's or system's settings. The file attribute is required.

When id is specified, the tag initializes a scripting variable with the value normally written out and nothing is written to the output stream. The value of the id attribute is the name of the scripting variable.

 

<wps:urlFindInTheme file="file_name" id="identifer">

Similar to <wps:urlFind>, this tag generates a URL pointing to a file in...

was_root/installedApps/hostname/wps.ear/wps.war/themes

The theme is derived from the user or system settings. The file attribute is required.

When id is specified, the tag initializes a scripting variable with the value normally written out and nothing is written to the output stream. The value of the id attribute is the name of the scripting variable.

 

<wps:urlGeneration attribute="value">>

Creates a URL to pages or portlets. The tag is conditional. If the URL cannot be found, the body of the tag is not evaluated. Inside the body of the tag, the <% wpsURL %> scripting variable can be used to write the URL directly to the output stream. For example:
     <a class="wpsToolBarLink" href='<% wpsURL.write(out); %>'>Edit Page</a>

Attributes

  • root="id|name"

    indicates the ID or unique name of the root container of the page. Used with navigationNode to bypass searching for the page and improve performance. Currently, there is only one root node called Home.

  • navigationNode="id|name"

    indicates the ID or unique name of the container of the page. Used with root to bypass searching for the page.

  • contentNode="id|name"

    Indicates the ID or unique name of the composition. If 'root' and 'navigationNode' are not given, the name or ID of the content node will be used to search for root and navigation node ID. The name or ID of the content node is also used to specify the page where the portlet can be found. In the case of a portlet, the navigation node ID will be used to find the content node ID if none is given.

  • compositionNode="id|name"

    Indicates the ID or unique name of the control that holds the portlet. Must be used in combination with 'contentNode' or 'navigationNode' in order to identify the page where the portlet is located.

  • portletWindowState="maximized|solo|normal"

    in the case of a portlet, indicates the state of the portlet window when it is displayed. If portlet state is not specified, the page will be shown with the previous state of the portlet. This parameter is ignored if no compositionNode is set.

    Use caution when using this tag to address portlets in solo state. The portlet must be capable of exiting solo state using the createReturnURI() method. If a portlet without this method is placed in solo state, then users are forced to log out or close their browser windows in order to return to the portal.

  • pacCheck="CreatePage|EditLayout|DeletePage|AssignRoles|NoCheck"

    Indicates the permissions to be checked. If the user does not have the given permission, the body of the tag is not executed. If the user has the necessary permissions, the current page ID is appended to the URL. If the parameter is set to 'noCheck', the current page ID is appended without checking the access control permissions. This is necessary for the target page or portlet to create a back button.

  • useReqID="true|false"

    Determines whether a request ID is appended to the URL. This can be used to open a new browser window while preserving the validity of the links. Indicates if the request ID should be added to the URL. Default is true.

  • newWindow=""true|false""

    Creates a session partition. For portlet URLs, this should be used if you want to display the portlet either in a new window or in an iFrame. The default value is false. The portlet window state for the addressed portlet in the new window is set to maximized. The portlet mode is set to the value of the current parent window. In the control.jsp of Skins that use iFrames, the <wps:if/> tag can be used to distinguish between rendering in the main window or in an iFrame or detached window.

Examples

The following example generates a URL to a page based on ID of the page container:



<wps:urlGeneration root="180" navigationNode="191"> 


The following example is used in the drop-down list in the toolbar to generate a URL to the Organize Favorites portlet. The noCheck value indicates that the user's access control is not checked prior to generating the tag content.



<wps:urlGeneration contentNode="wps.Organize Favorites" 
                portletWindowState="Normal" pacCheck="NoCheck">
   <option value='<% wpsURL.write(out); %>' >
   <wps:text key='link.favorites.orgainize' bundle='nls.engine'/>
</wps:urlGeneration


<wps:urlGeneration/> can be used together with <wps:urlParam/> to pass parameters to a portlet. In the following example, the <wps:urlParam/> is used to send parameters to the Content portlet so that the portlet can launch with the specified page opened for editing.



<wps:urlGeneration contentNode="<%=wpsContentNode%>" 
                portletWindowState="Normal" 
                pacCheck="<%=CreateUrlCommand.PAC_EDIT_LAYOUT%>">
    
   <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_INIT %>" 
      value="init" />
   <wps:urlParam name="<%= SharedParamConstants.WORKING_CONTENT_NODE%>" 
      value="<%= wpsContentNodeID %>"/>
   <wps:urlParam name="<%= SharedParamConstants.ORIGIN_CONTENT_NODE %>" 
      value="<%= wpsContentNodeID %>" />
   <wps:urlParam name="<%= SharedParamConstants.WPS_ADMIN_NAVIGATION_PUSH %>" 
      value="push" />
    
   <td class="wpsLinkBar" valign="middle" align="<%=bidiAlignRight%>" nowrap>
      <a href="<% wpsURL.write(out); %>" class="wpsLinkBarLink">
      <wps:text key="link.editlayout" bundle="nls.engine"/>
      </a>
   </td>
    
</wps:urlGeneration


 

<wps:urlParam name="parameter_name" value="parameter_value">

This tag is used to add parameters to the parent URL. Parent tags include <wps:url/> and <wps:urlGeneration/>.

The parameters can be used by the target, for example, a portlet.

This tag can add parameters to the URL after the URL is generated. This tag can be used to pass context data further to the next portlet. When UrlParamTag is called a new URL will be generated.

For example


  <wps:url command="ChangeLanguage">
      <wps:urlParam name="locale">de</wps:urlParam
  </wps:url

 

<wps:urlParent screen="screen_name">

This tag creates a URL that supports one of the following surrounding tags. For better performance, use the parent tag's scripting variable if one is available.

<wps:PortletMaximize>

Used in the control to put the portlet in maximize state.

<wps:PortletMinimize>

Used in the control to put the portlet in minimize state.

<wps:PortletRestore>

Used in the control to put the portlet in normal state.

<wps:PortletBack>

Used in the control to return the portlet to its previous mode.

<wps:PortletConfigure>

Used in the control to put the portlet in configure mode.

<wps:PortletEdit>

Used in the control to put the portlet in edit mode.

<wps:PortletHelp>

Used in the control to put the portlet in edit mode.

 

<wps:user attribute="value">

If the user is logged in, this tag returns one of the specified user attributes. value can be any user attribute defined to Member Manager.

 

<wps:width>

Determines the width of a component. This tag is valid only within the <componentLoop> tag.

See also