/** * This method is necessary in order to re-self-inject the {@link LiferayFacesContext} during deserialization. For * more information, see: http://issues.liferay.com/browse/FACES-1168 */ private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { objectInputStream.defaultReadObject(); liferayFacesContext = LiferayFacesContext.getInstance(); }
/** * This method is necessary in order to re-self-inject the {@link LiferayFacesContext} during deserialization. For * more information, see: http://issues.liferay.com/browse/FACES-1168 */ private void readObject(ObjectInputStream objectInputStream) throws IOException, ClassNotFoundException { objectInputStream.defaultReadObject(); liferayFacesContext = LiferayFacesContext.getInstance(); }
@Override public String getRequestPath() { LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance(); String portalURL = liferayFacesContext.getPortalURL(); return portalURL + resourceName; }
@Override public String getRequestPath() { LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance(); String portalURL = liferayFacesContext.getPortalURL(); return portalURL + resourceName; }
@Override public String getResourceGroupId() { String resourceGroupId = super.getResourceGroupId(); if (resourceGroupId == null) { resourceGroupId = String.valueOf(LiferayFacesContext.getInstance().getScopeGroupId()); } return resourceGroupId; } }
@Override public String getResourceGroupId() { String resourceGroupId = super.getResourceGroupId(); if (resourceGroupId == null) { resourceGroupId = String.valueOf(LiferayFacesContext.getInstance().getScopeGroupId()); } return resourceGroupId; } }
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); } }