themeLinks.jspf

 

<%-- 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.	

--%>

<%
// The <portal-navigation:navigation> tag throws exceptions that get logged if it cannot find the unique name.
// So, for backward compatibility, we need to see if themeLinksUniqueNameRoot exists before using the tag.

com.ibm.portal.ObjectID themeLinksUniqueNameRootOID = null;
try {
    themeLinksUniqueNameRootOID = identification.deserialize(themeLinksUniqueNameRoot);
} catch (com.ibm.portal.serialize.SerializationException se ) {
    // Intentionally do nothing if this exception is thrown.
    // It means that the themeLinksUniqueNameRoot does not exist, and that is OK...
    // We are checking to see if it exists.
}			

if (null != themeLinksUniqueNameRootOID) {
%>

    <portal-navigation:navigation scopeUniqueName="<%=themeLinksUniqueNameRoot%>"  startLevel="1" stopLevel="1">
    <ul class="wptheme-themeLinks">
    <portal-navigation:navigationLoop>
    <% 
          // Labels come back with link URLs so you have to check this way to avoid generating an unnecessary link.
          boolean isLabel = com.ibm.portal.content.ContentNodeType.LABEL.equals(wpsNavNode.getContentNode().getContentNodeType());
    
          // metadata value PageIcon to display with Quick Links
          String pageIconUrl = null;
          if (wpsNavNode instanceof com.ibm.portal.MetaDataProvider) {
             com.ibm.portal.MetaData iMetaData = ((com.ibm.portal.MetaDataProvider) wpsNavNode).getMetaData();               
             Object pageIcon = iMetaData.getValue("com.ibm.portal.PageIcon");
             if(pageIcon != null) {
                // a null check is not good enough.  You have got to check for empty as well.
                pageIconUrl = pageIcon.toString();
                if (pageIconUrl.length() < 1) {
                  pageIconUrl = null;
                }
             }
          }
    %>      
    <li>
        <% if (!isLabel) { %>
            <a href='<portal-navigation:navigationUrl type="link" />'>
            <% if (null != pageIconUrl) { %>
                <img src="<portal-logic:urlFindInTheme file='<%=pageIconUrl%>'/>" title="<portal-fmt:title/>" alt="<portal-fmt:title/>" border="0" align="absmiddle"/>
            <% } %><portal-fmt:title/></a>
        <% } else { %>
            <span class="wptheme-themeLinks-label">
            <% if (null != pageIconUrl) { %>
                <img src="<portal-logic:urlFindInTheme file='<%=pageIconUrl%>'/>" title="<portal-fmt:title/>" alt="<portal-fmt:title/>" border="0" align="absmiddle"/>
            <% } %>
            <portal-fmt:title/></span>
        <% } %>
    </li>
    
    </portal-navigation:navigationLoop>
    </ul>
    </portal-navigation:navigation>

<% } %>