Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McDLStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/Attic/McDLStarterAction.java,v diff -u -r1.2 -r1.3 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McDLStarterAction.java 15 Jan 2006 16:38:44 -0000 1.2 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McDLStarterAction.java 2 Feb 2006 20:58:38 -0000 1.3 @@ -54,6 +54,7 @@ import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.tool.mc.McAppConstants; import org.lamsfoundation.lams.tool.mc.McApplicationException; +import org.lamsfoundation.lams.tool.mc.McUtils; import org.lamsfoundation.lams.tool.mc.service.IMcService; import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; @@ -63,11 +64,14 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, McApplicationException { - McStarterAction mcStarterAction= new McStarterAction(); - + McUtils.cleanUpSessionAbsolute(request); + logger.debug("init defineLater mode. removed attributes..."); + IMcService mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("mcService: " + mcService); request.getSession().setAttribute(TOOL_SERVICE, mcService); - + + McStarterAction mcStarterAction= new McStarterAction(); return mcStarterAction.executeDefineLater(mapping, form, request, response, mcService); } } Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java,v diff -u -r1.11 -r1.12 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java 31 Jan 2006 16:27:04 -0000 1.11 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McLearningForm.java 2 Feb 2006 20:58:38 -0000 1.12 @@ -26,6 +26,9 @@ protected String donePreview; protected String doneLearnerProgress; + + + public void resetCommands() { this.setContinueOptions(null); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java,v diff -u -r1.60 -r1.61 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 2 Feb 2006 14:48:23 -0000 1.60 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McStarterAction.java 2 Feb 2006 20:58:38 -0000 1.61 @@ -132,51 +132,74 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, McApplicationException { - - IMcService mcService = (IMcService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("will retrieve mcService" + mcService); - - + + /* String showAuthoringTabs=(String) request.getSession().getAttribute(SHOW_AUTHORING_TABS); logger.debug("showAuthoringTabs: " + showAuthoringTabs); - + if (showAuthoringTabs == null) { request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); } logger.debug("final showAuthoringTabs: " + request.getSession().getAttribute(SHOW_AUTHORING_TABS)); + */ + McUtils.cleanUpSessionAbsolute(request); + logger.debug("init authoring mode. removed attributes..."); - + IMcService mcService = (IMcService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("mcService: " + mcService); + if (mcService == null) + { + logger.debug("will retrieve mcService"); + mcService = McServiceProxy.getMcService(getServlet().getServletContext()); + logger.debug("retrieving mcService from cache: " + mcService); + } + request.getSession().setAttribute(TOOL_SERVICE, mcService); + + String servletPath=request.getServletPath(); + logger.debug("getServletPath: "+ servletPath); + if (servletPath.indexOf("defineLaterStarter") > 0) + { + logger.debug("request is for define later module."); + request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + } + else + { + logger.debug("request is for authoring module"); + request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); + request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); + } + + /* String activeModule=(String) request.getSession().getAttribute(ACTIVE_MODULE); logger.debug("activeModule: " + activeModule); - /* determine whether the request is from Monitoring url Edit Activity - * null sourceMcStarter indicates that the request is from authoring url. - * */ - - String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); - logger.debug("sourceMcStarter: " + sourceMcStarter); - - if ( (activeModule == null) || (!activeModule.equals(DEFINE_LATER)) ) { + McUtils.cleanUpSessionAbsolute(request); + logger.debug("init authoring mode. removed attributes..."); request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); logger.debug("activeModule set to Authoring: " + activeModule); + request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(true).toString()); } logger.debug("final active activeModule is: " + request.getSession().getAttribute(ACTIVE_MODULE)); - - if (mcService == null) - { - logger.debug("will retrieve mcService"); - mcService = McServiceProxy.getMcService(getServlet().getServletContext()); - logger.debug("retrieving mcService from proxy: " + mcService); - request.getSession().setAttribute(TOOL_SERVICE, mcService); - } + logger.debug("final showAuthoringTabs: " + request.getSession().getAttribute(SHOW_AUTHORING_TABS)); + */ initialiseAttributes(request); + /* determine whether the request is from Monitoring url Edit Activity + * null sourceMcStarter indicates that the request is from authoring url. + * */ + String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); + logger.debug("sourceMcStarter: " + sourceMcStarter); + + McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; mcAuthoringForm.resetRadioBoxes(); @@ -343,7 +366,7 @@ * there is no need to check if the content is in use in this case. * It is always unlocked -> not in use since it is the default content. */ - + if (!existsContent(toolContentId, request)) { logger.debug("retrieving default content"); @@ -376,13 +399,19 @@ /* it is possible that the content is being EDITED in the monitoring interface. In this situation, the content is not modifiable*/ boolean isDefineLater=McUtils.isDefineLater(mcContent); logger.debug("isDefineLater:" + isDefineLater); - - if (isDefineLater == true) + String defineLater= (String)request.getSession().getAttribute(ACTIVE_MODULE); + logger.debug("the url mode is :" + defineLater); + + /* we should allow content to be edited if the url mode is define Later*/ + if (!defineLater.equals(DEFINE_LATER)) { - persistError(request,"error.content.beingModified"); - McUtils.cleanUpSessionAbsolute(request); - logger.debug("forwarding to: " + ERROR_LIST); - return (mapping.findForward(ERROR_LIST)); + if (isDefineLater == true) + { + persistError(request,"error.content.beingModified"); + McUtils.cleanUpSessionAbsolute(request); + logger.debug("forwarding to: " + ERROR_LIST); + return (mapping.findForward(ERROR_LIST)); + } } } @@ -784,10 +813,12 @@ request.getSession().setAttribute(TOOL_SERVICE, mcService); /* present the view-only screen first */ + /* request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); - request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString()); + */ + return execute(mapping, form, request, response); }