public int getBuildNumber() { return liferayFacesContext.getBuildNumber(); }
/** * Returns the Liferay companyId primary key value associated with the community/organization portal page that the * current portlet is placed upon. */ public Long getCompanyId() { if (companyId == null) { companyId = liferayFacesContext.getCompanyId(); } return companyId; }
/** * Returns the absolute URL for the Liferay Document Library Struts action path. For example: * http://localhost:8080/c/document_library */ public String getDocumentLibraryURL() { if (documentLibraryURL == null) { documentLibraryURL = liferayFacesContext.getDocumentLibraryURL(); } return documentLibraryURL; }
@Override public String getRequestPath() { LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance(); String portalURL = liferayFacesContext.getPortalURL(); return portalURL + resourceName; }
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); } }
@Override public String getResourceGroupId() { String resourceGroupId = super.getResourceGroupId(); if (resourceGroupId == null) { resourceGroupId = String.valueOf(LiferayFacesContext.getInstance().getScopeGroupId()); } return resourceGroupId; } }
public boolean isInlineInputEditor() { if (inlineInputEditor == null) { inlineInputEditor = Boolean.FALSE; int buildNumber = liferayFacesContext.getBuildNumber(); if (buildNumber >= 6012) { inlineInputEditor = Boolean.TRUE; } else { String configOption = liferayFacesContext.getExternalContext().getInitParameter( "com.liferay.faces.portal.inlineInputEditor"); if (configOption == null) { // Backwards compatibility configOption = liferayFacesContext.getExternalContext().getInitParameter( "org.portletfaces.liferay.faces.inlineInputEditor"); } if ((configOption != null) && BooleanHelper.isTrueToken(configOption)) { inlineInputEditor = Boolean.TRUE; } } } return inlineInputEditor; }
/** * Returns the absolute URL for the Liferay Image Servlet. Although this can be used to construct a URL that points * a Liferay user's portrait/photo, for performance reasons, it is better to call {@link #getPortraitURL()} instead. */ public String getImageURL() { if (imageURL == null) { imageURL = liferayFacesContext.getImageGalleryURL(); } return imageURL; }
/** * Returns the Liferay {@link User} that owns the Liferay community/organization portal page that the containing * portlet is placed upon. */ public User getScopeGroupUser() { if (groupUser == null) { groupUser = liferayFacesContext.getScopeGroupUser(); } return groupUser; }
/** * 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(); }
/** * Returns the absolute URL for the portal. For example: http://localhost:8080 */ public String getPortalURL() { if (portalURL == null) { portalURL = liferayFacesContext.getPortalURL(); } return portalURL; }
/** * Returns the Liferay {@link Layout} associated with the community/organization portal page that the containing * portlet is placed upon. */ public Layout getLayout() { if (layout == null) { layout = liferayFacesContext.getLayout(); } return layout; }
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); } }
@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; } }
public boolean isInlineInputEditor() { if (inlineInputEditor == null) { inlineInputEditor = Boolean.FALSE; int buildNumber = liferayFacesContext.getBuildNumber(); if (buildNumber >= 6012) { inlineInputEditor = Boolean.TRUE; } else { String configOption = liferayFacesContext.getExternalContext().getInitParameter( "com.liferay.faces.portal.inlineInputEditor"); if (configOption == null) { // Backwards compatibility configOption = liferayFacesContext.getExternalContext().getInitParameter( "org.portletfaces.liferay.faces.inlineInputEditor"); } if ((configOption != null) && BooleanHelper.isTrueToken(configOption)) { inlineInputEditor = Boolean.TRUE; } } } return inlineInputEditor; }
/** * Returns the absolute URL for the Liferay Document Library Struts action path. For example: * http://localhost:8080/image/image_gallery */ public String getImageGalleryURL() { if (imageGalleryURL == null) { imageGalleryURL = liferayFacesContext.getImageGalleryURL(); } return imageGalleryURL; }
/** * Returns the Liferay {@link User} that owns the Liferay community/organization portal page that the containing * portlet is placed upon. */ public User getScopeGroupUser() { if (groupUser == null) { groupUser = liferayFacesContext.getScopeGroupUser(); } return groupUser; }
/** * 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(); }
/** * Returns the absolute URL for the portal. For example: http://localhost:8080 */ public String getPortalURL() { if (portalURL == null) { portalURL = liferayFacesContext.getPortalURL(); } return portalURL; }