转载请注明出处 http://jjs-love.iteye.com
<%-- Licensed Materials - Property of IBM, 5724-E76, (C) Copyright IBM Corp. 2001, 2004, 2006 - All Rights reserved.
NOTE: See notes in Default.jsp for information regarding editing theme JSP fragments.
--%>
<%--
This JSP renders the navigation bar on the left side of the page.
By default, this will continue rendering the navigation where the
previous navigation entity left off.
--%>
<c-rt:if test = "${themePolicy.renderSideNavigation}">
<portal-logic:if navigationAvailable="yes" screen="Home,LoggedIn,LoggedOut">
<table cellspacing=0 cellpadding=0 border=0 width="188" height="100%" >
<tr>
<td valign="top" height=64 width=188><img src='<portal-logic:urlFindInTheme file="themeimage/tu_3.jpg" />' height=64 width=188></td>
</tr>
<portal-navigation:navigation startLevel="${themePolicy.sideNavigationStartLevel}">
<% int previousNavLevel=0;%>
<portal-navigation:navigationLoop>
<%--
basic logic required:
if node is selected give selected style
if node has children, show expand/collapse
if node is unselectable(label), don't render anchor
if node is external url, open in new window
if navlevel changed, open/close uls as needed.
--%>
<% // variables
boolean isNodeSelected = wpsSelectionModel.isNodeSelected(wpsNavNode);
String rowCssClass = isNodeSelected ? "wpsNavItem selected" : "wpsNavItem";
boolean nodeHasChildren = wpsNavModel.hasChildren(wpsNavNode);
boolean isExpanded = ((Boolean)((com.ibm.portal.state.StateModel)wpsNavModel).getState(wpsNavNode, com.ibm.portal.state.StateType.EXPANSION)).booleanValue() ;
boolean openInNewWindow = com.ibm.portal.content.ContentNodeType.EXTERNALURL.equals(wpsNavNode.getContentNode().getContentNodeType());
boolean isLabel = com.ibm.portal.content.ContentNodeType.LABEL.equals(wpsNavNode.getContentNode().getContentNodeType());
int currentNavLevel = wpsNavLevel.intValue();
%>
<span class="<%=rowCssClass%>">
<tr>
<%-- ****************** render expand/collapse ****************** --%>
<c-rt:choose>
<c-rt:when test="<%=nodeHasChildren && isExpanded %>">
<td width=188 valign="middle" height="31" background='<portal-logic:urlFindInTheme file="themeimage/unselected.gif" />' style="background-repeat: repeat-y">
<a href='<portal-navigation:navigationUrl type="collapse"/>'><portal-fmt:title/></a>
</td>
</c-rt:when>
<c-rt:when test="<%=nodeHasChildren && !isExpanded %>">
<td width=188 valign="middle" height="31" background='<portal-logic:urlFindInTheme file="themeimage/unselected.gif" />' style="background-repeat: repeat-y">
<a href='<portal-navigation:navigationUrl type="expand"/>'><portal-fmt:title/></a>
</td>
</c-rt:when>
</c-rt:choose>
</tr>
<tr>
<td>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<%-- ****************** render node ****************** --%>
<c-rt:choose>
<c-rt:when test="<%=isLabel%>">
</c-rt:when>
<c-rt:otherwise>
<td width=188 valign="middle" height="31" bgColor='#F8F8FA' style="border:1px solid #728B90;border-bottom:1px solid #728B90;border-top:none; ">
<a href="<portal-navigation:navigationUrl type="launch"/>" <% if (openInNewWindow) {%>target="_blank"<% } %> <% if (isNodeSelected) { %>οnfοcus="showPageAffordance()" <% } %> >
<portal-fmt:title/>
</a>
</td>
</c-rt:otherwise>
</c-rt:choose>
</td>
</tr>
</table>
</td>
</tr>
</span>
<%-- the list item is closed if the node does not have children or it is not expanded --%>
<c-rt:if test="<%=(!nodeHasChildren || !isExpanded)%>">
</li>
</c-rt:if>
<%previousNavLevel = currentNavLevel;%>
</portal-navigation:navigationLoop>
<%-- When no more nodes are left to be processed by the nav loop, it exits but leaves the
lists and list items open, there is a check to see if there is more than one level, if true,
the lists and list items are closed. There is a </ul> tag after the for loop to close the initial
list that is opened. This initial <ul> is created when a side nav page is created --%>
<c-rt:if test="<%=previousNavLevel > 0 %>"><% for(int i = previousNavLevel; i > 1; i--){%></ul></li><%} %></ul></c-rt:if>
</portal-navigation:navigation>
<tr>
<td valign="top" width=188 height=413 background='<portal-logic:urlFindInTheme file="themeimage/nav3.gif" />'>
<img src='<portal-logic:urlFindInTheme file="themeimage/bottom.gif" />' border=0 >
</td>
</tr>
<tr height="100%"><td width=188 background='<portal-logic:urlFindInTheme file="themeimage/nav3.gif" />' ></td></tr>
</table>
</portal-logic:if>
<portal-theme-ext:themeExtension id="com.ibm.portal.theme.plugin.VerticalPageBarItems" >
<portal-theme-ext:themeExtensionLoop>
<portal-theme-ext:themeExtensionRenderInclude />
</portal-theme-ext:themeExtensionLoop>
</portal-theme-ext:themeExtension>
</c-rt:if>