Force SSA debugging Notes

I was trying to debug how the Force SSA part works and these are my notes

Page Level Force SSA


You can force a page to use SSA by adding this page level parameter

<parameter name="RenderMode" type="string" update="set"><![CDATA[force_ssa]]></parameter>

Once you mark a page for SSA, logout and log back in. Now if your page is at top level take your mouse to the tab and you will notice that the JavaScript function that gets called when you click on that tab is like this

<li class="wpsUnSelectedPage" id="cm:oid:6_6RUKKSU3181N102VTSDK2J3000" menulink="?uri=wp.operations:page:oid:6_6RUKKSU3181N102VTSDK2J3000&mode=download&digest=I88GY_vLacgFxE4JVwkCEg!!"><a href="javascript:com.ibm.portal.navigation.controller.NAVIGATION_CONTROLLER.setSelection('cm:oid:6_6RUKKSU3181N102VTSDK2J3000', null, null, 'force_ssa');">Test Page</a></li>

That means the tab change or page change event handler knows that the page that your moving to hast force_ssa parameter and as a result it will use full page refresh

Portlet level Force SSA



The client side script checks that if a page has any portlet that requires server side aggregation if yes it will set name of that page in cookie and after that every time you go to the page or click on any link in the portlet it will be SSA. But first time you visit the page it will CSA. You can set SSA at portlet by following one of two approaches

Setting portlet initialization parameter


As per Infocenter, you can force SSA at portlet level by adding initialization parameter like this

<init-param>
<name>com.ibm.wps.web2.renderMode</name>
<value>force_SSA</value>
</init-param>

But this does not work. WHen i debugged the code i found out that the CSA theme is reading the portlet preferences instead of portlet initialization parameter to figure out if the portlet requires SSA.
So i tried setting com.ibm.wps.web2.renderMode preference for portlet and after that the page was using SSA for portlet link click or navigation link click.

Adding name of the portlet application to portletForServerSideOnly.js



You can force all the portlets in an portlet application to use SSA by adding the application id into portletForServerSideOnly.js like this
First open portlet.xml file for that portlet application and find the portlet app id

<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" id="com.ibm.forcessasample.ForceSSASamplePortlet.ebbea04302">

Copy name of the id attribute and add it in portletForServerSideOnly.js like this

"com.ibm.forcessasample.ForceSSASamplePortlet.ebbea04302":true,


Important Note Problem with Portlet level SSA is one portlet can force the full page to use SSA. If you dont want that then change head_extras.jspf to change value of enforceSSAOnPortletLevel to false.
Once you set enforceSSAOnPortletLevel to false, PortletWeb2 theme will stop checking if any of the portlet on page requires SSA. It will always use client side aggregation for that page.

DOwnload the ForceSSAPortlet sample

No comments: