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

--%>
<% 
    // Access the theme configuration
    if (null == themeConfig)
    {
        // Load the theme defaults - this is only done once... but we cannot do it in
        // jspInit() because we do not have a way to use <portal-logic:urlFindInTheme/> there.
%>        
        <portal-logic:urlFindInTheme id="themeConfigURL" file="colors/themeConfig.properties"/>
<%
        themeConfig = new java.util.Properties();
        
        // ServletContext.getResourceAsStream() does not work if the servlet context path
        // (the "/wps" part) is present at the beginning of the URL.  So use the getContextPath()
        // API to determine the length of the string which should be stripped off of the front
        // of the URL string. Note that themeConfigURL is not of type String...
        String configURL = themeConfigURL.toString();
        String contextPath = request.getContextPath();
        if (configURL.startsWith(contextPath)) {
            configURL = configURL.substring(contextPath.length());
       } else {
            // Get the active theme
            final com.ibm.portal.admin.Theme currentTheme = getCurrentTheme(request, response);
            final String contextRoot = currentTheme.getContextRoot(); 
            // Strip off the context root if the theme was deployed as a standalone web app
            if (configURL.startsWith(contextRoot)) {
                configURL = configURL.substring(contextRoot.length());
            }
        }
        
        ServletContext context = getServletConfig().getServletContext();
        java.io.InputStream configStream = context.getResourceAsStream(configURL);
        try
        {
           themeConfig.load(configStream);
        }
        catch (Exception e)
        {
            // Handle the case where configStream is null and a possible IOException
            // internal to the Properties.load() method.
            System.out.println("Unable to load theme configuration " + configURL);
        }
        finally {
            try {
               configStream.close();
            } catch (java.io.IOException ioe) {
               // intentionally ignore this exception because if it happens, it is likely
               // because configStream is null and therefore we have already logged something.
            }
        }
   }
   
   // Make the themeConfig map accessible to expression language.
   pageContext.setAttribute("themeConfig", themeConfig); 
%>

<%@ page import="com.ibm.portal.ObjectID" %>
<%@ page import="com.ibm.portal.content.ContentNode" %>
<%@ page import="com.ibm.portal.navigation.NavigationNode" %>
<%
com.ibm.portal.model.NavigationSelectionModelProvider nsmProvider = navigationSelectionModelHome.getNavigationSelectionModelProvider();
com.ibm.portal.navigation.NavigationSelectionModel nsm = nsmProvider.getNavigationSelectionModel(request, response);
String pageOidStr = identification.serialize( ( ( com.ibm.portal.Identifiable ) nsm.getSelectedNode() ).getObjectID());
%>

<%@ include file="./browserDetection.jspf" %>

<c:set var="isIE" value="${browser eq 'ie'}"/>
<c:set var="isSafari" value="${browser eq 'safari'}"/>

<%-- renderPlaceholdersOnly is used to keep as much common code between the Portal and PortalWeb2 themes as possible. In the
	 PortalWeb2 theme, we only want placeholder markup rendered since the contents of the placeholders will be replaced at bootstrap
	 as the REST service calls complete. This value will be overridden in the PortalWeb2 theme.
--%>
<c:set var="renderPlaceholdersOnly" value="false" />