/**
  * This method is used to set the next portlet window state if this one needs to be modified
  * because of the incoming request
  */
 public static void setNextState(UIPortlet uiPortlet, WindowState state) {
   if (state != null) {
     UIPage uiPage = uiPortlet.getAncestorOfType(UIPage.class);
     if (WindowState.MAXIMIZED.equals(state)) {
       uiPortlet.setCurrentWindowState(WindowState.MAXIMIZED);
       if (uiPage != null) {
         uiPage.setMaximizedUIPortlet(uiPortlet);
       }
     } else if (WindowState.MINIMIZED.equals(state)) {
       uiPortlet.setCurrentWindowState(WindowState.MINIMIZED);
       if (uiPage != null) {
         uiPage.setMaximizedUIPortlet(null);
       }
     } else {
       uiPortlet.setCurrentWindowState(WindowState.NORMAL);
       if (uiPage != null) {
         uiPage.setMaximizedUIPortlet(null);
       }
     }
   }
 }
  @RequestMapping(
      value = {"VIEW"},
      params = {"action=browseStandard"})
  public ModelAndView browseStandard(RenderRequest request, RenderResponse response, String dir) {
    this.init(request);
    final PortletPreferences prefs = request.getPreferences();
    boolean useDoubleClick = "true".equals(prefs.getValue(PREF_USE_DOUBLE_CLICK, "true"));
    boolean useCursorWaitDialog =
        "true".equals(prefs.getValue(PREF_USE_CURSOR_WAIT_DIALOG, "false"));

    ModelMap model = new ModelMap();
    model.put("useDoubleClick", useDoubleClick);
    model.put("useCursorWaitDialog", useCursorWaitDialog);
    if (dir == null) dir = "";
    model.put("defaultPath", dir);

    boolean fullViewOnlyMaximized =
        "true".equals(prefs.getValue(PREF_FULL_VIEW_ONLY_MAXIMIZED, "true"));
    boolean fullView =
        !fullViewOnlyMaximized || WindowState.MAXIMIZED.equals(request.getWindowState());
    model.put("fullView", fullView);

    return new ModelAndView("view-portlet", model);
  }