+

Search Tips   |   Advanced Search

Remove code that is now provided by modules


Since the IBM WebSphere Portal ready-to-use features are now available as modules, do not include code in the JSPs within a theme that is now available within modules.

If the theme uses any of the ready-to-use JSP files provided within the PageBuilder WAR file, we can update the JSP files to remove code that is now provided by modules. Before proceeding, ensure that your theme references JSP file that are within a custom web application, which are actually copies of the JSP files in the PageBuilder WAR file. Your theme references copies of the ready-to-use JSPs instead of referencing those JSP files directly.

Make the following changes to the theme files:

  1. Edit...

      WP_PROFILE/installedApps/MyNode/MyTheme.ear/MyTheme.war/themes/html/MyTheme/head.jsp

    1. Remove the block of code that generates the element for tagging search, which is now provided by the wp_tagging_rating module.
      <% 
      final Profile clientProfile = ProfileFactory.getInstance().newProfile(request);
      final Attribute attribute = clientProfile.getAttribute("Vendor");
      final boolean isIE;
      if (attribute != null) {
       final String vendor =  attribute.toString();
       isIE = "Microsoft".equals(vendor);
      } else {
       isIE = false;
      }
      %><c:if test="${cpConfig.isTaggingEnabled && cpConfig.operations.canViewTags}"><% 
      if(isIE){ 
      %><link rel="search"
              
              href='<%=getStaticUrl(pageContext, "tosPublic")%>'
              type="application/opensearchdescription+xml"/><% 
      } else { 
      %><link rel="search"
              
              href='<%=getStaticUrl(pageContext, "tosDefault")%>'
              type="application/opensearchdescription+xml"/><% 
      }%></c:if>
      

    2. Remove the code that generates the element to the portal_editmode_widgets.css style sheet. The styles contained within this file are now provided by various modules.
      <%-- Styles for widgets rendered in edit mode --%>
      <link rel="stylesheet alternate edit_mode"
         href="http://setgetweb.com/p/portal80/<%=getCCConfigValue(pageContext, "cc.builder.context", null)%>/css/portal_editmode_widgets.css"
         type="text/css" /><%
      if((Boolean)pageContext.getAttribute("isRTL", PageContext.REQUEST_SCOPE)) {
      %><link rel="stylesheet alternate edit_mode"
         href="http://setgetweb.com/p/portal80/<%=getCCConfigValue(pageContext, "cc.builder.context", null)%>/css/portal_editmode_widgets_rtl.css"
         type="text/css" /><%
      }
      %>
      

    3. Remove the code that generates the element to the tundra.css style sheet within the Dojo toolkit, which is now provided by the dijit_theme_tundra module.
      <%-- Dojo theme styles --%>
      <link rel="stylesheet" 
         href="http://setgetweb.com/p/portal80/<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/dijit/themes/tundra/tundra.css" 
         type="text/css" />
      

    4. Remove the code that generates the elements to the common.css and master.css style sheets with their RTL counterparts, which is now provided by the theme_YourTheme module.
      <%-- Portal theme and skin styles --%><%
      if((Boolean)pageContext.getAttribute("isRTL", PageContext.REQUEST_SCOPE)) {
      %><link rel="stylesheet" href="http://setgetweb.com/p/portal80/<%=getStaticUrl(pageContext, "commonRTL.css")%>" type="text/css" />
      <link rel="stylesheet" href="http://setgetweb.com/p/portal80/<%=getStaticUrl(pageContext, "masterRTL.css")%>" type="text/css" /><%
      } else {
      %><link rel="stylesheet" href="http://setgetweb.com/p/portal80/<%=getStaticUrl(pageContext, "common.css")%>" type="text/css" />
      <link rel="stylesheet" href="http://setgetweb.com/p/portal80/<%=getStaticUrl(pageContext, "master.css")%>" type="text/css" /><%
      }
      %>
      

    5. Remove the code that generates the elements for the Sametime proxy support, which is now provided by the wp_sametime_proxy module.
      <%-- Sametime Awareness styles --%>
      <c:if test="${!empty sametimeProxyUrl && isAuthenticated}">
      <link href="http://setgetweb.com/p/portal80/${sametimeProxyUrl}/stwebclient/dojo.blue/sametime/themes/WebClientAll.css" type="text/css" rel="stylesheet">
      </c:if>
      

    6. Remove the code that generates the element to the widgets_combined.css file, which is used to render some of the UI elements in the theme that is now provided by various modules.
      <%-- Styles for system widgets--%>
      <link rel="stylesheet" 
         href="http://setgetweb.com/p/portal80/<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/com/ibm/widgets/css/widgets_combined.css" 
         type="text/css" />
      

    7. Remove the code that creates the <script> element which creates the global djConfig object. This provides configuration for the Dojo toolkit which is now provided by the Dojo module.
      <%-- include dojo --%>
      <script type="text/javascript">
      var djConfig = {parseOnLoad: false,    locale: '<%=pageContext.getAttribute("preferredLocale", PageContext.REQUEST_SCOPE)%>'.replace(/_/, '-').replace(/iw/, 'he').toLowerCase(),    baseUrl: "<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/dojo/"};
      </script>
      

    8. Remove the code that creates the <script> element which includes the dojo.js file. This step loads Dojo packages, and the Portal client programming model code that was built into the dojo.js file in the v1.4.3 directory within the Dojo web application. This code is now provided by various Dojo-specific modules, and the client programming code is provided by the portal_client_model module.
      <script type="text/javascript" src="<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/dojo/dojo.js
      <%="true".equals(getCCConfigValue(pageContext, "cc.isDebug", null)) ? ".uncompressed.js" : ""%>"></script>
      

    9. Remove the code that creates the <script> element that loads the OpenAjaxManagedHub code, which is now provided by the openajaxhub module.
      <script type="text/javascript" 
         src="<%=pageContext.getAttribute("dojoRoot", PageContext.REQUEST_SCOPE)%>/openajaxhub/OpenAjaxManagedHub-all.js"></script>
      

    10. Remove the code that generates the styles for the ibmLayoutContainersHidden class, which is used to hide the page content area until the rendering mode of the portlets and widgets on the page is accounted for and visualized correctly. This mechanism was used in the PageBuilder theme with CSA to show a maximized portlet within the entire content area. This code was used with the RenderingController object. A new module called wp_layout_windowstates allows the contents of the page to be displayed immediately instead of waiting until the onload event fires in the browser.
      <%-- Hide the layout only when scripting is enabled so that the layout displays at least in the error case when scripting is disabled --%>
      <script type="text/javascript">//<![CDATA[
      <%--
      In IE, if you hide the layout, we can get errors when the browser attempts to focus on form elements inside the invisible area.  So just position it offscreen but allow it to be visible.
      For FF, if you change the position or overflow settings of a node containing an object element as a descendant, the object element gets reloaded.  This causes things like applets to load twice
      on page load, and can cause some problems.  The conditional logic below results in almost exactly the same user experience while working around the browser quirks.
      --%>
      var style = dojo.isIE ? "<style>.ibmLayoutContainersHidden{position:absolute;top:-9999px;z-index=-1;}</style>" :
         "<style>.ibmLayoutContainersHidden{opacity:0;height:0;max-height:0;}</style>";document.write(style);
      //]]>
      </script>
      

  2. Edit the config.jsp file in the web application for the theme at WP_PROFILE\installedApps\MyNode\MyTheme.ear\MyTheme.war\themes\html\MyTheme):

    1. Remove the logic regarding Sametime enablement, including the <menu:menuinit/> JSP tag, the <pa:peopleinit/> JSP tag, and the <pa:peopleend/> JSP tag. Sametime support is now provided through the wp_sametime_proxy or wp_sametime_links modules.
      <menu:menuinit/><c:if test="${empty sametimeProxyUrl && isAuthenticated}"><pa:peopleinit/></c:if>
      <c:if test="${empty sametimeProxyUrl && isAuthenticated}"><pa:peopleend/></c:if>
      

    2. Remove the five <script> blocks that set up ibmConfig and ibmPortalConfig, which is now provided by the portal_standard_config module.
      <script type="text/javascript" src="<portal-logic:urlFindInTheme file="./js/config_js.jsp"/>"></script>
      <script type="text/javascript">
      (function(){
       ibmCfg.controllers = {<%-- controllers initialized in com.ibm.themes.PageBuilder2.init 
       --%>rendering: null,<%--
       --%>navigation: null,<%--
       --%>dnd: null<%--
      --%>};
      .
      .
      .
      .
      </script>
      <script type="text/javascript">
      <%-- set ibmPortalConfig and ibmConfig objects to ibmCfg objects for legacy support --%>
      ibmPortalConfig = ibmCfg.portalConfig;
      ibmConfig = ibmCfg.enablerConfig;
      portalMashupsConfig = {
       portalContext: ibmCfg.portalConfig.portalContext,  hubURL: ibmCfg.enablerConfig.hubURL,  portalProxyUrl: ibmCfg.portalConfig.proxyURL,  serviceDocURL: ibmCfg.enablerConfig.serviceDocumentUrl,  contentHandlerContextPath: ibmCfg.portalConfig.contentHandlerURI
      };
      </script>
      <%
      {
       // PERFORMANCE: Check if Tagging or Rating are enabled before writing out the cp configuration map.
       Map<String,Object> cpConfig = (Map<String,Object>)pageContext.getAttribute("cpConfig", PageContext.REQUEST_SCOPE);
       if((Boolean)cpConfig.get("isTaggingEnabled") || (Boolean)cpConfig.get("isRatingEnabled")) {
      %>
       <script type="text/javascript">var ibmPortalCPConfig = <json:object value='<%=cpConfig%>' /></script>
      <%
       }
       else {
      %>
       <script type="text/javascript">var ibmPortalCPConfig = null</script>
      <%
       }
      }
      %>
      

    3. Add the following code to the end of the file so that all JavaScript configuration entries are present in the modularized theme.
      <portal-logic:if loggedIn="yes">
      <script type="text/javascript">
      i$.merge({<%-- url for selfcare --%>
          <portal-internal:adminlinkinfo name="SELFCARE">
              <portal-navigation:urlGeneration contentNode="<%=wpsContentNode%>" 
                layoutNode="<%= wpsCompositionNode %>" 
                portletWindowState="Normal" 
                themeTemplate="" 
                portletParameterType="render">
                  <portal-navigation:urlParam type="render" name="ao" value="thm"/>
                  <portal-navigation:urlParam type="render" name="OCN" value="<%= wpsNavigationNodeID %>" />
                  selfcareURL: "<%wpsURL.write(escapeXmlWriter);%>"
              </portal-navigation:urlGeneration>
          </portal-internal:adminlinkinfo><%
          if((Boolean)pageContext.getAttribute("isImpersonationEnabled", PageContext.APPLICATION_SCOPE)) {
              %><portal-logic:if userImpersonated="false">
                  <portal-navigation:urlGeneration contentNode="ibm.portal.Impersonation">
                  ,impersonationURL: "<% wpsURL.write(escapeXmlWriter); %>"
                  ,impersonateLabel: "<portal-fmt:text key='link.impersonate' bundle='nls.engine'/>"
                  </portal-navigation:urlGeneration>
              </portal-logic:if><%
          }
          %>
      },ibmCfg.themeConfig);
      </script>
      </portal-logic:if>
      

    4. Remove the four <script> blocks that set up Sametime awareness, which is now provided by the wp_sametime_proxy and wp_sametime_links modules.
      <%-- begin Sametime Awareness javascript --%><c:if test="${!empty sametimeProxyUrl && isAuthenticated}">
      <script type="text/javascript">
      var stproxyConfig = {
       server: "${sametimeProxyUrl}",  
                  isConnectClient: false,  
                  disableXDomain: true,  
                  isPortalAjaxProxy: ${isPortalAjaxProxy},  plugins: {
        lnmpChat : false,   
        lnmpCall : false,   
        lnmpMeetingInvite : false,   
        lnmpSendAnnouncement : false,   
        lnmpBizCard : false,   
        lnmpAddToContacts : false,   
        lnmpAddContact : false,  
        lnmpAddToContacts : false, 
        lnmpAddSubgroup : false  }
       }
      </script>
      <script type="text/javascript" src="${sametimeProxyUrl}/stbaseapi/baseComps.js"></script>
      <script type="text/javascript" src="${sametimeProxyUrl}/stwebclient/widgetsLight.js"></script>
      <script type="text/javascript" src="${sametimeProxyUrl}/stwebclient/apps/webspherePortal.js"></script>
      <%-- used to override some sametime proxy details for WebSphere Portal --%>
      </c:if><%-- end Sametime Awareness JavaScript --%>
      

    5. Remove the <script> tag that sets up semantic tagging, which is now provided by the wp_liveobject_framework module.
      <script type="text/javascript" src="/wps_semanticTag/javascript/semanticTagService.js"></script>
      

    6. Remove the JavaScript lines that set up the livetext service, which is now provided by the mm_enabler module.
      <%-- livetextService is set outside ibmCfg.enablerConfig because the tagservice.entries.cfg references ibmCfg.enablerConfig --%>
      <% Object liveTextCfgUri = pageContext.getAttribute("LIVETEXT_CFG_URI", PageContext.REQUEST_SCOPE);
      if (liveTextCfgUri != null) { %>
      ibmCfg.enablerConfig.livetextService = ibmConfig.livetextService = <r:dataSource uri='<%=(URI)liveTextCfgUri%>' escape="none">
                        <r:param name="pragma" value="cache"/> <%-- Cache publicly with 2 weeks expiration --%>
                        <r:param name="max-age" value="1209600"/>
                        <r:param name="cache-scope" value="public"/>
                        <r:param name="user-context" value="false"/>
                        <r:param name="vary" value="none"/>
                       </r:dataSource>;
      <% } %>
      

    7. Remove the code that registers Dojo module paths to the mashups component code, specifically the com.ibm.mashups, com.ibm.mm, com.ibm.mashups.builder, and com.ibm.mm.builder module names.
      dojo.registerModulePath("com.ibm.mashups", ibmCfg.enablerConfig["com.ibm.mashups.contextroot.enabler"] + 
          "/js/com/ibm/mashups");
      dojo.registerModulePath("com.ibm.mm", ibmCfg.enablerConfig["com.ibm.mashups.contextroot.enabler"] + 
          "/js/com/ibm/mm");
      dojo.registerModulePath("com.ibm.mashups.builder", ibmCfg.enablerConfig["com.ibm.mashups.contextroot.builder"] +
          "/js/com/ibm/mashups/builder");
      dojo.registerModulePath("com.ibm.mm.builder", ibmCfg.enablerConfig["com.ibm.mashups.contextroot.builder"] + 
          "/js/com/ibm/mm/builder");
      dojo.registerModulePath("widget-catalog", ibmCfg.enablerConfig["com.ibm.mashups.contextroot.builder"] + 
          "/widget-catalog");
      dojo.registerModulePath("widget_catalog", dojo.moduleUrl("widget-catalog", ""));
      

    8. Remove the <script> tag that sets up the layer loading, which is now provided by various modules.
      <script type="text/javascript" 
              src="<%=pageContext.getAttribute("dojoContextRoot", PageContext.REQUEST_SCOPE)%>/layerLoader.jsp?
              path=v1.4.3/com/ibm/themes/PageBuilder2&name=theme&locale=<%=pageContext.getAttribute("preferredLocale", PageContext.REQUEST_SCOPE)%>
      <%="true".equals(getCCConfigValue(pageContext, "cc.isDebug", null)) ? "&uncompressed=true" : ""%>"></script>
      

    9. Remove the <script> tag that loads the init.js file, which is now provided through the theme_YourTheme module.
      <script type="text/javascript" src="<%=getStaticUrl(pageContext, "init.js")%>"></script>
      

  3. Edit the pageToolbar.jsp file in the web application for the theme at WP_PROFILE\installedApps\MyNode\MyTheme.ear\MyTheme.war\themes\html\MyTheme:

    1. Remove the logic regarding the pageToolbarButtons iWidget, which is now provided through the mm_page_toolbar module.
      <%-- Renders the page toolbar iwidget, displays the customize, save, and cancel buttons --%>
      <div class="iw-iWidget" iw-Standalone pb-pageMode-edit" id="pageToolbarButtons">
      <a class="iw-Definition" 
        href="http://setgetweb.com/p/portal80/${ccConfig['cc.builder.context']}/widget-catalog/pageToolbarButtons.xml?
      pragma=cache&max-age=1209600&cache-scope=public&vary=none&user-context=false">
      </a>
      <span class="iw-ItemSet" >
      <a class="iw-Item" href="http://setgetweb.com/p/portal80/#shelfId" style="visibility:hidden; display:none">customizeShelfContainer</a>
      </span>
      </div>
      

    2. Change all instances of cc.builder.context to cc.builder.3001.context to get the latest Builder widgets.

  4. Edit the bannerCommonActions.jsp file in the web application for the theme at WP_PROFILE\installedApps\MyNode\MyTheme.ear\MyTheme.war\themes\html\MyTheme:

    1. Change all instances of cc.builder.context to cc.builder.3001.context to get the latest Builder widgets.

  5. Edit the bannerNav.jsp file in the web application for the theme at WP_PROFILE\installedApps\MyNode\MyTheme.ear\MyTheme.war\themes\html\MyTheme:

    1. Change all instances of cc.builder.context to cc.builder.3001.context to get the latest Builder widgets.

  6. Edit the tabNav.jsp file in the web application for the theme at WP_PROFILE\installedApps\MyNode\MyTheme.ear\MyTheme.war\themes\html\MyTheme:

    1. Change all instances of cc.builder.context to cc.builder.3001.context to get the latest Builder widgets.


Parent: Making a modularized theme