- The head_extras.jspf has browser check like this
>c:set var="isSSA" scope="request" value="${ renderMode eq 'force_ssa' or isSafari or (browser eq 'Moz' and (browserName ne 'Firefox' and browserName ne 'Opera') )}"/<
It checks that if browser is Safari or Mozilla but not firefox or Opera then use Server side aggregatioin. - If you disable javascript in your IE or Firefox then it wont force SSA, instead your page will stop rendering.
- I also tried changing the supported client configuration and change profile of Firefox to remove HTML_JAVASCRIPT. That means to say that Firefox does not have JavaScript capabilities but that does not work either
Showing posts with label forcessa. Show all posts
Showing posts with label forcessa. Show all posts
Browser that does not support JavaScript
As per Infocenter the client side theme will use Server Side aggregation mode if the browser does not support JavaScript. I did some debugging to find out what it really means
Force SSA debugging Notes
I was trying to debug how the Force SSA part works and these are my notes
You can force a page to use SSA by adding this page level 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
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
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
As per Infocenter, you can force SSA at portlet level by adding initialization parameter like this
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
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
Copy name of the id attribute and add it in portletForServerSideOnly.js like this
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
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
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
Understand conditions for which Portal will use Server Side Aggregation
The PortalWeb2 or the Client Side Aggregation theme is implemented in such a way that it can either aggregate the full page on the server using traditional JSP tags, which is similar to the Serve side aggregation theme. Or second option is that it sends only place holders for main elements such as top navigation, side navigation, portal body in the first page load. Once the page is loaded the Client Side Aggregator (It is written in JavaScript) gets control. It makes request to REST service for each of the page fragments and assembles the page on the client side.
Even when you apply CSA theme to a page there could be cases where you want the full page to be aggregated on the server side.
You can force the Server side aggregation by using one of the following methods
Even when you apply CSA theme to a page there could be cases where you want the full page to be aggregated on the server side.
- Some pages are incompatible with CSA
- Portlets are not compatible with CSA
- Browser might not have sufficient capabilities for CSA
You can force the Server side aggregation by using one of the following methods
- Adding
com.ibm.wps.web2.renderMode=force_SSAinitialization parameter in portlet.xml. Once you mark a portlet as server side aggregation only, clicking on one of its link will result in full page refresh - You can blacklist particular portlet by adding
"portlet_app_id": trueto true in WebSphere\wp_profile\installedApps\sunpa\wps.ear\wps.war\themes\html\PortalWeb2\js\portletsForServerSideOnly.js file. If you open this file you will find name of the portlets that are shipped with IBM WPS. - You can set a page to be rendered in SSA mode by assigning and setting a page parameter named RenderMode = force_ssa.The portal Web 2.0 theme checks this parameter, and if you set it to RenderMode=force_ssa, it switches to SSA mode for this page. If the user navigates to a page that does not have this setting, the theme returns to CSA mode. For some portal components this parameter is set to the value force_ssa by default. For example, Web Content and Personalization are configured to enforced SSA mode. If you want to have pages of these components rendered in CSA mode, remove the parameter RenderMode from the component page root.
- If you need more fine grained control over CSA and SSA rendering than is provided by the methods listed above, you can edit the theme to add your own custom logic. The PortalWeb2 theme sets a page variable named isSSA, and its opposite, isCSA in the file head_extras.jspf. These are boolean variables. They are used throughout the theme to allow it to render in either CSA or SSA mode. If there are other circumstances in which SSA mode is desired, edit head_extras.jspf and add the logic to the conditions that set these variables to true or false.
Subscribe to:
Posts (Atom)