Package com.liferay.portal.model

Examples of com.liferay.portal.model.Portlet


  }

  protected ServletContext getServletContext(
    String portletId, String requestURI) {

    Portlet portlet = null;

    if (Validator.isNotNull(portletId)) {
      try {
        String rootPortletId = PortletConstants.getRootPortletId(
          portletId);

        portlet = PortletLocalServiceUtil.getPortletById(rootPortletId);
      }
      catch (Exception e) {
        if (_log.isDebugEnabled()) {
          _log.debug(e, e);
        }
      }
    }

    String servletContextName = null;

    if (portlet != null) {
      PortletApp portletApp = portlet.getPortletApp();

      servletContextName = portletApp.getServletContextName();
    }
    else if (requestURI != null) {
      servletContextName = requestURI;
View Full Code Here


  public String getPortletResourcePrimaryKey() {

    if (portletResourcePrimaryKey == null) {
      LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
      long plid = liferayFacesContext.getPlid();
      Portlet portlet = liferayFacesContext.getPortlet();
      String portletId = portlet.getPortletId();
      portletResourcePrimaryKey = PortletPermissionUtil.getPrimaryKey(plid, portletId);
    }

    return portletResourcePrimaryKey;
  }
View Full Code Here

      addPortlet(layoutTypePortlet, userId, columnNumber, portletId);

      // Store the preferences for the portlet, if any
      PortletPreferences portletPreferences = PortletPreferencesFactoryUtil.getLayoutPortletSetup(
          portalPageLayout, portletId);
      Portlet portlet = PortletLocalServiceUtil.getPortletById(companyId, portletId);
      PortletBag portletBag = PortletBagPool.get(portlet.getRootPortletId());

      if (portletBag != null) {
        portletPreferences.store();
      }
View Full Code Here

  }

  public Portlet getPortlet() {

    // Attempt to get the Portlet object from the "RENDER_PORTLET" request attribute.
    Portlet portlet = (Portlet) getPortletRequest().getAttribute(WebKeys.RENDER_PORTLET);

    // FACES-1212: If the request attribute was null, then this method is being called outside of the RENDER_PHASE
    // of the portlet lifecycle. In that case, use the cached version of the Portlet object from the "liferay"
    // ViewScoped managed-bean.
    if (portlet == null) {
View Full Code Here

          PortletRequest portletRequest = (PortletRequest) facesContext.getExternalContext().getRequest();
          String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID);
          ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

          try {
            Portlet portlet = PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(),
                portletId);
            addPortletAuthToken = portlet.isAddDefaultResource();
          }
          catch (SystemException e) {
            logger.error(e);
          }
        }
View Full Code Here

    boolean portletRequiresNamespacedParameters = false;

    String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID);

    try {
      Portlet portlet = PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(), portletId);
      portletRequiresNamespacedParameters = portlet.isRequiresNamespacedParameters();
    }
    catch (SystemException e) {
      logger.error(e);
    }
View Full Code Here

        if (action != null && action.equals("1")) {
          String companyId = PortalUtil.getCompanyId(req);
          User user = PortalUtil.getUser(req);
          String portletId = ParamUtil.getString(req, "p_p_id");

          Portlet portlet =
            PortletManagerUtil.getPortletById(companyId, portletId);
         
//            boolean hasPermission = RoleLocalManagerUtil.hasRoles(user.getUserId(), portlet.getRolesArray());
//            if (!hasPermission) {
//              _processRenderRequest(req, res);
View Full Code Here

    String companyId = PortalUtil.getCompanyId(req);
    User user = PortalUtil.getUser(req);
    Layout layout = (Layout)req.getAttribute(WebKeys.LAYOUT);
    String portletId = ParamUtil.getString(req, "p_p_id");

    Portlet portlet =
      PortletManagerUtil.getPortletById(companyId, portletId);

    ServletContext ctx = (ServletContext)req.getAttribute(WebKeys.CTX);

    CachePortlet cachePortlet = PortalUtil.getPortletInstance(portlet, ctx);
View Full Code Here

      itr = portletsPool.entrySet().iterator();

      while (itr.hasNext()) {
        Map.Entry entry = (Map.Entry)itr.next();

        Portlet portletModel = (Portlet)entry.getValue();

        if (!portletModel.getPortletId().equals(PortletKeys.ADMIN) &&
          !portletModel.getPortletId().equals(
            PortletKeys.MY_ACCOUNT) &&
          !portletModel.isInclude()) {

          itr.remove();
        }
      }
    }
View Full Code Here

      itr = portletIds.iterator();

      while (itr.hasNext()) {
        String portletId = (String)itr.next();

        Portlet portlet = (Portlet)_getPortletsPool().get(portletId);

        portlets.add(portlet);
      }
    }
    catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.liferay.portal.model.Portlet

Copyright © 2018 www.massapicom. 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.