Index: lams_build/lib/lams/lams-monitoring.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams-monitoring.jar,v diff -u -r1.15 -r1.16 Binary files differ Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml,v diff -u -r1.2 -r1.3 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml 15 Sep 2005 00:47:59 -0000 1.2 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/monitoringApplicationContext.xml 7 Dec 2005 06:08:19 -0000 1.3 @@ -62,6 +62,7 @@ PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED + PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java,v diff -u -r1.22 -r1.23 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java 7 Dec 2005 05:11:07 -0000 1.22 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java 7 Dec 2005 06:08:19 -0000 1.23 @@ -87,6 +87,13 @@ public void forceCompleteLessonByUser(long learnerProgressId); /** + * Archive the specified the lesson. When archived, the data is retained + * but the learners cannot access the details. + * @param lessonId the specified the lesson id. + */ + public void archiveLesson(long lessonId); + + /** * Set the gate to open to let all the learners through. This learning service * is triggerred by the system scheduler. Will return true GateActivity (or subclass) * object, rather than a hibernate proxy. This is needed so that the class can Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java,v diff -u -r1.27 -r1.28 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java 7 Dec 2005 05:11:07 -0000 1.27 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java 7 Dec 2005 06:08:18 -0000 1.28 @@ -328,7 +328,6 @@ for (Iterator i = activities.iterator(); i.hasNext();) { Activity activity = (Activity) i.next(); - System.out.println(activity); if ( activity.getActivityTypeId().intValue() == Activity.TOOL_ACTIVITY_TYPE ) { ToolActivity toolActivity = (ToolActivity) activityDAO.getActivityByActivityId(activity.getActivityId()); if (shouldInitToolSessionFor(toolActivity)) @@ -352,6 +351,25 @@ } /** + * Archive the specified the lesson. When archived, the data is retained + * but the learners cannot access the details. + * @param lessonId the specified the lesson id. + */ + public void archiveLesson(long lessonId) { + + Lesson requestedLesson = lessonDAO.getLesson(new Long(lessonId)); + if ( requestedLesson == null) { + throw new MonitoringServiceException("Lesson for id="+lessonId+" is missing. Unable to start lesson."); + } + + requestedLesson.setLessonStateId(Lesson.ARCHIVED_STATE); + lessonDAO.updateLesson(requestedLesson); + + } + + + + /** * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#openGate(org.lamsfoundation.lams.learningdesign.GateActivity) */ public GateActivity openGate(Long gateId) Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/DummyMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/Attic/DummyMonitoringAction.java,v diff -u -r1.5 -r1.6 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/DummyMonitoringAction.java 7 Dec 2005 05:11:07 -0000 1.5 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/DummyMonitoringAction.java 7 Dec 2005 06:08:19 -0000 1.6 @@ -32,7 +32,6 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -206,6 +205,36 @@ } /** + * The Struts dispatch method to archive a lesson. Forwards to the control + * list jsp. + * + * @param mapping An ActionMapping class that will be used by the Action class to tell + * the ActionServlet where to send the end-user. + * + * @param form The ActionForm class that will contain any data submitted + * by the end-user via a form. + * @param request A standard Servlet HttpServletRequest class. + * @param response A standard Servlet HttpServletResponse class. + * @return An ActionForward class that will be returned to the ActionServlet indicating where + * the user is to go next. + * @throws IOException + * @throws ServletException + */ + public ActionForward archiveLesson(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + + long lessonId = WebUtil.readLongParam(request,AttributeNames.PARAM_LESSON_ID); + monitoringService.archiveLesson(lessonId); + + return unspecified(mapping, form, request, response); + } + + /** * The Struts dispatch method that lists a lesson's details. Forwards to the detail screen * * @param mapping An ActionMapping class that will be used by the Action class to tell Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java,v diff -u -r1.8 -r1.9 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 7 Dec 2005 05:11:07 -0000 1.8 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 7 Dec 2005 06:08:19 -0000 1.9 @@ -33,12 +33,12 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; - import org.lamsfoundation.lams.monitoring.service.IMonitoringService; import org.lamsfoundation.lams.monitoring.service.MonitoringServiceProxy; import org.lamsfoundation.lams.tool.exception.LamsToolServiceException; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; /** @@ -76,11 +76,6 @@ //--------------------------------------------------------------------- private static final String SCHEDULER = "scheduler"; - //--------------------------------------------------------------------- - // Class level constants - session attributes - //--------------------------------------------------------------------- - private static final String PARAM_LESSON_ID = "lessonId"; - /** If you want the output given as a jsp, set the request parameter "jspoutput" to * some value other than an empty string (e.g. 1, true, 0, false, blah). * If you want it returned as a stream (ie for Flash), do not define this parameter @@ -143,7 +138,7 @@ { this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); - long lessonId = WebUtil.readLongParam(request,PARAM_LESSON_ID); + long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); monitoringService.startLesson(lessonId); @@ -153,9 +148,43 @@ return null; } - public ActionForward getAllLessons(ActionMapping mapping, + /** + * The Struts dispatch method to archive a lesson. A wddx + * acknowledgement message will be serialized and sent back to the flash + * component. + * + * @param mapping An ActionMapping class that will be used by the Action class to tell + * the ActionServlet where to send the end-user. + * + * @param form The ActionForm class that will contain any data submitted + * by the end-user via a form. + * @param request A standard Servlet HttpServletRequest class. + * @param response A standard Servlet HttpServletResponse class. + * @return An ActionForward class that will be returned to the ActionServlet indicating where + * the user is to go next. + * @throws IOException + * @throws ServletException + */ + public ActionForward archiveLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + + long lessonId = WebUtil.readLongParam(request,AttributeNames.PARAM_LESSON_ID); + monitoringService.archiveLesson(lessonId); + + //TODO add the wddx acknowledgement code. + + //return mapping.findForward(SCHEDULER); + return null; + } + + public ActionForward getAllLessons(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, HttpServletResponse response)throws IOException{ this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); String wddxPacket = monitoringService.getAllLessonsWDDX(); Index: lams_monitoring/web/dummyControlFrame.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/web/Attic/dummyControlFrame.jsp,v diff -u -r1.1 -r1.2 --- lams_monitoring/web/dummyControlFrame.jsp 7 Dec 2005 05:11:07 -0000 1.1 +++ lams_monitoring/web/dummyControlFrame.jsp 7 Dec 2005 06:08:19 -0000 1.2 @@ -17,6 +17,8 @@

Select a lesson

+ +

Note: If you archive a lesson, it can no longer be accessed. This is a temporary restriction.

@@ -33,6 +35,7 @@

" target="contentFrame">Monitor Lesson +
">Archive Lesson
Start new lesson