Enables exporting portfolio for teacher and learner modes.
@@ -110,6 +111,7 @@ exportPortfolioDTO.setPortfolioExportMode("learner"); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); + MessageService messageService = VoteServiceProxy.getMessageService(getServletContext()); if (userID == null || toolSessionID == null) { @@ -144,7 +146,7 @@ MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), - voteSession.getUid(), exportPortfolioDTO); + voteSession.getUid(), exportPortfolioDTO, messageService); // VoteChartGenerator.create{Pie|Bar}Chart expects these to be session attributes if ( voteSession.getVoteContent().isShowResults() ) { @@ -173,7 +175,8 @@ exportPortfolioDTO.setPortfolioExportMode("teacher"); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); - + MessageService messageService = VoteServiceProxy.getMessageService(getServletContext()); + if (toolContentID==null) { String error="Tool Content Id is missing. Unable to continue"; @@ -195,7 +198,7 @@ voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null, voteGeneralMonitoringDTO, exportPortfolioDTO); - MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null, exportPortfolioDTO); + MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null, exportPortfolioDTO, messageService); // VoteChartGenerator.create{Pie|Bar}Chart expects these to be session attributes request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, exportPortfolioDTO.getMapStandardNominationsContent()); request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, exportPortfolioDTO.getMapStandardRatesContent()); @@ -231,5 +234,5 @@ { logger.error("exception creating chart: ",e) ; } - } + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java,v diff -u -r1.44 -r1.45 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 12 May 2008 08:17:31 -0000 1.44 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java 13 May 2008 03:44:34 -0000 1.45 @@ -53,6 +53,7 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; +import org.lamsfoundation.lams.util.MessageService; /** * @@ -887,7 +888,7 @@ */ public static void prepareChartData(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, String toolContentID, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO, MessageService messageService) { logger.debug("starting prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); logger.debug("starting prepareChartData, toolContentID: " + toolContentID); @@ -1076,8 +1077,8 @@ logger.debug("final share: " + share); if(voteContent.isAllowText()) { - mapStandardNominationsContent.put(mapIndex.toString(), "Open Vote"); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), "Open Vote"); + mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); + mapStandardNominationsHTMLedContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); } mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); @@ -1133,7 +1134,7 @@ * @param toolSessionUid */ public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, - VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid, ExportPortfolioDTO exportPortfolioDTO) + VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid, ExportPortfolioDTO exportPortfolioDTO, MessageService messageService) { logger.debug("starting prepareChartDataForExportTeacher, toolContentID: " + toolContentID); logger.debug("starting prepareChartDataForExportTeacher, toolSessionUid: " + toolSessionUid); @@ -1240,8 +1241,8 @@ logger.debug("final share: " + share); - mapStandardNominationsContent.put(mapIndex.toString(), "Open Vote"); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), "Open Vote"); + mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); + mapStandardNominationsHTMLedContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); mapStandardUserCount.put(mapIndex.toString(), new Integer(userEnteredVotesCount).toString()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/VoteChartGenerator.java,v diff -u -r1.18 -r1.19 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java 17 Mar 2008 02:15:39 -0000 1.18 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java 13 May 2008 03:44:34 -0000 1.19 @@ -48,6 +48,7 @@ import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.util.ChartUtil; +import org.lamsfoundation.lams.util.MessageService; /** *Enables generation of JFreeCharts
@@ -80,15 +81,16 @@ { logger.debug("currentSessionId is specified, generating data for all sessions dto: "); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); - + MessageService messageService = VoteServiceProxy.getMessageService(getServletContext()); + VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentSessionId)); logger.debug("voteSession uid:" + voteSession.getUid()); VoteContent voteContent=voteSession.getVoteContent(); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), null, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), null, voteGeneralMonitoringDTO, messageService); if ( logger.isDebugEnabled() ) { logger.debug("creating maps MAP_STANDARD_NOMINATIONS_CONTENT and MAP_STANDARD_RATES_CONTENT: " + currentSessionId); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java,v diff -u -r1.46 -r1.47 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java 12 May 2008 08:17:32 -0000 1.46 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java 13 May 2008 03:44:34 -0000 1.47 @@ -64,6 +64,7 @@ import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.util.MessageService; /** *Action class that controls the logic of tool behavior.
@@ -280,7 +281,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); logger.debug("end of prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); @@ -783,7 +784,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); logger.debug("calling prepareChartData: " + toolContentID); MonitoringUtil.prepareChartData(request, voteService, null, toolContentID.toString(), toolSessionUid.toString(), - voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); @@ -1068,6 +1069,13 @@ logger.debug("userEntry: " + userEntry); voteLearningForm.setUserEntry(userEntry); } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext()); + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java,v diff -u -r1.45 -r1.46 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 26 Mar 2008 03:57:40 -0000 1.45 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java 13 May 2008 03:44:34 -0000 1.46 @@ -189,6 +189,7 @@ import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -370,7 +371,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); logger.debug("fwd'ing to: " + EXIT_PAGE); return (mapping.findForward(EXIT_PAGE)); @@ -482,7 +483,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); String isContentLockOnFinish=voteLearningForm.getLockOnFinish(); @@ -751,4 +752,11 @@ logger.debug("add " + message +" to ActionMessages:"); saveErrors(request,errors); } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext()); + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java,v diff -u -r1.42 -r1.43 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 26 Sep 2006 02:26:49 -0000 1.42 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java 13 May 2008 03:44:34 -0000 1.43 @@ -64,6 +64,7 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -248,7 +249,7 @@ VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentMonitoredToolSession)); logger.debug("voteSession uid:" + voteSession.getUid()); MonitoringUtil.prepareChartData(request, voteService, voteMonitoringForm, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), null, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), null, voteGeneralMonitoringDTO, getMessageService()); logger.debug("post prepareChartData, voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); @@ -3829,5 +3830,12 @@ return reflectionsContainerDTO; } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext()); + } } \ No newline at end of file