protected void toolModeDispatch(
      String methodBase, String methodExt, HttpServletRequest req, HttpServletResponse res)
      throws ToolException {
    SessionState sstate = getState(req);
    ToolSession toolSession = SessionManager.getCurrentToolSession();

    String mode = (String) sstate.getAttribute(STATE_MODE);
    Object started = toolSession.getAttribute(STARTED);

    if (mode == null && started != null) {
      toolSession.removeAttribute(STARTED);
      Tool tool = ToolManager.getCurrentTool();

      String url =
          (String)
              SessionManager.getCurrentToolSession()
                  .getAttribute(tool.getId() + Tool.HELPER_DONE_URL);

      SessionManager.getCurrentToolSession().removeAttribute(tool.getId() + Tool.HELPER_DONE_URL);

      try {
        res.sendRedirect(url);
      } catch (IOException e) {
        Log.warn("chef", this + " : ", e);
      }
      return;
    }

    super.toolModeDispatch(methodBase, methodExt, req, res);
  }
Пример #2
0
  /* (non-Javadoc)
   * @see org.sakaiproject.cheftool.VelocityPortletPaneledAction#toolModeDispatch(java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  protected void toolModeDispatch(
      String methodBase, String methodExt, HttpServletRequest req, HttpServletResponse res)
      throws ToolException {
    ToolSession toolSession = SessionManager.getCurrentToolSession();
    SessionState state = getState(req);

    if (MODE_DONE.equals(toolSession.getAttribute(LINK_MODE))) {

      Tool tool = ToolManager.getCurrentTool();

      String url =
          (String)
              SessionManager.getCurrentToolSession()
                  .getAttribute(tool.getId() + Tool.HELPER_DONE_URL);

      SessionManager.getCurrentToolSession().removeAttribute(tool.getId() + Tool.HELPER_DONE_URL);
      SessionManager.getCurrentToolSession().removeAttribute(LINK_MODE);

      try {
        res.sendRedirect(url);
      } catch (IOException e) {
        logger.warn("IOException: ", e);
      }
      return;
    } else if (sendToHelper(req, res, req.getPathInfo())) {
      return;
    } else {
      super.toolModeDispatch(methodBase, methodExt, req, res);
    }
  }
Пример #3
0
 public String getToolId() {
   return tool.getId();
 }