The ICEfaces 1.x extended-request scope is very similar to what JSF 2.0 now calls "view" scope. While normal JSF request scope keeps a managed-bean in memory for the duration of a request, the ICEfaces extended-request scope typically keeps a managed-bean in memory for a longer duration. The scope begins when a JSF view is first requested, and terminates under one of the following conditions:
When an ICEfaces portlet is rendered on a portal page, the ICEfaces 1.x portlet bridge will participate in the Portlet RenderRequest phase just like any other portlet. However, from that time on the ICEfaces 1.x bridge will bypass the portlet lifecycle and perform all subsequent interactions with the server via Ajax by hitting the ICEfaces PersistentFacesServlet. The ICEfaces 1.x portlet bridge is based on the JSR 168 (Portlet 1.0) API and therefore cannot take advantage of the new ResourceRequest phase of the JSR 286 (Portlet 2.0) API. The benefit of hitting the PersistentFacesServlet directly is that ICEfaces partial submits will execute faster than if they went through the the Portlet 2.0 ResourceRequest phase. The drawback is that certain Liferay objects are unusable after the initial RenderRequest phase. Specifically, the Liferay PermissionChecker and ThemeDisplay objects get "recycled" at then end of the RenderRequest phase by Liferay's ServicePostAction.
PortletFaces works around this problem by making copies of Liferay's PermissionChecker and ThemeDisplay objects and keeping them in "request" scope, which will default to the ICEfaces extended-request scope when ICEfaces is used in a portlet. These objects are available to JSF portlet developers by calling the PortletFacesContext.getPermissionChecker() and PortletFacesContext.getThemeDisplay() methods respectively.
Example 6.59. Getting the Liferay PermissionChecker and ThemeDisplay objects from the PortletFacesContext
import com.liferay.portal.security.permission.PermissionChecker;
import com.liferay.portal.theme.ThemeDisplay;
public class BackingManagedBean {
PortletFacesContext portletFacesContext =
PortletFacesContext.getInstance();
public String submit() {
PermissionChecker permissionChecker =
PortletFacesContext.getPermissionChecker();
ThemeDisplay themeDisplay =
PortletFacesContext.getThemeDisplay();
}
}