/** * Returns the Liferay {@link ThemeDisplay} associated with the {@link PortletRequest}. */ public ThemeDisplay getThemeDisplay() { if (themeDisplay == null) { themeDisplay = liferayFacesContext.getThemeDisplay(); } return themeDisplay; }
/** * Returns the Liferay {@link ThemeDisplay} associated with the {@link PortletRequest}. */ public ThemeDisplay getThemeDisplay() { if (themeDisplay == null) { themeDisplay = liferayFacesContext.getThemeDisplay(); } return themeDisplay; }
private void setLocale() { try { LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance(); // It's possible that the FacesServlet was invoked directly, and so this PhaseListener // needs to check to see if the request/response is part of a portlet environment before // proceeding further. if (liferayFacesContext.isPortletEnvironment()) { ThemeDisplay themeDisplay = liferayFacesContext.getThemeDisplay(); if (themeDisplay != null) { Locale locale = themeDisplay.getLocale(); if (locale != null) { UIViewRoot viewRoot = liferayFacesContext.getViewRoot(); if (viewRoot != null) { viewRoot.setLocale(locale); } else { logger.error("viewRoot is null!"); } } } } } catch (Exception e) { logger.error(e.getMessage(), e); } }
private void setLocale() { try { LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance(); // It's possible that the FacesServlet was invoked directly, and so this PhaseListener // needs to check to see if the request/response is part of a portlet environment before // proceeding further. if (liferayFacesContext.isPortletEnvironment()) { ThemeDisplay themeDisplay = liferayFacesContext.getThemeDisplay(); if (themeDisplay != null) { Locale locale = themeDisplay.getLocale(); if (locale != null) { UIViewRoot viewRoot = liferayFacesContext.getViewRoot(); if (viewRoot != null) { viewRoot.setLocale(locale); } else { logger.error("viewRoot is null!"); } } } } } catch (Exception e) { logger.error(e.getMessage(), e); } }