Package com.liferay.portlet

Examples of com.liferay.portlet.PortletConfigImpl


      (PortletConfig)map.get(portlet.getPortletId());

    if (portletConfig == null) {
      PortletContext portletCtx = getPortletContext(portlet, ctx);

      portletConfig = new PortletConfigImpl(
        portlet.getPortletId(), portletCtx, portlet.getInitParams(),
        portlet.getResourceBundle(), portlet.getPortletInfo());

      map.put(portlet.getPortletId(), portletConfig);
    }
View Full Code Here


    return com.dotmarketing.util.PortletURLUtil.getActionURL(httpReq, _windowState, _params);
  }

  public static String getActionURL(HttpServletRequest req, String _windowState, Map _params) {
   
    PortletConfigImpl portletConfig = (PortletConfigImpl) req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);
    String portletName = null;
 
    if(portletConfig==null) {
      try {
        User user = WebAPILocator.getUserWebAPI().getLoggedInUser(req);
        List<Layout>layouts = APILocator.getLayoutAPI().loadLayoutsForUser(user);
        if(layouts.size()==0){
          return null;
        }
        Layout layout = layouts.get(0);
        List<String> portletIds = layout.getPortletIds();
        portletName = portletIds.get(0);
        return getActionURL(req, layout.getId(), _windowState, _params, portletName);
      } catch (Exception e) {
        Logger.error(PortletURLUtil.class, e.toString(), e);
      }
    } else {
      portletName = portletConfig.getPortletId();
    }
   
    return getActionURL(req, _windowState, _params, portletName);
 
  }
View Full Code Here

  public PortletURLUtil() {
    // empty constructor to call methods from velocity pages
  }

  public static String getRenderURL(HttpServletRequest req, String _windowState, Map _params) {
    PortletConfigImpl portletConfig = (PortletConfigImpl) req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);
    String portletName = portletConfig.getPortletId();
    return getRenderURL(req, _windowState, _params, portletName);
  }
View Full Code Here

      (PortletAction)processActionCreate(httpReq, httpRes, mapping);
    if (action == null) {
      return;
    }

    PortletConfigImpl portletConfig =
      (PortletConfigImpl)req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);

    try {
      action.processAction(mapping, form, portletConfig, req, res);
    }
    catch (Exception e) {
      String exceptionId =
        WebKeys.PORTLET_STRUTS_EXCEPTION + StringPool.PERIOD +
          portletConfig.getPortletId();

      req.setAttribute(exceptionId, e);
    }

    String forward =
View Full Code Here

  protected ActionForward processActionPerform(
      HttpServletRequest req, HttpServletResponse res, Action action,
      ActionForm form, ActionMapping mapping)
    throws IOException, ServletException {

    PortletConfigImpl portletConfig =
      (PortletConfigImpl)req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);

    String exceptionId =
      WebKeys.PORTLET_STRUTS_EXCEPTION + StringPool.PERIOD +
        portletConfig.getPortletId();

    Exception e = (Exception)req.getAttribute(exceptionId);

    if (e != null) {
      return processException(req, res, e, form, mapping);
View Full Code Here

  protected void doInclude(
      String uri, HttpServletRequest req, HttpServletResponse res)
    throws IOException, ServletException {

    PortletConfigImpl portletConfig =
      (PortletConfigImpl)req.getAttribute(WebKeys.JAVAX_PORTLET_CONFIG);

    RenderRequest renderRequest =
      (RenderRequest)req.getAttribute(WebKeys.JAVAX_PORTLET_REQUEST);

    RenderResponse renderResponse =
      (RenderResponse)req.getAttribute(WebKeys.JAVAX_PORTLET_RESPONSE);

    PortletRequestDispatcherImpl prd = (PortletRequestDispatcherImpl)
      portletConfig.getPortletContext().getRequestDispatcher(
        Constants.TEXT_HTML_DIR + uri);

    try {
      if (prd == null) {
        _log.error(uri + " is not a valid include");
View Full Code Here

    if (Validator.isNull(path)) {
      path = (String)req.getAttribute(WebKeys.PORTLET_STRUTS_ACTION);
    }

    if (path == null) {
      PortletConfigImpl portletConfig =
        (PortletConfigImpl)req.getAttribute(
          WebKeys.JAVAX_PORTLET_CONFIG);

      _log.error(
        portletConfig.getPortletName() +
          " does not have any paths specified");
    }

    return path;
  }
View Full Code Here

TOP

Related Classes of com.liferay.portlet.PortletConfigImpl

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.