WebSphere Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows


 

<portal-navigation/> tags

The <portal-navigation/> tags are used to implement navigation tasks such as generating URLs and traversing the portal navigation model.

The following section provides detailed descriptions of the <portal-navigation/> JSP tags:

<portal:favoritesLoop/>

This tag is deprecated and should be replaced by using the <portal-navigation:navigation/> tag in conjunction with its scopeUniqueName attribute.The following code example uses this tag to create the "Organize Favorites" functionality. To use this code, place it within the themes that you wish to have this functionality.
<%@ taglib uri="/WEB-INF/tld/portal.tld" prefix="portal" %>
<portal-logic:if loggedIn="yes" notScreen="SelfcareUserForm,SelfcareUserConf">
<table border="0"  cellpadding="0" >
	<tr>
	<td align="<%=bidiAlignRight%>" valign="middle" dir="ltr" nowrap>
	<%
	boolean firstItem = true;
	%>  					  
	<table border="0" cellpadding="0"  <%= bidiDirAttr %> >
	<tr>
	<td valign="middle">
	<form tabIndex="8" name="wpsFavoritesSelectionForm" method="GET" 
	 style="margin-bottom: 0" 
	 action='<portal-navigation:url commandParam="favoritesCommand"/>'>
	<select name="favoritesCommand" onchange="javascript: if 
  (this.options[this.selectedIndex].value.charAt(0) == '@')
 { 			window.open(this.options[this.selectedIndex].value.substring(1),
  '_blank'); this.selectedIndex=0; return false;} 
 else {	this.form.submit(); return false; }">

			<option value='#' selected><wps:text key='link.favorites.myfavorites'
			bundle='nls.engine'/>

			<portal-logic:if pageBookmarkable="true">
			<option value='<portal-navigation:url command="AddBookmark"
			alias="wps.My Favorites"/>'><portal-fmt:text key='link.favorites.add'
			bundle='nls.engine'/>
			</portal-logic:if>

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

			<option value='#'>------------
					
				<portal:favoritesLoop>
				<% 
				// wpsFavoritesURL is null for folders in the list of favorites
				if (wpsFavoritesURL != null)
				{
				// Check the favorite type.  If it is an external URL, add a symbol to the URL
				// so the JavaScript on the select can detect when to open a new window
				// wpsFavoritesType may be null.  wpsFavoritesType=1 means external URL
					if ("EXTERNALURL".equals(wpsFavoritesType))
					wpsFavoritesURL = "@" + wpsFavoritesURL;
				//Phone number links are only supported on WML devices... and
					favorites are not markup-specific.
				// wpsFavoritesType may be null.  wpsFavoritesType=2 means Phone Number
					if (!"2".equals(wpsFavoritesType))
					{
					%>
					<option value="<%= wpsFavoritesURL %>">
					<% for (int favSpace=1; favSpace < wpsFavoritesLevel.intValue();
					favSpace++) {%>   <% } %><%= wpsFavoritesTitle %>
					<%
					}
					}
					else
					{
					%>
					<option value="#" ><% for (int favSpace=1; 
					favSpace < wpsFavoritesLevel.intValue();
					favSpace++) {%>   <% } %>--<%= wpsFavoritesTitle %>--
					<%
					}
					%>
					</portal:favoritesLoop>
				</select>
				<noscript>
				<input type="image" border="0" align="absmiddle"
				src='<portal-logic:urlFindInTheme file="go.gif"/>'/>
				<span class="wpsPlaceBarLink" > <portal-fmt:text key="go"
				bundle="nls.button"/></span>
				</noscript>
				</form>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</portal-logic:if>

<portal-navigation:navigation>

Initializes a set of objects an makes them available through scripting variables. These objects are required for the rendering process of the navigation. The scripting variables are accessible only 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

<portal-navigation:navigationLoop>

Traverses through the navigation model. This tag is nested inside of the <portal-navigation:navigation/> tag when used. 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 several scripting variables available for obtaining information for the navigation. These scripting variables are accessible only within the body of the tag.

<portal-navigation: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. If this tag is not used, all page links for the current level are rendered.

<portal-navigation:navigationUrl type="link|expand|collapse|launch" varname="node_name" var="variable_name"/>

Creates URLs for navigation nodes. The tag is used inside the body of the <portal-navigation:navigationLoop> tag and outputs links for the current navigation node according to the type attribute.

Attributes:

type

Use one of the following values:

  • type="link" creates a URL to change the selected node
  • type="expand" creates a URL that expands the node to reveal its child nodes. This is intended for expanding the navigation tree.
  • type="collapse" creates a URL that collapses the node to conceal its child nodes. This is intended for collapsing the navigation tree.
  • type="launch" creates a URL that either launches a page if all conditions for the page launch are fulfilled for the navigation node or if just like in the selection URL in type="link"
Note: The global state of the portal navigation trees is collapsed by default (with some exceptions, such as the Portal Administration navigation). You can configure the default state of the portal navigation trees to expand all nodes by setting the Portal Configuration Service property navigation.expansion.defaultstate to true.

varname

Specifies an object of type com.ibm.portal.navigation.NavigationNode for which the URL is to be generated. The attribute is optional.

var

Specifies the name of a scripting variable that will be exposed in the body of the tag. The attribute is optional. The variable exposes an object that implements com.ibm.portal.DisposableURL that can be used to stream the URL to the output. If the content node referenced by the navigation node is an internal URL, the body is evaluated only if the target of the internal URL is accessible.

forceAbsolute = "true|false"

This attribute is optional. It specifies whether the URL that is generated by this tag is to be absolute or not. If you set this attribute to true, absolute URLs are enforced; in this case other settings that affect the generation of URLs might be overridden.

To generate the title or description of a navigation node, use the <portal-fmt:title/> or the <portal-fmt:description/> tags, respectively. This tag should be used only in theme JSPs.

<portal-navigation:url>

Creates a portal URL depending on the specified attribute. Attributes

Example

This part of a user login form uses the <portal:url> tag to process input fields, user ID, and password.
    <FORM method="POST"
         action='<portal-navigation:url command="LoginUser"/>'
         enctype="application/x-www-form-urlencoded"
         name="LoginPage">
    
    

<portal-navigation: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); %>'>My page</a>  
Attributes are as follows:

<portal-navigation:urlParam name="parameter_name" value="parameter_value">

This tag is used to add parameters to the parent URL. Parent tags include <portal-navigation:url/> and <portal-navigation:urlGeneration/>. Parameters added to the <urlGeneration/> tag occur as unscoped query parameters unless the attributes specified on <urlGeneration/> specify otherwise. Parameter handling depends on the target of the URL. If the URL points to a page, the parameters are visible to all IBM portlets on that page. Parameters are not visible to standard portlets if the URL does not point specifically to that portlet. Attributes

<portal-navigation:url command="ChangeLanguage">

This tag is used to change the active language in the navigational state in which the URL is generated.The following code example uses this tag to change the language to Dutch.
<a href='<portal-navigation:url command="ChangeLanguage"><portal-navigation:urlParam name="locale" value="de"/></portal-navigation:url>'>Diese Seite in deutch</a>
Parent topic: Tags used by the portal JSPs
Library | Support | Terms of use |