Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java,v diff -u -r1.90 -r1.91 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 19 Jan 2006 20:53:04 -0000 1.90 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java 21 Jan 2006 21:00:22 -0000 1.91 @@ -2217,6 +2217,53 @@ } + /**Double check: we assume that the author have to use Cancel button to exit the authoring module. + * This is the place to remove any authoring modle related session attributes + * + * author exiting, remove any session attributes that belong to authoring module here + * cancelAuthoring(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + * + * @param mapping + * @param form + * @param request + * @param response + * @return ActionForward + * @throws IOException + * @throws ServletException + */ + public ActionForward cancelAuthoring(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + logger.debug("dispatching cancelAuthoring..."); + McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; + + + /* determine whether the request is from Monitoring url Edit Activity*/ + String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); + logger.debug("sourceMcStarter: " + sourceMcStarter); + + String userAction="cancelAuthoring"; + request.setAttribute(USER_ACTION, userAction); + logger.debug("userAction:" + userAction); + mcAuthoringForm.resetUserAction(); + + /*remove attribues */ + request.getSession().removeAttribute(SHOW_AUTHORING_TABS); + request.getSession().removeAttribute(ACTIVE_MODULE); + logger.debug("removed attribues..."); + + /* Check this: find out where to forward to*/ + return (mapping.findForward(AUTHORING_STARTER)); + } + + /** * ensures that the weight valued entered are valid * validateQuestionWeights(HttpServletRequest request, McAuthoringForm mcAuthoringForm)