Index: lams_monitoring/conf/xdoclet/struts-forms.xml =================================================================== diff -u --- lams_monitoring/conf/xdoclet/struts-forms.xml (revision 0) +++ lams_monitoring/conf/xdoclet/struts-forms.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,6 @@ + + + + + + Index: lams_monitoring/conf/xdoclet/struts-plugins.xml =================================================================== diff -u --- lams_monitoring/conf/xdoclet/struts-plugins.xml (revision 0) +++ lams_monitoring/conf/xdoclet/struts-plugins.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/CloseScheduleGateJob.java =================================================================== diff -u -r06534437a29c100f06d4dda2a400b055eec2fd58 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/CloseScheduleGateJob.java (.../CloseScheduleGateJob.java) (revision 06534437a29c100f06d4dda2a400b055eec2fd58) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/CloseScheduleGateJob.java (.../CloseScheduleGateJob.java) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -44,7 +44,7 @@ //--------------------------------------------------------------------- // Instance variables //--------------------------------------------------------------------- - private static Logger log = Logger.getLogger(OpenScheduleGateJob.class); + private static Logger log = Logger.getLogger(CloseScheduleGateJob.class); private IMonitoringService monitoringService; //--------------------------------------------------------------------- @@ -70,12 +70,12 @@ Map properties = context.getJobDetail().getJobDataMap(); Long gateId = (Long)properties.get("gateId"); - //if(log.isDebugEnabled()) - log.info("Closing gate......["+gateId.longValue()+"]"); + if(log.isDebugEnabled()) + log.debug("Closing gate......["+gateId.longValue()+"]"); monitoringService.closeGate(gateId); - //if(log.isDebugEnabled()) - log.info("Gate......["+gateId.longValue()+"] Closed"); + if(log.isDebugEnabled()) + log.debug("Gate......["+gateId.longValue()+"] Closed"); } } Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java =================================================================== diff -u -r06534437a29c100f06d4dda2a400b055eec2fd58 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java (.../IMonitoringService.java) (revision 06534437a29c100f06d4dda2a400b055eec2fd58) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/IMonitoringService.java (.../IMonitoringService.java) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -23,6 +23,7 @@ import java.io.IOException; import java.util.List; +import org.lamsfoundation.lams.learningdesign.Activity; import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.tool.service.LamsToolServiceException; import org.lamsfoundation.lams.usermanagement.Organisation; @@ -209,4 +210,11 @@ * @throws IOException */ public String renameLesson(Long lessonID, String newName, Integer userID)throws IOException; + + /** + * Return an activity object based on the requested id. + * @param activityId id of the activity. + * @return the requested activity object. + */ + public Activity getActivityById(long activityId); } Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java =================================================================== diff -u -r06534437a29c100f06d4dda2a400b055eec2fd58 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 06534437a29c100f06d4dda2a400b055eec2fd58) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -76,8 +76,10 @@ * because we need to load up tool's service dynamically according to the * selected learning design.

* - * @author Jacky Fang 2/02/2005 + * @author Jacky Fang * @author Manpreet Minhas + * @since 2/02/2005 + * @version 1.1 */ public class MonitoringService implements IMonitoringService,ApplicationContextAware { @@ -267,8 +269,8 @@ */ public void startlesson(long lessonId) { - //if(log.isDebugEnabled()) - log.info("=============Starting Lesson "+lessonId+"=============="); + if(log.isDebugEnabled()) + log.debug("=============Starting Lesson "+lessonId+"=============="); //we get the lesson just created Lesson requestedLesson = lessonDAO.getLesson(new Long(lessonId)); //initialize tool sessions if necessary @@ -292,55 +294,11 @@ lessonDAO.updateLesson(requestedLesson); - //if(log.isDebugEnabled()) - log.info("=============Lesson "+lessonId+" started==============="); + if(log.isDebugEnabled()) + log.debug("=============Lesson "+lessonId+" started==============="); } /** - *

Runs the system scheduler to start the scheduling for opening gate and - * closing gate. It invlovs a couple of steps to start the scheduler:

- *
  • 1. Initialize the resource needed by scheduling job by setting - * them into the job data map. - *
  • - *
  • 2. Create customized triggers for the scheduling.
  • - *
  • 3. start the scheduling job
  • - * - * @param scheduleGate the gate that needs to be scheduled. - */ - private void runGateScheduler(ScheduleGateActivity scheduleGate) - { - //if(log.isDebugEnabled()) - log.info("Running scheduler for gate "+scheduleGate.getActivityId()+"..."); - JobDetail openScheduleGateJob = getOpenScheduleGateJob(); - JobDetail closeScheduleGateJob = getCloseScheduleGateJob(); - //setup the message for scheduling job - openScheduleGateJob.setName("openGate"); - openScheduleGateJob.getJobDataMap().put("gateId",scheduleGate.getActivityId()); - closeScheduleGateJob.setName("closeGate"); - closeScheduleGateJob.getJobDataMap().put("gateId",scheduleGate.getActivityId()); - //create customized triggers - Trigger openGateTrigger = new SimpleTrigger("openGateTrigger", - Scheduler.DEFAULT_GROUP, - scheduleGate.getRealGateOpenTime()); - Trigger closeGateTrigger = new SimpleTrigger("closeGateTrigger", - Scheduler.DEFAULT_GROUP, - scheduleGate.getRealGateCloseTime()); - //start the scheduling job - try - { - scheduler.scheduleJob(openScheduleGateJob, openGateTrigger); - scheduler.scheduleJob(closeScheduleGateJob, closeGateTrigger); - } - catch (SchedulerException e) - { - throw new MonitoringServiceException("Error occurred at " + - "[runGateScheduler]- fail to start scheduling",e); - } - //if(log.isDebugEnabled()) - log.info("Scheduler for Gate "+scheduleGate.getActivityId()+" started..."); - } - - /** * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#openGate(org.lamsfoundation.lams.learningdesign.GateActivity) */ public void openGate(Long gateId) @@ -367,9 +325,205 @@ // TODO Auto-generated method stub } + + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLessons() + */ + public String getAllLessons() throws IOException{ + List lessons = lessonDAO.getAllLessons(); + return requestLessonList(lessons); + } + + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLessons(java.lang.Integer) + */ + public String getAllLessons(Integer userID)throws IOException{ + List lessons = lessonDAO.getLessonsForUser(userID); + return requestLessonList(lessons); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLessonDetails(java.lang.Long) + */ + public String getLessonDetails(Long lessonID)throws IOException{ + Lesson lesson = lessonDAO.getLesson(lessonID); + if(lesson!=null){ + flashMessage = new FlashMessage("getLessonDetails",lesson.getLessonDetails()); + }else + flashMessage = new FlashMessage("getLessonDetails", + "No such Lesson with a lessonID of :" + lessonID + " exists.", + FlashMessage.ERROR); + return flashMessage.serializeMessage(); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLessonLearners(java.lang.Long) + */ + public String getLessonLearners(Long lessonID)throws IOException{ + Vector lessonLearners = new Vector(); + Lesson lesson = lessonDAO.getLesson(lessonID); + if(lesson!=null){ + Iterator iterator = lesson.getLessonClass().getLearners().iterator(); + while(iterator.hasNext()){ + User user = (User)iterator.next(); + lessonLearners.add(user.getUserDTO()); + } + flashMessage = new FlashMessage("getLessonLearners",lessonLearners); + }else + flashMessage = new FlashMessage("getLessonLearners", + "No such lesson with a lesson_id of :"+ lessonID + " exists", + FlashMessage.ERROR); + return flashMessage.serializeMessage(); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLearningDesignDetails(java.lang.Long) + */ + public String getLearningDesignDetails(Long lessonID)throws IOException{ + Lesson lesson = lessonDAO.getLesson(lessonID); + return authoringService.getLearningDesignDetails(lesson.getLearningDesign().getLearningDesignId()); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLearnersProgress(java.lang.Long) + */ + public String getAllLearnersProgress(Long lessonID)throws IOException { + Vector progressData = new Vector(); + Lesson lesson = lessonDAO.getLesson(lessonID); + if(lesson!=null){ + Iterator iterator = lesson.getLearnerProgresses().iterator(); + while(iterator.hasNext()){ + LearnerProgress learnerProgress = (LearnerProgress)iterator.next(); + progressData.add(learnerProgress.getLearnerProgressData()); + } + flashMessage = new FlashMessage("getAllLearnersProgress",progressData); + }else{ + flashMessage = new FlashMessage("getAllLearnersProgress", + "No such lesson with a lesson_id of :"+ lessonID + " exists", + FlashMessage.ERROR); + } + return flashMessage.serializeMessage(); + } + + /** + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getActivityById(long) + */ + public Activity getActivityById(long activityId) + { + return activityDAO.getActivityByActivityId(new Long(activityId)); + } + + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllContributeActivities(java.lang.Long) + */ + public String getAllContributeActivities(Long lessonID)throws IOException{ + Lesson lesson = lessonDAO.getLesson(lessonID); + if(lesson!=null){ + Vector sortedSet = getOrderedActivityTree(lesson.getLearningDesign()); + flashMessage = new FlashMessage("getAllContributeActivities",sortedSet); + }else{ + flashMessage = new FlashMessage("getAllContributeActivities", + "No such lesson with a lesson_id of " + lessonID + "exists", + FlashMessage.ERROR); + } + return flashMessage.serializeMessage(); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLearnerActivityURL(java.lang.Long, java.lang.Integer) + */ + public String getLearnerActivityURL(Long activityID,Integer userID)throws IOException, LamsToolServiceException{ + Activity activity = activityDAO.getActivityByActivityId(activityID); + User user = userDAO.getUserById(userID); + if(activity==null || user==null){ + flashMessage = new FlashMessage("getLearnerActivityURL", + "Invalid activityID/User :" + activityID + " : " + userID, + FlashMessage.ERROR); + }else{ + if(activity.isToolActivity()){ + ToolActivity toolActivity = (ToolActivity)activity; + String toolURL = lamsCoreToolService.getLearnerToolURLByMode(toolActivity,user,ToolAccessMode.TEACHER); + flashMessage = new FlashMessage("getLearnerActivityURL",new ProgressActivityDTO(activityID,toolURL)); + }else{ + flashMessage = new FlashMessage("getLearnerActivityURL", + "Invalid Activity type: " + activity.getActivityId()+ "\n Only ToolActivity allowed.", + FlashMessage.ERROR); + } + } + + return flashMessage.serializeMessage(); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getActivityContributionURL(java.lang.Long) + */ + public String getActivityContributionURL(Long activityID)throws IOException{ + Activity activity = activityDAO.getActivityByActivityId(activityID); + if(activity!=null){ + if(activity.isToolActivity()){ + ToolActivity toolActivity = (ToolActivity)activity; + String contributionURL = toolActivity.getTool().getContributeUrl(); + flashMessage = new FlashMessage("getActivityContributionURL",contributionURL); + } + }else + flashMessage = FlashMessage.getNoSuchActivityExists("getActivityContributionURL",activityID); + + return flashMessage.serializeMessage(); + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#moveLesson(java.lang.Long, java.lang.Integer, java.lang.Integer) + */ + public String moveLesson(Long lessonID, Integer targetWorkspaceFolderID,Integer userID)throws IOException{ + Lesson lesson = lessonDAO.getLesson(lessonID); + if(lesson!=null){ + if(lesson.getUser().getUserId().equals(userID)){ + WorkspaceFolder workspaceFolder = workspaceFolderDAO.getWorkspaceFolderByID(targetWorkspaceFolderID); + if(workspaceFolder!=null){ + LearningDesign learningDesign = lesson.getLearningDesign(); + learningDesign.setWorkspaceFolder(workspaceFolder); + learningDesignDAO.update(learningDesign); + flashMessage = new FlashMessage("moveLesson",targetWorkspaceFolderID); + } + else + flashMessage = FlashMessage.getNoSuchWorkspaceFolderExsists("moveLesson",targetWorkspaceFolderID); + }else + flashMessage = FlashMessage.getUserNotAuthorized("moveLesson",userID); + }else{ + flashMessage = new FlashMessage("moveLesson", + "No such lesson with a lesson_id of :" + lessonID +" exists.", + FlashMessage.ERROR); + + } + return flashMessage.serializeMessage(); + + } + /** + * (non-Javadoc) + * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#renameLesson(java.lang.Long, java.lang.String, java.lang.Integer) + */ + public String renameLesson(Long lessonID, String newName, Integer userID)throws IOException{ + Lesson lesson = lessonDAO.getLesson(lessonID); + if(lesson!=null){ + if(lesson.getUser().getUserId().equals(userID)){ + lesson.setLessonName(newName); + lessonDAO.updateLesson(lesson); + flashMessage = new FlashMessage("renameLesson",newName); + }else + flashMessage = FlashMessage.getUserNotAuthorized("renameLesson",userID); + }else + flashMessage = new FlashMessage("renameLesson", + "No such lesson with a lesson_id of :" + lessonID +" exists.", + FlashMessage.ERROR); + return flashMessage.serializeMessage(); + } + //--------------------------------------------------------------------- - // Helper Methods + // Helper Methods - create lesson //--------------------------------------------------------------------- /** * Create a new lesson and setup all the staffs and learners who will be @@ -447,7 +601,10 @@ { return toolActivity.getTool().getServiceName().equals("surveyService"); } - + + //--------------------------------------------------------------------- + // Helper Methods - start lesson + //--------------------------------------------------------------------- /** * Create lams tool session for requested learner in the lesson. After the * creation of lams tool session, it delegates to the tool instances to @@ -498,15 +655,7 @@ return activity.isToolActivity() && !((ToolActivity) activity).getApplyGrouping().booleanValue(); } - - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLessons() - */ - public String getAllLessons() throws IOException{ - List lessons = lessonDAO.getAllLessons(); - return requestLessonList(lessons); - } + /** * This method returns the list of lessons in WDDX format * @@ -524,136 +673,7 @@ FlashMessage flashMessage = new FlashMessage("getAllLessons",lessonObjects); return flashMessage.serializeMessage(); } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLessons(java.lang.Integer) - */ - public String getAllLessons(Integer userID)throws IOException{ - List lessons = lessonDAO.getLessonsForUser(userID); - return requestLessonList(lessons); - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLessonDetails(java.lang.Long) - */ - public String getLessonDetails(Long lessonID)throws IOException{ - Lesson lesson = lessonDAO.getLesson(lessonID); - if(lesson!=null){ - flashMessage = new FlashMessage("getLessonDetails",lesson.getLessonDetails()); - }else - flashMessage = new FlashMessage("getLessonDetails", - "No such Lesson with a lessonID of :" + lessonID + " exists.", - FlashMessage.ERROR); - return flashMessage.serializeMessage(); - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLessonLearners(java.lang.Long) - */ - public String getLessonLearners(Long lessonID)throws IOException{ - Vector lessonLearners = new Vector(); - Lesson lesson = lessonDAO.getLesson(lessonID); - if(lesson!=null){ - Iterator iterator = lesson.getLessonClass().getLearners().iterator(); - while(iterator.hasNext()){ - User user = (User)iterator.next(); - lessonLearners.add(user.getUserDTO()); - } - flashMessage = new FlashMessage("getLessonLearners",lessonLearners); - }else - flashMessage = new FlashMessage("getLessonLearners", - "No such lesson with a lesson_id of :"+ lessonID + " exists", - FlashMessage.ERROR); - return flashMessage.serializeMessage(); - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLearningDesignDetails(java.lang.Long) - */ - public String getLearningDesignDetails(Long lessonID)throws IOException{ - Lesson lesson = lessonDAO.getLesson(lessonID); - return authoringService.getLearningDesignDetails(lesson.getLearningDesign().getLearningDesignId()); - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllLearnersProgress(java.lang.Long) - */ - public String getAllLearnersProgress(Long lessonID)throws IOException { - Vector progressData = new Vector(); - Lesson lesson = lessonDAO.getLesson(lessonID); - if(lesson!=null){ - Iterator iterator = lesson.getLearnerProgresses().iterator(); - while(iterator.hasNext()){ - LearnerProgress learnerProgress = (LearnerProgress)iterator.next(); - progressData.add(learnerProgress.getLearnerProgressData()); - } - flashMessage = new FlashMessage("getAllLearnersProgress",progressData); - }else{ - flashMessage = new FlashMessage("getAllLearnersProgress", - "No such lesson with a lesson_id of :"+ lessonID + " exists", - FlashMessage.ERROR); - } - return flashMessage.serializeMessage(); - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getAllContributeActivities(java.lang.Long) - */ - public String getAllContributeActivities(Long lessonID)throws IOException{ - Lesson lesson = lessonDAO.getLesson(lessonID); - if(lesson!=null){ - Vector sortedSet = getOrderedActivityTree(lesson.getLearningDesign()); - flashMessage = new FlashMessage("getAllContributeActivities",sortedSet); - }else{ - flashMessage = new FlashMessage("getAllContributeActivities", - "No such lesson with a lesson_id of " + lessonID + "exists", - FlashMessage.ERROR); - } - return flashMessage.serializeMessage(); - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getLearnerActivityURL(java.lang.Long, java.lang.Integer) - */ - public String getLearnerActivityURL(Long activityID,Integer userID)throws IOException, LamsToolServiceException{ - Activity activity = activityDAO.getActivityByActivityId(activityID); - User user = userDAO.getUserById(userID); - if(activity==null || user==null){ - flashMessage = new FlashMessage("getLearnerActivityURL", - "Invalid activityID/User :" + activityID + " : " + userID, - FlashMessage.ERROR); - }else{ - if(activity.isToolActivity()){ - ToolActivity toolActivity = (ToolActivity)activity; - String toolURL = lamsCoreToolService.getLearnerToolURLByMode(toolActivity,user,ToolAccessMode.TEACHER); - flashMessage = new FlashMessage("getLearnerActivityURL",new ProgressActivityDTO(activityID,toolURL)); - }else{ - flashMessage = new FlashMessage("getLearnerActivityURL", - "Invalid Activity type: " + activity.getActivityId()+ "\n Only ToolActivity allowed.", - FlashMessage.ERROR); - } - } - - return flashMessage.serializeMessage(); - } /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#getActivityContributionURL(java.lang.Long) - */ - public String getActivityContributionURL(Long activityID)throws IOException{ - Activity activity = activityDAO.getActivityByActivityId(activityID); - if(activity!=null){ - if(activity.isToolActivity()){ - ToolActivity toolActivity = (ToolActivity)activity; - String contributionURL = toolActivity.getTool().getContributeUrl(); - flashMessage = new FlashMessage("getActivityContributionURL",contributionURL); - } - }else - flashMessage = FlashMessage.getNoSuchActivityExists("getActivityContributionURL",activityID); - - return flashMessage.serializeMessage(); - } - /** * This method assigns an orderID to all the activties in the LearningDesign * based on the transitions. Once this is done it just packages it in a container * to be serialized and sent to flash @@ -705,67 +725,68 @@ } return activitySet; } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#moveLesson(java.lang.Long, java.lang.Integer, java.lang.Integer) - */ - public String moveLesson(Long lessonID, Integer targetWorkspaceFolderID,Integer userID)throws IOException{ - Lesson lesson = lessonDAO.getLesson(lessonID); - if(lesson!=null){ - if(lesson.getUser().getUserId().equals(userID)){ - WorkspaceFolder workspaceFolder = workspaceFolderDAO.getWorkspaceFolderByID(targetWorkspaceFolderID); - if(workspaceFolder!=null){ - LearningDesign learningDesign = lesson.getLearningDesign(); - learningDesign.setWorkspaceFolder(workspaceFolder); - learningDesignDAO.update(learningDesign); - flashMessage = new FlashMessage("moveLesson",targetWorkspaceFolderID); - } - else - flashMessage = FlashMessage.getNoSuchWorkspaceFolderExsists("moveLesson",targetWorkspaceFolderID); - }else - flashMessage = FlashMessage.getUserNotAuthorized("moveLesson",userID); - }else{ - flashMessage = new FlashMessage("moveLesson", - "No such lesson with a lesson_id of :" + lessonID +" exists.", - FlashMessage.ERROR); - - } - return flashMessage.serializeMessage(); - - } - /** - * (non-Javadoc) - * @see org.lamsfoundation.lams.monitoring.service.IMonitoringService#renameLesson(java.lang.Long, java.lang.String, java.lang.Integer) - */ - public String renameLesson(Long lessonID, String newName, Integer userID)throws IOException{ - Lesson lesson = lessonDAO.getLesson(lessonID); - if(lesson!=null){ - if(lesson.getUser().getUserId().equals(userID)){ - lesson.setLessonName(newName); - lessonDAO.updateLesson(lesson); - flashMessage = new FlashMessage("renameLesson",newName); - }else - flashMessage = FlashMessage.getUserNotAuthorized("renameLesson",userID); - }else - flashMessage = new FlashMessage("renameLesson", - "No such lesson with a lesson_id of :" + lessonID +" exists.", - FlashMessage.ERROR); - return flashMessage.serializeMessage(); - } - + + //--------------------------------------------------------------------- + // Helper Methods - scheduling + //--------------------------------------------------------------------- /** - * + *

    Runs the system scheduler to start the scheduling for opening gate and + * closing gate. It invlovs a couple of steps to start the scheduler:

    + *
  • 1. Initialize the resource needed by scheduling job by setting + * them into the job data map. + *
  • + *
  • 2. Create customized triggers for the scheduling.
  • + *
  • 3. start the scheduling job
  • + * + * @param scheduleGate the gate that needs to be scheduled. */ + private void runGateScheduler(ScheduleGateActivity scheduleGate) + { + if(log.isDebugEnabled()) + log.debug("Running scheduler for gate "+scheduleGate.getActivityId()+"..."); + JobDetail openScheduleGateJob = getOpenScheduleGateJob(); + JobDetail closeScheduleGateJob = getCloseScheduleGateJob(); + //setup the message for scheduling job + openScheduleGateJob.setName("openGate"); + openScheduleGateJob.getJobDataMap().put("gateId",scheduleGate.getActivityId()); + closeScheduleGateJob.setName("closeGate"); + closeScheduleGateJob.getJobDataMap().put("gateId",scheduleGate.getActivityId()); + //create customized triggers + Trigger openGateTrigger = new SimpleTrigger("openGateTrigger", + Scheduler.DEFAULT_GROUP, + scheduleGate.getRealGateOpenTime()); + Trigger closeGateTrigger = new SimpleTrigger("closeGateTrigger", + Scheduler.DEFAULT_GROUP, + scheduleGate.getRealGateCloseTime()); + //start the scheduling job + try + { + scheduler.scheduleJob(openScheduleGateJob, openGateTrigger); + scheduler.scheduleJob(closeScheduleGateJob, closeGateTrigger); + } + catch (SchedulerException e) + { + throw new MonitoringServiceException("Error occurred at " + + "[runGateScheduler]- fail to start scheduling",e); + } + if(log.isDebugEnabled()) + log.debug("Scheduler for Gate "+scheduleGate.getActivityId()+" started..."); + } + + /** + * Returns the bean that defines the open schedule gate job. + */ private JobDetail getOpenScheduleGateJob() { return (JobDetail)applicationContext.getBean("openScheduleGateJob"); } /** - * + * Returns the bean that defines the close schdule gate job. */ private JobDetail getCloseScheduleGateJob() { return (JobDetail)applicationContext.getBean("closeScheduleGateJob"); } + } \ No newline at end of file Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringServiceProxy.java =================================================================== diff -u -r06534437a29c100f06d4dda2a400b055eec2fd58 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringServiceProxy.java (.../MonitoringServiceProxy.java) (revision 06534437a29c100f06d4dda2a400b055eec2fd58) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringServiceProxy.java (.../MonitoringServiceProxy.java) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -24,6 +24,7 @@ import javax.servlet.ServletContext; +import org.lamsfoundation.lams.learning.service.ILearnerService; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -44,18 +45,27 @@ { /** - * Return the learner domain service object. It will delegate to the Spring + * Return the monitor domain service object. It will delegate to the Spring * helper method to retrieve the proper bean from Spring bean factory. * @param servletContext the servletContext for current application - * @return learner service object. + * @return monitoring service object. */ public static final IMonitoringService getMonitoringService(ServletContext servletContext) { return (IMonitoringService)getDomainService(servletContext,"monitoringService"); } - /** + * Return the learner domain service object. It will delegate to the Spring + * helper method to retrieve the proper bean from Spring bean factory. + * @param servletContext the servletContext for current application + * @return learner service object. + */ + public static final ILearnerService getLearnerService(ServletContext servletContext) + { + return (ILearnerService)getDomainService(servletContext,"learnerService"); + } + /** * Retrieve the proper Spring bean from bean factory. * @param servletContext the servletContext for current application * @return the Spring service bean. Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/OpenScheduleGateJob.java =================================================================== diff -u -r06534437a29c100f06d4dda2a400b055eec2fd58 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/OpenScheduleGateJob.java (.../OpenScheduleGateJob.java) (revision 06534437a29c100f06d4dda2a400b055eec2fd58) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/OpenScheduleGateJob.java (.../OpenScheduleGateJob.java) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -69,13 +69,13 @@ Map properties = context.getJobDetail().getJobDataMap(); Long gateId = (Long)properties.get("gateId"); - //if(log.isDebugEnabled()) - log.info("Openning gate......["+gateId.longValue()+"]"); + if(log.isDebugEnabled()) + log.debug("Openning gate......["+gateId.longValue()+"]"); monitoringService.openGate(gateId); - //if(log.isDebugEnabled()) - log.info("Gate......["+gateId.longValue()+"] opened"); + if(log.isDebugEnabled()) + log.debug("Gate......["+gateId.longValue()+"] opened"); } Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java =================================================================== diff -u --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java (revision 0) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,249 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ + +package org.lamsfoundation.lams.monitoring.web; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; +import org.lamsfoundation.lams.learning.service.ILearnerService; +import org.lamsfoundation.lams.learning.web.util.LessonLearnerDataManager; +import org.lamsfoundation.lams.learningdesign.Activity; +import org.lamsfoundation.lams.learningdesign.PermissionGateActivity; +import org.lamsfoundation.lams.learningdesign.ScheduleGateActivity; +import org.lamsfoundation.lams.learningdesign.SynchGateActivity; +import org.lamsfoundation.lams.monitoring.service.IMonitoringService; +import org.lamsfoundation.lams.monitoring.service.MonitoringServiceException; +import org.lamsfoundation.lams.monitoring.service.MonitoringServiceProxy; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; + + +/** + *

    The action servlet that allows the teacher to view the status of sync + * gate, scheduling gate and permission gate. The teacher can also force the + * gate to open through this servlet.

    + * + *

    Regarding view gate status, followings contents should be shown by + * calling this action servlet: + *

  • 1.View the status of an sync gate, the lams should show how many + * learners are waiting and the size of the total class.
  • + *
  • 2.View the status of the permission gate, the lams shows the number + * of the learners waiting in front of the gates.
  • + *
  • 3.View the status of the schedule gate, the lams shows the gate + * status. If the schedule has been triggerred. The teacher should + * be able to change the trigger.
  • + *

    + * + * @author Jacky Fang + * @since 2005-4-15 + * @version 1.1 + * + * ----------------XDoclet Tags-------------------- + * + * @struts:action name="GateForm" + * path="/gate" + * parameter="method" + * validate="false" + * @struts.action-exception key="error.system.monitor" scope="request" + * type="org.lamsfoundation.lams.monitoring.service.MonitoringServiceException" + * path=".systemError" + * handler="org.lamsfoundation.lams.util.CustomStrutsExceptionHandler" + * @struts:action-forward name="viewSynchGate" path=".viewSynchGate" + * @struts:action-forward name="viewPermissionGate" path=".viewPermissionGate" + * @struts:action-forward name="viewScheduleGate" path=".viewScheduleGate" + * @struts:action-forward name="openGate" path=".openGate" + * ----------------XDoclet Tags-------------------- + * + */ +public class GateAction extends LamsDispatchAction +{ + //--------------------------------------------------------------------- + // Instance variables + //--------------------------------------------------------------------- + private static Logger log = Logger.getLogger(GateAction.class); + + private IMonitoringService monitoringService; + private ILearnerService learnerService; + //--------------------------------------------------------------------- + // Class level constants - Struts forward + //--------------------------------------------------------------------- + private static final String VIEW_SYNCH_GATE = "viewSynchGate"; + private static final String VIEW_PERMISSION_GATE = "viewPermissionGate"; + private static final String VIEW_SCHEDULE_GATE="viewScheduleGate"; + private static final String OPEN_GATE = "openGate"; + //--------------------------------------------------------------------- + // Class level constants - session attributes + //--------------------------------------------------------------------- + private static final String PARAM_GATE_ACTIVITY_ID = "activityId"; + private static final String PARAM_LESSON_ID = "lessonId"; + + //--------------------------------------------------------------------- + // Struts Dispatch Method + //--------------------------------------------------------------------- + /** + *

    The dispatch method that allows the teacher to view the status of the + * gate. It is expecting the caller passed in lesson id and gate activity + * id as http parameter. Otherwise, the utility method will generate some + * exception.

    + * + *

    Based on the lesson id and gate activity id, it sets up the gate form + * to show the waiting learners and the total waiting learners. Regarding + * schedule gate, it also shows the estimated gate opening time and gate + * closing time.

    + * + * Note: gate form attribute waitingLearners got setup + * after the view is dispatch to ensure there won't be casting exception + * occur if the activity id is not a gate by chance. + * + * + * @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 viewGate(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + DynaActionForm gateForm = (DynaActionForm)form; + + this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + this.learnerService = MonitoringServiceProxy.getLearnerService(getServlet().getServletContext()); + + long gateId = ((Long)gateForm.get("activityId")).longValue(); + long lessonId = WebUtil.readLongParam(request,PARAM_LESSON_ID); + + Activity gate = monitoringService.getActivityById(gateId); + + //setup the total learners + int totalLearners = LessonLearnerDataManager.getAllLessonLearners(getServlet().getServletContext(),lessonId,learnerService) + .size(); + gateForm.set("totalLearners",new Integer(totalLearners)); + + //dispatch the view according to the type of the gate. + if(gate.isSynchGate()) + return viewSynchGate(mapping,gateForm,(SynchGateActivity)gate); + else if(gate.isScheduleGate()) + return viewScheduleGate(mapping,gateForm,(ScheduleGateActivity)gate); + else if(gate.isPermissionGate()) + return viewPermissionGate(mapping,gateForm,(PermissionGateActivity)gate); + else + throw new MonitoringServiceException("Invalid gate activity. " + + "gate id ["+gate.getActivityId()+"] - the type ["+ + gate.getActivityTypeId()+"] is not a gate type"); + } + + /** + * Open the gate if is closed. + * + * @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 openGate(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws IOException, + ServletException + { + this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + + DynaActionForm gateForm = (DynaActionForm)form; + + monitoringService.openGate((Long)gateForm.get("activityId")); + + return mapping.findForward(OPEN_GATE); + } + + /** + * + * @param mapping + * @param gateForm + * @param permissionGate + * @return + */ + private ActionForward viewPermissionGate(ActionMapping mapping, + DynaActionForm gateForm, + PermissionGateActivity permissionGate) + { + gateForm.set("waitingLearners",new Integer(permissionGate.getWaitingLearners().size())); + return mapping.findForward(VIEW_PERMISSION_GATE); + } + + /** + * @param mapping + * @param gateForm + * @param scheduleGate + * @return + */ + private ActionForward viewScheduleGate(ActionMapping mapping, + DynaActionForm gateForm, + ScheduleGateActivity scheduleGate) + { + gateForm.set("waitingLearners",new Integer(scheduleGate.getWaitingLearners().size())); + //gateForm.set("startingTime",scheduleGate.get); + + return mapping.findForward(VIEW_SCHEDULE_GATE); + } + + /** + * + * @param mapping + * @param gateForm + * @param synchgate + * @return + */ + private ActionForward viewSynchGate(ActionMapping mapping, + DynaActionForm gateForm, + SynchGateActivity synchgate) + { + gateForm.set("waitingLearners",new Integer(synchgate.getWaitingLearners().size())); + return mapping.findForward(VIEW_SYNCH_GATE); + } + +} Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== diff -u -r06534437a29c100f06d4dda2a400b055eec2fd58 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 06534437a29c100f06d4dda2a400b055eec2fd58) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -40,7 +40,6 @@ /** - * *

    The action servlet that provide all the monitoring functionalities. It * interact with the teacher via flash and JSP monitoring interface.

    * @@ -114,7 +113,10 @@ monitoringService.startlesson(lessonId); - return mapping.findForward(SCHEDULER); + //TODO add the wddx acknowledgement code. + + //return mapping.findForward(SCHEDULER); + return null; } } Index: lams_monitoring/test/java/SurveyAnsContent.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveyAnsContent.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveyAnsContent.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/SurveyContent.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveyContent.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveyContent.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/SurveyQueContent.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveyQueContent.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveyQueContent.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/SurveyQueType.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveyQueType.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveyQueType.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/SurveyQueUsr.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveyQueUsr.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveyQueUsr.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/SurveySession.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveySession.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveySession.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/SurveyUsrResp.hbm.xml =================================================================== diff -u --- lams_monitoring/test/java/SurveyUsrResp.hbm.xml (revision 0) +++ lams_monitoring/test/java/SurveyUsrResp.hbm.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_monitoring/test/java/org/lamsfoundation/lams/monitoring/web/TestGateAction.java =================================================================== diff -u --- lams_monitoring/test/java/org/lamsfoundation/lams/monitoring/web/TestGateAction.java (revision 0) +++ lams_monitoring/test/java/org/lamsfoundation/lams/monitoring/web/TestGateAction.java (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,140 @@ +/*************************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * ***********************************************************************/ + +package org.lamsfoundation.lams.monitoring.web; + +import org.lamsfoundation.lams.AbstractLamsStrutsTestCase; + + +/** + * + * @author Jacky Fang + * @since 2005-4-18 + * @version + * + */ +public class TestGateAction extends AbstractLamsStrutsTestCase +{ + + private static final String TEST_LESSON_ID = "2"; + private static final String TEST_SYNCH_GATE_ID = "33"; + private static final String TEST_SCHEUDLE_GATE_ID = "34"; + private static final String TEST_PERMISSION_GATE_ID = "35"; + + /* + * @see AbstractLamsStrutsTestCase#setUp() + */ + protected void setUp() throws Exception + { + super.setUp(); + setConfigFile("/WEB-INF/struts/struts-config.xml"); + setRequestPathInfo("/gate.do"); + } + + /* + * @see AbstractLamsStrutsTestCase#tearDown() + */ + protected void tearDown() throws Exception + { + super.tearDown(); + } + + /** + * Constructor for TestGateAction. + * @param testName + */ + public TestGateAction(String testName) + { + super(testName); + } + + /** + * @see org.lamsfoundation.lams.AbstractLamsStrutsTestCase#getContextConfigLocation() + */ + protected String getContextConfigLocation() + { + return "/WEB-INF/spring/applicationContext.xml " + +"/WEB-INF/spring/monitoringApplicationContext.xml " + +"/org/lamsfoundation/lams/lesson/lessonApplicationContext.xml " + +"/WEB-INF/spring/authoringApplicationContext.xml " + +"/WEB-INF/spring/learningApplicationContext.xml " + +"/org/lamsfoundation/lams/tool/toolApplicationContext.xml " + +"/org/lamsfoundation/lams/tool/survey/dataAccessContext.xml " + +"/org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml"; + + } + + /** + * @see org.lamsfoundation.lams.AbstractLamsStrutsTestCase#getHibernateSessionFactoryBeanName() + */ + protected String getHibernateSessionFactoryBeanName() + { + return "coreSessionFactory"; + } + + public void testViewSynchGate() + { + addRequestParameter("method", "viewGate"); + addRequestParameter("lessonId",TEST_LESSON_ID); + addRequestParameter("activityId",TEST_SYNCH_GATE_ID); + + actionPerform(); + + verifyNoActionErrors(); + verifyTilesForward("viewSynchGate",".viewSynchGate"); + } + + public void testViewScheduleGate() + { + addRequestParameter("method", "viewGate"); + addRequestParameter("lessonId",TEST_LESSON_ID); + addRequestParameter("activityId",TEST_SYNCH_GATE_ID); + + actionPerform(); + + verifyNoActionErrors(); + verifyTilesForward("viewScheduleGate",".viewScheduleGate"); + } + + public void testViewPermissionGate() + { + addRequestParameter("method", "viewGate"); + addRequestParameter("lessonId",TEST_LESSON_ID); + addRequestParameter("activityId",TEST_SYNCH_GATE_ID); + + actionPerform(); + + verifyNoActionErrors(); + verifyTilesForward("viewPermissionGate",".viewPermissionGate"); + } + + public void testOpenGate() + { + addRequestParameter("method", "openGate"); + addRequestParameter("activityId",TEST_SYNCH_GATE_ID); + + actionPerform(); + + verifyNoActionErrors(); + verifyTilesForward("openGate",".openGate"); + } +} Index: lams_monitoring/test/web/WEB-INF/spring/authoringApplicationContext.xml =================================================================== diff -u --- lams_monitoring/test/web/WEB-INF/spring/authoringApplicationContext.xml (revision 0) +++ lams_monitoring/test/web/WEB-INF/spring/authoringApplicationContext.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + PROPAGATION_REQUIRED + + + + Index: lams_monitoring/test/web/WEB-INF/spring/learningApplicationContext.xml =================================================================== diff -u --- lams_monitoring/test/web/WEB-INF/spring/learningApplicationContext.xml (revision 0) +++ lams_monitoring/test/web/WEB-INF/spring/learningApplicationContext.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED + + + + + + + + + + + + http://localhost:8080/lams_learning + + + + Index: lams_monitoring/test/web/WEB-INF/spring/monitoringApplicationContext.xml =================================================================== diff -u -r9f3dd3ba6a4a04baca65a99516e36e5e47e0e962 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/test/web/WEB-INF/spring/monitoringApplicationContext.xml (.../monitoringApplicationContext.xml) (revision 9f3dd3ba6a4a04baca65a99516e36e5e47e0e962) +++ lams_monitoring/test/web/WEB-INF/spring/monitoringApplicationContext.xml (.../monitoringApplicationContext.xml) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -1,26 +1,5 @@ - - - + + + + + + @@ -72,6 +74,43 @@ redirect="false" /> + + + + + + + @@ -101,6 +140,13 @@ - + + + + + + + Index: lams_monitoring/test/web/WEB-INF/struts/tiles-defs.xml =================================================================== diff -u --- lams_monitoring/test/web/WEB-INF/struts/tiles-defs.xml (revision 0) +++ lams_monitoring/test/web/WEB-INF/struts/tiles-defs.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_monitoring/test/web/WEB-INF/web.xml =================================================================== diff -u -r9f3dd3ba6a4a04baca65a99516e36e5e47e0e962 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/test/web/WEB-INF/web.xml (.../web.xml) (revision 9f3dd3ba6a4a04baca65a99516e36e5e47e0e962) +++ lams_monitoring/test/web/WEB-INF/web.xml (.../web.xml) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -31,28 +31,76 @@ contextConfigLocation - /WEB-INF/spring/applicationContext.xml /org/lamsfoundation/lams/tool/toolApplicationContext.xml - /WEB-INF/spring/monitoringApplicationContext.xml /org/lamsfoundation/lams/lesson/lessonApplicationContext.xml - /org/lamsfoundation/lams/learningdesign/learningDesignApplicationContext.xml - /org/lamsfoundation/lams/tool/survey/dataAccessContext.xml - /org/lamsfoundation/lams/tool/survey/surveyApplicationContext.xml + /WEB-INF/spring/applicationContext.xml /WEB-INF/spring/toolApplicationContext.xml + /WEB-INF/spring/monitoringApplicationContext.xml /WEB-INF/spring/lessonApplicationContext.xml + /WEB-INF/spring/authoringApplicationContext.xml + /WEB-INF/spring/dataAccessContext.xml /WEB-INF/spring/surveyApplicationContext.xml - + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +--> + + + HibernateFilter + org.springframework.orm.hibernate.support.OpenSessionInViewFilter + + sessionFactoryBeanName + coreSessionFactory + + + singleSession + true + + + + + + HibernateFilter + *.do + + + HibernateFilter + *.jsp + + - + + + + + + @@ -72,6 +74,43 @@ redirect="false" /> + + + + + + + @@ -101,6 +140,13 @@ - + + + + + + + Index: lams_monitoring/web/WEB-INF/struts/tiles-defs.xml =================================================================== diff -u --- lams_monitoring/web/WEB-INF/struts/tiles-defs.xml (revision 0) +++ lams_monitoring/web/WEB-INF/struts/tiles-defs.xml (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: lams_monitoring/web/WEB-INF/web.xml =================================================================== diff -u -r9f3dd3ba6a4a04baca65a99516e36e5e47e0e962 -rb6df3bbcefaf4633858d1d3161063abc3b620e7e --- lams_monitoring/web/WEB-INF/web.xml (.../web.xml) (revision 9f3dd3ba6a4a04baca65a99516e36e5e47e0e962) +++ lams_monitoring/web/WEB-INF/web.xml (.../web.xml) (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -61,7 +61,7 @@ HibernateFilter - org.lamsfoundation.lams.util.CustomizedOpenSessionInViewFilter + org.springframework.orm.hibernate.support.OpenSessionInViewFilter sessionFactoryBeanName coreSessionFactory Index: lams_monitoring/web/errorbox.jsp =================================================================== diff -u --- lams_monitoring/web/errorbox.jsp (revision 0) +++ lams_monitoring/web/errorbox.jsp (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,43 @@ + +<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> +<%@ page import="org.apache.struts.action.Action" %> +<%@ page import="org.apache.struts.action.ActionErrors" %> +<% +String cprotocol = request.getProtocol(); +if(cprotocol.startsWith("HTTPS")){ + cprotocol = "https://"; +}else{ + cprotocol = "http://"; +} +String rootPath = cprotocol+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/"; +%> + + + + Error occured + + + + + + \ No newline at end of file Index: lams_monitoring/web/gate/sychGateContent.jsp =================================================================== diff -u --- lams_monitoring/web/gate/sychGateContent.jsp (revision 0) +++ lams_monitoring/web/gate/sychGateContent.jsp (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,69 @@ + +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> +<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %> +<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean-el" %> +<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic-el" %> +<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +
     
     
    + +
     
    + test +
    + +
    + + + + + Index: lams_monitoring/web/images/error.jpg =================================================================== diff -u Binary files differ Index: lams_monitoring/web/systemErrorContent.jsp =================================================================== diff -u --- lams_monitoring/web/systemErrorContent.jsp (revision 0) +++ lams_monitoring/web/systemErrorContent.jsp (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,40 @@ + + +<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %> +<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> + + + + + + + + +
    + +
    +
    + <%@ include file="errorbox.jsp" %> +
    +
    + + Index: lams_monitoring/web/template/baseContent.jsp =================================================================== diff -u --- lams_monitoring/web/template/baseContent.jsp (revision 0) +++ lams_monitoring/web/template/baseContent.jsp (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,22 @@ + + +

    Base Content

    Index: lams_monitoring/web/template/template.jsp =================================================================== diff -u --- lams_monitoring/web/template/template.jsp (revision 0) +++ lams_monitoring/web/template/template.jsp (revision b6df3bbcefaf4633858d1d3161063abc3b620e7e) @@ -0,0 +1,59 @@ + +<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %> +<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> +<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt" %> +<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> + + + + + + + <tiles:getAsString name="title"/> + + + + + + + + + + + + + + + + + + + +
    + +