示例#1
0
  public void doView(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {

    if (WindowState.MINIMIZED.equals(request.getWindowState())) {
      return;
    }

    if (WindowState.NORMAL.equals(request.getWindowState())) {
      normalView.include(request, response);
    } else {
      maximizedView.include(request, response);
    }
  }
  @Override
  protected void writeAjaxPage(
      RenderRequest request, RenderResponse response, Window window, Application application)
      throws IOException, MalformedURLException, PortletException {
    MailApplication mailApplication = (MailApplication) application;

    // user is set in the portlet listener by the application
    if (mailApplication.getController().getUser() == null) {
      // normally, the portal takes care of this
      // this branch is in case the user has not been registered in the controller
      writeNotLoggedInPageHtml(request, response, window);
    } else if (PortletMode.VIEW.equals(request.getPortletMode())
        && WindowState.NORMAL.equals(request.getWindowState())) {
      mailApplication.writeViewPageHtml(request, response, window);
    } else {
      // this includes other modes as well as the maximized state
      super.writeAjaxPage(request, response, window, application);
    }
  }
  public void doView(RenderRequest request, RenderResponse response)
      throws PortletException, IOException {

    long clock = System.currentTimeMillis();

    try {
      System.out.println("hi: " + clock);
      log.debug("Rendering view.");

      if (WindowState.MINIMIZED.equals(request.getWindowState())) {
        return;
      }

      if (WindowState.NORMAL.equals(request.getWindowState())) {
        normalView.include(request, response);
      } else {
        maximizedView.include(request, response);
      }
    } finally {
      long duration = System.currentTimeMillis() - clock;
      log.debug(String.format("View rendering took %s ms.", duration));
    }
  }