Examples of ThemeDisplay


Examples of com.liferay.portal.theme.ThemeDisplay

      // 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) {
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

      }

      FacesContext facesContext = FacesContext.getCurrentInstance();
      ExternalContext externalContext = facesContext.getExternalContext();
      PortletRequest portletRequest = (PortletRequest) externalContext.getRequest();
      ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
      String portalURL = themeDisplay.getPortalURL();
      String imagePath = portalURL + "/image";
      UserPortraitResource userPortraitResource = new UserPortraitResource(imagePath, selectedUser,
          uploadedFileId);
      String requestPath = userPortraitResource.getRequestPath();
      Application application = facesContext.getApplication();
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

      portalPages = new ArrayList<PortalPage>();

      try {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ThemeDisplay themeDisplay = (ThemeDisplay) facesContext.getExternalContext().getRequestMap().get(
            WebKeys.THEME_DISPLAY);
        long groupId = themeDisplay.getScopeGroupId();
        boolean publicLayout = themeDisplay.getLayout().isPublicLayout();
        Locale locale = themeDisplay.getLocale();
        List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(groupId, !publicLayout);

        for (Layout layout : layouts) {
          long portalPageId = layout.getPlid();
          String portalPageName = layout.getHTMLTitle(locale);
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

    }
  }

  public boolean userHasPortletPermission(String actionId) {
    ThemeDisplay themeDisplay = getThemeDisplay();
    PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();
    String portletId = themeDisplay.getPortletDisplay().getId();
    boolean hasPermission = false;

    try {
      hasPermission = PortletPermissionUtil.contains(permissionChecker, themeDisplay.getPlid(), portletId,
          actionId);
    }
    catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

  }

  public ServiceContext getServiceContext() {

    ServiceContext serviceContext = new ServiceContext();
    ThemeDisplay themeDisplay = getThemeDisplay();
    serviceContext.setCompanyId(themeDisplay.getCompanyId());
    serviceContext.setLanguageId(themeDisplay.getLanguageId());
    serviceContext.setPathMain(PortalUtil.getPathMain());
    serviceContext.setPlid(themeDisplay.getPlid());
    serviceContext.setPortalURL(PortalUtil.getPortalURL(getPortletRequest()));
    serviceContext.setScopeGroupId(themeDisplay.getScopeGroupId());
    serviceContext.setUserId(themeDisplay.getUserId());

    try {
      serviceContext.setLayoutFullURL(PortalUtil.getLayoutFullURL(themeDisplay));
      serviceContext.setLayoutURL(PortalUtil.getLayoutURL(themeDisplay));
      serviceContext.setUserDisplayURL(themeDisplay.getUser().getDisplayURL(themeDisplay));
    }
    catch (Exception e) {
      logger.error(e.getMessage(), e);
    }
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

  public Theme getTheme() {
    return getThemeDisplay().getTheme();
  }

  public ThemeDisplay getThemeDisplay() {
    ThemeDisplay themeDisplay = (ThemeDisplay) getPortletRequest().getAttribute(WebKeys.THEME_DISPLAY);

    return themeDisplay;
  }
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

  }

  public String getThemeImagesURL() {

    String portalURL = null;
    ThemeDisplay themeDisplay = getThemeDisplay();
    String cdnHost = themeDisplay.getCDNHost();

    if ((cdnHost != null) && (cdnHost.length() > 0)) {
      portalURL = cdnHost;
    }
    else {
      portalURL = themeDisplay.getPortalURL();
    }

    String pathThemeImages = themeDisplay.getPathThemeImages();

    if (pathThemeImages.startsWith(portalURL)) {

      // The portalURL will already be included for versions of Liferay Portal newer than 6.1.0 CE GA1
      return pathThemeImages;
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

      // Faces Bridge will detect the redirect, and maintain the Bridge Request Scope accordingly.
      eventPayload = new EventPayloadWrapper(customer, true);

      // Issue the redirect to the selected portal page.
      try {
        ThemeDisplay themeDisplay = (ThemeDisplay) externalContext.getRequestMap().get(WebKeys.THEME_DISPLAY);
        Layout layout = LayoutLocalServiceUtil.getLayout(customersViewBean.getPortalPageId());
        String portalURL = PortalUtil.getPortalURL(themeDisplay);
        String redirectPortalPageURL = portalURL + PortalUtil.getLayoutFriendlyURL(layout, themeDisplay);
        externalContext.redirect(redirectPortalPageURL);
      }
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

      // Initialize the private data members.
      this.portletResponseNamespace = portletResponse.getNamespace();

      LiferayPortletRequest liferayPortletRequest = new LiferayPortletRequest(portletRequest);
      ThemeDisplay themeDisplay = liferayPortletRequest.getThemeDisplay();
      this.liferayPortletRequest = liferayPortletRequest;

      // Initialize the pseudo-constants.
      NAMESPACED_P_P_COL_ID = portletResponseNamespace + LiferayConstants.P_P_COL_ID;
      NAMESPACED_P_P_COL_POS = portletResponseNamespace + LiferayConstants.P_P_COL_POS;
View Full Code Here

Examples of com.liferay.portal.theme.ThemeDisplay

  @Override
  public String getRequestURL() {

    if (requestURL == null) {
      StringBuilder buf = new StringBuilder();
      ThemeDisplay themeDisplay = liferayPortletRequest.getThemeDisplay();
      buf.append(themeDisplay.getURLPortal());
      buf.append(themeDisplay.getURLCurrent());
      requestURL = buf.toString();
    }

    return requestURL;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.